[antlr-interest] Inherent lexer nondeterminism

Xue Yong Zhi zhixueyong at hotmail.com
Fri Mar 9 07:58:14 PST 2007


> 
> I am not sure how to do this.
> can you  provide an example please?
> 

See my ruby lexer at:
http://xruby.googlecode.com/svn/trunk/src/com/xruby/compiler/parser/ruby.g

> doing this will probably not fix the non-determinism warnings, right?
> 

Use Semantic Predicates (you can examples in the link above):
http://antlr.org/doc/metalang.html#SemanticPredicates
Antlr won't give you non-determinism warnings if there is semantic 
predicates (be careful as this may hide errors).

-- 
Xue Yong Zhi
XRuby (Ruby to Java bytecode compiler):
http://xruby.blogspot.com



More information about the antlr-interest mailing list