Skip to content

Commit 15047e5

Browse files
committed
execute语法
1 parent dbf4dfd commit 15047e5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/main/antlr/mcfppLexer.g4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ TRY:'try';
7474
STORE:'store';
7575
AS:'as';
7676
FROM:'from';
77+
EXECUTE:'execute';
7778

7879
BREAK:'break';
7980
CONTINUE:'continue';
@@ -191,6 +192,11 @@ FloatConstant
191192
| FractionalConstant ExponentPart? NBTFloatSuffix?
192193
;
193194

195+
RelativeValue
196+
: '~' IntegerConstant
197+
| '~' FloatConstant
198+
;
199+
194200
BooleanConstant
195201
: 'true'
196202
| 'false'

src/main/antlr/mcfppParser.g4

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,15 @@ statement
407407
| controlStatement ';'
408408
| orgCommand
409409
| returnStatement ';'
410+
| executeStatement
411+
;
412+
413+
executeStatement
414+
: EXECUTE '(' executeContext (',' executeContext)* ')' block
415+
;
416+
417+
executeContext
418+
: varWithSelector '=' expression
410419
;
411420

412421
orgCommand
@@ -526,6 +535,7 @@ functionReturnType
526535
value
527536
: intValue
528537
| floatValue
538+
| RelativeValue
529539
| LineString
530540
| boolValue
531541
| multiLineStringLiteral

0 commit comments

Comments
 (0)