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

C target broken in antlr >= 3.5 #175

Open
mjakubicek opened this issue Jul 18, 2015 · 6 comments
Open

C target broken in antlr >= 3.5 #175

mjakubicek opened this issue Jul 18, 2015 · 6 comments

Comments

@mjakubicek
Copy link

The C target is entirely broken in antlr >= 3.5. In earlier versions there was a warning which became an error in antlr >= 3.5:

error(24): template error: context [/outputFile /parser] 1:1 could not pass through undefined attribute filterMode

making antlr not producing lexer code.

@opoplawski
Copy link

We seem to see similar with cvc4 and belle-sip. Ultimately leads to errors like:

generated/Smt1Lexer.c:1759:41: error: '_empty' was not declared in this scope
     dfa13_T182, dfa13_T143, dfa13_T209, _empty, _empty, _empty, dfa13_T53, 

@mjakubicek
Copy link
Author

Dear Orion,

I was getting these kinds of errors even before too and fixed them (in my
case) by:

@lexer::includes {
#define _empty NULL
}

Its a pity that the C target is in such a bad shape (and reason why we are
moving off from Antlr after 10 years of using it in our developments).

Milos

2015-09-01 4:25 GMT+02:00 Orion Poplawski notifications@github.com:

We seem to see similar with cvc4 and belle-sip. Ultimately leads to errors
like:

generated/Smt1Lexer.c:1759:41: error: '_empty' was not declared in this scope
dfa13_T182, dfa13_T143, dfa13_T209, _empty, _empty, _empty, dfa13_T53,


Reply to this email directly or view it on GitHub
#175 (comment).

@opoplawski
Copy link

Thanks, that may be helpful for cvc4, bit in the belle-sip case, we can't get around the antlr template error:

error(24):  template error: context [/outputFile /parser] 1:1 could not pass through undefined attribute filterMode

@opoplawski
Copy link

I see lots of people reporting that error as a warning. Not sure why it appears as an error for belle-sip.

@mjakubicek
Copy link
Author

That is what changed from 3.4 to 3.5: it was a warning, now it is an error.
Dne 1. 9. 2015 17:19 napsal uživatel "Orion Poplawski" <
notifications@github.com>:

I see lots of people reporting that error as a warning. Not sure why it
appears as an error for belle-sip.


Reply to this email directly or view it on GitHub
#175 (comment).

@ibre5041
Copy link
Contributor

ibre5041 commented Sep 2, 2015

I think this regression shown up between 3.5 releases. Maybe 3.5.1 => 3.5.2. It has something to do with StringTemplate library used internally by Antlr. About year ago I went through C++ target and have fixed these warnings at least for this one. If somebody is willing to fix this, I recommend to go though these commits (it should be easy to port these fixes back into the C target). https://github.com/ibre5041/antlr3/commits/master?page=3. Also this patch significantly improves performance of generated parser (when using predicates): ibre5041@e36baba

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

No branches or pull requests

4 participants