Java8 and C# grammar: Tree structure of a variable that is initialized with a literal during declaration #3998
Labels
csharp
target:java
Grammars for Java target, https://github.com/antlr/antlr4/blob/master/doc/java-target.md
Hi,
I have a question regarding the tree that's generated for the following Java8 code:
The tree for the initialisation in the declaration looks like:
![Screenshot 2024-03-04 at 3 09 16 PM](https://private-user-images.githubusercontent.com/19567657/309802078-9b6bae0a-8b79-4013-84f4-b22ffad4b58b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5MjM1MzgsIm5iZiI6MTcxODkyMzIzOCwicGF0aCI6Ii8xOTU2NzY1Ny8zMDk4MDIwNzgtOWI2YmFlMGEtOGI3OS00MDEzLTg0ZjQtYjIyZmZhZDRiNThiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIwVDIyNDAzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRjN2E5YmM0YzdhZDEzMGE2YzZmZTBmZWQxYjBiMzEzZWFkYzg1NzFkN2M4YzE5Yzk5N2IwNWYyOTAyNTVkM2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5SbZbr5fQzAABqWiniQEP5ncVdBzNIH-XY1cjTMNaCI)
Why is the initialization so convoluted? Why are
inclusive*
andshift*
nodes involved here when the RHS is a simple literal? Do I have to go through all those nodes to access the literal? I see that this happens for other languages like C# as well.The text was updated successfully, but these errors were encountered: