[client] exeute command

This commit is contained in:
2021-04-17 23:03:40 +05:30
parent ed83e649fb
commit d7d48785aa
16 changed files with 1298 additions and 16 deletions

49
client/bf.g4 Normal file
View File

@@ -0,0 +1,49 @@
grammar bf;
program
: statements EOF;
statements
: eligibleStmt*;
eligibleStmt
: stmt
| numberedStmt
;
numberedStmt
: stmt NUMBER
;
stmt
: basicStmt
| loopStmt
;
loopStmt
: LOOPSTART statements LOOPEND
;
basicStmt
: INC # ptrIncr
| DEC # ptrDecr
| LEFT # ptrLeft
| RIGHT # ptrRight
| INPUT # inputStmt
| OUTPUT # outputStmt
;
LOOPSTART: '[';
LOOPEND:']';
NUMBER: [0-9]+;
INPUT: ',';
OUTPUT: '.';
DEC: '-';
INC: '+';
LEFT: '<';
RIGHT: '>';
EVERYTHING_ELSE: . ->channel(HIDDEN);
WS: [ \r\n] -> skip;