-
Notifications
You must be signed in to change notification settings - Fork 150
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
missing children from OC_ComparisonExpressionContext
in cpp-runtime of ANTLR
#529
Comments
Hi, Thank you for engaging with the openCypher grammar. To your problem: Unfortunately, I cannot speak to the C++ specific part of it. If the behavior is indeed different between different host language (Java vs. C++) and different usage patterns, then it seems to be more an Antlr problem to me. However, let me note something just in case you have miss it by accident.
(naming as in the Java variant) Maybe you happen to look at the wrong Another possibility is that you miss a method in your visitor or a return line in one of the methods, so that the visitor is no fully descending the parse tree under Note that I am mostly guessing. You may have double checked all of that already. If so, I am sorry. Hope it helps, anyway. |
Thanks! the problem is resolved. I work on the openCypher implementation at KatanaGraph. I would like to know whether I can join the openCypher committee so we can officially contribute back to the community. I have implemented a majority part of the openCypher. I found there are several places where improvement of the grammar is needed to simplify the implementation. |
How can we solve this missing-children problem?
I am trying to use the antlr4 c++ runtime for the openCypher grammar.
When I tried to parse the following query,
I see a child missing for the parent node
OC_ComparisonExpressionContext
in the visitor pattern:Here the
ctx->children.size()
shows1
but it indeed has3
children from the parse tree generated which one of them isoC_PartialComparisonExpression
. With this problem,visitOC_PartialComparisonExpression
is not called becausevisitChildren(ctx)
fromvisitOC_ComparisonExpression()
will not get to this missing child.I have tried the listener pattern and it has no this missing-child problem. Also, I have tried the Java runtime and this problem is not there.
To reproduce the problem in C++, I have provided the dependencies needed.
https://s3.amazonaws.com/artifacts.opencypher.org/M18/Cypher.g4
The text was updated successfully, but these errors were encountered: