[antlr-interest] Invalid parser generation

mark4 at voila.fr mark4 at voila.fr
Tue Sep 4 04:20:12 PDT 2012


Hi everyone,

I've built a grammar file, checked it with AntlrWorks, and ran the code generation for the C# language. Though, some invalid code has been generated.

This rule:
compte : ('0'..'9')+
;

translates to:

[GrammarRule("compte")]
private void compte()
...
try { DebugEnterSubRule(5);
while (true)
{
int alt5=2;
try { DebugEnterDecision(5, decisionCanBacktrack[5]);
int LA5_0 = input.LA(1);

if (()) <= This triggers an error!!!
{
alt5 = 1;
}
...

I have a similar void if, a bit farther in the compte() method. What's wrong with this simple rule?

Thanks in advance,
Mark
___________________________________________________________
Quand Jean-Luc Delarue parlait de son grand amour… à lire sur Voila.fr http://people.voila.fr/people/actu-stars/personnalites/quand-jean-luc-delarue-parlait-d-anissa-kehl-son-grand-amour-people_8397.html


More information about the antlr-interest mailing list