You probably want to make ANY_CHAR a lexer fragment so that it does not consume input except as part of a larger rule which calls it. Or maybe I missed your intent.
Kyle ------Original Message------ From: Michael C. Starkie Sender: ANTLR To: [email protected] Subject: [antlr-interest] Syntactic Predicates for matching literals withinchar sequences? Sent: Jan 17, 2010 2:04 PM Hi, I'm new to Antlr and I'm trying to match the string literal 'DATA_IN' which appears multiple times in a sequence of ASCII chars. However, the parser get's confused when it encounters strings like 'DAP' or 'DA<any char>': mismatched character 'P' expecting 'T' lexer: DATA_IN : 'DATA_IN'; ANY_CHAR : '\u0002'..'\u007F'; parser: rule: line+ ; line: data_in check; data_in_check options { backtrack=true; } : data_in | any_char; data_in : DATA_IN any_char : ANY_CHAR; Mike List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address Sent from my Verizon Wireless BlackBerry 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.
