Package | Description |
---|---|
org.antlr.analysis | |
org.antlr.tool |
Modifier and Type | Class and Description |
---|---|
static class |
SemanticContext.AND |
static class |
SemanticContext.CommutativePredicate |
static class |
SemanticContext.FalsePredicate |
static class |
SemanticContext.NOT |
static class |
SemanticContext.OR |
static class |
SemanticContext.Predicate |
static class |
SemanticContext.TruePredicate |
Modifier and Type | Field and Description |
---|---|
protected SemanticContext |
SemanticContext.NOT.ctx |
static SemanticContext |
SemanticContext.EMPTY_SEMANTIC_CONTEXT
Create a default value for the semantic context shared among all
NFAConfigurations that do not have an actual semantic context.
|
SemanticContext |
NFAConfiguration.semanticContext
The set of semantic predicates associated with this NFA
configuration.
|
protected SemanticContext |
PredicateLabel.semanticContext
A tree of semantic predicates from the grammar AST if label==SEMPRED.
|
Modifier and Type | Field and Description |
---|---|
protected Set<SemanticContext> |
SemanticContext.CommutativePredicate.operands |
protected Map<DFAState,Map<Integer,SemanticContext>> |
DecisionProbe.stateToAltSetWithSemanticPredicatesMap
Track the predicates for each alt per DFA state;
more than one DFA state might have syntactically ambig alt prediction.
|
Modifier and Type | Method and Description |
---|---|
protected SemanticContext |
LL1Analyzer._getPredicates(NFAState s,
NFAState altStartState) |
static SemanticContext |
SemanticContext.and(SemanticContext a,
SemanticContext b) |
abstract SemanticContext |
SemanticContext.CommutativePredicate.combinePredicates(SemanticContext left,
SemanticContext right) |
SemanticContext |
SemanticContext.AND.combinePredicates(SemanticContext left,
SemanticContext right) |
SemanticContext |
SemanticContext.OR.combinePredicates(SemanticContext left,
SemanticContext right) |
static SemanticContext[] |
SemanticContext.factorAnd(SemanticContext a,
SemanticContext b) |
static SemanticContext[] |
SemanticContext.factorOr(SemanticContext a,
SemanticContext b) |
abstract SemanticContext |
SemanticContext.getGatedPredicateContext()
Given a semantic context expression tree, return a tree with all
nongated predicates set to true and then reduced.
|
SemanticContext |
SemanticContext.Predicate.getGatedPredicateContext() |
SemanticContext |
SemanticContext.CommutativePredicate.getGatedPredicateContext() |
SemanticContext |
SemanticContext.NOT.getGatedPredicateContext() |
SemanticContext |
DFAState.getGatedPredicatesInNFAConfigurations()
For gated productions, we need an OR'd list of all predicates for the
target of an edge so we can gate the edge based upon the predicates
associated with taking that path (if any).
|
SemanticContext |
LL1Analyzer.getPredicates(NFAState altStartState)
Return predicate expression found via epsilon edges from s.
|
SemanticContext |
PredicateLabel.getSemanticContext() |
SemanticContext |
Label.getSemanticContext() |
SemanticContext |
DecisionProbe.getSemanticContextForAlt(DFAState d,
int alt)
Each state in the DFA represents a different input sequence for an
alt of the decision.
|
protected static SemanticContext |
NFAToDFAConverter.getUnionOfPredicates(Map<?,SemanticContext> altToPredMap)
OR together all predicates from the alts.
|
static SemanticContext |
SemanticContext.not(SemanticContext a) |
static SemanticContext |
SemanticContext.or(SemanticContext a,
SemanticContext b) |
Modifier and Type | Method and Description |
---|---|
static Collection<SemanticContext> |
SemanticContext.getAndOperands(SemanticContext context) |
Set<? extends SemanticContext> |
DFAState.getGatedSyntacticPredicatesInNFAConfigurations() |
static Collection<SemanticContext> |
SemanticContext.getOrOperands(SemanticContext context) |
protected Map<Integer,SemanticContext> |
NFAToDFAConverter.getPredicatesPerNonDeterministicAlt(DFAState d,
Set<Integer> nondeterministicAlts)
Return a mapping from nondeterministc alt to combined list of predicates.
|
Modifier and Type | Method and Description |
---|---|
NFAConfiguration |
DFAState.addNFAConfiguration(NFAState state,
int alt,
NFAContext context,
SemanticContext semanticContext) |
static SemanticContext |
SemanticContext.and(SemanticContext a,
SemanticContext b) |
void |
NFAToDFAConverter.closure(NFAState p,
int alt,
NFAContext context,
SemanticContext semanticContext,
DFAState d,
boolean collectPredicates)
Where can we get from NFA state p traversing only epsilon transitions?
Add new NFA states + context to DFA state d.
|
abstract SemanticContext |
SemanticContext.CommutativePredicate.combinePredicates(SemanticContext left,
SemanticContext right) |
SemanticContext |
SemanticContext.AND.combinePredicates(SemanticContext left,
SemanticContext right) |
SemanticContext |
SemanticContext.OR.combinePredicates(SemanticContext left,
SemanticContext right) |
static SemanticContext[] |
SemanticContext.factorAnd(SemanticContext a,
SemanticContext b) |
static SemanticContext[] |
SemanticContext.factorOr(SemanticContext a,
SemanticContext b) |
static Collection<SemanticContext> |
SemanticContext.getAndOperands(SemanticContext context) |
static Collection<SemanticContext> |
SemanticContext.getOrOperands(SemanticContext context) |
static SemanticContext |
SemanticContext.not(SemanticContext a) |
static SemanticContext |
SemanticContext.or(SemanticContext a,
SemanticContext b) |
Modifier and Type | Method and Description |
---|---|
protected static SemanticContext |
NFAToDFAConverter.getUnionOfPredicates(Map<?,SemanticContext> altToPredMap)
OR together all predicates from the alts.
|
void |
DecisionProbe.reportAltPredicateContext(DFAState d,
Map<Integer,? extends SemanticContext> altPredicateContext)
Report the list of predicates found for each alternative; copy
the list because this set gets altered later by the method
tryToResolveWithSemanticPredicates() while flagging NFA configurations
in d as resolved.
|
Constructor and Description |
---|
AND(SemanticContext a,
SemanticContext b) |
CommutativePredicate(SemanticContext a,
SemanticContext b) |
NFAConfiguration(int state,
int alt,
NFAContext context,
SemanticContext semanticContext) |
NOT(SemanticContext ctx) |
OR(SemanticContext a,
SemanticContext b) |
PredicateLabel(SemanticContext semCtx)
Make a semantic predicates label
|
Constructor and Description |
---|
AND(HashSet<SemanticContext> contexts) |
CommutativePredicate(HashSet<SemanticContext> contexts) |
OR(HashSet<SemanticContext> contexts) |
Modifier and Type | Method and Description |
---|---|
void |
Grammar.synPredUsedInDFA(DFA dfa,
SemanticContext semCtx) |
Copyright © 1992–2015 ANTLR. All rights reserved.