Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%reentrant causes a syntax error in parser-lexer_io.ads #8

Closed
Bubuche87 opened this issue Feb 5, 2024 · 2 comments
Closed

%reentrant causes a syntax error in parser-lexer_io.ads #8

Bubuche87 opened this issue Feb 5, 2024 · 2 comments

Comments

@Bubuche87
Copy link

Hello. Maybe I am doing something wrong that confuses aflex and this error wouldn't show up with a better ".l"

The file containing the lexer definition is called "paeser-lexer.l" (I don't know if it's of any importance).

When I add the option %reentrant, the generated file parser-lexer_io.ads has its functions and procedures changed (which is normal and expected). However, the function "Create_Output" (line 48 in my file, could be different your side) has an incorrect signature. The line is:

procedure Create_Output (Context : in our Context_Type) frame : in String := "");

The error is just after "Context_Type". It should be a semicolon (";") and not a closing parenthesis (")").

Note that the functions and procedures above are correctly generated, as far as I can tell.

Can you reproduce the bug ?

@Bubuche87
Copy link
Author

I am slowly moving on to a different solution - I might have to write my own lexer and parser tables generator in the end but it's fine.
However, I would still like to have this issue fixed. For a future self, for other people and for Ada.

@stcarrez
Copy link
Collaborator

I don't use the Create_Output in my projects which explains why I've not seen your issue.

I've fixed the re-entrant template when Create_Output is necessary.
It should work now.

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

No branches or pull requests

2 participants