Overriding lexer methods from imported grammar

11 views
Skip to first unread message

Antonio Ye

unread,
Mar 23, 2015, 1:11:24 AM3/23/15
to antlr-di...@googlegroups.com
Is it possible to override a lexer method from an imported grammar? In my grammar I am importing the ECMAScript grammar which defines a lexer method called isRegexPossible which I want to extends and have it return false from some new tokens I created in my combined grammar. I tried modifying the ECMAScript grammar but this of course does not work because the tokens I define in my grammar do not exist in the ECMAScript grammar. I also tried to rename isRegexPossible to isRegexPossible2 in the ECMAScript grammar and define isRegexPossible it in my grammar and then have it call isRegexPossible2 if its not one of my tokens. Again this does not work because ECMAScriptLexer is calling isRegexPossible and it is not defined. Any ideas on how to do this?
Reply all
Reply to author
Forward
0 new messages