<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
I have written a very simple grammar, that supports single line
comments, and a primitive 'DEFINE name' statement.<br>
<br>
Processing this inside AntlrWorks seems to be reasonably OK< e.g.
generating the parse tree. However, when I try<br>
to debug or generate code I get the following error:<br>
<br>
error(100):
U:\Development\NomadSchemaAnalyser\grammar\NomadSchema.g:0:0: syntax
error: codegen: <AST>:0:0: unexpected end of subtree<br>
error(10): internal error:
org.antlr.tool.Message.toString(Message.java:124): Assertion failed!
Message ID 100 created but is not present in errorMsgIDs or
warningMsgIDs. <br>
<br>
This looks like an internal Antlr bug - referring to a non-existent
'Message ID 100' am I correct in this supposition? If so,<br>
when is it due to be fixed; if not, what am I doing wrong?<br>
<br>
My grammar is as given below:<br>
<blockquote><font color="#3366ff"><tt>grammar TestGrammar;<br>
<br>
DefList: (CommentLine | Def | WS)*;<br>
<br>
fragment Def: 'DEFINE' WS Name; <br>
fragment CommentLine: '!' ~('\n'|'\r')* '\r'? '\n' { $channel =
HIDDEN; };<br>
fragment Name: Letter AlphaNum*;<br>
fragment AlphaNum: Letter | Digit;<br>
fragment Digit: '0'..'9';<br>
fragment Letter : 'A'..'Z' | 'a'..'z';<br>
fragment WS: ( ' ' | '\t' | '\r' | '\n')+ { $channel = HIDDEN; };<br>
</tt></font></blockquote>
Thanks,<br>
<br>
Andy D<br>
<br>
</body>
</html>