Information such as the #symbolNames and the #symbolTypes of a parser is not instance-specific. So would it not be more reasonable to put it in a class-side method?
The use case that would benefit from this is when one is patching up, for example, the tokenActions table at scanner initialization time. It seems unnecessary to create a parser instance just so that one can look up a code corresponding to a symbol in aParser symbolNames.
#transitionTable is also not-instance specific, but there may be a reason to keep this on the instance side.
Information such as the
#symbolNames
and the#symbolTypes
of a parser is not instance-specific. So would it not be more reasonable to put it in a class-side method?The use case that would benefit from this is when one is patching up, for example, the
tokenActions
table at scanner initialization time. It seems unnecessary to create a parser instance just so that one can look up a code corresponding to a symbol inaParser symbolNames
.#transitionTable
is also not-instance specific, but there may be a reason to keep this on the instance side.