View Single Post
  #1 (permalink)  
Old 06-18-2008, 08:15 AM
mathmax mathmax is offline
Newbie
 
Join Date: Jun 2008
Posts: 2
Credits: 0
Rep Power: 0
mathmax is on a distinguished road
Default parse an expression in c

Hello,

I would like to parse an expression which is a condition of the CA-Clipper language and then translate it into SQL. Do you think that tools like LEX and YACC could help me to solve my problem? Or do you think there is an other better way?

Here is a translation sample:

("Mart" $ Customers->Name .and. Orders->Price >= 120) .or. Oders->Date = ctod("18/06/08")

will be translated to:

where exists (select 0 from Customers as C, Orders as O where C.Id = O.Customers_Id and (C.Name like "%Mart%" and O.Price >= 120) or O.Date = #18/06/08#)

Thank you in advance,

Mathmax
Reply With Quote

Sponsored Links