Have you tried making the whole comment a lexer token? This way, the keyword tokens would not interfere with plain text inside comments (If that was your intention: lexer rule names have to start with an upper case letter)
Andreas Bob Sole schrieb: > I'm trying to write a parser for PL/SQL package header files but I'm > banging my head against the wall with a basic problem to do with > case-insensitive parsing. I'm using Jim Idle's NoCaseFileStream to > convert tokens into upper case, but I'm finding that the parser gets > confused when it comes across language keywords that are embedded > within comments. Here's some example input which has the OR keyword > embedded within the package comment. The "create or replace package" > statement is deliberately messed up - the parser handles this > correctly, but it stumbles against the first 'or' on line 2: > > /** > blah blah or blah > */ > create Or rePlace PACKAGE > test IS > > Here's the grammar: > > grammar Test; > > input: statement+ ; > > statement: pkgComment | pkgStmt ; > > pkgComment: '/**' description '*/' ; 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 -~----------~----~----~----~------~----~------~--~---
