I've found a problem with ply2.3 related to parsing table reloading. I am
using python2.5.1 (on windows2K :().
When we want to read the parsing tables from a dotted module name like
'pckg.subpckg.parsetab' (by adding 'tabmodule = "pckg.subpckg.parsetab" to
the parser constructor), the lr_read_tables function executes 'import
pckg.subpckg.parsetab as parsetab'. This is fairly ok, but that's not the
problem.
The problem is, when yacc writes the tables, it will write to a file named
'pckg.subpckg.parsetab.py' inside the specified outputdir (using the full
module name, and not only parsetab).
This isn't what we intended, so at reload, yacc will search for
'pckg.subpckg.parsetab' but it won't find a file named 'parsetab.py' inside
a 'pckg/subpckg' directory on python's module search path.
So, instead of loading the tables from the previously generated file, it
will regenerate the parsing tables every time it gets loaded.
I've fixed the bug on my ply source. The solution is rather ugly (to blend
with the rest of yacc's source :P), but the problem seems to be gone. If
anyone's interested in my solution, please contact me be email (cptbinho at
gmail dot com) and i'll gladly send you my modified version.
Regards
Original issue reported on code.google.com by cptbi...@gmail.com on 8 Apr 2008 at 8:52
Original issue reported on code.google.com by
cptbi...@gmail.com
on 8 Apr 2008 at 8:52