Grammar rule 'classDeclaration' error
See original GitHub issueDescription
I litterally just copy pasted the 3 kotlin .g4
files and ran grun
to check the generated AST using the MutableStack<E>
code from the example here : https://play.kotlinlang.org/byExample/01_introduction/06_Generics
And it seems like it can’t match the LCURLY
bracket of the classBody
rule ? Could anyone confirm please
Output + AST
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
ANTLR4 can only parse a class statement, not the whole file
classDeclaration() corresponds to the classDeclaration rule, which presumably represents a class declaration, and not the entire program.
Read more >TMF (Xtext) » Simple Grammar causes ... - Eclipse Community Forums
InternalTestLangParser.rule__ClassDeclaration__MembersAssignment_4( ... meanwhile I found out how to solve the error by rewriting the grammar but the error ...
Read more >2.2.2 Coco/R - Grammar: package, annotation and interface ...
Coco/R grammar rules are written after the reserved word PRODUCTIONS. ... ClassDeclaration and InterfaceDeclaration is given dummy tokens for the moment, ...
Read more >[Boost-users] rule.ipp(173) : error C1128: number of sections ...
It looks like, the compiler complaining about the size of the inline code. ... What is the solution to this issue? If I...
Read more >SashaMazurovSandbox < Sandbox < TWiki
You will see all changes on a real case for ValueWithErrorGrammar (also, ... parameters as // qi::grammar at the class declaration: qi::rule<Iterator, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Literally any feedback for the grammar is appreciated as it shows somebody is actively using it =)
The Inside_ rules are there to distinguish expressions inside parentheses from free-range ones. The
Inside_WHATEVER: WHATEVER -> type(WHATEVER);
boilerplate code maps them to their non-inside counterparts so they do not need to be referenced anywhere as the token stream will contain the non-Inside variant.Why do we need to distinguish expressions inside parentheses? Because inside parentheses you can safely ignore newlines and you cannot do that on the top-level. An example of this is, for example,
a * b
: