TODO add class description
The reason that we need this is because we don't want the hash map to use the standard hash code and equals. We need all configurations with the same {@code (s,i,_,semctx)} to be equal. Unfortunately, this key effectively doubles the number of objects associated with ATNConfigs. The other solution is to use a hash table that lets us specify the equals/hashcode operation.
Adding a new config means merging contexts with existing configs for {@code (s, i, pi, _)}, where {@code s} is the {@link ATNConfig#state}, {@code i} is the {@link ATNConfig#alt}, and {@code pi} is the {@link ATNConfig#semanticContext}. We use {@code (s,i,pi)} as key.
@uml Return a List holding list of configs
@uml Gets the complete set of represented alternatives for the configuration set.
@uml @override
@uml @override @safe @nothrow
@uml @override
@uml Track the elements as they are added to the set; supports get(i)
@uml Currently this is only used when we detect SLL conflict; this does not necessarily represent the ambiguous alternatives. In fact, I should also point out that this seems to include predicated alternatives that have predicates that evaluate to false. Computed in computeTargetState().
@uml Indicates that this configuration set is part of a full context LL prediction. It will be used to determine how to merge $. With SLL it's a wildcard whereas it is not for LL context merge. @final
@uml Used in parser and lexer. In lexer, it indicates we hit a pred while computing a closure operation. Don't make a DFA state from this.
@uml Indicates that the set of configurations is read-only. Do not allow any code to manipulate the set; DFA states will point at the sets and they must not change. This does not protect the other fields; in particular, conflictingAlts is set after we've made this readonly. @read
@uml TODO: these fields make me pretty uncomfortable but nice to pack up info together, saves recomputation TODO: can we track conflicts as they are added to save scanning configs later?
Specialized {@link Set}{@code <}{@link ATNConfig}{@code >} that can track info about the set, with support for combining similar configurations using a graph-structured stack.
The reason that we need this is because we don't want the hash map to use the standard hash code and equals. We need all configurations with the same {@code (s,i,_,semctx)} to be equal. Unfortunately, this key effectively doubles the number of objects associated with ATNConfigs. The other solution is to use a hash table that lets us specify the equals/hashcode operation.