We cannot execute predicates dependent upon local context unless
we know for sure we are in the correct context. Because there is
no way to do this efficiently, we simply cannot evaluate
dependent predicates unless we are in the rule that initially
invokes the ATN simulator.
<p>
closure() tracks the depth of how far we dip into the outer context:
depth > 0. Note that it may not be totally accurate depth since I
don't ever decrement. TODO: make it a boolean then</p>
<p>
For memory efficiency, the {@link #isPrecedenceFilterSuppressed} method
is also backed by this field. Since the field is publicly accessible, the
highest bit which would not cause the value to become negative is used to
store this field. This choice minimizes the risk that code which only
compares this value to 0 would be affected by the new purpose of the
flag. It also ensures the performance of the existing {@link ATNConfig}
constructors as well as certain operations like
{@link ATNConfigSet#add(ATNConfig, DoubleKeyMap)} method are
<em>completely</em> unaffected by the change.</p>
We cannot execute predicates dependent upon local context unless we know for sure we are in the correct context. Because there is no way to do this efficiently, we simply cannot evaluate dependent predicates unless we are in the rule that initially invokes the ATN simulator.
<p> closure() tracks the depth of how far we dip into the outer context: depth > 0. Note that it may not be totally accurate depth since I don't ever decrement. TODO: make it a boolean then</p>
<p> For memory efficiency, the {@link #isPrecedenceFilterSuppressed} method is also backed by this field. Since the field is publicly accessible, the highest bit which would not cause the value to become negative is used to store this field. This choice minimizes the risk that code which only compares this value to 0 would be affected by the new purpose of the flag. It also ensures the performance of the existing {@link ATNConfig} constructors as well as certain operations like {@link ATNConfigSet#add(ATNConfig, DoubleKeyMap)} method are <em>completely</em> unaffected by the change.</p>