- edited description
Remove List Rewrites
Stop using list rewrites in JastAddJ!
List rewrites are used to rewrite variable declarations, field declarations and add implicit constructors. The list rewrites could be replaced by nonterminal attributes.
Comments (7)
-
reporter -
reporter List rewrites to add implicit constructors have been removed, now list rewrites that rewrite field and variable declarations should be replaced by NTAs.
Rewrites for variable and field declarations seem to reside in the file
VariableDeclaration.jrag
-
reporter -
reporter -
reporter -
reporter Remove variable declaration rewrites
- VarDeclStmt is no longer rewritten to a separate VariableDeclaration statements.
- VarDeclStmt now has an NTA list of single declarations named SingleDecl
- VariableDeclaration no longer inherits from Stmt.
Since VariableDeclaration is now a child of VarDeclStmt some inherited attributes needed to be changed in order to properly propagate values to VariableDeclaration nodes.
see issue
#22(bitbucket)→ <<cset f24288ffa10d>>
-
reporter - changed status to resolved
The
FieldDecl
list rewrite was removed in commit 9cfd7f7c6d0d165a0de34d24a13f867dfbe818e3This was the last remaining list rewrite in ExtendJ.
The AST was refactored a bit in order to remove the list rewrite. First,
VariableDeclaration
was removed from the abstract grammar in 3107b2352a298ccb9c9d8274c843c7c01e0def66, then theVariableDecl
node was replaced by theVariableDeclarator
node andFieldDeclaration
was replaced byFieldDeclarator
. BothVariableDeclarator
andFieldDeclarator
inherit from the same abstract node typeDeclarator
, which does not inherit from statement or body decl likeVariableDeclaration
andFieldDeclaration
did. This means thatEnumConstant
no longer could inherit some attribute declarations fromFieldDeclaration
. A more detailed description of these changes will be compiled in the extension migration guide later. - Log in to comment