ATNDeserializer#encodeIntsWith16BitWords(IntegerList) and
org.antlr.v4.codegen.model.SerializedJavaATN .
| Modifier and Type | Field and Description |
|---|---|
| public ATN | |
| private final IntegerList | |
| private final IntegerList | |
| private final IntegerList | |
| private final Map | sets
Note that we use a LinkedHashMap as a set to mainintain insertion order while deduplicating entries with the same key. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| private int | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private Map | |
| public static IntegerList | |
| public IntegerList | |
| private static void |
| atn | back to summary |
|---|---|
| public ATN atn | |
| data | back to summary |
|---|---|
| private final IntegerList data | |
| nonGreedyStates | back to summary |
|---|---|
| private final IntegerList nonGreedyStates | |
| precedenceStates | back to summary |
|---|---|
| private final IntegerList precedenceStates | |
| sets | back to summary |
|---|---|
| private final Map<IntervalSet, Boolean> sets Note that we use a LinkedHashMap as a set to mainintain insertion order while deduplicating entries with the same key. | |
| ATNSerializer | back to summary |
|---|---|
| public ATNSerializer(ATN atn) | |
| addDecisionStartStates | back to summary |
|---|---|
| private void addDecisionStartStates() | |
| addEdges | back to summary |
|---|---|
| private void addEdges(int nedges, Map<IntervalSet, Integer> setIndices) | |
| addEdges | back to summary |
|---|---|
| private int addEdges() | |
| addLexerActions | back to summary |
|---|---|
| private void addLexerActions() | |
| addModeStartStates | back to summary |
|---|---|
| private void addModeStartStates() | |
| addNonGreedyStates | back to summary |
|---|---|
| private void addNonGreedyStates() | |
| addPreamble | back to summary |
|---|---|
| private void addPreamble() | |
| addPrecedenceStates | back to summary |
|---|---|
| private void addPrecedenceStates() | |
| addRuleStatesAndLexerTokenTypes | back to summary |
|---|---|
| private void addRuleStatesAndLexerTokenTypes() | |
| addSets | back to summary |
|---|---|
| private Map | |
| getSerialized | back to summary |
|---|---|
| public static IntegerList getSerialized(ATN atn) | |
| serialize | back to summary |
|---|---|
| public IntegerList serialize() Serialize state descriptors, edge descriptors, and decision→state map into list of ints. Likely out of date, but keeping as it could be helpful: SERIALIZED_VERSION UUID (2 longs) grammar-type, (ANTLRParser.LEXER, ...) max token type, num states, state-0-type ruleIndex, state-1-type ruleIndex, ... state-i-type ruleIndex optional-arg ... num rules, rule-1-start-state rule-1-args, rule-2-start-state rule-2-args, ... (args are token type,actionIndex in lexer else 0,0) num modes, mode-0-start-state, mode-1-start-state, ... (parser has 0 modes) num unicode-bmp-sets bmp-set-0-interval-count intervals, bmp-set-1-interval-count intervals, ... num unicode-smp-sets smp-set-0-interval-count intervals, smp-set-1-interval-count intervals, ... num total edges, src, trg, edge-type, edge arg1, optional edge arg2 (present always), ... num decisions, decision-0-start-state, decision-1-start-state, ... Convenient to pack into unsigned shorts to make as Java string. | |
| serializeSets | back to summary |
|---|---|
| private static void serializeSets(IntegerList data, Collection<IntervalSet> sets) | |