public class RuleStore extends Object implements Serializable
Constructor and Description |
---|
RuleStore(TreeAutomaton auto) |
RuleStore(TreeAutomaton auto,
TopDownRuleIndex topDown,
BottomUpRuleIndex bottomUp) |
Modifier and Type | Method and Description |
---|---|
void |
foreachRuleBottomUpForSets(IntSet labelIds,
List<IntSet> childStateSets,
SignatureMapper signatureMapper,
Consumer<Rule> fn) |
void |
foreachRuleTopDown(int parentState,
Consumer<Rule> fn) |
Iterable<Rule> |
getAllRulesBottomUp() |
Iterable<Rule> |
getAllRulesTopDown() |
IntIterable |
getLabelsTopDown(int parentState) |
Iterable<Rule> |
getRulesBottomUp(int labelId,
int[] childStates)
Like getRulesBottomUp, but only looks for rules in the cache of
previously discovered rules.
|
Iterable<Rule> |
getRulesBottomUpRaw(int labelId,
int[] childStates)
Returns null if such rules were never cached.
|
List<Iterable<Rule>> |
getRulesForRhsState(int rhsState) |
Iterable<Rule> |
getRulesTopDown(int parentState) |
Iterable<Rule> |
getRulesTopDown(int labelId,
int parentState)
Like getRulesTopDown, but only looks for rules in the cache of previously
discovered rules.
|
boolean |
hasRulesForRhsState(int rhsState) |
boolean |
isBottomUpDeterministic() |
boolean |
isExplicit() |
boolean |
isStoring() |
void |
printStatistics() |
void |
processNewRulesForRhs() |
void |
setExplicit(boolean explicit) |
Collection<Rule> |
setRules(Collection<Rule> rules,
int labelID,
int[] children) |
void |
setStoring(boolean storing) |
void |
storeRuleBottomUp(Rule rule) |
void |
storeRuleTopDown(Rule rule) |
boolean |
useCachedRuleBottomUp(int label,
int[] childStates)
Checks whether the cache contains a bottom-up rule for the given parent
label and children states.
|
boolean |
useCachedRuleTopDown(int label,
int parent)
Checks whether the cache contains a top-down rule for the given parent
label and state.
|
public RuleStore(TreeAutomaton auto)
public RuleStore(TreeAutomaton auto, TopDownRuleIndex topDown, BottomUpRuleIndex bottomUp)
public boolean isStoring()
public void setStoring(boolean storing)
public boolean isExplicit()
public void setExplicit(boolean explicit)
public void storeRuleBottomUp(Rule rule)
public void storeRuleTopDown(Rule rule)
public Collection<Rule> setRules(Collection<Rule> rules, int labelID, int[] children)
public boolean isBottomUpDeterministic()
public void processNewRulesForRhs()
public Iterable<Rule> getRulesBottomUpRaw(int labelId, int[] childStates)
labelId
- childStates
- public Iterable<Rule> getRulesBottomUp(int labelId, int[] childStates)
labelId
- childStates
- public Iterable<Rule> getRulesTopDown(int labelId, int parentState)
labelId
- parentState
- public IntIterable getLabelsTopDown(int parentState)
public boolean hasRulesForRhsState(int rhsState)
public boolean useCachedRuleBottomUp(int label, int[] childStates)
label
- childStates
- public boolean useCachedRuleTopDown(int label, int parent)
label
- parent
- public void printStatistics()
public void foreachRuleBottomUpForSets(IntSet labelIds, List<IntSet> childStateSets, SignatureMapper signatureMapper, Consumer<Rule> fn)
Copyright © 2017. All rights reserved.