[antlr-interest] AST generation

Mark Davidson markd at samsungcontact.com
Tue Sep 3 09:56:25 PDT 2002


Thanks,

That got me on the right track. Final answer was this:

  | (col ("not")? "like") => ( col (n:"not"!)? "like"^ value)
  	{if (n!=null) {##=#(#[n.getType(),n.getText()],##);}}

Mark


mzukowski at yci.com wrote:
> Something like this:
> 
> | (col ("not")? "like") => ( col (n:"not")? "like"^ value) 
> 	{if (n!=null) {##=#[#[n.getType(),n.getText()],##];}}
> 
> Monty
> 
> 
>>-----Original Message-----
>>From: Mark Davidson [mailto:markd at samsungcontact.com]
>>Sent: Tuesday, September 03, 2002 9:35 AM
>>To: antlr-interest at yahoogroups.com
>>Subject: [antlr-interest] AST generation
>>
>>
>>Hi,
>>
>>I have the following rule in my grammer:
>>
>>factor: (col EQ) => (col EQ^ value)
>>         | (col NE) => (col NE^ value)
>>         | (col ("not")? "like") => ( col ("not")? "like" value) ;
>>
>>For the last line I want to create a tree:
>>
>>    not
>>    |--like
>>       |--col
>>       |--value
>>
>>But I cannot work out how.
>>
>>Thanks
>>Mark
>>
>>
>> 
>>
>>Your use of Yahoo! Groups is subject to 
>>http://docs.yahoo.com/info/terms/ 
>>
>>
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 




 

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



More information about the antlr-interest mailing list