[antlr-interest] Cannot display rule "X" because start state is not found
Michael Pinnegar
jazzepi at gmail.com
Mon Nov 2 09:59:36 PST 2009
Jim Idle wrote:
>> rules, I get "Cannot display rule "X" because start state is not found"
>>
>> comment
>> : !(DIGIT | LETTER | SPACE)*
>> ;
>
> Remove the ! from this rule. Looks like you are trying to type a v2 grammar into AntlrWorks, which is for v3 grammars, which is probably what you should be using for a new project :-)
Actually the ! sign was just suppose to be the markup for a comment in the language. I guess it's
also an operator for ANTLR's grammar processor like * or ; I encapsulated it in a set of 's and that
fixed everything.
>
>> SPACE
>> options {
>> paraphrase = " ";
>> }
>
> Paraphrase option is for v2, not v3, so remove that options{} clause.
I ran the debugger some yesterday and it was complaining about this, so I did that. I think I found
this from an example online somewhere. I just picked up the book today, so hopefully that should help.
Incidentally is there a good way to get the entire CFG printed/displayed as a *complete* railroad
diagram? I'd like to put that in my program documentation.
MPinnegar
>
> Jim
>
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
More information about the antlr-interest
mailing list