You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to intercept the detection of a valid rule, in such a way that we can then adjust a property used by the lexer? Consider:
@lexer::members {
// This code MUST compile fine as Java and C#
public String KeywordLexiconCode = "en";
public Boolean Lexicon(String Code)
{
return Code == KeywordLexiconCode;
}
}
Is there a way - during the parse - for me to have the parser recognize some rule and at that point modify the string KeywordLexiconCode thus influencing the remainder of the tokenization and parsing? The string is used in token predicates like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there a way to intercept the detection of a valid rule, in such a way that we can then adjust a property used by the lexer? Consider:
Is there a way - during the parse - for me to have the parser recognize some rule and at that point modify the string
KeywordLexiconCode
thus influencing the remainder of the tokenization and parsing? The string is used in token predicates like this:I know we have parse tree visitors and listeners, but not sure if these are an appropriate place to do this.
Beta Was this translation helpful? Give feedback.
All reactions