2021-04-30 16:05:03 +00:00
|
|
|
@struct_type -> "STRUCT" "ID" "OPENING_BRACE" member_list "CLOSING_BRACE" more_struct_type
|
2021-04-30 12:55:56 +00:00
|
|
|
more_struct_type -> "EOF"
|
|
|
|
more_struct_type -> ε
|
|
|
|
|
2021-04-30 16:05:03 +00:00
|
|
|
member_list -> type_spec declarators "SEMICOLON" member_list
|
2021-04-30 12:55:56 +00:00
|
|
|
member_list -> ε
|
|
|
|
|
2021-04-30 05:33:22 +00:00
|
|
|
type_spec -> base_type_spec
|
2021-04-30 12:55:56 +00:00
|
|
|
type_spec -> @struct_type
|
2021-04-30 05:33:22 +00:00
|
|
|
base_type_spec -> floating_pt_type
|
|
|
|
base_type_spec -> integer_type
|
2021-04-30 16:05:03 +00:00
|
|
|
base_type_spec -> "CHAR"
|
|
|
|
base_type_spec -> "BOOLEAN"
|
|
|
|
floating_pt_type -> "FLOAT"
|
|
|
|
floating_pt_type -> "DOUBLE"
|
|
|
|
floating_pt_type -> "LONG" "DOUBLE"
|
2021-04-30 05:33:22 +00:00
|
|
|
integer_type -> signed_int
|
|
|
|
integer_type -> unsigned_int
|
|
|
|
|
2021-04-30 16:05:03 +00:00
|
|
|
signed_int -> "SHORT"
|
|
|
|
signed_int -> "INT16"
|
|
|
|
signed_int -> "LONG"
|
|
|
|
signed_int -> "INT32"
|
|
|
|
signed_int -> "LONG" "LONG"
|
|
|
|
signed_int -> "INT64"
|
|
|
|
signed_int -> "INT8"
|
2021-04-30 05:33:22 +00:00
|
|
|
|
2021-04-30 16:05:03 +00:00
|
|
|
unsigned_int -> "UNSIGNED" "SHORT"
|
|
|
|
unsigned_int -> "UNSIGNED" "LONG"
|
|
|
|
unsigned_int -> "UNSIGNED" "LONG" "LONG"
|
|
|
|
unsigned_int -> "UINT16"
|
|
|
|
unsigned_int -> "UINT32"
|
|
|
|
unsigned_int -> "UINT64"
|
|
|
|
unsigned_int -> "UINT8"
|
2021-04-30 05:33:22 +00:00
|
|
|
|
|
|
|
declarators -> declarator more_declarators
|
2021-04-30 16:05:03 +00:00
|
|
|
more_declarators -> "COMMA" declarator more_declarators
|
2021-04-30 05:33:22 +00:00
|
|
|
more_declarators -> ε
|
|
|
|
|
|
|
|
declarator -> "ID" more_declarator
|
|
|
|
more_declarator -> exp_list
|
|
|
|
more_declarator -> ε
|
|
|
|
|
2021-04-30 16:05:03 +00:00
|
|
|
exp_list -> "LEFT_BRACKET" or_expr more_or_expr "RIGHT_BRACKET"
|
|
|
|
more_or_expr -> "COMMA" or_expr more_or_expr
|
2021-04-30 05:33:22 +00:00
|
|
|
more_or_expr -> ε
|
2021-04-30 12:55:56 +00:00
|
|
|
|
|
|
|
or_expr -> xor_expr more_xor_expr
|
2021-04-30 16:05:03 +00:00
|
|
|
more_xor_expr -> "DELIMITER" xor_expr more_xor_expr
|
2021-04-30 12:55:56 +00:00
|
|
|
more_xor_expr -> ε
|
|
|
|
|
2021-04-30 05:33:22 +00:00
|
|
|
xor_expr -> and_expr more_and_expr
|
2021-04-30 16:05:03 +00:00
|
|
|
more_and_expr -> "INSERT" and_expr more_and_expr
|
2021-04-30 05:33:22 +00:00
|
|
|
more_and_expr -> ε
|
2021-04-30 12:55:56 +00:00
|
|
|
|
2021-04-30 05:33:22 +00:00
|
|
|
and_expr -> shift_expr more_shift_expr
|
2021-04-30 16:05:03 +00:00
|
|
|
more_shift_expr -> "AND" shift_expr more_shift_expr
|
2021-04-30 05:33:22 +00:00
|
|
|
more_shift_expr -> ε
|
2021-04-30 12:55:56 +00:00
|
|
|
|
2021-04-30 05:33:22 +00:00
|
|
|
shift_expr -> add_expr more_add_expr
|
2021-04-30 12:55:56 +00:00
|
|
|
more_add_expr -> shift_sign add_expr more_add_expr
|
2021-04-30 16:05:03 +00:00
|
|
|
shift_sign -> "RIGHT_SHIFT"
|
|
|
|
shift_sign -> "LEFT_SHIFT"
|
2021-04-30 12:55:56 +00:00
|
|
|
more_add_expr -> ε
|
|
|
|
|
2021-04-30 05:33:22 +00:00
|
|
|
add_expr -> multi_expr more_multi_expr
|
2021-04-30 12:55:56 +00:00
|
|
|
more_multi_expr -> multi_sign multi_expr more_multi_expr
|
2021-04-30 16:05:03 +00:00
|
|
|
multi_sign -> "PLUS"
|
|
|
|
multi_sign -> "SUB"
|
2021-04-30 12:55:56 +00:00
|
|
|
more_multi_expr -> ε
|
|
|
|
|
2021-04-30 05:33:22 +00:00
|
|
|
multi_expr -> unary_expr more_unary_expr
|
2021-04-30 12:55:56 +00:00
|
|
|
more_unary_expr -> unary_sign unary_expr more_unary_expr
|
2021-04-30 16:05:03 +00:00
|
|
|
unary_sign -> "MULT"
|
|
|
|
unary_sign -> "SLASH"
|
|
|
|
unary_sign -> "PERCENT"
|
2021-04-30 12:55:56 +00:00
|
|
|
more_unary_expr -> ε
|
|
|
|
|
2021-04-30 05:33:22 +00:00
|
|
|
unary_expr -> unary_sign_2 unary_declare
|
2021-04-30 16:05:03 +00:00
|
|
|
unary_sign_2 -> "SUB"
|
|
|
|
unary_sign_2 -> "PLUS"
|
|
|
|
unary_sign_2 -> "TILDE"
|
2021-04-30 12:55:56 +00:00
|
|
|
unary_sign_2 -> ε
|
2021-04-30 05:33:22 +00:00
|
|
|
unary_declare -> "INTEGER"
|
|
|
|
unary_declare -> "STRING"
|
2021-04-30 16:05:03 +00:00
|
|
|
unary_declare -> BOOLEAN_VALUE
|
2021-04-30 12:55:56 +00:00
|
|
|
|
2021-04-30 16:05:03 +00:00
|
|
|
BOOLEAN_VALUE -> "TRUE"
|
|
|
|
BOOLEAN_VALUE -> "FALSE"
|