Small change
This commit is contained in:
parent
cf3519c2cc
commit
dd33b17f5c
@ -5,8 +5,8 @@ grammar astRefactor;
|
|||||||
*/
|
*/
|
||||||
syntaxtreenode: typablestatement | reftypeortphorwildcardorgeneric | methodinterface | fieldinterface | formalparameter | parameterlist | generictypevar | sourcefile | genericdecllist | argumentlist | classorinterface;
|
syntaxtreenode: typablestatement | reftypeortphorwildcardorgeneric | methodinterface | fieldinterface | formalparameter | parameterlist | generictypevar | sourcefile | genericdecllist | argumentlist | classorinterface;
|
||||||
|
|
||||||
class : ACCESSMODIFIER WHITESPACE CLASS WHITESPACE CLASSNAME '(' ( formalparameter| typeplaceholder ) WHITESPACE NAME ')''{'(NEWLINE)* classbody'}';
|
class : ACCESSMODIFIER WHITESPACE CLASS WHITESPACE CLASSNAME '(' (( formalparameter| typeplaceholder ) WHITESPACE NAME)* ')''{'(NEWLINE)* classbody'}';
|
||||||
classbody : ( method NEWLINE | variable NEWLINE )*;
|
classbody : ( method NEWLINE | variable NEWLINE | NEWLINE | whilestmt | dostmt)*;
|
||||||
|
|
||||||
variable : ACCESSMODIFIER WHITESPACE ( formalparameter | typeplaceholder )WHITESPACE NAME WHITESPACE '=' WHITESPACE ( WORD | NUMBER) ';'
|
variable : ACCESSMODIFIER WHITESPACE ( formalparameter | typeplaceholder )WHITESPACE NAME WHITESPACE '=' WHITESPACE ( WORD | NUMBER) ';'
|
||||||
| ACCESSMODIFIER WHITESPACE ( formalparameter | typeplaceholder ) WHITESPACE NAME ';';
|
| ACCESSMODIFIER WHITESPACE ( formalparameter | typeplaceholder ) WHITESPACE NAME ';';
|
||||||
@ -82,7 +82,11 @@ returninterface: RETURN | RETURNVOID;
|
|||||||
|
|
||||||
methodcallinterface: METHODCALL | THISCALL | SUPERCALL | NEWCLASS;
|
methodcallinterface: METHODCALL | THISCALL | SUPERCALL | NEWCLASS;
|
||||||
|
|
||||||
whileinterface: WHILESTMT | DOSTMT;
|
whileinterface: whilestmt | dostmt;
|
||||||
|
|
||||||
|
dostmt: DOSTMT '{'( NEWLINE )*'}' (NEWLINE)* whilestmt ;
|
||||||
|
|
||||||
|
whilestmt: WHILESTMT'('')''{'( NEWLINE)*'}';
|
||||||
|
|
||||||
assignleft: assigntofield | ASSIGNLEFTSIDE;
|
assignleft: assigntofield | ASSIGNLEFTSIDE;
|
||||||
|
|
||||||
@ -104,8 +108,8 @@ GENERICDECLLIST : 'List<T>';
|
|||||||
SOURCEFILE : WORD '.java';
|
SOURCEFILE : WORD '.java';
|
||||||
ASSIGNTOFIELD : 'assigntofield';
|
ASSIGNTOFIELD : 'assigntofield';
|
||||||
ASSIGNLEFTSIDE : 'assignleftside';
|
ASSIGNLEFTSIDE : 'assignleftside';
|
||||||
WHILESTMT : 'while()';
|
WHILESTMT : 'while';
|
||||||
DOSTMT : 'do()';
|
DOSTMT : 'do';
|
||||||
GENERICTYPEVAR : 'generictypevar';
|
GENERICTYPEVAR : 'generictypevar';
|
||||||
FORMALPARAMETER : ('int' | 'String' | 'double' | 'float' | 'boolean');
|
FORMALPARAMETER : ('int' | 'String' | 'double' | 'float' | 'boolean');
|
||||||
FIELDDECLARATION : 'fielddeclaration';
|
FIELDDECLARATION : 'fielddeclaration';
|
||||||
@ -120,7 +124,7 @@ GENERICREFTYPE : 'genericreftype';
|
|||||||
THIS : 'this';
|
THIS : 'this';
|
||||||
SUPER : 'super';
|
SUPER : 'super';
|
||||||
FIELDVAR : 'fieldvar';
|
FIELDVAR : 'fieldvar';
|
||||||
NEWARRAY : 'new ArrayList<>()';
|
NEWARRAY : 'new ArrayList';
|
||||||
LITERAL : 'literal';
|
LITERAL : 'literal';
|
||||||
CASTEXPR : 'castexpr';
|
CASTEXPR : 'castexpr';
|
||||||
LAMBDAEXPRESSION : 'lambdaexpression';
|
LAMBDAEXPRESSION : 'lambdaexpression';
|
||||||
@ -128,12 +132,12 @@ INSTANCEOF : 'instanceOf';
|
|||||||
BINARYEXPR : 'binaryexpr';
|
BINARYEXPR : 'binaryexpr';
|
||||||
EXPRESSIONRECEIVER : 'expressionreceiver';
|
EXPRESSIONRECEIVER : 'expressionreceiver';
|
||||||
STATICCLASSNAME : 'staticclassname';
|
STATICCLASSNAME : 'staticclassname';
|
||||||
FORSMT : 'for()';
|
FORSMT : 'for';
|
||||||
BLOCK : 'block';
|
BLOCK : 'block';
|
||||||
EMPTYSTMT : 'emptystmt';
|
EMPTYSTMT : 'emptystmt';
|
||||||
LOCALVARDECL : 'localvardecl';
|
LOCALVARDECL : 'localvardecl';
|
||||||
ASSIGN : 'assign';
|
ASSIGN : 'assign';
|
||||||
IFSTMT : 'if()';
|
IFSTMT : 'if';
|
||||||
LOCALVAR : 'localvar';
|
LOCALVAR : 'localvar';
|
||||||
RETURN : 'return';
|
RETURN : 'return';
|
||||||
RETURNVOID : 'return void';
|
RETURNVOID : 'return void';
|
||||||
|
Loading…
Reference in New Issue
Block a user