[antlr-interest] Help need with nondeterminism error
Sharon Li
hushlee83 at yahoo.com.sg
Thu Feb 13 23:31:27 PST 2003
Hi can someone pls help me with this nondeterminism error?
I'm also not sure if I can use predicates this way. pls advice!
Thanks in advance.
ANTLR Parser Generator Version 2.7.0 1989-2000 MageLang's jGur
lfile.g.txt:410: warning: nondeterminism upon
lfile.g.txt:410: k==1:COLON,TIMES,POW,LT,GT
lfile.g.txt:410: k==2:COLON,LPAREN,TIMES,POW,LT,GT
lfile.g.txt:410: between alts 1 and 2 of block
lfile.g.txt:432: warning: nondeterminism upon
lfile.g.txt:432: k==1:LT,GT
lfile.g.txt:432: k==2:COLON,TIMES,POW,LT,GT,"conditional"
lfile.g.txt:432: between alt 1 and exit branch of block
/********** fraction of parser code ***************************/
406: productions : (production)+;
407:
408: production : predecessor /*conditional ( (YIELD) | (OYIELD)) successor */ ;
409:
410: predecessor : subpredecessor_one
411: | subpredecessor_two
412: ;
413:
414: subpredecessor_two
415: : (strictPred GT)=> strictPred GT rContext
416: | strictPred
417: ;
418:
419: subpredecessor_one
420: : (lContext LT strictPred GT)=> lContext LT strictPred GT rContext
421: | lContext LT strictPred
422: ;
423:
424: strictPred : formalModules;
425:
426: rContext : (formalModules)=> formalModules
427: | /*empty*/ ;
428:
429: lContext : (formalModules)=> formalModules
430: | /*empty*/ ;
431:
432: formalModules : (formalModule)+;
433:
434: formalModule {String fsymbol;} : (fsymbol = symbol) (LPAREN formalParameters RPAREN)? ;
435:
436: formalParameters : (formalParameter) (COMMA formalParameter)* ;
437:
438: formalParameter : NAME;
symbol returns [String sym] {sym = null;}
: p:POW {sym = p.getText();}
| lt:LT {sym = lt.getText();}
| gt:GT {sym = gt.getText();}
| col:COLON {sym = col.getText();}
| times:TIMES {sym = times.getText();}
;
/******** lexer ***************/
COLON : ':';
TIMES : '*';
POW : '^';
GT : '>';
LT : '<';
Yahoo! Biztools
- Promote your business from just $5 a month!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20030214/3bf93693/attachment.html
More information about the antlr-interest
mailing list