Looking for ANTLR code that will parse conditional expressions containing IF, ELSE, ELSE IF, AND, OR conditionals.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rick_Dabir
Posted On:   Thursday, April 15, 2004 05:11 PM

Hi, Does anyone know if someone who has written some ANTLR code that will parse conditional expressions containing IF, ELSE, ELSE IF, AND, OR conditionals?
Example:
I need to parse expressions that look like the following:


If ConditionA = 1 OR (ConditionB = 1 And ConditionC = 2) Else If  ConditionA > 5 OR ConditionB > 5



I’m new to using ANTLR, so I would appreciate any help I can get.


Thanks

Re: Looking for ANTLR code that will parse conditional expressions containing IF, ELSE, ELSE IF, AND, OR conditionals.

Posted By:   Lance_Walton  
Posted On:   Friday, April 16, 2004 02:26 AM

Hi.

Have a look in the sample grammars provided with the ANTLR distribution (i.e. the Java grammar). Many of them demonstrate this kind of thing.

Regards,

LAnce

About | Sitemap | Contact