diff options
Diffstat (limited to '')
-rw-r--r-- | syntax_thing | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/syntax_thing b/syntax_thing new file mode 100644 index 0000000..8f48af7 --- /dev/null +++ b/syntax_thing @@ -0,0 +1,63 @@ +root => root_expr* +root_expr => function +root_expr => expr +function => FUNCTION IDENT params block +params => IDENT +params => OP CP +params => OP params_impl +params_impl => IDENT COMMA params_impl +params_impl => IDENT CP +block => expr* +expr => if_expr +if_expr => IF math_expr block ELSE if_expr +if_expr => IF math_expr block ELSE block +if_expr => IF math_expr block +expr => DO block WHILE math_expr +expr => WHILE math_expr block +expr => LET IDENT EQ math_expr END +expr => LET IDENT END +expr => IDENT EQ math_expr END +expr => block +expr => RETURN math_expr END +expr => BREAK +expr => CONTINUE +expr => math_expr END +math_expr => (math_expr_and OR)* math_expr_and +math_expr_and => math_expr_and AND math_expr_and +math_expr_and => math_expr_compare +math_expr_compare => math_expr_compare <COMPARE> math_expr_compare + +power_term => power_term POWER power_term +power_term => power_term BIT_AND power_term +power_term => power_term BIT_OR power_term +power_term => power_term SHIFT_LEFT power_term +power_term => power_term SHIFT_RIGHT power_term +power_term => term +term => value +term => tuple +term => list +term => table +term => IDENT +value => INT DIVIDE INT +value => INT +value => FLOAT +value => COMPLEX +value => STRING +value => REGEX +value => TRUE +value => FALSE +tuple => OP CP +tuple => OP tuple_impl +tuple_impl => math_expr COMMA tuple_impl +tuple_impl => math_expr CP +list => LBRK RBRK +list => LBRK list_impl +list_impl => math_expr COMMA tuple_impl +list_impl => math_expr RBRK +table => LBRC RBRC +table => LBRC table_impl +table_impl => table_key EQ math_expr COMMA table_impl +table_impl => table_key EQ math_expr RBRC +table_key => LBRK math_expr RBRK +table_key => IDENT +table_key => STRING |