[antlr-interest] not parsing to end of input

Tom Smith yotommy at gmail.com
Mon Dec 10 09:27:03 PST 2007


When I ran this through the ANTLRworks debugger, it parsed all the
input properly.

When you invoked "Debug" are you selecting the 'script' rule as the start rule?

On Dec 10, 2007 12:08 PM, Mark Volkmann <r.mark.volkmann at gmail.com> wrote:
> I've stripped down my grammar to the smallest size that reproduces the
> problem. When I run "print x;" through this grammar using the
> ANTLRWorks debugger, it doesn't process the semicolon. It stops
> parsing at that point and throws the rest of the input away. In my
> real grammar this ends up being multiple lines of lost input. Any idea
> what I'm doing wrong?
>
> grammar problem;
>
> options {
>   output = AST;
> }
>
> script: print ';';
> print: 'print' LETTER -> ^('print');
>
> LETTER: 'a'..'z';
> WHITESPACE: ' '+ { $channel = HIDDEN; };
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>


More information about the antlr-interest mailing list