You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to take a given lexer/parser and pickle the results once the class is instantiated, and then reuse it later (to save us some startup time)? I tried to pickle a created Parser class with rules but the resulting file didn't seem to have any of the grammar data in it.
The text was updated successfully, but these errors were encountered:
The grammar rules/tables aren't stored in instances of Parser, but on the class itself. Thus, that information won't be stored as part of any kind of pickle.
Trying to cache parsing tables has caused no end of headaches in the related "PLY" project. SLY does not do that. How much startup time are you seeing?
Not a gigantic amount, but it's a noticeable pause (maybe 0.3/0.4 sec?). It's more of a nice-to-have than a must-have, especially since the project (which I thank you for, BTW) is still so young.
Another idea that comes to mind is code generation a la ANTLR, but I imagine you are getting flashbacks and horror chills just contemplating the idea.
Is there any way to take a given lexer/parser and pickle the results once the class is instantiated, and then reuse it later (to save us some startup time)? I tried to pickle a created Parser class with rules but the resulting file didn't seem to have any of the grammar data in it.
The text was updated successfully, but these errors were encountered: