Parse till operators

This commit is contained in:
2021-10-20 21:21:02 +02:00
committed by raymon
parent 8bd1224889
commit 13b29b8bdc
2 changed files with 57 additions and 7 deletions
+15 -1
View File
@@ -1 +1,15 @@
alpha = { 'a'..'z' | 'A'..'Z' }
operator = @{ "operator" } // TODO
operand = @{ "operand" } // TODO
instruction = { operator ~ (" "+ ~ operand)*}
loopBlockStart = { "[" }
loopBlockEnd = { "]" }
loopBlock = { loopBlockStart
~ instruction*
~ loopBlockEnd
}
statement = _{ instruction | loopBlock }
file = {SOI ~ (statement ~ ("\n" | "\r\n")+)* ~ EOI}