[antlr-interest] Macros Replacement

adrian_simionescu adrian_simionescu at yahoo.com
Fri Nov 1 07:15:14 PST 2002


Hello all,

I have to parse the following macro:

Syntax:
 define <macro-name'nonterminal-type> match-string as {"replacement"}

Syntax example:
  
 define <largest'action> "largest <expression> <number>" as {
   if (<number> > <expression>) then {<expression> = <number>};
 };

So, this mean:

 largest x+y**2 5;

Should be replaced with:

 if (5 > x+y**2) then {x+y**2=5};

Everything was so simple till now ;), but I have no ideea how can I solve this problem!

Thanks,
Simi


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list