dabeaz / ply

Python Lex-Yacc

Home Page:http://www.dabeaz.com/ply/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using an already-built parsetab.py file?

massung opened this issue · comments

I'm likely doing something silly and wrong, but haven't figured it out from the documentation.

I'm using ply in a package I've built and am installing with setuptools. Yet, when I import the parser, it attempts to build a new parsertab.py file and outputs the following warning that it doesn't have permission to write it (good!):

WARNING: Couldn't create 'parsetab'. [Errno 2] No such file or directory: 'C:\\Python39\\lib\\site-packages\\pqs-0.1-py3.9.egg\\pqs\\parsetab.py'

My question is whether there's a way to either A) just use the existing parsertab.py file that was created as I developed (and is installed with the package) instead of building a new one... or B) disable the warning, which is innocuous and doesn't have any negative impact on whether the project works or not?

Thanks!

Okay, I've discovered there's a write_tables flag passed to yacc, which I can set to False. I don't know if this flag alone will do what's needed, but looks promising enough that I'll close the issue.