Small change

This commit is contained in:
Linus K 2022-10-23 21:47:07 +02:00
parent 26a539e440
commit 5ea3deacfd
2 changed files with 7 additions and 6 deletions

View File

@ -7,10 +7,10 @@ grammar astRefactor;
class : ACCESSMODIFIER WHITESPACE CLASS WHITESPACE NAME '(' ( MODIFIER| TYPEPLACEHOLDER ) WHITESPACE NAME ')''{'NEWLINE classbody'}';
classbody : ( method NEWLINE | variable NEWLINE )+;
variable : ACCESSMODIFIER WHITESPACE ( MODIFIER WHITESPACE )? NAME WHITESPACE '=' WHITESPACE ( WORD | NUMBER) ';'
| ACCESSMODIFIER WHITESPACE ( MODIFIER WHITESPACE )? NAME ';';
variable : ACCESSMODIFIER WHITESPACE ( MODIFIER | TYPEPLACEHOLDER )WHITESPACE NAME WHITESPACE '=' WHITESPACE ( WORD | NUMBER) ';'
| ACCESSMODIFIER WHITESPACE ( MODIFIER | TYPEPLACEHOLDER ) WHITESPACE NAME ';';
method : ACCESSMODIFIER WHITESPACE ( MODIFIER WHITESPACE )? NAME '(' MODIFIER WHITESPACE WORD ')';
method : ACCESSMODIFIER WHITESPACE ( MODIFIER | TYPEPLACEHOLDER ) WHITESPACE NAME '(' ( MODIFIER | TYPEPLACEHOLDER ) WHITESPACE WORD ')';
syntaxtreenode: typablestatement | reftypeortphorwildcardorgeneric | methodinterface | fieldinterface | formalparameter | parameterlist | generictypevar | sourcefile | genericdecllist | argumentlist | classorinterface;

View File

@ -20,9 +20,10 @@ public class SwitchTest {
System.out.println("argumentList");
}
case ClassOrInterface classOrInterface -> {
System.out.println("ClassOrInterface: \n" +
"Modifier = " + classOrInterface.getModifiers() + "\n" +
"Classname = " + classOrInterface.getClassName());
int mod = classOrInterface.getModifiers();
if (mod == 1) {
System.out.println("ClassOrInterface: \n" + "public PLACEHOLDER " + classOrInterface.getClassName() + "{}");
}
}
case FormalParameter formalParameter -> {
System.out.println("formalParameter");