From e649cef4255cf9546304f4faa545e351ea636313 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 22 Feb 2024 19:40:09 -0500 Subject: indexing and field access --- syntax_thing | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 syntax_thing (limited to 'syntax_thing') 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 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 -- cgit v1.2.3-freya