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
Conversion to ANTLR 4 (work in progress) #23
Conversation
Feel free to leave comments in the commits or here if you have questions |
Hi Sam, @SuppressWarnings("unused")
} But it is obviously line 3 "WHERE color in ('red', 2000, 'blue')", while antlr reports correct line. I got positions from ctx, like this. Do you think it is ok to change ut according the position like this:
|
…redicate, exitNot_equal_predicate, exitBetween_predicate, and exitRange_predicate
I added 3 commits showing how I would update the error reporting for the validation in several predicate methods. For your specific example, the error is located at the token |
I have fixed the test case. Error message are from 2 sources now.
|
…e semantic analyzer methods
I added a 4th commit to correct the tests in |
The problem with embedding the line number in the error message is it hinders the ability of an IDE to highlight errors spanning multiple tokens. By including the |
So you don;t suggest embed the line number in the error message? |
I will try to use your latest code tomorrow. |
With the latest two commits, all unit tests in |
Thanks Sam! |
Merged thanks Sam! |
This is a work-in-progress showing the conversion of BQL.g (ANTLR 3.4) to BQL.g4 (ANTLR 4.2). Here is the current state of the conversion:
BQLCompilerAnalyzer.java
.All tests in TestErrorHandling.java fail, sinceAll tests in TestErrorHandling.java now pass and have greatly improved error locality compared to the ANTLR 3 reporting; the pull request was updated to work with ANTLR 4 exceptions.BQLCompiler.getErrorMessage
has not been updated to work with the ANTLR 4 exceptions.