On Friday 25 June 2010 16:36:43 Scherer Markus wrote:
> Thanks for your quick response Gordon.
>
> Unfortunately, this solution does not seem to work. If I define "stuff" as
> generic as I want it to be (like (options {greedy=false;} : .)*)) it isn't
> able to compile either (The following alternatives can never be matched:
> 2). I guess because the END of a codeBlock would get matched by "stuff" in
> statement. If define stuff as
>
> stuff : (options {greedy=false;} : ~(END))* ;
>
> it does not match all tokens I am interested in :-/.
this is like switching the lexer language during lexing. There are discussions
here that antlr is able so simulate packrat parsing (like rats!), which can
handle that (you need to enable backtracking for unlimited lookahead and
memoizing), but I'm not sure about it.
You could also use another lexer like jflex with antlr which has lexer states
to handle that.
But if your pl_sql_block_content (or stuff) includes a statement with a string
which includes your 'END' keyword, your splitter doesn't work anymore. So you
may need to lex strings in pl_sql_block_content (or stuff).
cheers,
Michael
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.