From: Luke Kenneth Casson Leighton Date: Thu, 25 Apr 2019 18:44:59 +0000 (+0100) Subject: more patterns $$ = true -> p[0] = True etc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7bc2bc9b895bb7af15ba30754581a0e4d0ca1239;p=sv2nmigen.git more patterns $$ = true -> p[0] = True etc --- diff --git a/parse_sv.py b/parse_sv.py index 1490051..b61df9e 100644 --- a/parse_sv.py +++ b/parse_sv.py @@ -815,12 +815,12 @@ def p__embed4_function_declaration(p): def p_import_export_1(p): '''import_export : K_import ''' print('import_export_1', list(p)) - # { p[0] = True; } + p[0] = True () def p_import_export_2(p): '''import_export : K_export ''' print('import_export_2', list(p)) - # { p[0] = False; } + p[0] = False () def p_implicit_class_handle_1(p): '''implicit_class_handle : K_this ''' @@ -874,17 +874,17 @@ def p_inside_expression_1(p): def p_integer_vector_type_1(p): '''integer_vector_type : K_reg ''' print('integer_vector_type_1', list(p)) - # { $$ = IVL_VT_NO_TYPE; } + p[0] = IVL_VT_NO_TYPE () def p_integer_vector_type_2(p): '''integer_vector_type : K_bit ''' print('integer_vector_type_2', list(p)) - # { $$ = IVL_VT_BOOL; } + p[0] = IVL_VT_BOOL () def p_integer_vector_type_3(p): '''integer_vector_type : K_logic ''' print('integer_vector_type_3', list(p)) - # { $$ = IVL_VT_LOGIC; } + p[0] = IVL_VT_LOGIC () def p_integer_vector_type_4(p): '''integer_vector_type : K_bool ''' @@ -1618,12 +1618,12 @@ def p_real_or_realtime_2(p): def p_signing_1(p): '''signing : K_signed ''' print('signing_1', list(p)) - # { p[0] = True; } + p[0] = True () def p_signing_2(p): '''signing : K_unsigned ''' print('signing_2', list(p)) - # { p[0] = False; } + p[0] = False () def p_simple_type_or_string_1(p): '''simple_type_or_string : integer_vector_type ''' @@ -2333,12 +2333,12 @@ def p_block_item_decls_2(p): def p_block_item_decls_opt_1(p): '''block_item_decls_opt : block_item_decls ''' print('block_item_decls_opt_1', list(p)) - # { p[0] = True; } + p[0] = True () def p_block_item_decls_opt_2(p): '''block_item_decls_opt : ''' print('block_item_decls_opt_2', list(p)) - # { p[0] = False; } + p[0] = False () def p_type_declaration_1(p): '''type_declaration : K_typedef data_type IDENTIFIER dimensions_opt ';' ''' @@ -4836,32 +4836,32 @@ def p_net_type_opt_2(p): def p_unsigned_signed_opt_1(p): '''unsigned_signed_opt : K_signed ''' print('unsigned_signed_opt_1', list(p)) - # { p[0] = True; } + p[0] = True () def p_unsigned_signed_opt_2(p): '''unsigned_signed_opt : K_unsigned ''' print('unsigned_signed_opt_2', list(p)) - # { p[0] = False; } + p[0] = False () def p_unsigned_signed_opt_3(p): '''unsigned_signed_opt : ''' print('unsigned_signed_opt_3', list(p)) - # { p[0] = False; } + p[0] = False () def p_signed_unsigned_opt_1(p): '''signed_unsigned_opt : K_signed ''' print('signed_unsigned_opt_1', list(p)) - # { p[0] = True; } + p[0] = True () def p_signed_unsigned_opt_2(p): '''signed_unsigned_opt : K_unsigned ''' print('signed_unsigned_opt_2', list(p)) - # { p[0] = False; } + p[0] = False () def p_signed_unsigned_opt_3(p): '''signed_unsigned_opt : ''' print('signed_unsigned_opt_3', list(p)) - # { p[0] = True; } + p[0] = True () def p_atom2_type_1(p): '''atom2_type : K_byte ''' @@ -6086,12 +6086,12 @@ def p_value_range_expression_4(p): def p_from_exclude_1(p): '''from_exclude : K_from ''' print('from_exclude_1', list(p)) - # { p[0] = False; } + p[0] = False () def p_from_exclude_2(p): '''from_exclude : K_exclude ''' print('from_exclude_2', list(p)) - # { p[0] = True; } + p[0] = True () def p_parameter_value_opt_1(p): '''parameter_value_opt : '#' '(' expression_list_with_nuls ')' ''' @@ -6704,12 +6704,12 @@ def p_specify_edge_path_decl_2(p): def p_edge_operator_1(p): '''edge_operator : K_posedge ''' print('edge_operator_1', list(p)) - # { p[0] = True; } + p[0] = True () def p_edge_operator_2(p): '''edge_operator : K_negedge ''' print('edge_operator_2', list(p)) - # { p[0] = False; } + p[0] = False () def p_specify_edge_path_1(p): '''specify_edge_path : '(' specify_path_identifiers spec_polarity K_EG '(' specify_path_identifiers polarity_operator expression ')' ')' ''' @@ -8167,12 +8167,12 @@ def p_udp_port_list_2(p): def p_udp_reg_opt_1(p): '''udp_reg_opt : K_reg ''' print('udp_reg_opt_1', list(p)) - # { p[0] = True; } + p[0] = True () def p_udp_reg_opt_2(p): '''udp_reg_opt : ''' print('udp_reg_opt_2', list(p)) - # { p[0] = False; } + p[0] = False () def p_udp_initial_expr_opt_1(p): '''udp_initial_expr_opt : '=' expression ''' @@ -8247,43 +8247,43 @@ def p_udp_primitive_2(p): def p_K_packed_opt_1(p): '''K_packed_opt : K_packed ''' print('K_packed_opt', list(p)) - # { p[0] = True; } + p[0] = True () def p_K_packed_opt_2(p): '''K_packed_opt : ''' print('K_packed_opt', list(p)) - # { p[0] = False; } + p[0] = False () def p_K_reg_opt_1(p): '''K_reg_opt : K_reg ''' print('K_reg_opt', list(p)) - # { p[0] = True; } + p[0] = True () def p_K_reg_opt_2(p): '''K_reg_opt : ''' print('K_reg_opt', list(p)) - # { p[0] = False; } + p[0] = False () def p_K_static_opt_1(p): '''K_static_opt : K_static ''' print('K_static_opt', list(p)) - # { p[0] = True; } + p[0] = True () def p_K_static_opt_2(p): '''K_static_opt : ''' print('K_static_opt', list(p)) - # { p[0] = False; } + p[0] = False () def p_K_virtual_opt_1(p): '''K_virtual_opt : K_virtual ''' print(p) - # { p[0] = True; } + p[0] = True () def p_K_virtual_opt_2(p): '''K_virtual_opt : ''' print(p) - # { p[0] = False; } + p[0] = False () def p_error(p):