Some language stuff

This commit is contained in:
Daniel Holden
2013-09-26 17:58:14 +01:00
parent d1881a0d0c
commit 751e3f6b9d
5 changed files with 274 additions and 59 deletions

7
tests/maths.grammar Normal file
View File

@@ -0,0 +1,7 @@
expression : <product> (('+' | '-') <product>)*;
product : <value> (('*' | '/') <value>)*;
value : /[0-9]+/ | '(' <expression> ')';
maths : /^\\w*/ <expression> /\\w*$/;