-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Why are many syntax nodes not used in java.g4? #4418
Comments
First, let's test that statement (
(NB: trxgrep has stack overflow for ManyStringsConcat.java, so I removed that from the test. kaby76/Trash#540) So, 10 out of 13 test files contain either Next, I added an Antlr Listener to my driver program, and test where it tracks the count of
The results are the same. And I suspect the version that uses Antlr Visitors--if properly implemented--would be the same. I also tested this using trcover and found that 99% of the nodes are used across the entire test suite. Take this file cover.html.txt, rename to I generally do not use Antlr4 Visitors or Listeners. They are essentially the equivalent of assembly language programming for parsing. |
thank you. I'll try |
@kaby76 It may seem strange, but I'm asking, can you create a Python code formatter for me with a parser and a code generator, with 2 ports, one for C# and one for Java? Because I haven't mastered Java yet. |
I used g4 in the java directory in the project, which I think should be the official full version. I tested and ran all the java files in the example, including AllInOne7.java, AllInOne8.java, AllInOne11.java, AllInOne17.java, etc. However, it is found that nearly half of the nodes in g4, such as ModuleBody and LambdaParameters, have not been visited. What is the reason?
The text was updated successfully, but these errors were encountered: