GithubHelp home page GithubHelp logo

Comments (6)

arquer avatar arquer commented on July 28, 2024

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.

smvv avatar smvv commented on July 28, 2024

@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.

arquer avatar arquer commented on July 28, 2024

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.

arquer avatar arquer commented on July 28, 2024

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.

arquer avatar arquer commented on July 28, 2024

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.

arquer avatar arquer commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.