Comments (11)
It might not be a bad idea to use an ordered dict class. There was even a version of ply where I had to do this (it was relying on dict keys having a consistent order).
from ply.
Hi, ping? :)
from ply.
Dictionaries are used all over the place in yacc. Not sure I can easily fix this or not.
from ply.
@dabeaz Could you just do sorted(dct.items())
instead of dct.items()
?
from ply.
Would such a change affect performance though? Should it be for the debugging implementation only, and not any optimized ones?
from ply.
@johnyf I think that would only be run when parsetab.py
is being written, though, so it would be only for the first run.
from ply.
Suggest using yacc(write_tables=False) to disable the creation of the parsetab.py file entirely.
Background: The whole reason that parsetab.py file is there in the first place is that the first version of PLY was written on a 200Mhz PC and the parser table creation was slow. To make startup faster on subsequent runs, parsetab.py was written and used as a kind of cache. I'm not even sure it matters now. For one, machines are a LOT faster. Also, PLY switched over to a different, much faster, algorithm ages ago (generating the tables for C with some 353 states takes about 0.3s on my current machine).
Honestly, I've been thinking about ditching all of this parsetab.py/lextab.py business entirely in some future version.
from ply.
(Not all dicts would have to be changed, mind you...)
from ply.
In my experience with promela
, the parsetab.py
is useful and does accelerate runs. I would prefer that it remains available as functionality. Quantifying the difference would require collecting measurements from running a representative collection of large parsers.
from ply.
Ditching parsetab.py/lextab.py is not something I'm likely to do in the context of PLY. I have a more modern project in the works (a successor to PLY) that will ditch the generated files however.
from ply.
Hello, FWIW I switched the Debian packaging to the new release 1.0.0
https://github.com/viraptor/phply that seems to be the new one published on pypi
https://pypi.debian.net/phply
https://pypi.python.org/pypi/phply
So, I consider this issue "fixed" for my packaging needs
from ply.
Related Issues (20)
- Warn user about tuple flattening in precedence table HOT 3
- PyPI package HOT 2
- Trying to get in touch regarding a security issue
- "global flags not at the start of the expression" error when using in-line global regex flag with Python 11+ HOT 1
- Please make a new release HOT 1
- PLY not compatible with python 3.12 HOT 1
- extreme slowness HOT 5
- Read grammar from files HOT 2
- Re examples/ansic HOT 1
- lextab.py and yacctab.py HOT 13
- Exporting gramma for documentation
- ssl cert issue for the website
- License HOT 2
- "state" is ambiguous in the documentation. HOT 1
- lex.lex() can get some rules in the wrong order. HOT 1
- Documentation in doc/ply.md lacks important details about creating a custom lexer. HOT 6
- Import several module with lex()
- allow user actions in debug mode HOT 1
- Add MIT License
- PLY VHDL parser not producing a parser tree... HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ply.