geforkt von Mirrors/FastAsyncWorldEdit
Small modifications for better visitors
Dieser Commit ist enthalten in:
Ursprung
7d52374fc0
Commit
9f1e7cdaaf
@ -79,17 +79,17 @@ allStatements : statements EOF ;
|
|||||||
statements : statement+ ;
|
statements : statement+ ;
|
||||||
|
|
||||||
statement
|
statement
|
||||||
: block
|
: block # BlockStmt
|
||||||
| ifStatement
|
| ifStatement # IfStmt
|
||||||
| whileStatement
|
| whileStatement # WhileStmt
|
||||||
| doStatement
|
| doStatement # DoStmt
|
||||||
| forStatement
|
| forStatement # ForStmt
|
||||||
| breakStatement
|
| breakStatement # BreakStmt
|
||||||
| continueStatement
|
| continueStatement # ContinueStmt
|
||||||
| returnStatement
|
| returnStatement # ReturnStmt
|
||||||
| switchStatement
|
| switchStatement # SwitchStmt
|
||||||
| expressionStatement
|
| expressionStatement # ExpressionStmt
|
||||||
| SEMI_COLON
|
| SEMI_COLON # EmptyStmt
|
||||||
;
|
;
|
||||||
|
|
||||||
block : '{' statements '}' ;
|
block : '{' statements '}' ;
|
||||||
@ -118,29 +118,28 @@ returnStatement : RETURN expression? ;
|
|||||||
switchStatement : SWITCH '(' expression ')' '{' (switchLabel ':' statements )+ '}' ;
|
switchStatement : SWITCH '(' expression ')' '{' (switchLabel ':' statements )+ '}' ;
|
||||||
|
|
||||||
switchLabel
|
switchLabel
|
||||||
: CASE constantExpression
|
: CASE constantExpression # Case
|
||||||
| DEFAULT
|
| DEFAULT # Default
|
||||||
;
|
;
|
||||||
|
|
||||||
expressionStatement : expression SEMI_COLON ;
|
expressionStatement : expression SEMI_COLON ;
|
||||||
|
|
||||||
expression
|
expression
|
||||||
: constantExpression
|
: unaryOp expression # UnaryExpr
|
||||||
| functionCall
|
| expression binaryOp expression # BinaryExpr
|
||||||
| identifierExpression
|
| expression postUnaryOp # PostUnaryExpr
|
||||||
| '(' expression ')'
|
| ID binaryAssignOp expression # AssignExpr
|
||||||
| unaryOp expression
|
| expression '?' expression ':' expression # TernaryExpr
|
||||||
| identifierExpression binaryAssignOp expression
|
| functionCall # FunctionCallExpr
|
||||||
| expression binaryOp expression
|
| constantExpression # ConstantExpr
|
||||||
| expression postUnaryOp
|
| ID # IdExpr
|
||||||
|
| '(' expression ')' # WrappedExpr
|
||||||
;
|
;
|
||||||
|
|
||||||
constantExpression : NUMBER ;
|
constantExpression : NUMBER ;
|
||||||
|
|
||||||
functionCall : ID '(' (expression ( ',' expression )*)? ')' ;
|
functionCall : ID '(' (expression ( ',' expression )*)? ')' ;
|
||||||
|
|
||||||
identifierExpression : ID ;
|
|
||||||
|
|
||||||
unaryOp
|
unaryOp
|
||||||
: MINUS
|
: MINUS
|
||||||
| EXCLAMATION_MARK
|
| EXCLAMATION_MARK
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren