Hello,

I have to confess I am an absolute noob regarding ANTLR. I try to use
it to parse a type of LTL formula (later it will probably complete
SystemC) and include this into an Eclipse Editor. So, finally I will
want to use the parser, lexer and tree walker to recognize syntax
errors, do the outlining and so on.

My problem is that I cannot catch the "No viable alternative at
character" exception.

My grammar is:

expr    :       SCA_COMMAND '("' inner* '");';

inner   :        XFG(inner_quantor)+;
inner_quantor
        :       '['( INT | (INT':'INT))']';

SCA_COMMAND
        :        'sca_check' | 'sca_monitor';
INT :   '0'..'9'+ ;
XFG     :        ('X' | 'F' | 'G' );
NEWLINE:'\r'? '\n' ;
WS  :   (' '|'\t'|'\n'|'\r')+ {skip();} ;

When I try to parse >sca_check("hello"); I get console output, but the
exception is not thrown. When I try to parse >h, for example, I get an
exception.

Basically, I just need a way to get a list of all errors in the
syntax, with lines and colums, so I can use that information in the
error marking of Eclipse.

Any ideas?

Thanks a lot.

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to