text-generation-webui-mirror/user_data/grammars/arithmetic.gbnf
2025-04-26 08:56:54 -03:00

6 lines
177 B
Text

root ::= (expr "=" ws term "\n")+
expr ::= term ([-+*/] term)*
term ::= ident | num | "(" ws expr ")" ws
ident ::= [a-z] [a-z0-9_]* ws
num ::= [0-9]+ ws
ws ::= [ \t\n]*