What if you replace 'source' like this: source : (statement)* EOF Regards Philippe Frankson
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Christoph Schinko Sent: 09 March 2010 14:43 To: [email protected] Subject: [antlr-interest] Unexpected behavior - Error? Hi! Using the grammar below we experience unexpected behavior. The parser accepts the following input line: <<<<<<< .mine without throwing an error - which it should - according to the grammar. The grammar has been reduced to a toy example reproducing the error. Any thoughts on that? Regards, Chris ------------------------------------------------------------------------ grammar JScriptDoc; options { output=AST; backtrack=true; memoize=true; } source : (statement)* ; statement : statementEmpty | statementBlock ; statementBlock : '{' (statement )* '}' ; statementEmpty : ';' ; OPERATOR_LT : '<' ; OPERATOR_DOT : '.' ; IDENTIFIER : ('a'..'z'|'A'..'Z') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* ; NEWLINE : '\r'? '\n' {$channel=HIDDEN;} ; WHITESPACE : ' ' {$channel=HIDDEN;} ; WHITETAB : '\t' {$channel=HIDDEN;} ; -- Dipl.-Ing. Christoph Schinko [email protected] Institute of Computer Graphics and Knowledge Visualization Graz University of Technology tel: +43 (316) 873-5416 Inffeldgasse 16c, 8010 Graz, Austria List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
