Package org.antlr.v4.runtime.atn
Class ATNSerializer
java.lang.Object
org.antlr.v4.runtime.atn.ATNSerializer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode
(char[] data) static String
getDecoded
(ATN atn, List<String> tokenNames) static IntegerList
getSerialized
(ATN atn) static char[]
getSerializedAsChars
(ATN atn) static String
getSerializedAsString
(ATN atn) Used by Java target to encode short/int array as chars in string.getTokenName
(int t) Serialize state descriptors, edge descriptors, and decision→state map into list of ints: grammar-type, (ANTLRParser.LEXER, ...) max token type, num states, state-0-type ruleIndex, state-1-type ruleIndex, ...
-
Field Details
-
atn
-
-
Constructor Details
-
ATNSerializer
-
ATNSerializer
-
-
Method Details
-
serialize
Serialize state descriptors, edge descriptors, and decision→state map into list of ints: 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. -
decode
-
getTokenName
-
getSerializedAsString
Used by Java target to encode short/int array as chars in string. -
getSerialized
-
getSerializedAsChars
-
getDecoded
-