Create serializer and deserialize functions for Parsers.
Changes in serialized structure:
name becomes parser
tokens are now a dict with key token and optional token value. This allows for a instanced or constructor token to be created.
Some performance profiling was done:
deserialization of common abbreviations takes 0.2ms on my machine.
tests (copy of existing parser tests with deserialize(serialize(...)) added as a wrapper) complete in less than .1 seconds
With these numbers I think this is fast enough to allow us to use this generic parser version.
Create
serializer
anddeserialize
functions for Parsers.Changes in serialized structure:
name
becomesparser
token
and optional tokenvalue
. This allows for a instanced or constructor token to be created.Some performance profiling was done:
deserialize(serialize(...))
added as a wrapper) complete in less than .1 seconds With these numbers I think this is fast enough to allow us to use this generic parser version.