[grammar] update

This commit is contained in:
2021-04-13 11:25:39 +05:30
parent 88109924ed
commit ae57a1bcf2
2 changed files with 5 additions and 3 deletions

View File

@@ -61,14 +61,14 @@ Eg.
## Setup oddities (dev) ## Setup oddities (dev)
1. Copy `antlr-4.8-complete.jar` to `./thirdparty/antlr`. (Required only if grammar has to be updated) 1. Generate parsers to `./libs/generated` or use VSCode with the ANTLR extension or use a downloaded ANTLR JAR.
2. Generate parsers to `./libs/generated` or use VSCode with the ANTLR extension.
## Todo (Tentative) ## Todo (Tentative)
- [ ] Grammar - [ ] Grammar
- [X] Number shorthand - [X] Number shorthand
- [X] Loop statements - [X] Loop statements
- [X] Ignore rest
- [ ] Shorthand segments - [ ] Shorthand segments
- [X] Processing - [X] Processing
- [X] Translate to bf - [X] Translate to bf

View File

@@ -68,7 +68,6 @@ outputStmt
NEWLINE: '\n' -> skip; NEWLINE: '\n' -> skip;
COMMENT: '//' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN); COMMENT: '//' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN);
ML_COMMENT: '/*' .*? '*/' ->channel(HIDDEN); ML_COMMENT: '/*' .*? '*/' ->channel(HIDDEN);
WS: [ \r\n] -> skip;
DEF: '#'; DEF: '#';
LOOPSTART: '['; LOOPSTART: '[';
LOOPEND:']'; LOOPEND:']';
@@ -81,3 +80,6 @@ DEC: '-';
INC: '+'; INC: '+';
LEFT: '<'; LEFT: '<';
RIGHT: '>'; RIGHT: '>';
EVERYTHING_ELSE: . ->channel(HIDDEN);
WS: [ \r\n] -> skip;