Comments (5)
I'm not able to deep-dive into this, but there's not a whole lot to the PLY lexer other than repeatedly calling re.match()
. That said, the re
module is known to have pathological performance for certain kinds of regex. It's possible that you've somehow fallen into that by accident. Fixing it will require some further investigation.
from ply.
OK Thanks for the fast response. I can try figure out if it's really a pathological regex as such, or if the way PLY combines the regexes makes it pathological.
from ply.
Aside from your performance issue, there is a logical problem in your code. If you want to implement lexical analyzer for templates in C++ then your implementation of operators like >[=>]?
will be mistaken by operator >>
(bit-wise right shift operator and ostream cout) . It was C++ compiler problem from 1999 to 2011 because of not clear decision of the C++ committee. C++ programmer had to add extra space between > >
for template.
from ply.
Did I mention that I hate C++ with a burning passion? :)
What are the actual lexing rules in this case? Does the lexer need to be "template aware"? Because that's matlab levels of weirdness right there.
from ply.
Did I mention that I hate C++ with a burning passion? :)
What are the actual lexing rules in this case? Does the lexer need to be "template aware"? Because that's matlab levels of weirdness right there.
I wanted to indicate the problem that might help you. AFAIK, this problem can't be solved in lexical level.
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
- 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.