[antlr-interest] 2.7.3 nondeterminism bug?

FranklinChen at cmu.edu FranklinChen at cmu.edu
Fri Apr 9 11:50:14 PDT 2004


I am using ANTLR 2.7.3 and the following grammar does not trigger a
warning, but with -diagnostics outputs 

                Error: This rule is non-deterministic

in the diagnostics file.

In any case, the generated parser does not behave as I intend it to.

===
class BugReportParser extends Parser;

start: (sentence)+ EOF
    ;

sentence: contents terminator
    | JUNK
    ;

contents: (content terminator) => content
    | content contents
    ;

content: WORD
    | (DASH ~(JUNK | EOF)) => DASH
    ;

terminator: PERIOD
    | (DASH (JUNK | EOF)) => DASH
    ;

-- 
Franklin


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list