Determines if this
ATNConfig fully contains another
ATNConfig.
An ATN configuration represents a position (including context) in an
ATN during parsing. Since
ATNConfig stores the context as a
graph, a single
ATNConfig instance is capable of representing
many ATN configurations which are all in the same "location" but have
different contexts. These
ATNConfig instances are again merged
when they are added to an
ATNConfigSet. This method supports
ATNConfigSet#contains by evaluating whether a particular
ATNConfig contains all of the ATN configurations represented by
another
ATNConfig.
An
ATNConfig a contains another
ATNConfigb if all of the following conditions are met:
- The configurations are in the same state (
#getState())
- The configurations predict the same alternative
(
#getAlt())
- The semantic context of a implies the semantic context of
b (this method performs a weaker equality check)
- Joining the prediction contexts of a and b results
in the prediction context of a
This method implements a conservative approximation of containment. As
a result, when this method returns {code true} it is known that parsing
from
subconfig can only recognize a subset of the inputs which
can be recognized starting at the current
ATNConfig. However, due
to the imprecise evaluation of implication for the semantic contexts, no
assumptions can be made about the relationship between the configurations
when this method returns
false.