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 fixes/changes/improvements #112

Merged
merged 16 commits into from
Sep 8, 2013
Merged

Conversation

ibre5041
Copy link
Contributor

  • Some Lexer fixes (old C-target code ported to C++)
  • "Run-time headers" included (and modified)
  • Bugfixes
  • Parser return types named (shortened)
  • ST warnings removed

@ibre5041
Copy link
Contributor Author

I finally got familiar with git rebase command. The commit 4be2968 addresses you comment for 77d8914. This commit replaces three different commits, which change the same piece of the code.

@ibre5041
Copy link
Contributor Author

AST support was removed form this pull request. Can pls review and approve this set of patches?
Also @ members stay in .cpp while @ context is in .hpp.

@ksgokul
Copy link
Contributor

ksgokul commented Jun 19, 2013

+1.. The changes look fine to me.

@ibre5041
Copy link
Contributor Author

On 06/19/2013 07:27 PM, ksgokul wrote:

+1.. The changes look fine to me.


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

Sam can you please merge the pull request 112?

thx Ivan

PS: Maybe I've found a reason why C++ target is sometimes slower that
Java one.
When using semantic predicates ANTLR generates code like this:
// PLSQLGuiLexer.g:1107:2: ( ( SQLPLUS_COMMAND_INTRODUCER
)=>sqlplus= SQLPLUS_COMMAND_INTRODUCER |)
{
int alt51=2;
{
int LA51_0 = this->LA(1);
if ( (this->msynpred(
antlr3::ClassForwarder<synpred1_PLSQLGuiLexer>() )) && (LA51_0 == 'A'))
{
alt51=1;
}
else if ( (this->msynpred(
antlr3::ClassForwarder<synpred1_PLSQLGuiLexer>() )) && (LA51_0 == 'B'))
{
alt51=1;
}
...
The order is wrong - msynpred is evaluated again and again. The same
applies to C target too. While Java target generates:
// PLSQLGuiLexer.g:1107:2: ( ( SQLPLUS_COMMAND_INTRODUCER
)=>sqlplus= SQLPLUS_COMMAND_INTRODUCER |)
int alt51=2;
int LA51_0 = input.LA(1);
if ( (LA51_0=='A') && (synpred1_PLSQLGuiLexer())) {
alt51=1;
}
else if ( (LA51_0=='B') && (synpred1_PLSQLGuiLexer())) {
alt51=1;
}
else if ( (LA51_0=='C') && (synpred1_PLSQLGuiLexer())) {
alt51=1;
}
...
So far I could not identify piece of code, which is responsible for this.

@ibre5041
Copy link
Contributor Author

Can you please merge this pull request? It contains only bugfixes.

@sharwell
Copy link
Member

We're working on releasing ANTLR 4.1 tomorrow. I'll look into this merge either tomorrow or Monday.

@ibre5041
Copy link
Contributor Author

ibre5041 commented Sep 3, 2013

Ping

@parrt
Copy link
Member

parrt commented Sep 3, 2013

hahah! Almost got to it this weekend. dang it. thanks for ping.
T
On Sep 3, 2013, at 6:54 AM, ibre5041 wrote:

Ping


Reply to this email directly or view it on GitHub.

sharwell added a commit that referenced this pull request Sep 8, 2013
C++ target fixes/changes/improvements
@sharwell sharwell merged commit f9b709d into antlr:master Sep 8, 2013
@ibre5041 ibre5041 mentioned this pull request Nov 8, 2013
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.

4 participants