Hi!

Is it possible to have a gated semantic predicate, that somehow "hides" 
the tokens behind it, so that the prediction _only_ uses the predicate? 
Currently, gated semantic predicates take into account _both_ the input 
that follows _and_ the predicate:

int LA = input.LA(...);
if( LA == .. _and_ semanticPredicate() ) { alternative = ... }

What I would like to be generated:
if( semanticPredicate() ) { alternative = ... }

Let's say I have 600 keywords that I want to recognize as something like 
an identifier, but in other places, I really want different tokens. 
Currently, I have 600 rules that do some table lookup, so that they 
consume an identifier and return one of the 600 possible artificial 
keyword tokens. But still, this makes the stream of tokens look like an 
endless stream of identifiers to the parser, and I have a vague feeling 
that this might be not the best possible solution.

Best Regards,
Andreas Meyer

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to