always generate static const array first for atn
This commit is contained in:
parent
c79b0fd80c
commit
f33a0f3d13
|
@ -422,8 +422,7 @@ static std::vector\<uint16_t> _serializedATN;
|
|||
|
||||
// Constructs the serialized ATN and writes init code for static member vars.
|
||||
SerializedATN(model) ::= <<
|
||||
<if (rest(model.segments))>
|
||||
<model.segments: {segment | static uint16_t serializedATNSegment<i0>[] = {
|
||||
<model.segments: {segment | static const uint16_t serializedATNSegment<i0>[] = {
|
||||
<segment; wrap={<\n> }>
|
||||
\};}; separator="\n">
|
||||
|
||||
|
@ -431,13 +430,6 @@ SerializedATN(model) ::= <<
|
|||
serializedATNSegment<i0> + sizeof(serializedATNSegment<i0>) / sizeof(serializedATNSegment<i0>[0]));
|
||||
}>
|
||||
|
||||
<else>
|
||||
<! only one segment, can be inlined !>
|
||||
_serializedATN = {
|
||||
<model.serialized; wrap = {<\n>}>
|
||||
};
|
||||
<endif>
|
||||
|
||||
atn::ATNDeserializer deserializer;
|
||||
_atn = deserializer.deserialize(_serializedATN);
|
||||
|
||||
|
|
Loading…
Reference in New Issue