You may be the first that generates and saves the tables at build/install
time. I usually just suppress generation of the table files, and let the
program compute the tables on each run. Since it is normally a fraction of a
second, this solution is much easier imho.
However, I now have a grammar that needs 1.4 seconds for table generation, and
0.008 seconds for parsing a 'hello world'-like program.
The comparison is not entirely fair, since most programs will be larger, but
for this one I am afraid I'll have to do something like you did.
I am still collecting courage however....
> This is working, but is not as clean as I'd like. It relies on some
> PLY implementation details, namely:
> lex.py: exec "import %s as lextab" % tabfile
> yacc.py: exec "import %s as parsetab" % module
Technically, you could copy both files into your project, so you know for sure
this will not change without you knowing.
I don't know what the license says about this though.
If it is not allowed, you could check explicitly for the version of the PLY files.
Sincerely,
Albert