Skip to content

fix include in calc.py#32

Merged
da-h merged 1 commit intolukeparser:masterfrom
Skylake-dev:fix-doc-example
Jun 29, 2022
Merged

fix include in calc.py#32
da-h merged 1 commit intolukeparser:masterfrom
Skylake-dev:fix-doc-example

Conversation

@Skylake-dev
Copy link
Copy Markdown

@Skylake-dev Skylake-dev commented Jun 7, 2022

This change fixes compiler errors that are thrown when trying to run this example.

[...omitted warnings...]
/tmp/pybison/pybison_Parser/tmp.l:8:10: fatal error: tokens.h: No such file or directory
    8 | #include "tokens.h"
      |          ^~~~~~~~~~
compilation terminated.

The name of the header file has been changed in #20 but in some places there is still the old header name.

Also i wanted to ask about this code from the above mentioned #20
screenpr20
Aren't the comments wrong? Shouldn't the name be tmp.tab.h
The code is here

Lastly, always in the doc folder, the walkthrough example seem to be outdated as well because it includes tokens.h.

Is there something i am missing and the file tmp.tab.h is renamed later to tokens.h or was this just overlooked?

@da-h
Copy link
Copy Markdown

da-h commented Jun 29, 2022

Hey there, sorry for the late response!

Thanks for pointing this out. I am currently looking into all the examples, updating them to newer bison (3.8) features. So your PR is much appreciated & the comments you mentioned are indeed wrong.

The reason for the naming change was that previously pybison renamed the tmp.tab.h (bison output) file to tokens.h. This did introduce bugs in some cases (see #19). Additionally, keeping the default bison output structure has the benefit of not forcing a new naming scheme on a new user. :)

Best
da-h

@da-h da-h merged commit 17d4ef5 into lukeparser:master Jun 29, 2022
@da-h da-h mentioned this pull request Jun 29, 2022
@Skylake-dev Skylake-dev deleted the fix-doc-example branch June 29, 2022 14:23
@sbrodehl
Copy link
Copy Markdown

Quick follow up question: Is the calc example running through without errors with this fix?

@da-h
Copy link
Copy Markdown

da-h commented Jun 29, 2022

No, unfortunately.

Compilation errors are solved now, but the way the stdin is passed through the parser head-C-code through PyBison through Python seems to be broken currently.
Looking into this in the moment, but did not find the bug yet.

(Debugging is also a bit cumbersome as the build-files from the parser (parser and lexer files) cannot be found from within gdb during execution as of now. I will submit a PR that solves this.)

@Skylake-dev
Copy link
Copy Markdown
Author

If i recall correctly the example was working when i tried to run it.
Now i am not able to make it work, it runs but when i try to insert something it just go to a new line and nothing happens
Other samples in the examples folder also do not work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants