[antlr-interest] help - Parser problem

Gavin Lambert antlr at mirality.co.nz
Wed Dec 3 02:56:01 PST 2008


At 23:05 3/12/2008, virg g wrote:
>1.  As i have set of commands to parse
>if there is any unknown command found it breaks the parsing and 
>returns with the error. But how to continue the parsing  even 
>though it finds unknown command after returning the error.

Normally ANTLR will try to continue regardless, though it depends 
on how your grammar is structured and which version of ANTLR 
you're using.

>2. Added package at the beginning of header to grammar code. I 
>could see the package name for parser file but not for the lexer. 
>Why?

@header { foo } is just shorthand for @parser::header { foo }, 
when used in a combined grammar.

It's better to explicitly use @parser::header { foo } and 
@lexer::header { bar }.



More information about the antlr-interest mailing list