[antlr-interest] Lexers hoist simple preds now

Terence Parr parrt at jguru.com
Sat Aug 31 16:27:54 PDT 2002


Folks,

Haven't heard from anybody on my proposal, but I think it's a good idea 
so I've implemented it.  Works great for the "beginning of line issue." 
  Python-parsing lovers rejoice!

You can gate rules in/out depending on semantic context now:

A : {pred1}? 'a' ;

Will only be tested upon pred1 by the lexer.  In prior versions, it 
would enter the rule and then fail (as a validating pred not 
disambiguating pred).

NOTE the really cool thing is that the C++ and C# output generators 
will not have to be modified because the code generator is called after 
I build the internal representation of nextToken rule. :)  Woohoo!

Oh...I do not allow multiple alternative preds from same rule to be 
hoisted as that requires real hoisting (i.e., pulling syntactic context 
along with semantic).

L8R,
Ter
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org


 

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



More information about the antlr-interest mailing list