Bug #4091

nmlc writes 'parsetab.py' in working directory

Added by Alberth over 7 years ago. Updated about 5 years ago.

Status:ClosedStart date:2012-07-24
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


When running nmlc, the Ply parser writes parsetab.py in the working directory.


$ cd regression
# remove parsetab.py if it exists
$ make 001_action8
$ ls parsetab.py

Fix attached

no_parsetab.py Magnifier (446 Bytes) Alberth, 2012-07-24 06:52

Associated revisions

Revision 2192:89c05fb08f8e
Added by Alberth over 5 years ago

Fix: Don't write parse tables. Closes #4091


#1 Updated by Hirundo over 7 years ago

Regenerating parsetab.py each time (as attached patch does) impacts performance, I'd rather avoid that if possible.
From PLY documentation:

To change the directory in which the parsetab.py file (and other output files) are written, use:

Question is, what is the right place (tm) - if any - to write such a file?

#2 Updated by yexo about 7 years ago

For an installed version of nml it'd be best of parsetab.py was generated at install time and installed like the other file. That way it never has to be regenerated.
For a non-installed version of nml there are three choices: directory where nmlc is located, $HOME/.nml/ or working directory.

#3 Updated by Alberth over 5 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

Applied in changeset 89c05fb08f8e.

#4 Updated by frosch about 5 years ago

With the addition of the ".nmlcache" directory, I checked this again.
Constructing the parser takes about 0.65 seconds, no matter whether parsetab.py is present, used or not.

Also available in: Atom PDF