[antlr-interest] non-determinism... please help...
Octavian Nita
octavian_nita_2004 at yahoo.com
Sun Apr 17 12:49:54 PDT 2005
Hello. My name is Tavi (from Romania) and I'm (kind of) new to ANTLR.
I'm currently trying to write a grammar for the Lua language and I'm facing some problems.
First, I'd like to know what's wrong with this slice:
var : ID
| prefix ( ( '[' exp ']' ) | ( '.' ID ) )
;
prefix : ( ID | ( '(' exp ')' ) ) (prefix1)* /* (HERE I GET A NON-DETERMINISM WARNING
BETWEEN THE START CHARS OF prefix1) */
;
prefix1 : '[' exp ']'
: '.' ID
: args
: ':' ID args
;
funCall : prefix ( args | (':' ID args) )
;
args : '(' (expList)? ')'
: '{' (expList)? '}'
: string
;
Somewhere along the way, I also get to use
var and funCall as alternatives and there is also a problem that I understand
but I don't know how to solve (they both begin with prefix) - maybe some
predicates...
Thanks a lot, anyway...
---------------------------------
Do you Yahoo!?
Plan great trips with Yahoo! Travel: Now over 17,000 guides!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20050417/2a11c908/attachment.html
More information about the antlr-interest
mailing list