feat(package): hemar: antlr grammar, but still does not work

This commit is contained in:
2025-11-26 14:48:51 +00:00
parent 8a08272f68
commit 777d48bf3d
16 changed files with 282 additions and 7 deletions

View File

@@ -0,0 +1,28 @@
grammar Hemar;
// ----------------- parser rules -----------------
hemar: elements? EOF ;
elements: element+ ;
element
: segment
| interpoltion
;
segment : for elements? end ;
for : 'for' 'in' ;
end: 'end' ;
interpoltion : 'mcha' ;
OPEN : '{[' ;
CLOSE : ']}' ;
WS : [ \t\n\r]+ -> skip ;
LEADING_TEXT : { getCharPositionInLine() == 0 }? (~'{'|'{'~'[')* OPEN -> skip;
MIDLE_TEXT : CLOSE (~'{'|'{'~'[')* OPEN -> skip;
ENDING_TEXT : CLOSE (~'{'|'{'~'[')* EOF -> skip ;