Comments (6)
Hello,
if possible, could you just point me in the direction to solve this issue? If I knew where to start I could fix it myself.
from pybison.
@arquer there are multiple path to the syntax error messages. One of them is https://github.com/smvv/pybison/blob/master/src/python/__init__.py#L348
The other one is generated and put into the Bison grammar file: https://github.com/smvv/pybison/blob/master/src/pyrex/bison_.pyx#L416-L442
from pybison.
Yes, I saw those functions @smvv, however as I pointed out pybison keeps reporting all syntax errors with all zeros.. I even tried to define YYLLOC_DEFAULT (I don't know if that is actually needed or if bison already defines it by default).
I was thinking about modifying the python callbacks to include a new argument "locations" (besides target, names, option and values. The locations argument could be a list of pointers pointing to Bison's @n and @$ structures (yylloc structs if I remember correctly), that way the user could assign line numbers from one production to another. The problem I see is how to automatically assign location information to terminals.
What do you think?
from pybison.
I would really like your input on this... Just to know if I am going about it allright.
So far I am finding the package very usefull but I need to overcome some limitations in order to be able to use it. I will eventually make the parser I am doing (SystemVerilog, not Verilog, which is much easier) open-source.
So far my main concerns are:
- Get location of parser when an error occurs
- Get it to work under windows. At least the actual parsing, bison/flex files could be generated on a linux machine
- Allow multiple instance of the Parser to be ran concurrently.
from pybison.
I got the line number reporting working in the parser. I am sorry but I did not know all I had to do is define a YY_USER_ACTION.
Now as I stated above I am trying to get that line information available in my python callbacks so I can include that in my AST.
from pybison.
I have solved this issue, I have successfully passed all location information computed by bison to my python callbacks adding another argument.
from pybison.
Related Issues (12)
- ImportError: /usr/local/lib/python2.7/dis undefined symbol: py_callback HOT 3
- import error,ImportError: cannot import name bisonToPython HOT 5
- Make to work on OS X HOT 9
- submit to pypi? HOT 1
- Problem in Compile calc1 Example HOT 3
- Error when reporting parser errors HOT 5
- How can get and show error lexer and parser
- Concurrent execution HOT 11
- connection to http://freenet.mcnabhosting.com/python/pybison/ HOT 2
- Current Project State HOT 3
- Returning BisonSyntaxError
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 pybison.