You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
499 B
19 lines
499 B
operator = @{ "operator" } // TODO
|
|
operand = @{ "operand" } // TODO
|
|
|
|
instruction = { operator ~ (" "+ ~ operand)? }
|
|
|
|
loopBlockStart = { "[" ~ newline }
|
|
loopBlockEnd = { "]" }
|
|
loopBlock = { loopBlockStart
|
|
~ statements
|
|
~ newline
|
|
~ loopBlockEnd
|
|
}
|
|
|
|
statement = _{ instruction | loopBlock }
|
|
statements = _{ statement* }
|
|
|
|
newline = _{ "\n" | "\r\n" }
|
|
|
|
file = {SOI ~ (statement ~ newline+)* ~ EOI}
|
|
|