JavaCC syntactic lookahead in antlr
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Gulen_Chongtham
Posted On:   Monday, August 19, 2002 06:14 AM

What is the similar construct for the JavaCC synatactic lookahead in antlr


			
void MyRule():
{}
{
LOOKAHEAD(SubrulePlus1())
Subrule1()
|
Subrule2()
}

Re: JavaCC syntactic lookahead in antlr

Posted By:   Terence_Parr  
Posted On:   Saturday, September 14, 2002 12:34 PM

Hi. Use this:


myRule
: (SubrulePlus1) => Subrule1
| Subrule2
;


Note how much cleaner/smaller the spec is. ;)

Regards,

Terence

Re: JavaCC syntactic lookahead in antlr

Posted By:   Monty_Zukowski  
Posted On:   Tuesday, August 20, 2002 03:25 PM

Antlr calculates lookahead for you, you don't need to specify it like you do in JavaCC.
About | Sitemap | Contact