Comments (7)
Regrettably, I'm not able to help with course assignments or projects that happen to use PLY. For the specific issue at hand in this bug report, if you want to return multiple things from a grammar rule, you need to use some kind of container (list, tuple, etc.) and assign that to p[0].
from ply.
I'd look at Crafting Interpreters (https://craftinginterpreters.com).
from ply.
It doesn't work?
from ply.
Yes but there are two problems in the code. I'm not sure if the above code works properly because I can't test it. To tell about main issue takes long time and I can't write all of that in a comment line, so, let me share with you the link of the question in stack overflow where I describe what is the problem. Here is link
from ply.
First of all, thank you for your immediate attention. If I hadn't tried every way I could think of, I wouldn't have asked you for help for my project. About other Issue, I got that the code shown above is correct for assingment. Did you mean it?
from ply.
If you're assigning multiple values to p[0]
, you need to use a tuple or list:
p[0] = (p[1], p[2])
or something similar.
from ply.
Thanks a lot. Are there any examples for AST construction that I can study on?
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
- t_AUTOINCREMENT error ?
- 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
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.