The following grammar produces uncompilable code when generated from ANTLRWorks
using -debug in the ANTLR options. I'm not sure which version of ANTLR is being
used by ANTLRWorks. If it matters, I have ANTLR 3.1.3 on my machine.
====
grammar EdifactDelfor;
options {
language = 'CSharp2' ;
}
tokens {
}
file : contents+ EOF ;
contents : TEXT
| SEP
| WS
| CSEP
| EOL
;
EOL: '\'';
SEP: '+';
CSEP: ':';
TEXT: ('a'..'z'|'A'..'Z'|'0'..'9'|' '|'-'|','|'.'|'/'|'?')+ ;
WS: ('\r'? '\n')+ ;
====
Here is the culprit code that was generated (in the file() method):
default:
if (cnt1 >= 1) goto loop1;
EarlyExitException eee1 =
new EarlyExitException(1, input);
dbg.RecognitionException(eee); // Note the missing '1': should be eee1
throw eee1;
When I manually change the reference to eee1, the thing compiles.
This bug does not appear when -debug is turned off.
Rob
_________________________________________________________________
Attention all humans. We are your photos. Free us.
http://go.microsoft.com/?linkid=9666046
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address