public class ATNConfigSet extends Object implements Set<ATNConfig>
Modifier and Type | Class and Description |
---|---|
static class |
ATNConfigSet.AbstractConfigHashSet |
static class |
ATNConfigSet.ConfigEqualityComparator |
static class |
ATNConfigSet.ConfigHashSet
The reason that we need this is because we don't want the hash map to use
the standard hash code and equals.
|
Modifier and Type | Field and Description |
---|---|
ATNConfigSet.AbstractConfigHashSet |
configLookup
All configs but hashed by (s, i, _, pi) not including context.
|
ArrayList<ATNConfig> |
configs
Track the elements as they are added to the set; supports get(i)
|
protected BitSet |
conflictingAlts
Currently this is only used when we detect SLL conflict; this does
not necessarily represent the ambiguous alternatives.
|
boolean |
dipsIntoOuterContext |
boolean |
fullCtx
Indicates that this configuration set is part of a full context
LL prediction.
|
boolean |
hasSemanticContext |
protected boolean |
readonly
Indicates that the set of configurations is read-only.
|
int |
uniqueAlt |
Constructor and Description |
---|
ATNConfigSet() |
ATNConfigSet(ATNConfigSet old) |
ATNConfigSet(boolean fullCtx) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(ATNConfig config) |
boolean |
add(ATNConfig config,
DoubleKeyMap<PredictionContext,PredictionContext,PredictionContext> mergeCache)
Adding a new config means merging contexts with existing configs for
(s, i, pi, _) , where s is the
ATNConfig.state , i is the ATNConfig.alt , and
pi is the ATNConfig.semanticContext . |
boolean |
addAll(Collection<? extends ATNConfig> coll) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
containsFast(ATNConfig obj) |
List<ATNConfig> |
elements()
Return a List holding list of configs
|
boolean |
equals(Object o) |
ATNConfig |
get(int i) |
BitSet |
getAlts()
Gets the complete set of represented alternatives for the configuration
set.
|
List<SemanticContext> |
getPredicates() |
Set<ATNState> |
getStates() |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isReadonly() |
Iterator<ATNConfig> |
iterator() |
void |
optimizeConfigs(ATNSimulator interpreter) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
void |
setReadonly(boolean readonly) |
int |
size() |
ATNConfig[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
protected boolean readonly
public ATNConfigSet.AbstractConfigHashSet configLookup
public final ArrayList<ATNConfig> configs
public int uniqueAlt
protected BitSet conflictingAlts
public boolean hasSemanticContext
public boolean dipsIntoOuterContext
public final boolean fullCtx
public ATNConfigSet(boolean fullCtx)
public ATNConfigSet()
public ATNConfigSet(ATNConfigSet old)
public boolean add(ATNConfig config)
public boolean add(ATNConfig config, DoubleKeyMap<PredictionContext,PredictionContext,PredictionContext> mergeCache)
(s, i, pi, _)
, where s
is the
ATNConfig.state
, i
is the ATNConfig.alt
, and
pi
is the ATNConfig.semanticContext
. We use
(s,i,pi)
as key.
This method updates dipsIntoOuterContext
and
hasSemanticContext
when necessary.
public BitSet getAlts()
public List<SemanticContext> getPredicates()
public ATNConfig get(int i)
public void optimizeConfigs(ATNSimulator interpreter)
public boolean addAll(Collection<? extends ATNConfig> coll)
public boolean equals(Object o)
public int hashCode()
public int size()
public boolean isEmpty()
public boolean contains(Object o)
public boolean containsFast(ATNConfig obj)
public void clear()
public boolean isReadonly()
public void setReadonly(boolean readonly)
public ATNConfig[] toArray()
public <T> T[] toArray(T[] a)
public boolean remove(Object o)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<ATNConfig>
containsAll
in interface Set<ATNConfig>
public boolean retainAll(Collection<?> c)
public boolean removeAll(Collection<?> c)
Copyright © 1992–2020 ANTLR. All rights reserved.