fr.umlv.tatoo.runtime.tools
Class HashParserLookaheadActivator<R,T>

java.lang.Object
  extended by fr.umlv.tatoo.runtime.tools.HashParserLookaheadActivator<R,T>
Type Parameters:
R - type of rule.
T - type of terminal.
All Implemented Interfaces:
RuleActivator<R>

public class HashParserLookaheadActivator<R,T>
extends Object
implements RuleActivator<R>

A generic hash table based rule activator that use parser lookaheads. For each parser state, the implementation used the set of possible terminal given by the parser to find the set corresponding rules to activate.

Author:
Julien Cervelle
See Also:
EnumParserLookaheadActivator

Constructor Summary
HashParserLookaheadActivator(SimpleParser<? extends T> parser, Map<T,? extends Set<? extends R>> terminalMap, Set<? extends R> unconditionalRules)
          Creates a lookeahead activator
 
Method Summary
 Iterable<? extends R> activeRules()
          Determines the set of active rules.
 Iterable<? extends R> allRules()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashParserLookaheadActivator

public HashParserLookaheadActivator(SimpleParser<? extends T> parser,
                                    Map<T,? extends Set<? extends R>> terminalMap,
                                    Set<? extends R> unconditionalRules)
Creates a lookeahead activator

Parameters:
parser -
terminalMap -
unconditionalRules -
Method Detail

activeRules

public Iterable<? extends R> activeRules()
Description copied from interface: RuleActivator
Determines the set of active rules. The method activateRules is called before the beginning of new token recognition.

Specified by:
activeRules in interface RuleActivator<R>
Returns:
new set of active rules

allRules

public Iterable<? extends R> allRules()
Specified by:
allRules in interface RuleActivator<R>