|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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 |
| Sponsored Links |
|
|
|
|||
|
Whoo, boy, have you got problems ahead of you. You're going to need to make a compiler/translator for this if you can't find anything on the Internet. I don't understand either language, but I can help with creating a basic parser. I did a quick Google search, and you might want to take a look at this:
clipper sql convert - Google Search |
|
|||
|
Thank you for your answer.
All the results returned by google are about how to convert .dbf file to SQL tables. This is unfortunately not my issue. I would like to create a Clipper expression parser in order to get a SQL where clause as result. What do you think about using tools as lex and yacc to do this parser? regards, mathmax |
|
|||
|
I have no idea. Ask v0id or Jordan, they're very knowledgeable.
|
|
|||||
|
What you are looking at creating is basically a compiler, where it has to parse the Clipper language and translate it into the corresponding SQL. You may be able to do it with Regular Expressions, or with LEX & YACC (I'm not familiar with them). One thing that stands out is the fact that there are some definite assumptions that would have to be built into the process (such as the join fields).
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help with ereg expression | orjan | PHP Forum | 7 | 04-08-2008 09:16 PM |
| Facial Expression Recognition Software Developed | Kernel | Programming News | 2 | 02-27-2008 04:04 PM |
| Has anybody been using the MS Expression Web Design Program? | george89 | Website Design | 1 | 07-16-2007 09:18 PM |
| can someone help me with my c librarys? | bobwrit | C and C++ | 4 | 04-27-2007 07:19 PM |
| c# regular expression | moonrise | C# Programming | 3 | 05-22-2006 05:54 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |