Posted By:
Anonymous
Posted On:
Wednesday, December 31, 2008 07:55 PM
Hi. I'm using the Terrence Parr's Java 1.5 grammar and extending it to get some specific functionality via line comments. What I want to do is to put line comments in the main channel (removing $channel=HIDDEN), using @rulecatch to handle my logic with the comment's content and then simply continue parsing. When I do this (already tried using 'recover') the parsing process seems to break and forget the state where I was. How can I just catch the Exception (a line comment will be an unwanted token) and continue where I left? Just like "ignoring" the bad token in the parser after I handled the exception. Thanks in advance.
More>>
Hi. I'm using the Terrence Parr's Java 1.5 grammar and extending it to get some specific functionality via line comments.
What I want to do is to put line comments in the main channel (removing $channel=HIDDEN), using @rulecatch to handle my logic with the comment's content and then simply continue parsing.
When I do this (already tried using 'recover') the parsing process seems to break and forget the state where I was.
How can I just catch the Exception (a line comment will be an unwanted token) and continue where I left? Just like "ignoring" the bad token in the parser after I handled the exception.
Thanks in advance.
<<Less