diff options
author | Freya Murphy <freya@freyacat.org> | 2024-02-22 19:40:09 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-02-22 19:40:09 -0500 |
commit | e649cef4255cf9546304f4faa545e351ea636313 (patch) | |
tree | f9e53c2bc3eb1fd2470d4552d01fd8da098181c5 /syntax_thing | |
parent | lang is not expr based (diff) | |
download | matrix-e649cef4255cf9546304f4faa545e351ea636313.tar.gz matrix-e649cef4255cf9546304f4faa545e351ea636313.tar.bz2 matrix-e649cef4255cf9546304f4faa545e351ea636313.zip |
indexing and field access
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 |