Hi,
I started using ANTLR yesterday. I created my first grammar file via
ANTLRWorks. Everything was fine for awhile, then after typing about
600 lines of code I noticed that there was an error in the syntax
diagram pane:
"Cannot display rule "xxx" because start state not found"
The syntax highlighting in the editor didn't show any errors. So, I
pressed Ctl-R ('check grammar') which reported "check grammar
succeeded". So, I selected "Generate/Show Parser Code". This
complained about an exception which I have copied from the console
pane:
-----------pane contents-------------
[18:19:42] Checking Grammar...
[18:20:02] error(10): internal error: Exception SMF.g:410:9:
expecting '>', found
'p'@org.antlr.grammar.v2.ANTLRLexer.nextToken(ANTLRLexer.java:347):
unexpected stream error from parsing SMF.g
[18:20:02] error(150): grammar file SMF.g has no rules
[18:20:02] error(100): SMF.g:0:0: syntax error: assign.types:
<AST>:0:0: unexpected end of subtree
[18:20:02] error(100): SMF.g:0:0: syntax error: define: <AST>:0:0:
unexpected end of subtree
[18:20:02] error(10): internal error: Exception SMF.g:410:9:
expecting '>', found
'p'@org.antlr.grammar.v2.ANTLRLexer.nextToken(ANTLRLexer.java:347):
unexpected stream error from parsing SMF.g
[18:20:02] error(150): grammar file SMF.g has no rules
[18:20:02] error(100): SMF.g:0:0: syntax error: assign.types:
<AST>:0:0: unexpected end of subtree
[18:20:02] error(100): SMF.g:0:0: syntax error: define: <AST>:0:0:
unexpected end of subtree
[18:20:02] error(10): internal error: Exception C:\SMF.g:410:9:
expecting '>', found
'p'@org.antlr.grammar.v2.ANTLRLexer.nextToken(ANTLRLexer.java:347):
unexpected stream error from parsing C:\Documents and
Settings\ebatutis\My Documents\Contracts\netapp2\SMF.g
[18:20:02] error(150): grammar file C:\SMF.g has no rules
[18:20:02] error(100): C:\SMF.g:0:0: syntax error: assign.types:
<AST>:0:0: unexpected end of subtree
[18:20:02] error(100): C:\SMF.g:0:0: syntax error: define: <AST>:0:0:
unexpected end of subtree
[18:20:02] error(100): C:\SMF.g:0:0: syntax error: antlr.print:
<AST>:0:0: unexpected end of subtree
-----------pane contents-------------
Note that it is "expecting '>', found 'p'. Well, this syntax error is
inside a quoted string
tableWritePrivilege
:
'write-privilege'
(ATTRIBUTES_PRIVILEGE)
'{'
fieldNameList
'}'
;
If I remove that line then it complains about syntax errors inside
other literal strings later on in the file. If I forgot a quote
somewhere I can't find it.
My question: how do I debug this? I found a page listing various
switches and I've added them to the switch options in ANTLRWorks but
they don't seem to help.
Suggestions?
Thanks,
=Ed
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
-~----------~----~----~----~------~----~------~--~---