From d6f5b269498d6912bd357f2eb1b3dcfcd49dd23d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 25 Apr 2019 00:02:07 +0100 Subject: [PATCH] begin experimenting with lib2to3 Node/Leaf additions --- lexor.py | 2 +- parse_sv.py | 2120 ++++++++++++++++++++++++++------------------------- 2 files changed, 1073 insertions(+), 1049 deletions(-) diff --git a/lexor.py b/lexor.py index d19aa3f..d25ed61 100644 --- a/lexor.py +++ b/lexor.py @@ -588,7 +588,7 @@ def t_LITERAL(t): # t.lexer.begin('module') if keyword == 'IDENTIFIER': t.type = 'IDENTIFIER' - t.value = keyword + t.value = word return t t.type = keyword return t diff --git a/parse_sv.py b/parse_sv.py index 8180231..441f5cb 100644 --- a/parse_sv.py +++ b/parse_sv.py @@ -18,7 +18,12 @@ # * along with this program; if not, write to the Free Software # * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # */ -from ply import * + +from lib2to3.pytree import Node, Leaf +from lib2to3.pgen2 import token +from lib2to3.pygram import python_symbols as syms + +from ply import yacc, lex #from parse_tokens import tokens import lexor @@ -53,11 +58,13 @@ precedence = [\ () # -------------- RULES ---------------- () -#'''source_text : timeunits_declaration_opt _embed0_source_text description_list -def p_source_text(p): - '''source_text : timeunits_declaration_opt _embed0_source_text description_list - ''' - print(p) +def p_source_text_1(p): + '''source_text : timeunits_declaration_opt _embed0_source_text description_list ''' + print('source_text', list(p)) +() +def p_source_text_2(p): + '''source_text : ''' + print('source_text', list(p)) () def p__embed0_source_text(p): '''_embed0_source_text : ''' @@ -65,11 +72,11 @@ def p__embed0_source_text(p): () def p_assertion_item_1(p): '''assertion_item : concurrent_assertion_item ''' - print(p) + print('assertion_item', list(p)) () def p_assignment_pattern_1(p): '''assignment_pattern : K_LP expression_list_proper '}' ''' - print(p) + print('assignment_pattern', list(p)) # { PEAssignPattern*tmp = new PEAssignPattern(*$2); # FILE_NAME(tmp, @1); # delete $2; @@ -78,7 +85,7 @@ def p_assignment_pattern_1(p): () def p_assignment_pattern_2(p): '''assignment_pattern : K_LP '}' ''' - print(p) + print('assignment_pattern', list(p)) # { PEAssignPattern*tmp = new PEAssignPattern; # FILE_NAME(tmp, @1); # $$ = tmp; @@ -86,15 +93,15 @@ def p_assignment_pattern_2(p): () def p_block_identifier_opt_1(p): '''block_identifier_opt : IDENTIFIER ':' ''' - print(p) + print('block_identifier_opt', list(p)) () def p_block_identifier_opt_2(p): '''block_identifier_opt : ''' - print(p) + print('block_identifier_opt', list(p)) () def p_class_declaration_1(p): '''class_declaration : K_virtual_opt K_class lifetime_opt class_identifier class_declaration_extends_opt ';' _embed0_class_declaration class_items_opt K_endclass _embed1_class_declaration class_declaration_endlabel_opt ''' - print(p) + print('class_declaration', list(p)) # { // Wrap up the class. # if ($11 && $4 && $4->name != $11) { # yyerror(@11, "error: Class end label doesn't match class name."); @@ -114,15 +121,15 @@ def p__embed1_class_declaration(p): () def p_class_constraint_1(p): '''class_constraint : constraint_prototype ''' - print(p) + print('class_constraint', list(p)) () def p_class_constraint_2(p): '''class_constraint : constraint_declaration ''' - print(p) + print('class_constraint', list(p)) () def p_class_identifier_1(p): '''class_identifier : IDENTIFIER ''' - print(p) + print('class_identifier', list(p)) # { // Create a synthetic typedef for the class name so that the # // lexor detects the name as a type. # perm_string name = lex_strings.make($1); @@ -135,7 +142,7 @@ def p_class_identifier_1(p): () def p_class_identifier_2(p): '''class_identifier : TYPE_IDENTIFIER ''' - print(p) + print('class_identifier', list(p)) # { class_type_t*tmp = dynamic_cast($1.type); # if (tmp == 0) { # yyerror(@1, "Type name \"%s\"is not a predeclared class name.", $1.text); @@ -146,7 +153,7 @@ def p_class_identifier_2(p): () def p_class_declaration_endlabel_opt_1(p): '''class_declaration_endlabel_opt : ':' TYPE_IDENTIFIER ''' - print(p) + print('class_declaration_endlabel_opt', list(p)) # { class_type_t*tmp = dynamic_cast ($2.type); # if (tmp == 0) { # yyerror(@2, "error: class declaration endlabel \"%s\" is not a class name\n", $2.text); @@ -159,17 +166,17 @@ def p_class_declaration_endlabel_opt_1(p): () def p_class_declaration_endlabel_opt_2(p): '''class_declaration_endlabel_opt : ':' IDENTIFIER ''' - print(p) + print('class_declaration_endlabel_opt', list(p)) # { $$ = $2; } () def p_class_declaration_endlabel_opt_3(p): '''class_declaration_endlabel_opt : ''' - print(p) + print('class_declaration_endlabel_opt', list(p)) # { $$ = 0; } () def p_class_declaration_extends_opt_1(p): '''class_declaration_extends_opt : K_extends TYPE_IDENTIFIER ''' - print(p) + print('class_declaration_extends_opt', list(p)) # { $$.type = $2.type; # $$.exprs= 0; # delete[]$2.text; @@ -177,7 +184,7 @@ def p_class_declaration_extends_opt_1(p): () def p_class_declaration_extends_opt_2(p): '''class_declaration_extends_opt : K_extends TYPE_IDENTIFIER '(' expression_list_with_nuls ')' ''' - print(p) + print('class_declaration_extends_opt', list(p)) # { $$.type = $2.type; # $$.exprs = $4; # delete[]$2.text; @@ -185,28 +192,28 @@ def p_class_declaration_extends_opt_2(p): () def p_class_declaration_extends_opt_3(p): '''class_declaration_extends_opt : ''' - print(p) + print('class_declaration_extends_opt', list(p)) # { $$.type = 0; $$.exprs = 0; } () def p_class_items_opt_1(p): '''class_items_opt : class_items ''' - print(p) + print('class_items_opt', list(p)) () def p_class_items_opt_2(p): '''class_items_opt : ''' - print(p) + print('class_items_opt', list(p)) () def p_class_items_1(p): '''class_items : class_items class_item ''' - print(p) + print('class_items', list(p)) () def p_class_items_2(p): '''class_items : class_item ''' - print(p) + print('class_items', list(p)) () def p_class_item_1(p): '''class_item : method_qualifier_opt K_function K_new _embed0_class_item '(' tf_port_list_opt ')' ';' function_item_list_opt statement_or_null_list_opt K_endfunction endnew_opt ''' - print(p) + print('class_item', list(p)) # { current_function->set_ports($6); # pform_set_constructor_return(current_function); # pform_set_this_class(@3, current_function); @@ -217,90 +224,90 @@ def p_class_item_1(p): () def p_class_item_2(p): '''class_item : property_qualifier_opt data_type list_of_variable_decl_assignments ';' ''' - print(p) + print('class_item', list(p)) # { pform_class_property(@2, $1, $2, $3); } () def p_class_item_3(p): '''class_item : K_const class_item_qualifier_opt data_type list_of_variable_decl_assignments ';' ''' - print(p) + print('class_item', list(p)) # { pform_class_property(@1, $2 | property_qualifier_t::make_const(), $3, $4); } () def p_class_item_4(p): '''class_item : method_qualifier_opt task_declaration ''' - print(p) + print('class_item', list(p)) # { /* The task_declaration rule puts this into the class */ } () def p_class_item_5(p): '''class_item : method_qualifier_opt function_declaration ''' - print(p) + print('class_item', list(p)) # { /* The function_declaration rule puts this into the class */ } () def p_class_item_6(p): '''class_item : K_extern method_qualifier_opt K_function K_new ';' ''' - print(p) + print('class_item', list(p)) # { yyerror(@1, "sorry: External constructors are not yet supported."); } () def p_class_item_7(p): '''class_item : K_extern method_qualifier_opt K_function K_new '(' tf_port_list_opt ')' ';' ''' - print(p) + print('class_item', list(p)) # { yyerror(@1, "sorry: External constructors are not yet supported."); } () def p_class_item_8(p): '''class_item : K_extern method_qualifier_opt K_function data_type_or_implicit_or_void IDENTIFIER ';' ''' - print(p) + print('class_item', list(p)) # { yyerror(@1, "sorry: External methods are not yet supported."); # delete[] $5; # } () def p_class_item_9(p): '''class_item : K_extern method_qualifier_opt K_function data_type_or_implicit_or_void IDENTIFIER '(' tf_port_list_opt ')' ';' ''' - print(p) + print('class_item', list(p)) # { yyerror(@1, "sorry: External methods are not yet supported."); # delete[] $5; # } () def p_class_item_10(p): '''class_item : K_extern method_qualifier_opt K_task IDENTIFIER ';' ''' - print(p) + print('class_item', list(p)) # { yyerror(@1, "sorry: External methods are not yet supported."); # delete[] $4; # } () def p_class_item_11(p): '''class_item : K_extern method_qualifier_opt K_task IDENTIFIER '(' tf_port_list_opt ')' ';' ''' - print(p) + print('class_item', list(p)) # { yyerror(@1, "sorry: External methods are not yet supported."); # delete[] $4; # } () def p_class_item_12(p): '''class_item : class_constraint ''' - print(p) + print('class_item', list(p)) () def p_class_item_13(p): '''class_item : property_qualifier_opt data_type error ';' ''' - print(p) + print('class_item', list(p)) # { yyerror(@3, "error: Errors in variable names after data type."); # yyerrok; # } () def p_class_item_14(p): '''class_item : property_qualifier_opt IDENTIFIER error ';' ''' - print(p) + print('class_item', list(p)) # { yyerror(@3, "error: %s doesn't name a type.", $2); # yyerrok; # } () def p_class_item_15(p): '''class_item : method_qualifier_opt K_function K_new error K_endfunction endnew_opt ''' - print(p) + print('class_item', list(p)) # { yyerror(@1, "error: I give up on this class constructor declaration."); # yyerrok; # } () def p_class_item_16(p): '''class_item : error ';' ''' - print(p) + print('class_item', list(p)) # { yyerror(@2, "error: invalid class item."); # yyerrok; # } @@ -313,42 +320,42 @@ def p__embed0_class_item(p): () def p_class_item_qualifier_1(p): '''class_item_qualifier : K_static ''' - print(p) + print('class_item_qualifier', list(p)) # { $$ = property_qualifier_t::make_static(); } () def p_class_item_qualifier_2(p): '''class_item_qualifier : K_protected ''' - print(p) + print('class_item_qualifier', list(p)) # { $$ = property_qualifier_t::make_protected(); } () def p_class_item_qualifier_3(p): '''class_item_qualifier : K_local ''' - print(p) + print('class_item_qualifier', list(p)) # { $$ = property_qualifier_t::make_local(); } () def p_class_item_qualifier_list_1(p): '''class_item_qualifier_list : class_item_qualifier_list class_item_qualifier ''' - print(p) + print('class_item_qualifier_list', list(p)) # { $$ = $1 | $2; } () def p_class_item_qualifier_list_2(p): '''class_item_qualifier_list : class_item_qualifier ''' - print(p) + print('class_item_qualifier_list', list(p)) # { $$ = $1; } () def p_class_item_qualifier_opt_1(p): '''class_item_qualifier_opt : class_item_qualifier_list ''' - print(p) + print('class_item_qualifier_opt', list(p)) # { $$ = $1; } () def p_class_item_qualifier_opt_2(p): '''class_item_qualifier_opt : ''' - print(p) + print('class_item_qualifier_opt', list(p)) # { $$ = property_qualifier_t::make_none(); } () def p_class_new_1(p): '''class_new : K_new '(' expression_list_with_nuls ')' ''' - print(p) + print('class_new', list(p)) # { list*expr_list = $3; # strip_tail_items(expr_list); # PENewClass*tmp = new PENewClass(*expr_list); @@ -359,7 +366,7 @@ def p_class_new_1(p): () def p_class_new_2(p): '''class_new : K_new hierarchy_identifier ''' - print(p) + print('class_new', list(p)) # { PEIdent*tmpi = new PEIdent(*$2); # FILE_NAME(tmpi, @2); # PENewCopy*tmp = new PENewCopy(tmpi); @@ -370,7 +377,7 @@ def p_class_new_2(p): () def p_class_new_3(p): '''class_new : K_new ''' - print(p) + print('class_new', list(p)) # { PENewClass*tmp = new PENewClass; # FILE_NAME(tmp, @1); # $$ = tmp; @@ -378,7 +385,7 @@ def p_class_new_3(p): () def p_concurrent_assertion_item_1(p): '''concurrent_assertion_item : block_identifier_opt K_assert K_property '(' property_spec ')' statement_or_null ''' - print(p) + print('concurrent_assertion_item', list(p)) # { /* */ # if (gn_assertions_flag) { # yyerror(@2, "sorry: concurrent_assertion_item not supported." @@ -388,89 +395,89 @@ def p_concurrent_assertion_item_1(p): () def p_concurrent_assertion_item_2(p): '''concurrent_assertion_item : block_identifier_opt K_assert K_property '(' error ')' statement_or_null ''' - print(p) + print('concurrent_assertion_item', list(p)) # { yyerrok; # yyerror(@2, "error: Error in property_spec of concurrent assertion item."); # } () def p_constraint_block_item_1(p): '''constraint_block_item : constraint_expression ''' - print(p) + print('constraint_block_item', list(p)) () def p_constraint_block_item_list_1(p): '''constraint_block_item_list : constraint_block_item_list constraint_block_item ''' - print(p) + print('constraint_block_item_list', list(p)) () def p_constraint_block_item_list_2(p): '''constraint_block_item_list : constraint_block_item ''' - print(p) + print('constraint_block_item_list', list(p)) () def p_constraint_block_item_list_opt_1(p): '''constraint_block_item_list_opt : ''' - print(p) + print('constraint_block_item_list_opt', list(p)) () def p_constraint_block_item_list_opt_2(p): '''constraint_block_item_list_opt : constraint_block_item_list ''' - print(p) + print('constraint_block_item_list_opt', list(p)) () def p_constraint_declaration_1(p): '''constraint_declaration : K_static_opt K_constraint IDENTIFIER '{' constraint_block_item_list_opt '}' ''' - print(p) + print('constraint_declaration', list(p)) # { yyerror(@2, "sorry: Constraint declarations not supported."); } () def p_constraint_declaration_2(p): '''constraint_declaration : K_static_opt K_constraint IDENTIFIER '{' error '}' ''' - print(p) + print('constraint_declaration', list(p)) # { yyerror(@4, "error: Errors in the constraint block item list."); } () def p_constraint_expression_1(p): '''constraint_expression : expression ';' ''' - print(p) + print('constraint_expression', list(p)) () def p_constraint_expression_2(p): '''constraint_expression : expression K_dist '{' '}' ';' ''' - print(p) + print('constraint_expression', list(p)) () def p_constraint_expression_3(p): '''constraint_expression : expression K_TRIGGER constraint_set ''' - print(p) + print('constraint_expression', list(p)) () def p_constraint_expression_4(p): '''constraint_expression : K_if '(' expression ')' constraint_set %prec less_than_K_else ''' - print(p) + print('constraint_expression', list(p)) () def p_constraint_expression_5(p): '''constraint_expression : K_if '(' expression ')' constraint_set K_else constraint_set ''' - print(p) + print('constraint_expression', list(p)) () def p_constraint_expression_6(p): '''constraint_expression : K_foreach '(' IDENTIFIER '[' loop_variables ']' ')' constraint_set ''' - print(p) + print('constraint_expression', list(p)) () def p_constraint_expression_list_1(p): '''constraint_expression_list : constraint_expression_list constraint_expression ''' - print(p) + print('constraint_expression_list', list(p)) () def p_constraint_expression_list_2(p): '''constraint_expression_list : constraint_expression ''' - print(p) + print('constraint_expression_list', list(p)) () def p_constraint_prototype_1(p): '''constraint_prototype : K_static_opt K_constraint IDENTIFIER ';' ''' - print(p) + print('constraint_prototype', list(p)) # { yyerror(@2, "sorry: Constraint prototypes not supported."); } () def p_constraint_set_1(p): '''constraint_set : constraint_expression ''' - print(p) + print('constraint_set', list(p)) () def p_constraint_set_2(p): '''constraint_set : '{' constraint_expression_list '}' ''' - print(p) + print('constraint_set', list(p)) () def p_data_declaration_1(p): '''data_declaration : attribute_list_opt data_type_or_implicit list_of_variable_decl_assignments ';' ''' - print(p) + print('data_declaration', list(p)) # { data_type_t*data_type = $2; # if (data_type == 0) { # data_type = new vector_type_t(IVL_VT_LOGIC, false, 0); @@ -481,7 +488,7 @@ def p_data_declaration_1(p): () def p_data_type_1(p): '''data_type : integer_vector_type unsigned_signed_opt dimensions_opt ''' - print(p) + print('data_type', list(p)) # { ivl_variable_type_t use_vtype = $1; # bool reg_flag = false; # if (use_vtype == IVL_VT_NO_TYPE) { @@ -496,7 +503,7 @@ def p_data_type_1(p): () def p_data_type_2(p): '''data_type : non_integer_type ''' - print(p) + print('data_type', list(p)) # { real_type_t*tmp = new real_type_t($1); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -504,7 +511,7 @@ def p_data_type_2(p): () def p_data_type_3(p): '''data_type : struct_data_type ''' - print(p) + print('data_type', list(p)) # { if (!$1->packed_flag) { # yyerror(@1, "sorry: Unpacked structs not supported."); # } @@ -513,12 +520,12 @@ def p_data_type_3(p): () def p_data_type_4(p): '''data_type : enum_data_type ''' - print(p) + print('data_type', list(p)) # { $$ = $1; } () def p_data_type_5(p): '''data_type : atom2_type signed_unsigned_opt ''' - print(p) + print('data_type', list(p)) # { atom2_type_t*tmp = new atom2_type_t($1, $2); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -526,7 +533,7 @@ def p_data_type_5(p): () def p_data_type_6(p): '''data_type : K_integer signed_unsigned_opt ''' - print(p) + print('data_type', list(p)) # { list*pd = make_range_from_width(integer_width); # vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, $2, pd); # tmp->reg_flag = true; @@ -536,7 +543,7 @@ def p_data_type_6(p): () def p_data_type_7(p): '''data_type : K_time ''' - print(p) + print('data_type', list(p)) # { list*pd = make_range_from_width(64); # vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, false, pd); # tmp->reg_flag = !gn_system_verilog(); @@ -545,7 +552,7 @@ def p_data_type_7(p): () def p_data_type_8(p): '''data_type : TYPE_IDENTIFIER dimensions_opt ''' - print(p) + print('data_type', list(p)) # { if ($2) { # parray_type_t*tmp = new parray_type_t($1.type, $2); # FILE_NAME(tmp, @1); @@ -556,7 +563,7 @@ def p_data_type_8(p): () def p_data_type_9(p): '''data_type : PACKAGE_IDENTIFIER K_SCOPE_RES _embed0_data_type TYPE_IDENTIFIER ''' - print(p) + print('data_type', list(p)) # { lex_in_package_scope(0); # $$ = $4.type; # delete[]$4.text; @@ -564,7 +571,7 @@ def p_data_type_9(p): () def p_data_type_10(p): '''data_type : K_string ''' - print(p) + print('data_type', list(p)) # { string_type_t*tmp = new string_type_t; # FILE_NAME(tmp, @1); # $$ = tmp; @@ -576,12 +583,12 @@ def p__embed0_data_type(p): () def p_data_type_or_implicit_1(p): '''data_type_or_implicit : data_type ''' - print(p) + print('data_type_or_implicit', list(p)) # { $$ = $1; } () def p_data_type_or_implicit_2(p): '''data_type_or_implicit : signing dimensions_opt ''' - print(p) + print('data_type_or_implicit', list(p)) # { vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, $1, $2); # tmp->implicit_flag = true; # FILE_NAME(tmp, @1); @@ -590,7 +597,7 @@ def p_data_type_or_implicit_2(p): () def p_data_type_or_implicit_3(p): '''data_type_or_implicit : dimensions ''' - print(p) + print('data_type_or_implicit', list(p)) # { vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, false, $1); # tmp->implicit_flag = true; # FILE_NAME(tmp, @1); @@ -599,17 +606,17 @@ def p_data_type_or_implicit_3(p): () def p_data_type_or_implicit_4(p): '''data_type_or_implicit : ''' - print(p) + print('data_type_or_implicit', list(p)) # { $$ = 0; } () def p_data_type_or_implicit_or_void_1(p): '''data_type_or_implicit_or_void : data_type_or_implicit ''' - print(p) + print('data_type_or_implicit_or_void', list(p)) # { $$ = $1; } () def p_data_type_or_implicit_or_void_2(p): '''data_type_or_implicit_or_void : K_void ''' - print(p) + print('data_type_or_implicit_or_void', list(p)) # { void_type_t*tmp = new void_type_t; # FILE_NAME(tmp, @1); # $$ = tmp; @@ -617,35 +624,35 @@ def p_data_type_or_implicit_or_void_2(p): () def p_description_1(p): '''description : module ''' - print(p) + print('description', list(p)) () def p_description_2(p): '''description : udp_primitive ''' - print(p) + print('description', list(p)) () def p_description_3(p): '''description : config_declaration ''' - print(p) + print('description', list(p)) () def p_description_4(p): '''description : nature_declaration ''' - print(p) + print('description', list(p)) () def p_description_5(p): '''description : package_declaration ''' - print(p) + print('description', list(p)) () def p_description_6(p): '''description : discipline_declaration ''' - print(p) + print('description', list(p)) () def p_description_7(p): '''description : package_item ''' - print(p) + print('description', list(p)) () def p_description_8(p): '''description : KK_attribute '(' IDENTIFIER ',' STRING ',' STRING ')' ''' - print(p) + print('description', list(p)) # { perm_string tmp3 = lex_strings.make($3); # pform_set_type_attrib(tmp3, $5, $7); # delete[] $3; @@ -654,37 +661,37 @@ def p_description_8(p): () def p_description_list_1(p): '''description_list : description ''' - print(p) + print('description_list', list(p)) () def p_description_list_2(p): '''description_list : description_list description ''' - print(p) + print('description_list', list(p)) () def p_endnew_opt_1(p): '''endnew_opt : ':' K_new ''' - print(p) + print('endnew_opt', list(p)) () def p_endnew_opt_2(p): '''endnew_opt : ''' - print(p) + print('endnew_opt', list(p)) () def p_dynamic_array_new_1(p): '''dynamic_array_new : K_new '[' expression ']' ''' - print(p) + print('dynamic_array_new', list(p)) # { $$ = new PENewArray($3, 0); # FILE_NAME($$, @1); # } () def p_dynamic_array_new_2(p): '''dynamic_array_new : K_new '[' expression ']' '(' expression ')' ''' - print(p) + print('dynamic_array_new', list(p)) # { $$ = new PENewArray($3, $6); # FILE_NAME($$, @1); # } () def p_for_step_1(p): '''for_step : lpvalue '=' expression ''' - print(p) + print('for_step', list(p)) # { PAssign*tmp = new PAssign($1,$3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -692,17 +699,17 @@ def p_for_step_1(p): () def p_for_step_2(p): '''for_step : inc_or_dec_expression ''' - print(p) + print('for_step', list(p)) # { $$ = pform_compressed_assign_from_inc_dec(@1, $1); } () def p_for_step_3(p): '''for_step : compressed_statement ''' - print(p) + print('for_step', list(p)) # { $$ = $1; } () def p_function_declaration_1(p): '''function_declaration : K_function lifetime_opt data_type_or_implicit_or_void IDENTIFIER ';' _embed0_function_declaration function_item_list statement_or_null_list_opt K_endfunction _embed1_function_declaration endlabel_opt ''' - print(p) + print('function_declaration', list(p)) # { // Last step: check any closing name. # if ($11) { # if (strcmp($4,$11) != 0) { @@ -720,7 +727,7 @@ def p_function_declaration_1(p): () def p_function_declaration_2(p): '''function_declaration : K_function lifetime_opt data_type_or_implicit_or_void IDENTIFIER _embed2_function_declaration '(' tf_port_list_opt ')' ';' block_item_decls_opt statement_or_null_list_opt K_endfunction _embed3_function_declaration endlabel_opt ''' - print(p) + print('function_declaration', list(p)) # { // Last step: check any closing name. # if ($14) { # if (strcmp($4,$14) != 0) { @@ -738,7 +745,7 @@ def p_function_declaration_2(p): () def p_function_declaration_3(p): '''function_declaration : K_function lifetime_opt data_type_or_implicit_or_void IDENTIFIER error K_endfunction _embed4_function_declaration endlabel_opt ''' - print(p) + print('function_declaration', list(p)) # { // Last step: check any closing name. # if ($8) { # if (strcmp($4,$8) != 0) { @@ -802,27 +809,27 @@ def p__embed4_function_declaration(p): () def p_import_export_1(p): '''import_export : K_import ''' - print(p) + print('import_export', list(p)) # { $$ = true; } () def p_import_export_2(p): '''import_export : K_export ''' - print(p) + print('import_export', list(p)) # { $$ = false; } () def p_implicit_class_handle_1(p): '''implicit_class_handle : K_this ''' - print(p) + print('implicit_class_handle', list(p)) # { $$ = pform_create_this(); } () def p_implicit_class_handle_2(p): '''implicit_class_handle : K_super ''' - print(p) + print('implicit_class_handle', list(p)) # { $$ = pform_create_super(); } () def p_inc_or_dec_expression_1(p): '''inc_or_dec_expression : K_INCR lpvalue %prec UNARY_PREC ''' - print(p) + print('inc_or_dec_expression', list(p)) # { PEUnary*tmp = new PEUnary('I', $2); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -830,7 +837,7 @@ def p_inc_or_dec_expression_1(p): () def p_inc_or_dec_expression_2(p): '''inc_or_dec_expression : lpvalue K_INCR %prec UNARY_PREC ''' - print(p) + print('inc_or_dec_expression', list(p)) # { PEUnary*tmp = new PEUnary('i', $1); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -838,7 +845,7 @@ def p_inc_or_dec_expression_2(p): () def p_inc_or_dec_expression_3(p): '''inc_or_dec_expression : K_DECR lpvalue %prec UNARY_PREC ''' - print(p) + print('inc_or_dec_expression', list(p)) # { PEUnary*tmp = new PEUnary('D', $2); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -846,7 +853,7 @@ def p_inc_or_dec_expression_3(p): () def p_inc_or_dec_expression_4(p): '''inc_or_dec_expression : lpvalue K_DECR %prec UNARY_PREC ''' - print(p) + print('inc_or_dec_expression', list(p)) # { PEUnary*tmp = new PEUnary('d', $1); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -854,56 +861,56 @@ def p_inc_or_dec_expression_4(p): () def p_inside_expression_1(p): '''inside_expression : expression K_inside '{' open_range_list '}' ''' - print(p) + print('inside_expression', list(p)) # { yyerror(@2, "sorry: \"inside\" expressions not supported yet."); # $$ = 0; # } () def p_integer_vector_type_1(p): '''integer_vector_type : K_reg ''' - print(p) + print('integer_vector_type', list(p)) # { $$ = IVL_VT_NO_TYPE; } () def p_integer_vector_type_2(p): '''integer_vector_type : K_bit ''' - print(p) + print('integer_vector_type', list(p)) # { $$ = IVL_VT_BOOL; } () def p_integer_vector_type_3(p): '''integer_vector_type : K_logic ''' - print(p) + print('integer_vector_type', list(p)) # { $$ = IVL_VT_LOGIC; } () def p_integer_vector_type_4(p): '''integer_vector_type : K_bool ''' - print(p) + print('integer_vector_type', list(p)) # { $$ = IVL_VT_BOOL; } () def p_join_keyword_1(p): '''join_keyword : K_join ''' - print(p) + print('join_keyword', list(p)) # { $$ = PBlock::BL_PAR; } () def p_join_keyword_2(p): '''join_keyword : K_join_none ''' - print(p) + print('join_keyword', list(p)) # { $$ = PBlock::BL_JOIN_NONE; } () def p_join_keyword_3(p): '''join_keyword : K_join_any ''' - print(p) + print('join_keyword', list(p)) # { $$ = PBlock::BL_JOIN_ANY; } () def p_jump_statement_1(p): '''jump_statement : K_break ';' ''' - print(p) + print('jump_statement', list(p)) # { yyerror(@1, "sorry: break statements not supported."); # $$ = 0; # } () def p_jump_statement_2(p): '''jump_statement : K_return ';' ''' - print(p) + print('jump_statement', list(p)) # { PReturn*tmp = new PReturn(0); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -911,7 +918,7 @@ def p_jump_statement_2(p): () def p_jump_statement_3(p): '''jump_statement : K_return expression ';' ''' - print(p) + print('jump_statement', list(p)) # { PReturn*tmp = new PReturn($2); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -919,27 +926,27 @@ def p_jump_statement_3(p): () def p_lifetime_1(p): '''lifetime : K_automatic ''' - print(p) + print('lifetime', list(p)) # { $$ = LexicalScope::AUTOMATIC; } () def p_lifetime_2(p): '''lifetime : K_static ''' - print(p) + print('lifetime', list(p)) # { $$ = LexicalScope::STATIC; } () def p_lifetime_opt_1(p): '''lifetime_opt : lifetime ''' - print(p) + print('lifetime_opt', list(p)) # { $$ = $1; } () def p_lifetime_opt_2(p): '''lifetime_opt : ''' - print(p) + print('lifetime_opt', list(p)) # { $$ = LexicalScope::INHERITED; } () def p_loop_statement_1(p): '''loop_statement : K_for '(' lpvalue '=' expression ';' expression ';' for_step ')' statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { PForStatement*tmp = new PForStatement($3, $5, $7, $9, $11); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -947,7 +954,7 @@ def p_loop_statement_1(p): () def p_loop_statement_2(p): '''loop_statement : K_for '(' data_type IDENTIFIER '=' expression ';' expression ';' for_step ')' _embed0_loop_statement statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { pform_name_t tmp_hident; # tmp_hident.push_back(name_component_t(lex_strings.make($4))); # @@ -969,7 +976,7 @@ def p_loop_statement_2(p): () def p_loop_statement_3(p): '''loop_statement : K_forever statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { PForever*tmp = new PForever($2); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -977,7 +984,7 @@ def p_loop_statement_3(p): () def p_loop_statement_4(p): '''loop_statement : K_repeat '(' expression ')' statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { PRepeat*tmp = new PRepeat($3, $5); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -985,7 +992,7 @@ def p_loop_statement_4(p): () def p_loop_statement_5(p): '''loop_statement : K_while '(' expression ')' statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { PWhile*tmp = new PWhile($3, $5); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -993,7 +1000,7 @@ def p_loop_statement_5(p): () def p_loop_statement_6(p): '''loop_statement : K_do statement_or_null K_while '(' expression ')' ';' ''' - print(p) + print('loop_statement', list(p)) # { PDoWhile*tmp = new PDoWhile($5, $2); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -1001,7 +1008,7 @@ def p_loop_statement_6(p): () def p_loop_statement_7(p): '''loop_statement : K_foreach '(' IDENTIFIER '[' loop_variables ']' ')' _embed1_loop_statement statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { PForeach*tmp_for = pform_make_foreach(@1, $3, $5, $9); # # pform_pop_scope(); @@ -1015,42 +1022,42 @@ def p_loop_statement_7(p): () def p_loop_statement_8(p): '''loop_statement : K_for '(' lpvalue '=' expression ';' expression ';' error ')' statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { $$ = 0; # yyerror(@1, "error: Error in for loop step assignment."); # } () def p_loop_statement_9(p): '''loop_statement : K_for '(' lpvalue '=' expression ';' error ';' for_step ')' statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { $$ = 0; # yyerror(@1, "error: Error in for loop condition expression."); # } () def p_loop_statement_10(p): '''loop_statement : K_for '(' error ')' statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { $$ = 0; # yyerror(@1, "error: Incomprehensible for loop."); # } () def p_loop_statement_11(p): '''loop_statement : K_while '(' error ')' statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { $$ = 0; # yyerror(@1, "error: Error in while loop condition."); # } () def p_loop_statement_12(p): '''loop_statement : K_do statement_or_null K_while '(' error ')' ';' ''' - print(p) + print('loop_statement', list(p)) # { $$ = 0; # yyerror(@1, "error: Error in do/while loop condition."); # } () def p_loop_statement_13(p): '''loop_statement : K_foreach '(' IDENTIFIER '[' error ']' ')' statement_or_null ''' - print(p) + print('loop_statement', list(p)) # { $$ = 0; # yyerror(@4, "error: Errors in foreach loop variables list."); # } @@ -1088,7 +1095,7 @@ def p__embed1_loop_statement(p): () def p_list_of_variable_decl_assignments_1(p): '''list_of_variable_decl_assignments : variable_decl_assignment ''' - print(p) + print('list_of_variable_decl_assignments', list(p)) # { list*tmp = new list; # tmp->push_back($1); # $$ = tmp; @@ -1096,7 +1103,7 @@ def p_list_of_variable_decl_assignments_1(p): () def p_list_of_variable_decl_assignments_2(p): '''list_of_variable_decl_assignments : list_of_variable_decl_assignments ',' variable_decl_assignment ''' - print(p) + print('list_of_variable_decl_assignments', list(p)) # { list*tmp = $1; # tmp->push_back($3); # $$ = tmp; @@ -1104,7 +1111,7 @@ def p_list_of_variable_decl_assignments_2(p): () def p_variable_decl_assignment_1(p): '''variable_decl_assignment : IDENTIFIER dimensions_opt ''' - print(p) + print('variable_decl_assignment', list(p)) # { decl_assignment_t*tmp = new decl_assignment_t; # tmp->name = lex_strings.make($1); # if ($2) { @@ -1117,7 +1124,7 @@ def p_variable_decl_assignment_1(p): () def p_variable_decl_assignment_2(p): '''variable_decl_assignment : IDENTIFIER '=' expression ''' - print(p) + print('variable_decl_assignment', list(p)) # { decl_assignment_t*tmp = new decl_assignment_t; # tmp->name = lex_strings.make($1); # tmp->expr .reset($3); @@ -1127,7 +1134,7 @@ def p_variable_decl_assignment_2(p): () def p_variable_decl_assignment_3(p): '''variable_decl_assignment : IDENTIFIER '=' K_new '(' ')' ''' - print(p) + print('variable_decl_assignment', list(p)) # { decl_assignment_t*tmp = new decl_assignment_t; # tmp->name = lex_strings.make($1); # PENewClass*expr = new PENewClass; @@ -1139,7 +1146,7 @@ def p_variable_decl_assignment_3(p): () def p_loop_variables_1(p): '''loop_variables : loop_variables ',' IDENTIFIER ''' - print(p) + print('loop_variables', list(p)) # { list*tmp = $1; # tmp->push_back(lex_strings.make($3)); # delete[]$3; @@ -1148,7 +1155,7 @@ def p_loop_variables_1(p): () def p_loop_variables_2(p): '''loop_variables : IDENTIFIER ''' - print(p) + print('loop_variables', list(p)) # { list*tmp = new list; # tmp->push_back(lex_strings.make($1)); # delete[]$1; @@ -1157,23 +1164,23 @@ def p_loop_variables_2(p): () def p_method_qualifier_1(p): '''method_qualifier : K_virtual ''' - print(p) + print('method_qualifier', list(p)) () def p_method_qualifier_2(p): '''method_qualifier : class_item_qualifier ''' - print(p) + print('method_qualifier', list(p)) () def p_method_qualifier_opt_1(p): '''method_qualifier_opt : method_qualifier ''' - print(p) + print('method_qualifier_opt', list(p)) () def p_method_qualifier_opt_2(p): '''method_qualifier_opt : ''' - print(p) + print('method_qualifier_opt', list(p)) () def p_modport_declaration_1(p): '''modport_declaration : K_modport _embed0_modport_declaration modport_item_list ';' ''' - print(p) + print('modport_declaration', list(p)) () def p__embed0_modport_declaration(p): '''_embed0_modport_declaration : ''' @@ -1184,15 +1191,15 @@ def p__embed0_modport_declaration(p): () def p_modport_item_list_1(p): '''modport_item_list : modport_item ''' - print(p) + print('modport_item_list', list(p)) () def p_modport_item_list_2(p): '''modport_item_list : modport_item_list ',' modport_item ''' - print(p) + print('modport_item_list', list(p)) () def p_modport_item_1(p): '''modport_item : IDENTIFIER _embed0_modport_item '(' modport_ports_list ')' ''' - print(p) + print('modport_item', list(p)) # { pform_end_modport_item(@1); } () def p__embed0_modport_item(p): @@ -1201,15 +1208,15 @@ def p__embed0_modport_item(p): () def p_modport_ports_list_1(p): '''modport_ports_list : modport_ports_declaration ''' - print(p) + print('modport_ports_list', list(p)) () def p_modport_ports_list_2(p): '''modport_ports_list : modport_ports_list ',' modport_ports_declaration ''' - print(p) + print('modport_ports_list', list(p)) () def p_modport_ports_list_3(p): '''modport_ports_list : modport_ports_list ',' modport_simple_port ''' - print(p) + print('modport_ports_list', list(p)) # { if (last_modport_port.type == MP_SIMPLE) { # pform_add_modport_port(@3, last_modport_port.direction, # $3->name, $3->parm); @@ -1221,14 +1228,14 @@ def p_modport_ports_list_3(p): () def p_modport_ports_list_4(p): '''modport_ports_list : modport_ports_list ',' modport_tf_port ''' - print(p) + print('modport_ports_list', list(p)) # { if (last_modport_port.type != MP_TF) # yyerror(@3, "error: task/function declaration not allowed here."); # } () def p_modport_ports_list_5(p): '''modport_ports_list : modport_ports_list ',' IDENTIFIER ''' - print(p) + print('modport_ports_list', list(p)) # { if (last_modport_port.type == MP_SIMPLE) { # pform_add_modport_port(@3, last_modport_port.direction, # lex_strings.make($3), 0); @@ -1240,12 +1247,12 @@ def p_modport_ports_list_5(p): () def p_modport_ports_list_6(p): '''modport_ports_list : modport_ports_list ',' ''' - print(p) + print('modport_ports_list', list(p)) # { yyerror(@2, "error: NULL port declarations are not allowed"); } () def p_modport_ports_declaration_1(p): '''modport_ports_declaration : attribute_list_opt port_direction IDENTIFIER ''' - print(p) + print('modport_ports_declaration', list(p)) # { last_modport_port.type = MP_SIMPLE; # last_modport_port.direction = $2; # pform_add_modport_port(@3, $2, lex_strings.make($3), 0); @@ -1255,7 +1262,7 @@ def p_modport_ports_declaration_1(p): () def p_modport_ports_declaration_2(p): '''modport_ports_declaration : attribute_list_opt port_direction modport_simple_port ''' - print(p) + print('modport_ports_declaration', list(p)) # { last_modport_port.type = MP_SIMPLE; # last_modport_port.direction = $2; # pform_add_modport_port(@3, $2, $3->name, $3->parm); @@ -1265,7 +1272,7 @@ def p_modport_ports_declaration_2(p): () def p_modport_ports_declaration_3(p): '''modport_ports_declaration : attribute_list_opt import_export IDENTIFIER ''' - print(p) + print('modport_ports_declaration', list(p)) # { last_modport_port.type = MP_TF; # last_modport_port.is_import = $2; # yyerror(@3, "sorry: modport task/function ports are not yet supported."); @@ -1275,7 +1282,7 @@ def p_modport_ports_declaration_3(p): () def p_modport_ports_declaration_4(p): '''modport_ports_declaration : attribute_list_opt import_export modport_tf_port ''' - print(p) + print('modport_ports_declaration', list(p)) # { last_modport_port.type = MP_TF; # last_modport_port.is_import = $2; # yyerror(@3, "sorry: modport task/function ports are not yet supported."); @@ -1284,7 +1291,7 @@ def p_modport_ports_declaration_4(p): () def p_modport_ports_declaration_5(p): '''modport_ports_declaration : attribute_list_opt K_clocking IDENTIFIER ''' - print(p) + print('modport_ports_declaration', list(p)) # { last_modport_port.type = MP_CLOCKING; # last_modport_port.direction = NetNet::NOT_A_PORT; # yyerror(@3, "sorry: modport clocking declaration is not yet supported."); @@ -1294,7 +1301,7 @@ def p_modport_ports_declaration_5(p): () def p_modport_simple_port_1(p): '''modport_simple_port : '.' IDENTIFIER '(' expression ')' ''' - print(p) + print('modport_simple_port', list(p)) # { named_pexpr_t*tmp = new named_pexpr_t; # tmp->name = lex_strings.make($2); # tmp->parm = $4; @@ -1304,74 +1311,76 @@ def p_modport_simple_port_1(p): () def p_modport_tf_port_1(p): '''modport_tf_port : K_task IDENTIFIER ''' - print(p) + print('modport_tf_port', list(p)) () def p_modport_tf_port_2(p): '''modport_tf_port : K_task IDENTIFIER '(' tf_port_list_opt ')' ''' - print(p) + print('modport_tf_port', list(p)) () def p_modport_tf_port_3(p): '''modport_tf_port : K_function data_type_or_implicit_or_void IDENTIFIER ''' - print(p) + print('modport_tf_port', list(p)) () def p_modport_tf_port_4(p): '''modport_tf_port : K_function data_type_or_implicit_or_void IDENTIFIER '(' tf_port_list_opt ')' ''' - print(p) + print('modport_tf_port', list(p)) () def p_non_integer_type_1(p): '''non_integer_type : K_real ''' - print(p) + print('non_integer_type', list(p)) # { $$ = real_type_t::REAL; } () def p_non_integer_type_2(p): '''non_integer_type : K_realtime ''' - print(p) + print('non_integer_type', list(p)) # { $$ = real_type_t::REAL; } () def p_non_integer_type_3(p): '''non_integer_type : K_shortreal ''' - print(p) + print('non_integer_type', list(p)) # { $$ = real_type_t::SHORTREAL; } () def p_number_1(p): '''number : BASED_NUMBER ''' - print(p) + print('number1', list(p)) # { $$ = $1; based_size = 0;} () def p_number_2(p): '''number : DEC_NUMBER ''' - print(p) + print('number2', list(p)) # { $$ = $1; based_size = 0;} () def p_number_3(p): '''number : DEC_NUMBER BASED_NUMBER ''' - print(p) + print('number3', list(p)) + num = Leaf(token.NUMBER, "%s:%s" % (p[1], p[2])) + p[0] = num # { $$ = pform_verinum_with_size($1,$2, @2.text, @2.first_line); # based_size = 0; } () def p_number_4(p): '''number : UNBASED_NUMBER ''' - print(p) + print('number4', list(p)) # { $$ = $1; based_size = 0;} () def p_number_5(p): '''number : DEC_NUMBER UNBASED_NUMBER ''' - print(p) + print('number5', list(p)) # { yyerror(@1, "error: Unbased SystemVerilog literal cannot have " # "a size."); # $$ = $1; based_size = 0;} () def p_open_range_list_1(p): '''open_range_list : open_range_list ',' value_range ''' - print(p) + print('open_range_list', list(p)) () def p_open_range_list_2(p): '''open_range_list : value_range ''' - print(p) + print('open_range_list', list(p)) () def p_package_declaration_1(p): '''package_declaration : K_package lifetime_opt IDENTIFIER ';' _embed0_package_declaration timeunits_declaration_opt _embed1_package_declaration package_item_list_opt K_endpackage endlabel_opt ''' - print(p) + print('package_declaration', list(p)) # { pform_end_package_declaration(@1); # // If an end label is present make sure it match the package name. # if ($10) { @@ -1393,112 +1402,112 @@ def p__embed1_package_declaration(p): () def p_module_package_import_list_opt_1(p): '''module_package_import_list_opt : ''' - print(p) + print('module_package_import_list_opt', list(p)) () def p_module_package_import_list_opt_2(p): '''module_package_import_list_opt : package_import_list ''' - print(p) + print('module_package_import_list_opt', list(p)) () def p_package_import_list_1(p): '''package_import_list : package_import_declaration ''' - print(p) + print('package_import_list', list(p)) () def p_package_import_list_2(p): '''package_import_list : package_import_list package_import_declaration ''' - print(p) + print('package_import_list', list(p)) () def p_package_import_declaration_1(p): '''package_import_declaration : K_import package_import_item_list ';' ''' - print(p) + print('package_import_declaration', list(p)) # { } () def p_package_import_item_1(p): '''package_import_item : PACKAGE_IDENTIFIER K_SCOPE_RES IDENTIFIER ''' - print(p) + print('package_import_item', list(p)) # { pform_package_import(@2, $1, $3); # delete[]$3; # } () def p_package_import_item_2(p): '''package_import_item : PACKAGE_IDENTIFIER K_SCOPE_RES '*' ''' - print(p) + print('package_import_item', list(p)) # { pform_package_import(@2, $1, 0); # } () def p_package_import_item_list_1(p): '''package_import_item_list : package_import_item_list ',' package_import_item ''' - print(p) + print('package_import_item_list', list(p)) () def p_package_import_item_list_2(p): '''package_import_item_list : package_import_item ''' - print(p) + print('package_import_item_list', list(p)) () def p_package_item_1(p): '''package_item : timeunits_declaration ''' - print(p) + print('package_item', list(p)) () def p_package_item_2(p): '''package_item : K_parameter param_type parameter_assign_list ';' ''' - print(p) + print('package_item', list(p)) () def p_package_item_3(p): '''package_item : K_localparam param_type localparam_assign_list ';' ''' - print(p) + print('package_item', list(p)) () def p_package_item_4(p): '''package_item : type_declaration ''' - print(p) + print('package_item', list(p)) () def p_package_item_5(p): '''package_item : function_declaration ''' - print(p) + print('package_item', list(p)) () def p_package_item_6(p): '''package_item : task_declaration ''' - print(p) + print('package_item', list(p)) () def p_package_item_7(p): '''package_item : data_declaration ''' - print(p) + print('package_item', list(p)) () def p_package_item_8(p): '''package_item : class_declaration ''' - print(p) + print('package_item', list(p)) () def p_package_item_list_1(p): '''package_item_list : package_item_list package_item ''' - print(p) + print('package_item_list', list(p)) () def p_package_item_list_2(p): '''package_item_list : package_item ''' - print(p) + print('package_item_list', list(p)) () def p_package_item_list_opt_1(p): '''package_item_list_opt : package_item_list ''' - print(p) + print('package_item_list_opt', list(p)) () def p_package_item_list_opt_2(p): '''package_item_list_opt : ''' - print(p) + print('package_item_list_opt', list(p)) () def p_port_direction_1(p): '''port_direction : K_input ''' - print(p) + print('port_direction', list(p)) # { $$ = NetNet::PINPUT; } () def p_port_direction_2(p): '''port_direction : K_output ''' - print(p) + print('port_direction', list(p)) # { $$ = NetNet::POUTPUT; } () def p_port_direction_3(p): '''port_direction : K_inout ''' - print(p) + print('port_direction', list(p)) # { $$ = NetNet::PINOUT; } () def p_port_direction_4(p): '''port_direction : K_ref ''' - print(p) + print('port_direction', list(p)) # { $$ = NetNet::PREF; # if (!gn_system_verilog()) { # yyerror(@1, "error: Reference ports (ref) require SystemVerilog."); @@ -1508,110 +1517,110 @@ def p_port_direction_4(p): () def p_port_direction_opt_1(p): '''port_direction_opt : port_direction ''' - print(p) + print('port_direction_opt', list(p)) # { $$ = $1; } () def p_port_direction_opt_2(p): '''port_direction_opt : ''' - print(p) + print('port_direction_opt', list(p)) # { $$ = NetNet::PIMPLICIT; } () def p_property_expr_1(p): '''property_expr : expression ''' - print(p) + print('property_expr', list(p)) () def p_procedural_assertion_statement_1(p): '''procedural_assertion_statement : K_assert '(' expression ')' statement %prec less_than_K_else ''' - print(p) + print('procedural_assertion_statement', list(p)) # { yyerror(@1, "sorry: Simple immediate assertion statements not implemented."); # $$ = 0; # } () def p_procedural_assertion_statement_2(p): '''procedural_assertion_statement : K_assert '(' expression ')' K_else statement ''' - print(p) + print('procedural_assertion_statement', list(p)) # { yyerror(@1, "sorry: Simple immediate assertion statements not implemented."); # $$ = 0; # } () def p_procedural_assertion_statement_3(p): '''procedural_assertion_statement : K_assert '(' expression ')' statement K_else statement ''' - print(p) + print('procedural_assertion_statement', list(p)) # { yyerror(@1, "sorry: Simple immediate assertion statements not implemented."); # $$ = 0; # } () def p_property_qualifier_1(p): '''property_qualifier : class_item_qualifier ''' - print(p) + print('property_qualifier', list(p)) () def p_property_qualifier_2(p): '''property_qualifier : random_qualifier ''' - print(p) + print('property_qualifier', list(p)) () def p_property_qualifier_opt_1(p): '''property_qualifier_opt : property_qualifier_list ''' - print(p) + print('property_qualifier_opt', list(p)) # { $$ = $1; } () def p_property_qualifier_opt_2(p): '''property_qualifier_opt : ''' - print(p) + print('property_qualifier_opt', list(p)) # { $$ = property_qualifier_t::make_none(); } () def p_property_qualifier_list_1(p): '''property_qualifier_list : property_qualifier_list property_qualifier ''' - print(p) + print('property_qualifier_list', list(p)) # { $$ = $1 | $2; } () def p_property_qualifier_list_2(p): '''property_qualifier_list : property_qualifier ''' - print(p) + print('property_qualifier_list', list(p)) # { $$ = $1; } () def p_property_spec_1(p): '''property_spec : clocking_event_opt property_spec_disable_iff_opt property_expr ''' - print(p) + print('property_spec', list(p)) () def p_property_spec_disable_iff_opt_1(p): '''property_spec_disable_iff_opt : K_disable K_iff '(' expression ')' ''' - print(p) + print('property_spec_disable_iff_opt', list(p)) () def p_property_spec_disable_iff_opt_2(p): '''property_spec_disable_iff_opt : ''' - print(p) + print('property_spec_disable_iff_opt', list(p)) () def p_random_qualifier_1(p): '''random_qualifier : K_rand ''' - print(p) + print('random_qualifier', list(p)) # { $$ = property_qualifier_t::make_rand(); } () def p_random_qualifier_2(p): '''random_qualifier : K_randc ''' - print(p) + print('random_qualifier', list(p)) # { $$ = property_qualifier_t::make_randc(); } () def p_real_or_realtime_1(p): '''real_or_realtime : K_real ''' - print(p) + print('real_or_realtime', list(p)) () def p_real_or_realtime_2(p): '''real_or_realtime : K_realtime ''' - print(p) + print('real_or_realtime', list(p)) () def p_signing_1(p): '''signing : K_signed ''' - print(p) + print('signing', list(p)) # { $$ = true; } () def p_signing_2(p): '''signing : K_unsigned ''' - print(p) + print('signing', list(p)) # { $$ = false; } () def p_simple_type_or_string_1(p): '''simple_type_or_string : integer_vector_type ''' - print(p) + print('simple_type_or_string', list(p)) # { ivl_variable_type_t use_vtype = $1; # bool reg_flag = false; # if (use_vtype == IVL_VT_NO_TYPE) { @@ -1626,7 +1635,7 @@ def p_simple_type_or_string_1(p): () def p_simple_type_or_string_2(p): '''simple_type_or_string : non_integer_type ''' - print(p) + print('simple_type_or_string', list(p)) # { real_type_t*tmp = new real_type_t($1); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -1634,7 +1643,7 @@ def p_simple_type_or_string_2(p): () def p_simple_type_or_string_3(p): '''simple_type_or_string : atom2_type ''' - print(p) + print('simple_type_or_string', list(p)) # { atom2_type_t*tmp = new atom2_type_t($1, true); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -1642,7 +1651,7 @@ def p_simple_type_or_string_3(p): () def p_simple_type_or_string_4(p): '''simple_type_or_string : K_integer ''' - print(p) + print('simple_type_or_string', list(p)) # { list*pd = make_range_from_width(integer_width); # vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, true, pd); # tmp->reg_flag = true; @@ -1652,7 +1661,7 @@ def p_simple_type_or_string_4(p): () def p_simple_type_or_string_5(p): '''simple_type_or_string : K_time ''' - print(p) + print('simple_type_or_string', list(p)) # { list*pd = make_range_from_width(64); # vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, false, pd); # tmp->reg_flag = !gn_system_verilog(); @@ -1661,14 +1670,14 @@ def p_simple_type_or_string_5(p): () def p_simple_type_or_string_6(p): '''simple_type_or_string : TYPE_IDENTIFIER ''' - print(p) + print('simple_type_or_string', list(p)) # { $$ = $1.type; # delete[]$1.text; # } () def p_simple_type_or_string_7(p): '''simple_type_or_string : PACKAGE_IDENTIFIER K_SCOPE_RES _embed0_simple_type_or_string TYPE_IDENTIFIER ''' - print(p) + print('simple_type_or_string', list(p)) # { lex_in_package_scope(0); # $$ = $4.type; # delete[]$4.text; @@ -1676,7 +1685,7 @@ def p_simple_type_or_string_7(p): () def p_simple_type_or_string_8(p): '''simple_type_or_string : K_string ''' - print(p) + print('simple_type_or_string', list(p)) # { string_type_t*tmp = new string_type_t; # FILE_NAME(tmp, @1); # $$ = tmp; @@ -1688,44 +1697,44 @@ def p__embed0_simple_type_or_string(p): () def p_statement_1(p): '''statement : attribute_list_opt statement_item ''' - print(p) + print('statement', list(p)) # { pform_bind_attributes($2->attributes, $1); # $$ = $2; # } () def p_statement_or_null_1(p): '''statement_or_null : statement ''' - print(p) + print('statement_or_null', list(p)) # { $$ = $1; } () def p_statement_or_null_2(p): '''statement_or_null : attribute_list_opt ';' ''' - print(p) + print('statement_or_null', list(p)) # { $$ = 0; } () def p_stream_expression_1(p): '''stream_expression : expression ''' - print(p) + print('stream_expression', list(p)) () def p_stream_expression_list_1(p): '''stream_expression_list : stream_expression_list ',' stream_expression ''' - print(p) + print('stream_expression_list', list(p)) () def p_stream_expression_list_2(p): '''stream_expression_list : stream_expression ''' - print(p) + print('stream_expression_list', list(p)) () def p_stream_operator_1(p): '''stream_operator : K_LS ''' - print(p) + print('stream_operator', list(p)) () def p_stream_operator_2(p): '''stream_operator : K_RS ''' - print(p) + print('stream_operator', list(p)) () def p_streaming_concatenation_1(p): '''streaming_concatenation : '{' stream_operator '{' stream_expression_list '}' '}' ''' - print(p) + print('streaming_concatenation', list(p)) # { /* streaming concatenation is a SystemVerilog thing. */ # if (gn_system_verilog()) { # yyerror(@2, "sorry: Streaming concatenation not supported."); @@ -1738,7 +1747,7 @@ def p_streaming_concatenation_1(p): () def p_task_declaration_1(p): '''task_declaration : K_task lifetime_opt IDENTIFIER ';' _embed0_task_declaration task_item_list_opt statement_or_null_list_opt K_endtask _embed1_task_declaration endlabel_opt ''' - print(p) + print('task_declaration', list(p)) # { // Last step: check any closing name. This is done late so # // that the parser can look ahead to detect the present # // endlabel_opt but still have the pform_endmodule() called @@ -1759,7 +1768,7 @@ def p_task_declaration_1(p): () def p_task_declaration_2(p): '''task_declaration : K_task lifetime_opt IDENTIFIER '(' _embed2_task_declaration tf_port_list ')' ';' block_item_decls_opt statement_or_null_list_opt K_endtask _embed3_task_declaration endlabel_opt ''' - print(p) + print('task_declaration', list(p)) # { // Last step: check any closing name. This is done late so # // that the parser can look ahead to detect the present # // endlabel_opt but still have the pform_endmodule() called @@ -1780,7 +1789,7 @@ def p_task_declaration_2(p): () def p_task_declaration_3(p): '''task_declaration : K_task lifetime_opt IDENTIFIER '(' ')' ';' _embed4_task_declaration block_item_decls_opt statement_or_null_list K_endtask _embed5_task_declaration endlabel_opt ''' - print(p) + print('task_declaration', list(p)) # { // Last step: check any closing name. This is done late so # // that the parser can look ahead to detect the present # // endlabel_opt but still have the pform_endmodule() called @@ -1801,7 +1810,7 @@ def p_task_declaration_3(p): () def p_task_declaration_4(p): '''task_declaration : K_task lifetime_opt IDENTIFIER error K_endtask _embed6_task_declaration endlabel_opt ''' - print(p) + print('task_declaration', list(p)) # { // Last step: check any closing name. This is done late so # // that the parser can look ahead to detect the present # // endlabel_opt but still have the pform_endmodule() called @@ -1889,7 +1898,7 @@ def p__embed6_task_declaration(p): () def p_tf_port_declaration_1(p): '''tf_port_declaration : port_direction K_reg_opt unsigned_signed_opt dimensions_opt list_of_identifiers ';' ''' - print(p) + print('tf_port_declaration', list(p)) # { vector*tmp = pform_make_task_ports(@1, $1, # $2 ? IVL_VT_LOGIC : # IVL_VT_NO_TYPE, @@ -1899,7 +1908,7 @@ def p_tf_port_declaration_1(p): () def p_tf_port_declaration_2(p): '''tf_port_declaration : port_direction K_integer list_of_identifiers ';' ''' - print(p) + print('tf_port_declaration', list(p)) # { list*range_stub = make_range_from_width(integer_width); # vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_LOGIC, true, # range_stub, $3, true); @@ -1908,7 +1917,7 @@ def p_tf_port_declaration_2(p): () def p_tf_port_declaration_3(p): '''tf_port_declaration : port_direction K_time list_of_identifiers ';' ''' - print(p) + print('tf_port_declaration', list(p)) # { list*range_stub = make_range_from_width(64); # vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_LOGIC, false, # range_stub, $3); @@ -1917,7 +1926,7 @@ def p_tf_port_declaration_3(p): () def p_tf_port_declaration_4(p): '''tf_port_declaration : port_direction real_or_realtime list_of_identifiers ';' ''' - print(p) + print('tf_port_declaration', list(p)) # { vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_REAL, true, # 0, $3); # $$ = tmp; @@ -1925,7 +1934,7 @@ def p_tf_port_declaration_4(p): () def p_tf_port_declaration_5(p): '''tf_port_declaration : port_direction K_string list_of_identifiers ';' ''' - print(p) + print('tf_port_declaration', list(p)) # { vector*tmp = pform_make_task_ports(@1, $1, IVL_VT_STRING, true, # 0, $3); # $$ = tmp; @@ -1933,7 +1942,7 @@ def p_tf_port_declaration_5(p): () def p_tf_port_item_1(p): '''tf_port_item : port_direction_opt data_type_or_implicit IDENTIFIER dimensions_opt tf_port_item_expr_opt ''' - print(p) + print('tf_port_item', list(p)) # { vector*tmp; # NetNet::PortType use_port_type = $1; # if ((use_port_type == NetNet::PIMPLICIT) && (gn_system_verilog() || ($2 == 0))) @@ -1981,7 +1990,7 @@ def p_tf_port_item_1(p): () def p_tf_port_item_2(p): '''tf_port_item : port_direction_opt data_type_or_implicit IDENTIFIER error ''' - print(p) + print('tf_port_item', list(p)) # { yyerror(@3, "error: Error in task/function port item after port name %s.", $3); # yyerrok; # $$ = 0; @@ -1989,7 +1998,7 @@ def p_tf_port_item_2(p): () def p_tf_port_item_expr_opt_1(p): '''tf_port_item_expr_opt : '=' expression ''' - print(p) + print('tf_port_item_expr_opt', list(p)) # { if (! gn_system_verilog()) { # yyerror(@1, "error: Task/function default arguments require " # "SystemVerilog."); @@ -1999,12 +2008,12 @@ def p_tf_port_item_expr_opt_1(p): () def p_tf_port_item_expr_opt_2(p): '''tf_port_item_expr_opt : ''' - print(p) + print('tf_port_item_expr_opt', list(p)) # { $$ = 0; } () def p_tf_port_list_1(p): '''tf_port_list : _embed0_tf_port_list tf_port_item_list ''' - print(p) + print('tf_port_list', list(p)) # { $$ = $2; } () def p__embed0_tf_port_list(p): @@ -2015,7 +2024,7 @@ def p__embed0_tf_port_list(p): () def p_tf_port_item_list_1(p): '''tf_port_item_list : tf_port_item_list ',' tf_port_item ''' - print(p) + print('tf_port_item_list', list(p)) # { vector*tmp; # if ($1 && $3) { # size_t s1 = $1->size(); @@ -2034,38 +2043,38 @@ def p_tf_port_item_list_1(p): () def p_tf_port_item_list_2(p): '''tf_port_item_list : tf_port_item ''' - print(p) + print('tf_port_item_list', list(p)) # { $$ = $1; } () def p_tf_port_item_list_3(p): '''tf_port_item_list : error ',' tf_port_item ''' - print(p) + print('tf_port_item_list', list(p)) # { yyerror(@2, "error: Syntax error in task/function port declaration."); # $$ = $3; # } () def p_tf_port_item_list_4(p): '''tf_port_item_list : tf_port_item_list ',' ''' - print(p) + print('tf_port_item_list', list(p)) # { yyerror(@2, "error: NULL port declarations are not allowed."); # $$ = $1; # } () def p_tf_port_item_list_5(p): '''tf_port_item_list : tf_port_item_list ';' ''' - print(p) + print('tf_port_item_list', list(p)) # { yyerror(@2, "error: ';' is an invalid port declaration separator."); # $$ = $1; # } () def p_timeunits_declaration_1(p): '''timeunits_declaration : K_timeunit TIME_LITERAL ';' ''' - print(p) + print('timeunits_declaration', list(p)) # { pform_set_timeunit($2, allow_timeunit_decl); } () def p_timeunits_declaration_2(p): '''timeunits_declaration : K_timeunit TIME_LITERAL '/' TIME_LITERAL ';' ''' - print(p) + print('timeunits_declaration', list(p)) # { bool initial_decl = allow_timeunit_decl && allow_timeprec_decl; # pform_set_timeunit($2, initial_decl); # pform_set_timeprec($4, initial_decl); @@ -2073,34 +2082,34 @@ def p_timeunits_declaration_2(p): () def p_timeunits_declaration_3(p): '''timeunits_declaration : K_timeprecision TIME_LITERAL ';' ''' - print(p) + print('timeunits_declaration', list(p)) # { pform_set_timeprec($2, allow_timeprec_decl); } () def p_timeunits_declaration_opt_1(p): '''timeunits_declaration_opt : %prec no_timeunits_declaration ''' - print(p) + print('timeunits_declaration_opt', list(p)) () def p_timeunits_declaration_opt_2(p): '''timeunits_declaration_opt : timeunits_declaration %prec one_timeunits_declaration ''' - print(p) + print('timeunits_declaration_opt', list(p)) () def p_timeunits_declaration_opt_3(p): '''timeunits_declaration_opt : timeunits_declaration timeunits_declaration ''' - print(p) + print('timeunits_declaration_opt', list(p)) () def p_value_range_1(p): '''value_range : expression ''' - print(p) + print('value_range', list(p)) # { } () def p_value_range_2(p): '''value_range : '[' expression ':' expression ']' ''' - print(p) + print('value_range', list(p)) # { } () def p_variable_dimension_1(p): '''variable_dimension : '[' expression ':' expression ']' ''' - print(p) + print('variable_dimension', list(p)) # { list *tmp = new list; # pform_range_t index ($2,$4); # tmp->push_back(index); @@ -2109,7 +2118,7 @@ def p_variable_dimension_1(p): () def p_variable_dimension_2(p): '''variable_dimension : '[' expression ']' ''' - print(p) + print('variable_dimension', list(p)) # { // SystemVerilog canonical range # if (!gn_system_verilog()) { # warn_count += 1; @@ -2126,7 +2135,7 @@ def p_variable_dimension_2(p): () def p_variable_dimension_3(p): '''variable_dimension : '[' ']' ''' - print(p) + print('variable_dimension', list(p)) # { list *tmp = new list; # pform_range_t index (0,0); # tmp->push_back(index); @@ -2135,7 +2144,7 @@ def p_variable_dimension_3(p): () def p_variable_dimension_4(p): '''variable_dimension : '[' '$' ']' ''' - print(p) + print('variable_dimension', list(p)) # { // SystemVerilog queue # list *tmp = new list; # pform_range_t index (new PENull,0); @@ -2148,7 +2157,7 @@ def p_variable_dimension_4(p): () def p_variable_lifetime_1(p): '''variable_lifetime : lifetime ''' - print(p) + print('variable_lifetime', list(p)) # { if (!gn_system_verilog()) { # yyerror(@1, "error: overriding the default variable lifetime " # "requires SystemVerilog."); @@ -2161,32 +2170,32 @@ def p_variable_lifetime_1(p): () def p_attribute_list_opt_1(p): '''attribute_list_opt : attribute_instance_list ''' - print(p) + print('attribute_list_opt', list(p)) # { $$ = $1; } () def p_attribute_list_opt_2(p): '''attribute_list_opt : ''' - print(p) + print('attribute_list_opt', list(p)) # { $$ = 0; } () def p_attribute_instance_list_1(p): '''attribute_instance_list : K_PSTAR K_STARP ''' - print(p) + print('attribute_instance_list', list(p)) # { $$ = 0; } () def p_attribute_instance_list_2(p): '''attribute_instance_list : K_PSTAR attribute_list K_STARP ''' - print(p) + print('attribute_instance_list', list(p)) # { $$ = $2; } () def p_attribute_instance_list_3(p): '''attribute_instance_list : attribute_instance_list K_PSTAR K_STARP ''' - print(p) + print('attribute_instance_list', list(p)) # { $$ = $1; } () def p_attribute_instance_list_4(p): '''attribute_instance_list : attribute_instance_list K_PSTAR attribute_list K_STARP ''' - print(p) + print('attribute_instance_list', list(p)) # { list*tmp = $1; # if (tmp) { # tmp->splice(tmp->end(), *$3); @@ -2197,7 +2206,7 @@ def p_attribute_instance_list_4(p): () def p_attribute_list_1(p): '''attribute_list : attribute_list ',' attribute ''' - print(p) + print('attribute_list', list(p)) # { list*tmp = $1; # tmp->push_back(*$3); # delete $3; @@ -2206,7 +2215,7 @@ def p_attribute_list_1(p): () def p_attribute_list_2(p): '''attribute_list : attribute ''' - print(p) + print('attribute_list', list(p)) # { list*tmp = new list; # tmp->push_back(*$1); # delete $1; @@ -2215,7 +2224,7 @@ def p_attribute_list_2(p): () def p_attribute_1(p): '''attribute : IDENTIFIER ''' - print(p) + print('attribute', list(p)) # { named_pexpr_t*tmp = new named_pexpr_t; # tmp->name = lex_strings.make($1); # tmp->parm = 0; @@ -2225,7 +2234,7 @@ def p_attribute_1(p): () def p_attribute_2(p): '''attribute : IDENTIFIER '=' expression ''' - print(p) + print('attribute', list(p)) # { PExpr*tmp = $3; # named_pexpr_t*tmp2 = new named_pexpr_t; # tmp2->name = lex_strings.make($1); @@ -2236,97 +2245,97 @@ def p_attribute_2(p): () def p_block_item_decl_1(p): '''block_item_decl : data_type register_variable_list ';' ''' - print(p) + print('block_item_decl', list(p)) # { if ($1) pform_set_data_type(@1, $1, $2, NetNet::REG, attributes_in_context); # } () def p_block_item_decl_2(p): '''block_item_decl : variable_lifetime data_type register_variable_list ';' ''' - print(p) + print('block_item_decl', list(p)) # { if ($2) pform_set_data_type(@2, $2, $3, NetNet::REG, attributes_in_context); # var_lifetime = LexicalScope::INHERITED; # } () def p_block_item_decl_3(p): '''block_item_decl : K_reg data_type register_variable_list ';' ''' - print(p) + print('block_item_decl', list(p)) # { if ($2) pform_set_data_type(@2, $2, $3, NetNet::REG, attributes_in_context); # } () def p_block_item_decl_4(p): '''block_item_decl : variable_lifetime K_reg data_type register_variable_list ';' ''' - print(p) + print('block_item_decl', list(p)) # { if ($3) pform_set_data_type(@3, $3, $4, NetNet::REG, attributes_in_context); # var_lifetime = LexicalScope::INHERITED; # } () def p_block_item_decl_5(p): '''block_item_decl : K_event event_variable_list ';' ''' - print(p) + print('block_item_decl', list(p)) # { if ($2) pform_make_events($2, @1.text, @1.first_line); # } () def p_block_item_decl_6(p): '''block_item_decl : K_parameter param_type parameter_assign_list ';' ''' - print(p) + print('block_item_decl', list(p)) () def p_block_item_decl_7(p): '''block_item_decl : K_localparam param_type localparam_assign_list ';' ''' - print(p) + print('block_item_decl', list(p)) () def p_block_item_decl_8(p): '''block_item_decl : type_declaration ''' - print(p) + print('block_item_decl', list(p)) () def p_block_item_decl_9(p): '''block_item_decl : K_integer error ';' ''' - print(p) + print('block_item_decl', list(p)) # { yyerror(@1, "error: syntax error in integer variable list."); # yyerrok; # } () def p_block_item_decl_10(p): '''block_item_decl : K_time error ';' ''' - print(p) + print('block_item_decl', list(p)) # { yyerror(@1, "error: syntax error in time variable list."); # yyerrok; # } () def p_block_item_decl_11(p): '''block_item_decl : K_parameter error ';' ''' - print(p) + print('block_item_decl', list(p)) # { yyerror(@1, "error: syntax error in parameter list."); # yyerrok; # } () def p_block_item_decl_12(p): '''block_item_decl : K_localparam error ';' ''' - print(p) + print('block_item_decl', list(p)) # { yyerror(@1, "error: syntax error localparam list."); # yyerrok; # } () def p_block_item_decls_1(p): '''block_item_decls : block_item_decl ''' - print(p) + print('block_item_decls', list(p)) () def p_block_item_decls_2(p): '''block_item_decls : block_item_decls block_item_decl ''' - print(p) + print('block_item_decls', list(p)) () def p_block_item_decls_opt_1(p): '''block_item_decls_opt : block_item_decls ''' - print(p) + print('block_item_decls_opt', list(p)) # { $$ = true; } () def p_block_item_decls_opt_2(p): '''block_item_decls_opt : ''' - print(p) + print('block_item_decls_opt', list(p)) # { $$ = false; } () def p_type_declaration_1(p): '''type_declaration : K_typedef data_type IDENTIFIER dimensions_opt ';' ''' - print(p) + print('type_declaration', list(p)) # { perm_string name = lex_strings.make($3); # pform_set_typedef(name, $2, $4); # delete[]$3; @@ -2334,7 +2343,7 @@ def p_type_declaration_1(p): () def p_type_declaration_2(p): '''type_declaration : K_typedef data_type TYPE_IDENTIFIER ';' ''' - print(p) + print('type_declaration', list(p)) # { perm_string name = lex_strings.make($3.text); # if (pform_test_type_identifier_local(name)) { # yyerror(@3, "error: Typedef identifier \"%s\" is already a type name.", $3.text); @@ -2347,7 +2356,7 @@ def p_type_declaration_2(p): () def p_type_declaration_3(p): '''type_declaration : K_typedef K_class IDENTIFIER ';' ''' - print(p) + print('type_declaration', list(p)) # { // Create a synthetic typedef for the class name so that the # // lexor detects the name as a type. # perm_string name = lex_strings.make($3); @@ -2359,22 +2368,22 @@ def p_type_declaration_3(p): () def p_type_declaration_4(p): '''type_declaration : K_typedef K_enum IDENTIFIER ';' ''' - print(p) + print('type_declaration', list(p)) # { yyerror(@1, "sorry: Enum forward declarations not supported yet."); } () def p_type_declaration_5(p): '''type_declaration : K_typedef K_struct IDENTIFIER ';' ''' - print(p) + print('type_declaration', list(p)) # { yyerror(@1, "sorry: Struct forward declarations not supported yet."); } () def p_type_declaration_6(p): '''type_declaration : K_typedef K_union IDENTIFIER ';' ''' - print(p) + print('type_declaration', list(p)) # { yyerror(@1, "sorry: Union forward declarations not supported yet."); } () def p_type_declaration_7(p): '''type_declaration : K_typedef IDENTIFIER ';' ''' - print(p) + print('type_declaration', list(p)) # { // Create a synthetic typedef for the class name so that the # // lexor detects the name as a type. # perm_string name = lex_strings.make($2); @@ -2386,14 +2395,14 @@ def p_type_declaration_7(p): () def p_type_declaration_8(p): '''type_declaration : K_typedef error ';' ''' - print(p) + print('type_declaration', list(p)) # { yyerror(@2, "error: Syntax error in typedef clause."); # yyerrok; # } () def p_enum_data_type_1(p): '''enum_data_type : K_enum '{' enum_name_list '}' ''' - print(p) + print('enum_data_type', list(p)) # { enum_type_t*enum_type = new enum_type_t; # FILE_NAME(enum_type, @1); # enum_type->names .reset($3); @@ -2406,7 +2415,7 @@ def p_enum_data_type_1(p): () def p_enum_data_type_2(p): '''enum_data_type : K_enum atom2_type signed_unsigned_opt '{' enum_name_list '}' ''' - print(p) + print('enum_data_type', list(p)) # { enum_type_t*enum_type = new enum_type_t; # FILE_NAME(enum_type, @1); # enum_type->names .reset($5); @@ -2419,7 +2428,7 @@ def p_enum_data_type_2(p): () def p_enum_data_type_3(p): '''enum_data_type : K_enum K_integer signed_unsigned_opt '{' enum_name_list '}' ''' - print(p) + print('enum_data_type', list(p)) # { enum_type_t*enum_type = new enum_type_t; # FILE_NAME(enum_type, @1); # enum_type->names .reset($5); @@ -2432,7 +2441,7 @@ def p_enum_data_type_3(p): () def p_enum_data_type_4(p): '''enum_data_type : K_enum K_logic unsigned_signed_opt dimensions_opt '{' enum_name_list '}' ''' - print(p) + print('enum_data_type', list(p)) # { enum_type_t*enum_type = new enum_type_t; # FILE_NAME(enum_type, @1); # enum_type->names .reset($6); @@ -2445,7 +2454,7 @@ def p_enum_data_type_4(p): () def p_enum_data_type_5(p): '''enum_data_type : K_enum K_reg unsigned_signed_opt dimensions_opt '{' enum_name_list '}' ''' - print(p) + print('enum_data_type', list(p)) # { enum_type_t*enum_type = new enum_type_t; # FILE_NAME(enum_type, @1); # enum_type->names .reset($6); @@ -2458,7 +2467,7 @@ def p_enum_data_type_5(p): () def p_enum_data_type_6(p): '''enum_data_type : K_enum K_bit unsigned_signed_opt dimensions_opt '{' enum_name_list '}' ''' - print(p) + print('enum_data_type', list(p)) # { enum_type_t*enum_type = new enum_type_t; # FILE_NAME(enum_type, @1); # enum_type->names .reset($6); @@ -2471,13 +2480,13 @@ def p_enum_data_type_6(p): () def p_enum_name_list_1(p): '''enum_name_list : enum_name ''' - print(p) + print('enum_name_list', list(p)) # { $$ = $1; # } () def p_enum_name_list_2(p): '''enum_name_list : enum_name_list ',' enum_name ''' - print(p) + print('enum_name_list', list(p)) # { list*lst = $1; # lst->splice(lst->end(), *$3); # delete $3; @@ -2486,13 +2495,13 @@ def p_enum_name_list_2(p): () def p_pos_neg_number_1(p): '''pos_neg_number : number ''' - print(p) + print('pos_neg_number', list(p)) # { $$ = $1; # } () def p_pos_neg_number_2(p): '''pos_neg_number : '-' number ''' - print(p) + print('pos_neg_number', list(p)) # { verinum tmp = -(*($2)); # *($2) = tmp; # $$ = $2; @@ -2500,7 +2509,7 @@ def p_pos_neg_number_2(p): () def p_enum_name_1(p): '''enum_name : IDENTIFIER ''' - print(p) + print('enum_name', list(p)) # { perm_string name = lex_strings.make($1); # delete[]$1; # $$ = make_named_number(name); @@ -2508,7 +2517,7 @@ def p_enum_name_1(p): () def p_enum_name_2(p): '''enum_name : IDENTIFIER '[' pos_neg_number ']' ''' - print(p) + print('enum_name', list(p)) # { perm_string name = lex_strings.make($1); # long count = check_enum_seq_value(@1, $3, false); # delete[]$1; @@ -2518,7 +2527,7 @@ def p_enum_name_2(p): () def p_enum_name_3(p): '''enum_name : IDENTIFIER '[' pos_neg_number ':' pos_neg_number ']' ''' - print(p) + print('enum_name', list(p)) # { perm_string name = lex_strings.make($1); # $$ = make_named_numbers(name, check_enum_seq_value(@1, $3, true), # check_enum_seq_value(@1, $5, true)); @@ -2529,7 +2538,7 @@ def p_enum_name_3(p): () def p_enum_name_4(p): '''enum_name : IDENTIFIER '=' expression ''' - print(p) + print('enum_name', list(p)) # { perm_string name = lex_strings.make($1); # delete[]$1; # $$ = make_named_number(name, $3); @@ -2537,7 +2546,7 @@ def p_enum_name_4(p): () def p_enum_name_5(p): '''enum_name : IDENTIFIER '[' pos_neg_number ']' '=' expression ''' - print(p) + print('enum_name', list(p)) # { perm_string name = lex_strings.make($1); # long count = check_enum_seq_value(@1, $3, false); # $$ = make_named_numbers(name, 0, count-1, $6); @@ -2547,7 +2556,7 @@ def p_enum_name_5(p): () def p_enum_name_6(p): '''enum_name : IDENTIFIER '[' pos_neg_number ':' pos_neg_number ']' '=' expression ''' - print(p) + print('enum_name', list(p)) # { perm_string name = lex_strings.make($1); # $$ = make_named_numbers(name, check_enum_seq_value(@1, $3, true), # check_enum_seq_value(@1, $5, true), $8); @@ -2558,7 +2567,7 @@ def p_enum_name_6(p): () def p_struct_data_type_1(p): '''struct_data_type : K_struct K_packed_opt '{' struct_union_member_list '}' ''' - print(p) + print('struct_data_type', list(p)) # { struct_type_t*tmp = new struct_type_t; # FILE_NAME(tmp, @1); # tmp->packed_flag = $2; @@ -2569,7 +2578,7 @@ def p_struct_data_type_1(p): () def p_struct_data_type_2(p): '''struct_data_type : K_union K_packed_opt '{' struct_union_member_list '}' ''' - print(p) + print('struct_data_type', list(p)) # { struct_type_t*tmp = new struct_type_t; # FILE_NAME(tmp, @1); # tmp->packed_flag = $2; @@ -2580,7 +2589,7 @@ def p_struct_data_type_2(p): () def p_struct_data_type_3(p): '''struct_data_type : K_struct K_packed_opt '{' error '}' ''' - print(p) + print('struct_data_type', list(p)) # { yyerror(@3, "error: Errors in struct member list."); # yyerrok; # struct_type_t*tmp = new struct_type_t; @@ -2592,7 +2601,7 @@ def p_struct_data_type_3(p): () def p_struct_data_type_4(p): '''struct_data_type : K_union K_packed_opt '{' error '}' ''' - print(p) + print('struct_data_type', list(p)) # { yyerror(@3, "error: Errors in union member list."); # yyerrok; # struct_type_t*tmp = new struct_type_t; @@ -2604,7 +2613,7 @@ def p_struct_data_type_4(p): () def p_struct_union_member_list_1(p): '''struct_union_member_list : struct_union_member_list struct_union_member ''' - print(p) + print('struct_union_member_list', list(p)) # { list*tmp = $1; # tmp->push_back($2); # $$ = tmp; @@ -2612,7 +2621,7 @@ def p_struct_union_member_list_1(p): () def p_struct_union_member_list_2(p): '''struct_union_member_list : struct_union_member ''' - print(p) + print('struct_union_member_list', list(p)) # { list*tmp = new list; # tmp->push_back($1); # $$ = tmp; @@ -2620,7 +2629,7 @@ def p_struct_union_member_list_2(p): () def p_struct_union_member_1(p): '''struct_union_member : attribute_list_opt data_type list_of_variable_decl_assignments ';' ''' - print(p) + print('struct_union_member', list(p)) # { struct_member_t*tmp = new struct_member_t; # FILE_NAME(tmp, @2); # tmp->type .reset($2); @@ -2630,7 +2639,7 @@ def p_struct_union_member_1(p): () def p_struct_union_member_2(p): '''struct_union_member : error ';' ''' - print(p) + print('struct_union_member', list(p)) # { yyerror(@2, "Error in struct/union member."); # yyerrok; # $$ = 0; @@ -2638,7 +2647,7 @@ def p_struct_union_member_2(p): () def p_case_item_1(p): '''case_item : expression_list_proper ':' statement_or_null ''' - print(p) + print('case_item', list(p)) # { PCase::Item*tmp = new PCase::Item; # tmp->expr = *$1; # tmp->stat = $3; @@ -2648,7 +2657,7 @@ def p_case_item_1(p): () def p_case_item_2(p): '''case_item : K_default ':' statement_or_null ''' - print(p) + print('case_item', list(p)) # { PCase::Item*tmp = new PCase::Item; # tmp->stat = $3; # $$ = tmp; @@ -2656,7 +2665,7 @@ def p_case_item_2(p): () def p_case_item_3(p): '''case_item : K_default statement_or_null ''' - print(p) + print('case_item', list(p)) # { PCase::Item*tmp = new PCase::Item; # tmp->stat = $2; # $$ = tmp; @@ -2664,14 +2673,14 @@ def p_case_item_3(p): () def p_case_item_4(p): '''case_item : error ':' statement_or_null ''' - print(p) + print('case_item', list(p)) # { yyerror(@2, "error: Incomprehensible case expression."); # yyerrok; # } () def p_case_items_1(p): '''case_items : case_items case_item ''' - print(p) + print('case_items', list(p)) # { svector*tmp; # tmp = new svector(*$1, $2); # delete $1; @@ -2680,7 +2689,7 @@ def p_case_items_1(p): () def p_case_items_2(p): '''case_items : case_item ''' - print(p) + print('case_items', list(p)) # { svector*tmp = new svector(1); # (*tmp)[0] = $1; # $$ = tmp; @@ -2688,49 +2697,49 @@ def p_case_items_2(p): () def p_charge_strength_1(p): '''charge_strength : '(' K_small ')' ''' - print(p) + print('charge_strength', list(p)) () def p_charge_strength_2(p): '''charge_strength : '(' K_medium ')' ''' - print(p) + print('charge_strength', list(p)) () def p_charge_strength_3(p): '''charge_strength : '(' K_large ')' ''' - print(p) + print('charge_strength', list(p)) () def p_charge_strength_opt_1(p): '''charge_strength_opt : charge_strength ''' - print(p) + print('charge_strength_opt', list(p)) () def p_charge_strength_opt_2(p): '''charge_strength_opt : ''' - print(p) + print('charge_strength_opt', list(p)) () def p_defparam_assign_1(p): '''defparam_assign : hierarchy_identifier '=' expression ''' - print(p) + print('defparam_assign', list(p)) # { pform_set_defparam(*$1, $3); # delete $1; # } () def p_defparam_assign_list_1(p): '''defparam_assign_list : defparam_assign ''' - print(p) + print('defparam_assign_list', list(p)) () def p_defparam_assign_list_2(p): '''defparam_assign_list : dimensions defparam_assign ''' - print(p) + print('defparam_assign_list', list(p)) # { yyerror(@1, "error: defparam may not include a range."); # delete $1; # } () def p_defparam_assign_list_3(p): '''defparam_assign_list : defparam_assign_list ',' defparam_assign ''' - print(p) + print('defparam_assign_list', list(p)) () def p_delay1_1(p): '''delay1 : '#' delay_value_simple ''' - print(p) + print('delay1', list(p)) # { list*tmp = new list; # tmp->push_back($2); # $$ = tmp; @@ -2738,7 +2747,7 @@ def p_delay1_1(p): () def p_delay1_2(p): '''delay1 : '#' '(' delay_value ')' ''' - print(p) + print('delay1', list(p)) # { list*tmp = new list; # tmp->push_back($3); # $$ = tmp; @@ -2746,7 +2755,7 @@ def p_delay1_2(p): () def p_delay3_1(p): '''delay3 : '#' delay_value_simple ''' - print(p) + print('delay3', list(p)) # { list*tmp = new list; # tmp->push_back($2); # $$ = tmp; @@ -2754,7 +2763,7 @@ def p_delay3_1(p): () def p_delay3_2(p): '''delay3 : '#' '(' delay_value ')' ''' - print(p) + print('delay3', list(p)) # { list*tmp = new list; # tmp->push_back($3); # $$ = tmp; @@ -2762,7 +2771,7 @@ def p_delay3_2(p): () def p_delay3_3(p): '''delay3 : '#' '(' delay_value ',' delay_value ')' ''' - print(p) + print('delay3', list(p)) # { list*tmp = new list; # tmp->push_back($3); # tmp->push_back($5); @@ -2771,7 +2780,7 @@ def p_delay3_3(p): () def p_delay3_4(p): '''delay3 : '#' '(' delay_value ',' delay_value ',' delay_value ')' ''' - print(p) + print('delay3', list(p)) # { list*tmp = new list; # tmp->push_back($3); # tmp->push_back($5); @@ -2781,17 +2790,17 @@ def p_delay3_4(p): () def p_delay3_opt_1(p): '''delay3_opt : delay3 ''' - print(p) + print('delay3_opt', list(p)) # { $$ = $1; } () def p_delay3_opt_2(p): '''delay3_opt : ''' - print(p) + print('delay3_opt', list(p)) # { $$ = 0; } () def p_delay_value_list_1(p): '''delay_value_list : delay_value ''' - print(p) + print('delay_value_list', list(p)) # { list*tmp = new list; # tmp->push_back($1); # $$ = tmp; @@ -2799,7 +2808,7 @@ def p_delay_value_list_1(p): () def p_delay_value_list_2(p): '''delay_value_list : delay_value_list ',' delay_value ''' - print(p) + print('delay_value_list', list(p)) # { list*tmp = $1; # tmp->push_back($3); # $$ = tmp; @@ -2807,19 +2816,19 @@ def p_delay_value_list_2(p): () def p_delay_value_1(p): '''delay_value : expression ''' - print(p) + print('delay_value', list(p)) # { PExpr*tmp = $1; # $$ = tmp; # } () def p_delay_value_2(p): '''delay_value : expression ':' expression ':' expression ''' - print(p) + print('delay_value', list(p)) # { $$ = pform_select_mtm_expr($1, $3, $5); } () def p_delay_value_simple_1(p): '''delay_value_simple : DEC_NUMBER ''' - print(p) + print('delay_value_simple', list(p)) # { verinum*tmp = $1; # if (tmp == 0) { # yyerror(@1, "internal error: delay."); @@ -2833,7 +2842,7 @@ def p_delay_value_simple_1(p): () def p_delay_value_simple_2(p): '''delay_value_simple : REALTIME ''' - print(p) + print('delay_value_simple', list(p)) # { verireal*tmp = $1; # if (tmp == 0) { # yyerror(@1, "internal error: delay."); @@ -2846,7 +2855,7 @@ def p_delay_value_simple_2(p): () def p_delay_value_simple_3(p): '''delay_value_simple : IDENTIFIER ''' - print(p) + print('delay_value_simple', list(p)) # { PEIdent*tmp = new PEIdent(lex_strings.make($1)); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -2855,7 +2864,7 @@ def p_delay_value_simple_3(p): () def p_delay_value_simple_4(p): '''delay_value_simple : TIME_LITERAL ''' - print(p) + print('delay_value_simple', list(p)) # { int unit; # # based_size = 0; @@ -2875,15 +2884,15 @@ def p_delay_value_simple_4(p): () def p_optional_semicolon_1(p): '''optional_semicolon : ';' ''' - print(p) + print('optional_semicolon', list(p)) () def p_optional_semicolon_2(p): '''optional_semicolon : ''' - print(p) + print('optional_semicolon', list(p)) () def p_discipline_declaration_1(p): '''discipline_declaration : K_discipline IDENTIFIER optional_semicolon _embed0_discipline_declaration discipline_items K_enddiscipline ''' - print(p) + print('discipline_declaration', list(p)) # { pform_end_discipline(@1); delete[] $2; } () def p__embed0_discipline_declaration(p): @@ -2892,35 +2901,35 @@ def p__embed0_discipline_declaration(p): () def p_discipline_items_1(p): '''discipline_items : discipline_items discipline_item ''' - print(p) + print('discipline_items', list(p)) () def p_discipline_items_2(p): '''discipline_items : discipline_item ''' - print(p) + print('discipline_items', list(p)) () def p_discipline_item_1(p): '''discipline_item : K_domain K_discrete ';' ''' - print(p) + print('discipline_item', list(p)) # { pform_discipline_domain(@1, IVL_DIS_DISCRETE); } () def p_discipline_item_2(p): '''discipline_item : K_domain K_continuous ';' ''' - print(p) + print('discipline_item', list(p)) # { pform_discipline_domain(@1, IVL_DIS_CONTINUOUS); } () def p_discipline_item_3(p): '''discipline_item : K_potential IDENTIFIER ';' ''' - print(p) + print('discipline_item', list(p)) # { pform_discipline_potential(@1, $2); delete[] $2; } () def p_discipline_item_4(p): '''discipline_item : K_flow IDENTIFIER ';' ''' - print(p) + print('discipline_item', list(p)) # { pform_discipline_flow(@1, $2); delete[] $2; } () def p_nature_declaration_1(p): '''nature_declaration : K_nature IDENTIFIER optional_semicolon _embed0_nature_declaration nature_items K_endnature ''' - print(p) + print('nature_declaration', list(p)) # { pform_end_nature(@1); delete[] $2; } () def p__embed0_nature_declaration(p): @@ -2929,39 +2938,39 @@ def p__embed0_nature_declaration(p): () def p_nature_items_1(p): '''nature_items : nature_items nature_item ''' - print(p) + print('nature_items', list(p)) () def p_nature_items_2(p): '''nature_items : nature_item ''' - print(p) + print('nature_items', list(p)) () def p_nature_item_1(p): '''nature_item : K_units '=' STRING ';' ''' - print(p) + print('nature_item', list(p)) # { delete[] $3; } () def p_nature_item_2(p): '''nature_item : K_abstol '=' expression ';' ''' - print(p) + print('nature_item', list(p)) () def p_nature_item_3(p): '''nature_item : K_access '=' IDENTIFIER ';' ''' - print(p) + print('nature_item', list(p)) # { pform_nature_access(@1, $3); delete[] $3; } () def p_nature_item_4(p): '''nature_item : K_idt_nature '=' IDENTIFIER ';' ''' - print(p) + print('nature_item', list(p)) # { delete[] $3; } () def p_nature_item_5(p): '''nature_item : K_ddt_nature '=' IDENTIFIER ';' ''' - print(p) + print('nature_item', list(p)) # { delete[] $3; } () def p_config_declaration_1(p): '''config_declaration : K_config IDENTIFIER ';' K_design lib_cell_identifiers ';' list_of_config_rule_statements K_endconfig ''' - print(p) + print('config_declaration', list(p)) # { cerr << @1 << ": sorry: config declarations are not supported and " # "will be skipped." << endl; # delete[] $2; @@ -2969,172 +2978,172 @@ def p_config_declaration_1(p): () def p_lib_cell_identifiers_1(p): '''lib_cell_identifiers : ''' - print(p) + print('lib_cell_identifiers', list(p)) () def p_lib_cell_identifiers_2(p): '''lib_cell_identifiers : lib_cell_identifiers lib_cell_id ''' - print(p) + print('lib_cell_identifiers', list(p)) () def p_list_of_config_rule_statements_1(p): '''list_of_config_rule_statements : ''' - print(p) + print('list_of_config_rule_statements', list(p)) () def p_list_of_config_rule_statements_2(p): '''list_of_config_rule_statements : list_of_config_rule_statements config_rule_statement ''' - print(p) + print('list_of_config_rule_statements', list(p)) () def p_config_rule_statement_1(p): '''config_rule_statement : K_default K_liblist list_of_libraries ';' ''' - print(p) + print('config_rule_statement', list(p)) () def p_config_rule_statement_2(p): '''config_rule_statement : K_instance hierarchy_identifier K_liblist list_of_libraries ';' ''' - print(p) + print('config_rule_statement', list(p)) # { delete $2; } () def p_config_rule_statement_3(p): '''config_rule_statement : K_instance hierarchy_identifier K_use lib_cell_id opt_config ';' ''' - print(p) + print('config_rule_statement', list(p)) # { delete $2; } () def p_config_rule_statement_4(p): '''config_rule_statement : K_cell lib_cell_id K_liblist list_of_libraries ';' ''' - print(p) + print('config_rule_statement', list(p)) () def p_config_rule_statement_5(p): '''config_rule_statement : K_cell lib_cell_id K_use lib_cell_id opt_config ';' ''' - print(p) + print('config_rule_statement', list(p)) () def p_opt_config_1(p): '''opt_config : ''' - print(p) + print('opt_config', list(p)) () def p_opt_config_2(p): '''opt_config : ':' K_config ''' - print(p) + print('opt_config', list(p)) () def p_lib_cell_id_1(p): '''lib_cell_id : IDENTIFIER ''' - print(p) + print('lib_cell_id', list(p)) # { delete[] $1; } () def p_lib_cell_id_2(p): '''lib_cell_id : IDENTIFIER '.' IDENTIFIER ''' - print(p) + print('lib_cell_id', list(p)) # { delete[] $1; delete[] $3; } () def p_list_of_libraries_1(p): '''list_of_libraries : ''' - print(p) + print('list_of_libraries', list(p)) () def p_list_of_libraries_2(p): '''list_of_libraries : list_of_libraries IDENTIFIER ''' - print(p) + print('list_of_libraries', list(p)) # { delete[] $2; } () def p_drive_strength_1(p): '''drive_strength : '(' dr_strength0 ',' dr_strength1 ')' ''' - print(p) + print('drive_strength', list(p)) # { $$.str0 = $2.str0; # $$.str1 = $4.str1; # } () def p_drive_strength_2(p): '''drive_strength : '(' dr_strength1 ',' dr_strength0 ')' ''' - print(p) + print('drive_strength', list(p)) # { $$.str0 = $4.str0; # $$.str1 = $2.str1; # } () def p_drive_strength_3(p): '''drive_strength : '(' dr_strength0 ',' K_highz1 ')' ''' - print(p) + print('drive_strength', list(p)) # { $$.str0 = $2.str0; # $$.str1 = IVL_DR_HiZ; # } () def p_drive_strength_4(p): '''drive_strength : '(' dr_strength1 ',' K_highz0 ')' ''' - print(p) + print('drive_strength', list(p)) # { $$.str0 = IVL_DR_HiZ; # $$.str1 = $2.str1; # } () def p_drive_strength_5(p): '''drive_strength : '(' K_highz1 ',' dr_strength0 ')' ''' - print(p) + print('drive_strength', list(p)) # { $$.str0 = $4.str0; # $$.str1 = IVL_DR_HiZ; # } () def p_drive_strength_6(p): '''drive_strength : '(' K_highz0 ',' dr_strength1 ')' ''' - print(p) + print('drive_strength', list(p)) # { $$.str0 = IVL_DR_HiZ; # $$.str1 = $4.str1; # } () def p_drive_strength_opt_1(p): '''drive_strength_opt : drive_strength ''' - print(p) + print('drive_strength_opt', list(p)) # { $$ = $1; } () def p_drive_strength_opt_2(p): '''drive_strength_opt : ''' - print(p) + print('drive_strength_opt', list(p)) # { $$.str0 = IVL_DR_STRONG; $$.str1 = IVL_DR_STRONG; } () def p_dr_strength0_1(p): '''dr_strength0 : K_supply0 ''' - print(p) + print('dr_strength0', list(p)) # { $$.str0 = IVL_DR_SUPPLY; } () def p_dr_strength0_2(p): '''dr_strength0 : K_strong0 ''' - print(p) + print('dr_strength0', list(p)) # { $$.str0 = IVL_DR_STRONG; } () def p_dr_strength0_3(p): '''dr_strength0 : K_pull0 ''' - print(p) + print('dr_strength0', list(p)) # { $$.str0 = IVL_DR_PULL; } () def p_dr_strength0_4(p): '''dr_strength0 : K_weak0 ''' - print(p) + print('dr_strength0', list(p)) # { $$.str0 = IVL_DR_WEAK; } () def p_dr_strength1_1(p): '''dr_strength1 : K_supply1 ''' - print(p) + print('dr_strength1', list(p)) # { $$.str1 = IVL_DR_SUPPLY; } () def p_dr_strength1_2(p): '''dr_strength1 : K_strong1 ''' - print(p) + print('dr_strength1', list(p)) # { $$.str1 = IVL_DR_STRONG; } () def p_dr_strength1_3(p): '''dr_strength1 : K_pull1 ''' - print(p) + print('dr_strength1', list(p)) # { $$.str1 = IVL_DR_PULL; } () def p_dr_strength1_4(p): '''dr_strength1 : K_weak1 ''' - print(p) + print('dr_strength1', list(p)) # { $$.str1 = IVL_DR_WEAK; } () def p_clocking_event_opt_1(p): '''clocking_event_opt : event_control ''' - print(p) + print('clocking_event_opt', list(p)) () def p_clocking_event_opt_2(p): '''clocking_event_opt : ''' - print(p) + print('clocking_event_opt', list(p)) () def p_event_control_1(p): '''event_control : '@' hierarchy_identifier ''' - print(p) + print('event_control', list(p)) # { PEIdent*tmpi = new PEIdent(*$2); # PEEvent*tmpe = new PEEvent(PEEvent::ANYEDGE, tmpi); # PEventStatement*tmps = new PEventStatement(tmpe); @@ -3145,7 +3154,7 @@ def p_event_control_1(p): () def p_event_control_2(p): '''event_control : '@' '(' event_expression_list ')' ''' - print(p) + print('event_control', list(p)) # { PEventStatement*tmp = new PEventStatement(*$3); # FILE_NAME(tmp, @1); # delete $3; @@ -3154,19 +3163,19 @@ def p_event_control_2(p): () def p_event_control_3(p): '''event_control : '@' '(' error ')' ''' - print(p) + print('event_control', list(p)) # { yyerror(@1, "error: Malformed event control expression."); # $$ = 0; # } () def p_event_expression_list_1(p): '''event_expression_list : event_expression ''' - print(p) + print('event_expression_list', list(p)) # { $$ = $1; } () def p_event_expression_list_2(p): '''event_expression_list : event_expression_list K_or event_expression ''' - print(p) + print('event_expression_list', list(p)) # { svector*tmp = new svector(*$1, *$3); # delete $1; # delete $3; @@ -3175,7 +3184,7 @@ def p_event_expression_list_2(p): () def p_event_expression_list_3(p): '''event_expression_list : event_expression_list ',' event_expression ''' - print(p) + print('event_expression_list', list(p)) # { svector*tmp = new svector(*$1, *$3); # delete $1; # delete $3; @@ -3184,7 +3193,7 @@ def p_event_expression_list_3(p): () def p_event_expression_1(p): '''event_expression : K_posedge expression ''' - print(p) + print('event_expression', list(p)) # { PEEvent*tmp = new PEEvent(PEEvent::POSEDGE, $2); # FILE_NAME(tmp, @1); # svector*tl = new svector(1); @@ -3194,7 +3203,7 @@ def p_event_expression_1(p): () def p_event_expression_2(p): '''event_expression : K_negedge expression ''' - print(p) + print('event_expression', list(p)) # { PEEvent*tmp = new PEEvent(PEEvent::NEGEDGE, $2); # FILE_NAME(tmp, @1); # svector*tl = new svector(1); @@ -3204,7 +3213,7 @@ def p_event_expression_2(p): () def p_event_expression_3(p): '''event_expression : expression ''' - print(p) + print('event_expression', list(p)) # { PEEvent*tmp = new PEEvent(PEEvent::ANYEDGE, $1); # FILE_NAME(tmp, @1); # svector*tl = new svector(1); @@ -3214,37 +3223,38 @@ def p_event_expression_3(p): () def p_branch_probe_expression_1(p): '''branch_probe_expression : IDENTIFIER '(' IDENTIFIER ',' IDENTIFIER ')' ''' - print(p) + print('branch_probe_expression', list(p)) # { $$ = pform_make_branch_probe_expression(@1, $1, $3, $5); } () def p_branch_probe_expression_2(p): '''branch_probe_expression : IDENTIFIER '(' IDENTIFIER ')' ''' - print(p) + print('branch_probe_expression', list(p)) # { $$ = pform_make_branch_probe_expression(@1, $1, $3); } () def p_expression_1(p): '''expression : expr_primary_or_typename ''' - print(p) + print('expression1', list(p)) + p[0] = p[1] # { $$ = $1; } () def p_expression_2(p): '''expression : inc_or_dec_expression ''' - print(p) + print('expression2', list(p)) # { $$ = $1; } () def p_expression_3(p): '''expression : inside_expression ''' - print(p) + print('expression3', list(p)) # { $$ = $1; } () def p_expression_4(p): '''expression : '+' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression4', list(p)) # { $$ = $3; } () def p_expression_5(p): '''expression : '-' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression5', list(p)) # { PEUnary*tmp = new PEUnary('-', $3); # FILE_NAME(tmp, @3); # $$ = tmp; @@ -3252,7 +3262,7 @@ def p_expression_5(p): () def p_expression_6(p): '''expression : '~' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression6', list(p)) # { PEUnary*tmp = new PEUnary('~', $3); # FILE_NAME(tmp, @3); # $$ = tmp; @@ -3260,7 +3270,7 @@ def p_expression_6(p): () def p_expression_7(p): '''expression : '&' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression7', list(p)) # { PEUnary*tmp = new PEUnary('&', $3); # FILE_NAME(tmp, @3); # $$ = tmp; @@ -3268,7 +3278,7 @@ def p_expression_7(p): () def p_expression_8(p): '''expression : '!' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression8', list(p)) # { PEUnary*tmp = new PEUnary('!', $3); # FILE_NAME(tmp, @3); # $$ = tmp; @@ -3276,7 +3286,7 @@ def p_expression_8(p): () def p_expression_9(p): '''expression : '|' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression9', list(p)) # { PEUnary*tmp = new PEUnary('|', $3); # FILE_NAME(tmp, @3); # $$ = tmp; @@ -3284,7 +3294,7 @@ def p_expression_9(p): () def p_expression_10(p): '''expression : '^' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression10', list(p)) # { PEUnary*tmp = new PEUnary('^', $3); # FILE_NAME(tmp, @3); # $$ = tmp; @@ -3292,7 +3302,7 @@ def p_expression_10(p): () def p_expression_11(p): '''expression : '~' '&' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression', list(p)) # { yyerror(@1, "error: '~' '&' is not a valid expression. " # "Please use operator '~&' instead."); # $$ = 0; @@ -3300,7 +3310,7 @@ def p_expression_11(p): () def p_expression_12(p): '''expression : '~' '|' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression', list(p)) # { yyerror(@1, "error: '~' '|' is not a valid expression. " # "Please use operator '~|' instead."); # $$ = 0; @@ -3308,7 +3318,7 @@ def p_expression_12(p): () def p_expression_13(p): '''expression : '~' '^' attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression', list(p)) # { yyerror(@1, "error: '~' '^' is not a valid expression. " # "Please use operator '~^' instead."); # $$ = 0; @@ -3316,7 +3326,7 @@ def p_expression_13(p): () def p_expression_14(p): '''expression : K_NAND attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression', list(p)) # { PEUnary*tmp = new PEUnary('A', $3); # FILE_NAME(tmp, @3); # $$ = tmp; @@ -3324,7 +3334,7 @@ def p_expression_14(p): () def p_expression_15(p): '''expression : K_NOR attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression', list(p)) # { PEUnary*tmp = new PEUnary('N', $3); # FILE_NAME(tmp, @3); # $$ = tmp; @@ -3332,7 +3342,7 @@ def p_expression_15(p): () def p_expression_16(p): '''expression : K_NXOR attribute_list_opt expr_primary %prec UNARY_PREC ''' - print(p) + print('expression', list(p)) # { PEUnary*tmp = new PEUnary('X', $3); # FILE_NAME(tmp, @3); # $$ = tmp; @@ -3340,7 +3350,7 @@ def p_expression_16(p): () def p_expression_17(p): '''expression : '!' error %prec UNARY_PREC ''' - print(p) + print('expression', list(p)) # { yyerror(@1, "error: Operand of unary ! " # "is not a primary expression."); # $$ = 0; @@ -3348,7 +3358,7 @@ def p_expression_17(p): () def p_expression_18(p): '''expression : '^' error %prec UNARY_PREC ''' - print(p) + print('expression', list(p)) # { yyerror(@1, "error: Operand of reduction ^ " # "is not a primary expression."); # $$ = 0; @@ -3356,7 +3366,7 @@ def p_expression_18(p): () def p_expression_19(p): '''expression : expression '^' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('^', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3364,7 +3374,7 @@ def p_expression_19(p): () def p_expression_20(p): '''expression : expression K_POW attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBPower('p', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3372,7 +3382,7 @@ def p_expression_20(p): () def p_expression_21(p): '''expression : expression '*' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('*', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3380,7 +3390,7 @@ def p_expression_21(p): () def p_expression_22(p): '''expression : expression '/' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('/', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3388,7 +3398,7 @@ def p_expression_22(p): () def p_expression_23(p): '''expression : expression '%' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('%', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3396,7 +3406,7 @@ def p_expression_23(p): () def p_expression_24(p): '''expression : expression '+' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('+', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3404,7 +3414,7 @@ def p_expression_24(p): () def p_expression_25(p): '''expression : expression '-' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('-', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3412,7 +3422,7 @@ def p_expression_25(p): () def p_expression_26(p): '''expression : expression '&' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('&', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3420,7 +3430,7 @@ def p_expression_26(p): () def p_expression_27(p): '''expression : expression '|' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('|', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3428,7 +3438,7 @@ def p_expression_27(p): () def p_expression_28(p): '''expression : expression K_NAND attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('A', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3436,7 +3446,7 @@ def p_expression_28(p): () def p_expression_29(p): '''expression : expression K_NOR attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('O', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3444,7 +3454,7 @@ def p_expression_29(p): () def p_expression_30(p): '''expression : expression K_NXOR attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBinary('X', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3452,7 +3462,7 @@ def p_expression_30(p): () def p_expression_31(p): '''expression : expression '<' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('<', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3460,7 +3470,7 @@ def p_expression_31(p): () def p_expression_32(p): '''expression : expression '>' attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('>', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3468,7 +3478,7 @@ def p_expression_32(p): () def p_expression_33(p): '''expression : expression K_LS attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBShift('l', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3476,7 +3486,7 @@ def p_expression_33(p): () def p_expression_34(p): '''expression : expression K_RS attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBShift('r', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3484,7 +3494,7 @@ def p_expression_34(p): () def p_expression_35(p): '''expression : expression K_RSS attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBShift('R', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3492,7 +3502,7 @@ def p_expression_35(p): () def p_expression_36(p): '''expression : expression K_EQ attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('e', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3500,7 +3510,7 @@ def p_expression_36(p): () def p_expression_37(p): '''expression : expression K_CEQ attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('E', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3508,7 +3518,7 @@ def p_expression_37(p): () def p_expression_38(p): '''expression : expression K_WEQ attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('w', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3516,7 +3526,7 @@ def p_expression_38(p): () def p_expression_39(p): '''expression : expression K_LE attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('L', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3524,7 +3534,7 @@ def p_expression_39(p): () def p_expression_40(p): '''expression : expression K_GE attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('G', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3532,7 +3542,7 @@ def p_expression_40(p): () def p_expression_41(p): '''expression : expression K_NE attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('n', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3540,7 +3550,7 @@ def p_expression_41(p): () def p_expression_42(p): '''expression : expression K_CNE attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('N', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3548,7 +3558,7 @@ def p_expression_42(p): () def p_expression_43(p): '''expression : expression K_WNE attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBComp('W', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3556,7 +3566,7 @@ def p_expression_43(p): () def p_expression_44(p): '''expression : expression K_LOR attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBLogic('o', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3564,7 +3574,7 @@ def p_expression_44(p): () def p_expression_45(p): '''expression : expression K_LAND attribute_list_opt expression ''' - print(p) + print('expression', list(p)) # { PEBinary*tmp = new PEBLogic('a', $1, $4); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3572,7 +3582,7 @@ def p_expression_45(p): () def p_expression_46(p): '''expression : expression '?' attribute_list_opt expression ':' expression ''' - print(p) + print('expression', list(p)) # { PETernary*tmp = new PETernary($1, $4, $6); # FILE_NAME(tmp, @2); # $$ = tmp; @@ -3580,12 +3590,12 @@ def p_expression_46(p): () def p_expr_mintypmax_1(p): '''expr_mintypmax : expression ''' - print(p) + print('expr_mintypmax', list(p)) # { $$ = $1; } () def p_expr_mintypmax_2(p): '''expr_mintypmax : expression ':' expression ':' expression ''' - print(p) + print('expr_mintypmax', list(p)) # { switch (min_typ_max_flag) { # case MIN: # $$ = $1; @@ -3623,7 +3633,7 @@ def p_expr_mintypmax_2(p): () def p_expression_list_with_nuls_1(p): '''expression_list_with_nuls : expression_list_with_nuls ',' expression ''' - print(p) + print('expression_list_with_nuls', list(p)) # { list*tmp = $1; # tmp->push_back($3); # $$ = tmp; @@ -3631,7 +3641,7 @@ def p_expression_list_with_nuls_1(p): () def p_expression_list_with_nuls_2(p): '''expression_list_with_nuls : expression ''' - print(p) + print('expression_list_with_nuls', list(p)) # { list*tmp = new list; # tmp->push_back($1); # $$ = tmp; @@ -3639,7 +3649,7 @@ def p_expression_list_with_nuls_2(p): () def p_expression_list_with_nuls_3(p): '''expression_list_with_nuls : ''' - print(p) + print('expression_list_with_nuls', list(p)) # { list*tmp = new list; # tmp->push_back(0); # $$ = tmp; @@ -3647,7 +3657,7 @@ def p_expression_list_with_nuls_3(p): () def p_expression_list_with_nuls_4(p): '''expression_list_with_nuls : expression_list_with_nuls ',' ''' - print(p) + print('expression_list_with_nuls', list(p)) # { list*tmp = $1; # tmp->push_back(0); # $$ = tmp; @@ -3655,7 +3665,7 @@ def p_expression_list_with_nuls_4(p): () def p_expression_list_proper_1(p): '''expression_list_proper : expression_list_proper ',' expression ''' - print(p) + print('expression_list_proper', list(p)) # { list*tmp = $1; # tmp->push_back($3); # $$ = tmp; @@ -3663,7 +3673,7 @@ def p_expression_list_proper_1(p): () def p_expression_list_proper_2(p): '''expression_list_proper : expression ''' - print(p) + print('expression_list_proper', list(p)) # { list*tmp = new list; # tmp->push_back($1); # $$ = tmp; @@ -3671,11 +3681,13 @@ def p_expression_list_proper_2(p): () def p_expr_primary_or_typename_1(p): '''expr_primary_or_typename : expr_primary ''' - print(p) + print('expr_primary_or_typename', list(p)) + p[0] = p[1] () def p_expr_primary_or_typename_2(p): '''expr_primary_or_typename : TYPE_IDENTIFIER ''' - print(p) + print('expr_primary_or_typename', list(p)) + p[0] = p[1] # { PETypename*tmp = new PETypename($1.type); # FILE_NAME(tmp,@1); # $$ = tmp; @@ -3684,7 +3696,8 @@ def p_expr_primary_or_typename_2(p): () def p_expr_primary_1(p): '''expr_primary : number ''' - print(p) + print('expr_primary1', list(p)) + p[0] = p[1] # { assert($1); # PENumber*tmp = new PENumber($1); # FILE_NAME(tmp, @1); @@ -3693,7 +3706,7 @@ def p_expr_primary_1(p): () def p_expr_primary_2(p): '''expr_primary : REALTIME ''' - print(p) + print('expr_primary', list(p)) # { PEFNumber*tmp = new PEFNumber($1); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -3701,7 +3714,7 @@ def p_expr_primary_2(p): () def p_expr_primary_3(p): '''expr_primary : STRING ''' - print(p) + print('expr_primary3', list(p)) # { PEString*tmp = new PEString($1); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -3709,7 +3722,7 @@ def p_expr_primary_3(p): () def p_expr_primary_4(p): '''expr_primary : TIME_LITERAL ''' - print(p) + print('expr_primary', list(p)) # { int unit; # # based_size = 0; @@ -3728,7 +3741,7 @@ def p_expr_primary_4(p): () def p_expr_primary_5(p): '''expr_primary : SYSTEM_IDENTIFIER ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = lex_strings.make($1); # PECallFunction*tmp = new PECallFunction(tn); # FILE_NAME(tmp, @1); @@ -3738,7 +3751,8 @@ def p_expr_primary_5(p): () def p_expr_primary_6(p): '''expr_primary : hierarchy_identifier ''' - print(p) + print('expr_primary6', list(p)) + p[0] = p[1] # { PEIdent*tmp = pform_new_ident(*$1); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -3747,14 +3761,14 @@ def p_expr_primary_6(p): () def p_expr_primary_7(p): '''expr_primary : PACKAGE_IDENTIFIER K_SCOPE_RES hierarchy_identifier ''' - print(p) + print('expr_primary', list(p)) # { $$ = pform_package_ident(@2, $1, $3); # delete $3; # } () def p_expr_primary_8(p): '''expr_primary : hierarchy_identifier '(' expression_list_with_nuls ')' ''' - print(p) + print('expr_primary', list(p)) # { list*expr_list = $3; # strip_tail_items(expr_list); # PECallFunction*tmp = pform_make_call_function(@1, *$1, *expr_list); @@ -3764,7 +3778,7 @@ def p_expr_primary_8(p): () def p_expr_primary_9(p): '''expr_primary : implicit_class_handle '.' hierarchy_identifier '(' expression_list_with_nuls ')' ''' - print(p) + print('expr_primary', list(p)) # { pform_name_t*t_name = $1; # while (! $3->empty()) { # t_name->push_back($3->front()); @@ -3780,7 +3794,7 @@ def p_expr_primary_9(p): () def p_expr_primary_10(p): '''expr_primary : SYSTEM_IDENTIFIER '(' expression_list_proper ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = lex_strings.make($1); # PECallFunction*tmp = new PECallFunction(tn, *$3); # FILE_NAME(tmp, @1); @@ -3790,7 +3804,7 @@ def p_expr_primary_10(p): () def p_expr_primary_11(p): '''expr_primary : PACKAGE_IDENTIFIER K_SCOPE_RES IDENTIFIER '(' expression_list_proper ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string use_name = lex_strings.make($3); # PECallFunction*tmp = new PECallFunction($1, use_name, *$5); # FILE_NAME(tmp, @3); @@ -3800,7 +3814,7 @@ def p_expr_primary_11(p): () def p_expr_primary_12(p): '''expr_primary : SYSTEM_IDENTIFIER '(' ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = lex_strings.make($1); # const vectorempty; # PECallFunction*tmp = new PECallFunction(tn, empty); @@ -3814,7 +3828,7 @@ def p_expr_primary_12(p): () def p_expr_primary_13(p): '''expr_primary : implicit_class_handle ''' - print(p) + print('expr_primary', list(p)) # { PEIdent*tmp = new PEIdent(*$1); # FILE_NAME(tmp,@1); # delete $1; @@ -3823,7 +3837,7 @@ def p_expr_primary_13(p): () def p_expr_primary_14(p): '''expr_primary : implicit_class_handle '.' hierarchy_identifier ''' - print(p) + print('expr_primary', list(p)) # { pform_name_t*t_name = $1; # while (! $3->empty()) { # t_name->push_back($3->front()); @@ -3838,7 +3852,7 @@ def p_expr_primary_14(p): () def p_expr_primary_15(p): '''expr_primary : K_acos '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$acos"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3847,7 +3861,7 @@ def p_expr_primary_15(p): () def p_expr_primary_16(p): '''expr_primary : K_acosh '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$acosh"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3856,7 +3870,7 @@ def p_expr_primary_16(p): () def p_expr_primary_17(p): '''expr_primary : K_asin '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$asin"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3865,7 +3879,7 @@ def p_expr_primary_17(p): () def p_expr_primary_18(p): '''expr_primary : K_asinh '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$asinh"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3874,7 +3888,7 @@ def p_expr_primary_18(p): () def p_expr_primary_19(p): '''expr_primary : K_atan '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$atan"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3883,7 +3897,7 @@ def p_expr_primary_19(p): () def p_expr_primary_20(p): '''expr_primary : K_atanh '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$atanh"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3892,7 +3906,7 @@ def p_expr_primary_20(p): () def p_expr_primary_21(p): '''expr_primary : K_atan2 '(' expression ',' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$atan2"); # PECallFunction*tmp = make_call_function(tn, $3, $5); # FILE_NAME(tmp,@1); @@ -3901,7 +3915,7 @@ def p_expr_primary_21(p): () def p_expr_primary_22(p): '''expr_primary : K_ceil '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$ceil"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3910,7 +3924,7 @@ def p_expr_primary_22(p): () def p_expr_primary_23(p): '''expr_primary : K_cos '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$cos"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3919,7 +3933,7 @@ def p_expr_primary_23(p): () def p_expr_primary_24(p): '''expr_primary : K_cosh '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$cosh"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3928,7 +3942,7 @@ def p_expr_primary_24(p): () def p_expr_primary_25(p): '''expr_primary : K_exp '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$exp"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3937,7 +3951,7 @@ def p_expr_primary_25(p): () def p_expr_primary_26(p): '''expr_primary : K_floor '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$floor"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3946,7 +3960,7 @@ def p_expr_primary_26(p): () def p_expr_primary_27(p): '''expr_primary : K_hypot '(' expression ',' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$hypot"); # PECallFunction*tmp = make_call_function(tn, $3, $5); # FILE_NAME(tmp,@1); @@ -3955,7 +3969,7 @@ def p_expr_primary_27(p): () def p_expr_primary_28(p): '''expr_primary : K_ln '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$ln"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3964,7 +3978,7 @@ def p_expr_primary_28(p): () def p_expr_primary_29(p): '''expr_primary : K_log '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$log10"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3973,7 +3987,7 @@ def p_expr_primary_29(p): () def p_expr_primary_30(p): '''expr_primary : K_pow '(' expression ',' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$pow"); # PECallFunction*tmp = make_call_function(tn, $3, $5); # FILE_NAME(tmp,@1); @@ -3982,7 +3996,7 @@ def p_expr_primary_30(p): () def p_expr_primary_31(p): '''expr_primary : K_sin '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$sin"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -3991,7 +4005,7 @@ def p_expr_primary_31(p): () def p_expr_primary_32(p): '''expr_primary : K_sinh '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$sinh"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -4000,7 +4014,7 @@ def p_expr_primary_32(p): () def p_expr_primary_33(p): '''expr_primary : K_sqrt '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$sqrt"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -4009,7 +4023,7 @@ def p_expr_primary_33(p): () def p_expr_primary_34(p): '''expr_primary : K_tan '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$tan"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -4018,7 +4032,7 @@ def p_expr_primary_34(p): () def p_expr_primary_35(p): '''expr_primary : K_tanh '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { perm_string tn = perm_string::literal("$tanh"); # PECallFunction*tmp = make_call_function(tn, $3); # FILE_NAME(tmp,@1); @@ -4027,7 +4041,7 @@ def p_expr_primary_35(p): () def p_expr_primary_36(p): '''expr_primary : K_abs '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { PEUnary*tmp = new PEUnary('m', $3); # FILE_NAME(tmp,@1); # $$ = tmp; @@ -4035,7 +4049,7 @@ def p_expr_primary_36(p): () def p_expr_primary_37(p): '''expr_primary : K_max '(' expression ',' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { PEBinary*tmp = new PEBinary('M', $3, $5); # FILE_NAME(tmp,@1); # $$ = tmp; @@ -4043,7 +4057,7 @@ def p_expr_primary_37(p): () def p_expr_primary_38(p): '''expr_primary : K_min '(' expression ',' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { PEBinary*tmp = new PEBinary('m', $3, $5); # FILE_NAME(tmp,@1); # $$ = tmp; @@ -4051,12 +4065,12 @@ def p_expr_primary_38(p): () def p_expr_primary_39(p): '''expr_primary : '(' expr_mintypmax ')' ''' - print(p) + print('expr_primary', list(p)) # { $$ = $2; } () def p_expr_primary_40(p): '''expr_primary : '{' expression_list_proper '}' ''' - print(p) + print('expr_primary', list(p)) # { PEConcat*tmp = new PEConcat(*$2); # FILE_NAME(tmp, @1); # delete $2; @@ -4065,7 +4079,7 @@ def p_expr_primary_40(p): () def p_expr_primary_41(p): '''expr_primary : '{' expression '{' expression_list_proper '}' '}' ''' - print(p) + print('expr_primary', list(p)) # { PExpr*rep = $2; # PEConcat*tmp = new PEConcat(*$4, rep); # FILE_NAME(tmp, @1); @@ -4075,7 +4089,7 @@ def p_expr_primary_41(p): () def p_expr_primary_42(p): '''expr_primary : '{' expression '{' expression_list_proper '}' error '}' ''' - print(p) + print('expr_primary', list(p)) # { PExpr*rep = $2; # PEConcat*tmp = new PEConcat(*$4, rep); # FILE_NAME(tmp, @1); @@ -4088,7 +4102,7 @@ def p_expr_primary_42(p): () def p_expr_primary_43(p): '''expr_primary : '{' '}' ''' - print(p) + print('expr_primary', list(p)) # { // This is the empty queue syntax. # if (gn_system_verilog()) { # list empty_list; @@ -4103,7 +4117,7 @@ def p_expr_primary_43(p): () def p_expr_primary_44(p): '''expr_primary : expr_primary "'" '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { PExpr*base = $4; # if (gn_system_verilog()) { # PECastSize*tmp = new PECastSize($1, base); @@ -4117,7 +4131,7 @@ def p_expr_primary_44(p): () def p_expr_primary_45(p): '''expr_primary : simple_type_or_string "'" '(' expression ')' ''' - print(p) + print('expr_primary', list(p)) # { PExpr*base = $4; # if (gn_system_verilog()) { # PECastType*tmp = new PECastType($1, base); @@ -4131,17 +4145,17 @@ def p_expr_primary_45(p): () def p_expr_primary_46(p): '''expr_primary : assignment_pattern ''' - print(p) + print('expr_primary', list(p)) # { $$ = $1; } () def p_expr_primary_47(p): '''expr_primary : streaming_concatenation ''' - print(p) + print('expr_primary', list(p)) # { $$ = $1; } () def p_expr_primary_48(p): '''expr_primary : K_null ''' - print(p) + print('expr_primary', list(p)) # { PENull*tmp = new PENull; # FILE_NAME(tmp, @1); # $$ = tmp; @@ -4149,22 +4163,22 @@ def p_expr_primary_48(p): () def p_function_item_list_opt_1(p): '''function_item_list_opt : function_item_list ''' - print(p) + print('function_item_list_opt', list(p)) # { $$ = $1; } () def p_function_item_list_opt_2(p): '''function_item_list_opt : ''' - print(p) + print('function_item_list_opt', list(p)) # { $$ = 0; } () def p_function_item_list_1(p): '''function_item_list : function_item ''' - print(p) + print('function_item_list', list(p)) # { $$ = $1; } () def p_function_item_list_2(p): '''function_item_list : function_item_list function_item ''' - print(p) + print('function_item_list', list(p)) # { /* */ # if ($1 && $2) { # vector*tmp = $1; @@ -4183,17 +4197,17 @@ def p_function_item_list_2(p): () def p_function_item_1(p): '''function_item : tf_port_declaration ''' - print(p) + print('function_item', list(p)) # { $$ = $1; } () def p_function_item_2(p): '''function_item : block_item_decl ''' - print(p) + print('function_item', list(p)) # { $$ = 0; } () def p_gate_instance_1(p): '''gate_instance : IDENTIFIER '(' expression_list_with_nuls ')' ''' - print(p) + print('gate_instance', list(p)) # { lgate*tmp = new lgate; # tmp->name = $1; # tmp->parms = $3; @@ -4205,7 +4219,7 @@ def p_gate_instance_1(p): () def p_gate_instance_2(p): '''gate_instance : IDENTIFIER dimensions '(' expression_list_with_nuls ')' ''' - print(p) + print('gate_instance', list(p)) # { lgate*tmp = new lgate; # list*rng = $2; # tmp->name = $1; @@ -4222,7 +4236,7 @@ def p_gate_instance_2(p): () def p_gate_instance_3(p): '''gate_instance : '(' expression_list_with_nuls ')' ''' - print(p) + print('gate_instance', list(p)) # { lgate*tmp = new lgate; # tmp->name = ""; # tmp->parms = $2; @@ -4233,7 +4247,7 @@ def p_gate_instance_3(p): () def p_gate_instance_4(p): '''gate_instance : IDENTIFIER dimensions ''' - print(p) + print('gate_instance', list(p)) # { lgate*tmp = new lgate; # list*rng = $2; # tmp->name = $1; @@ -4251,7 +4265,7 @@ def p_gate_instance_4(p): () def p_gate_instance_5(p): '''gate_instance : IDENTIFIER '(' port_name_list ')' ''' - print(p) + print('gate_instance', list(p)) # { lgate*tmp = new lgate; # tmp->name = $1; # tmp->parms = 0; @@ -4264,7 +4278,7 @@ def p_gate_instance_5(p): () def p_gate_instance_6(p): '''gate_instance : IDENTIFIER dimensions '(' port_name_list ')' ''' - print(p) + print('gate_instance', list(p)) # { lgate*tmp = new lgate; # list*rng = $2; # tmp->name = $1; @@ -4282,7 +4296,7 @@ def p_gate_instance_6(p): () def p_gate_instance_7(p): '''gate_instance : IDENTIFIER '(' error ')' ''' - print(p) + print('gate_instance', list(p)) # { lgate*tmp = new lgate; # tmp->name = $1; # tmp->parms = 0; @@ -4297,7 +4311,7 @@ def p_gate_instance_7(p): () def p_gate_instance_8(p): '''gate_instance : IDENTIFIER dimensions '(' error ')' ''' - print(p) + print('gate_instance', list(p)) # { lgate*tmp = new lgate; # tmp->name = $1; # tmp->parms = 0; @@ -4312,7 +4326,7 @@ def p_gate_instance_8(p): () def p_gate_instance_list_1(p): '''gate_instance_list : gate_instance_list ',' gate_instance ''' - print(p) + print('gate_instance_list', list(p)) # { svector*tmp1 = $1; # lgate*tmp2 = $3; # svector*out = new svector (*tmp1, *tmp2); @@ -4323,7 +4337,7 @@ def p_gate_instance_list_1(p): () def p_gate_instance_list_2(p): '''gate_instance_list : gate_instance ''' - print(p) + print('gate_instance_list', list(p)) # { svector*tmp = new svector(1); # (*tmp)[0] = *$1; # delete $1; @@ -4332,127 +4346,129 @@ def p_gate_instance_list_2(p): () def p_gatetype_1(p): '''gatetype : K_and ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::AND; } () def p_gatetype_2(p): '''gatetype : K_nand ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::NAND; } () def p_gatetype_3(p): '''gatetype : K_or ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::OR; } () def p_gatetype_4(p): '''gatetype : K_nor ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::NOR; } () def p_gatetype_5(p): '''gatetype : K_xor ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::XOR; } () def p_gatetype_6(p): '''gatetype : K_xnor ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::XNOR; } () def p_gatetype_7(p): '''gatetype : K_buf ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::BUF; } () def p_gatetype_8(p): '''gatetype : K_bufif0 ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::BUFIF0; } () def p_gatetype_9(p): '''gatetype : K_bufif1 ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::BUFIF1; } () def p_gatetype_10(p): '''gatetype : K_not ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::NOT; } () def p_gatetype_11(p): '''gatetype : K_notif0 ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::NOTIF0; } () def p_gatetype_12(p): '''gatetype : K_notif1 ''' - print(p) + print('gatetype', list(p)) # { $$ = PGBuiltin::NOTIF1; } () def p_switchtype_1(p): '''switchtype : K_nmos ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::NMOS; } () def p_switchtype_2(p): '''switchtype : K_rnmos ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::RNMOS; } () def p_switchtype_3(p): '''switchtype : K_pmos ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::PMOS; } () def p_switchtype_4(p): '''switchtype : K_rpmos ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::RPMOS; } () def p_switchtype_5(p): '''switchtype : K_cmos ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::CMOS; } () def p_switchtype_6(p): '''switchtype : K_rcmos ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::RCMOS; } () def p_switchtype_7(p): '''switchtype : K_tran ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::TRAN; } () def p_switchtype_8(p): '''switchtype : K_rtran ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::RTRAN; } () def p_switchtype_9(p): '''switchtype : K_tranif0 ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::TRANIF0; } () def p_switchtype_10(p): '''switchtype : K_tranif1 ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::TRANIF1; } () def p_switchtype_11(p): '''switchtype : K_rtranif0 ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::RTRANIF0; } () def p_switchtype_12(p): '''switchtype : K_rtranif1 ''' - print(p) + print('switchtype', list(p)) # { $$ = PGBuiltin::RTRANIF1; } () def p_hierarchy_identifier_1(p): '''hierarchy_identifier : IDENTIFIER ''' - print(p) + print('hierarchy_identifier', list(p)) + lpvalue = Leaf(token.NAME, p[1]) + p[0] = lpvalue # { $$ = new pform_name_t; # $$->push_back(name_component_t(lex_strings.make($1))); # delete[]$1; @@ -4460,7 +4476,7 @@ def p_hierarchy_identifier_1(p): () def p_hierarchy_identifier_2(p): '''hierarchy_identifier : hierarchy_identifier '.' IDENTIFIER ''' - print(p) + print('hierarchy_identifier', list(p)) # { pform_name_t * tmp = $1; # tmp->push_back(name_component_t(lex_strings.make($3))); # delete[]$3; @@ -4469,7 +4485,7 @@ def p_hierarchy_identifier_2(p): () def p_hierarchy_identifier_3(p): '''hierarchy_identifier : hierarchy_identifier '[' expression ']' ''' - print(p) + print('hierarchy_identifier', list(p)) # { pform_name_t * tmp = $1; # name_component_t&tail = tmp->back(); # index_component_t itmp; @@ -4481,7 +4497,7 @@ def p_hierarchy_identifier_3(p): () def p_hierarchy_identifier_4(p): '''hierarchy_identifier : hierarchy_identifier '[' '$' ']' ''' - print(p) + print('hierarchy_identifier', list(p)) # { pform_name_t * tmp = $1; # name_component_t&tail = tmp->back(); # if (! gn_system_verilog()) { @@ -4498,7 +4514,7 @@ def p_hierarchy_identifier_4(p): () def p_hierarchy_identifier_5(p): '''hierarchy_identifier : hierarchy_identifier '[' expression ':' expression ']' ''' - print(p) + print('hierarchy_identifier', list(p)) # { pform_name_t * tmp = $1; # name_component_t&tail = tmp->back(); # index_component_t itmp; @@ -4511,7 +4527,7 @@ def p_hierarchy_identifier_5(p): () def p_hierarchy_identifier_6(p): '''hierarchy_identifier : hierarchy_identifier '[' expression K_PO_POS expression ']' ''' - print(p) + print('hierarchy_identifier', list(p)) # { pform_name_t * tmp = $1; # name_component_t&tail = tmp->back(); # index_component_t itmp; @@ -4524,7 +4540,7 @@ def p_hierarchy_identifier_6(p): () def p_hierarchy_identifier_7(p): '''hierarchy_identifier : hierarchy_identifier '[' expression K_PO_NEG expression ']' ''' - print(p) + print('hierarchy_identifier', list(p)) # { pform_name_t * tmp = $1; # name_component_t&tail = tmp->back(); # index_component_t itmp; @@ -4537,47 +4553,47 @@ def p_hierarchy_identifier_7(p): () def p_list_of_identifiers_1(p): '''list_of_identifiers : IDENTIFIER ''' - print(p) + print('list_of_identifiers', list(p)) # { $$ = list_from_identifier($1); } () def p_list_of_identifiers_2(p): '''list_of_identifiers : list_of_identifiers ',' IDENTIFIER ''' - print(p) + print('list_of_identifiers', list(p)) # { $$ = list_from_identifier($1, $3); } () def p_list_of_port_identifiers_1(p): '''list_of_port_identifiers : IDENTIFIER dimensions_opt ''' - print(p) + print('list_of_port_identifiers', list(p)) # { $$ = make_port_list($1, $2, 0); } () def p_list_of_port_identifiers_2(p): '''list_of_port_identifiers : list_of_port_identifiers ',' IDENTIFIER dimensions_opt ''' - print(p) + print('list_of_port_identifiers', list(p)) # { $$ = make_port_list($1, $3, $4, 0); } () def p_list_of_variable_port_identifiers_1(p): '''list_of_variable_port_identifiers : IDENTIFIER dimensions_opt ''' - print(p) + print('list_of_variable_port_identifiers', list(p)) # { $$ = make_port_list($1, $2, 0); } () def p_list_of_variable_port_identifiers_2(p): '''list_of_variable_port_identifiers : IDENTIFIER dimensions_opt '=' expression ''' - print(p) + print('list_of_variable_port_identifiers', list(p)) # { $$ = make_port_list($1, $2, $4); } () def p_list_of_variable_port_identifiers_3(p): '''list_of_variable_port_identifiers : list_of_variable_port_identifiers ',' IDENTIFIER dimensions_opt ''' - print(p) + print('list_of_variable_port_identifiers', list(p)) # { $$ = make_port_list($1, $3, $4, 0); } () def p_list_of_variable_port_identifiers_4(p): '''list_of_variable_port_identifiers : list_of_variable_port_identifiers ',' IDENTIFIER dimensions_opt '=' expression ''' - print(p) + print('list_of_variable_port_identifiers', list(p)) # { $$ = make_port_list($1, $3, $4, $6); } () def p_list_of_ports_1(p): '''list_of_ports : port_opt ''' - print(p) + print('list_of_ports', list(p)) # { vector*tmp # = new vector(1); # (*tmp)[0] = $1; @@ -4586,7 +4602,7 @@ def p_list_of_ports_1(p): () def p_list_of_ports_2(p): '''list_of_ports : list_of_ports ',' port_opt ''' - print(p) + print('list_of_ports', list(p)) # { vector*tmp = $1; # tmp->push_back($3); # $$ = tmp; @@ -4594,7 +4610,7 @@ def p_list_of_ports_2(p): () def p_list_of_port_declarations_1(p): '''list_of_port_declarations : port_declaration ''' - print(p) + print('list_of_port_declarations', list(p)) # { vector*tmp # = new vector(1); # (*tmp)[0] = $1; @@ -4603,7 +4619,7 @@ def p_list_of_port_declarations_1(p): () def p_list_of_port_declarations_2(p): '''list_of_port_declarations : list_of_port_declarations ',' port_declaration ''' - print(p) + print('list_of_port_declarations', list(p)) # { vector*tmp = $1; # tmp->push_back($3); # $$ = tmp; @@ -4611,7 +4627,7 @@ def p_list_of_port_declarations_2(p): () def p_list_of_port_declarations_3(p): '''list_of_port_declarations : list_of_port_declarations ',' IDENTIFIER ''' - print(p) + print('list_of_port_declarations', list(p)) # { Module::port_t*ptmp; # perm_string name = lex_strings.make($3); # ptmp = pform_module_port_reference(name, @3.text, @@ -4632,7 +4648,7 @@ def p_list_of_port_declarations_3(p): () def p_list_of_port_declarations_4(p): '''list_of_port_declarations : list_of_port_declarations ',' ''' - print(p) + print('list_of_port_declarations', list(p)) # { # yyerror(@2, "error: NULL port declarations are not " # "allowed."); @@ -4640,7 +4656,7 @@ def p_list_of_port_declarations_4(p): () def p_list_of_port_declarations_5(p): '''list_of_port_declarations : list_of_port_declarations ';' ''' - print(p) + print('list_of_port_declarations', list(p)) # { # yyerror(@2, "error: ';' is an invalid port declaration " # "separator."); @@ -4648,7 +4664,7 @@ def p_list_of_port_declarations_5(p): () def p_port_declaration_1(p): '''port_declaration : attribute_list_opt K_input net_type_opt data_type_or_implicit IDENTIFIER dimensions_opt ''' - print(p) + print('port_declaration', list(p)) # { Module::port_t*ptmp; # perm_string name = lex_strings.make($5); # data_type_t*use_type = $4; @@ -4664,7 +4680,7 @@ def p_port_declaration_1(p): () def p_port_declaration_2(p): '''port_declaration : attribute_list_opt K_input K_wreal IDENTIFIER ''' - print(p) + print('port_declaration', list(p)) # { Module::port_t*ptmp; # perm_string name = lex_strings.make($4); # ptmp = pform_module_port_reference(name, @2.text, @@ -4682,7 +4698,7 @@ def p_port_declaration_2(p): () def p_port_declaration_3(p): '''port_declaration : attribute_list_opt K_inout net_type_opt data_type_or_implicit IDENTIFIER dimensions_opt ''' - print(p) + print('port_declaration', list(p)) # { Module::port_t*ptmp; # perm_string name = lex_strings.make($5); # ptmp = pform_module_port_reference(name, @2.text, @2.first_line); @@ -4700,7 +4716,7 @@ def p_port_declaration_3(p): () def p_port_declaration_4(p): '''port_declaration : attribute_list_opt K_inout K_wreal IDENTIFIER ''' - print(p) + print('port_declaration', list(p)) # { Module::port_t*ptmp; # perm_string name = lex_strings.make($4); # ptmp = pform_module_port_reference(name, @2.text, @@ -4718,7 +4734,7 @@ def p_port_declaration_4(p): () def p_port_declaration_5(p): '''port_declaration : attribute_list_opt K_output net_type_opt data_type_or_implicit IDENTIFIER dimensions_opt ''' - print(p) + print('port_declaration', list(p)) # { Module::port_t*ptmp; # perm_string name = lex_strings.make($5); # data_type_t*use_dtype = $4; @@ -4757,7 +4773,7 @@ def p_port_declaration_5(p): () def p_port_declaration_6(p): '''port_declaration : attribute_list_opt K_output K_wreal IDENTIFIER ''' - print(p) + print('port_declaration', list(p)) # { Module::port_t*ptmp; # perm_string name = lex_strings.make($4); # ptmp = pform_module_port_reference(name, @2.text, @@ -4775,7 +4791,7 @@ def p_port_declaration_6(p): () def p_port_declaration_7(p): '''port_declaration : attribute_list_opt K_output net_type_opt data_type_or_implicit IDENTIFIER '=' expression ''' - print(p) + print('port_declaration', list(p)) # { Module::port_t*ptmp; # perm_string name = lex_strings.make($5); # NetNet::Type use_type = $3; @@ -4803,67 +4819,68 @@ def p_port_declaration_7(p): () def p_net_type_opt_1(p): '''net_type_opt : net_type ''' - print(p) + print('net_type_opt', list(p)) # { $$ = $1; } () def p_net_type_opt_2(p): '''net_type_opt : ''' - print(p) + print('net_type_opt', list(p)) # { $$ = NetNet::IMPLICIT; } () def p_unsigned_signed_opt_1(p): '''unsigned_signed_opt : K_signed ''' - print(p) + print('unsigned_signed_opt', list(p)) # { $$ = true; } () def p_unsigned_signed_opt_2(p): '''unsigned_signed_opt : K_unsigned ''' - print(p) + print('unsigned_signed_opt', list(p)) # { $$ = false; } () def p_unsigned_signed_opt_3(p): '''unsigned_signed_opt : ''' - print(p) + print('unsigned_signed_opt', list(p)) # { $$ = false; } () def p_signed_unsigned_opt_1(p): '''signed_unsigned_opt : K_signed ''' - print(p) + print('signed_unsigned_opt', list(p)) # { $$ = true; } () def p_signed_unsigned_opt_2(p): '''signed_unsigned_opt : K_unsigned ''' - print(p) + print('signed_unsigned_opt', list(p)) # { $$ = false; } () def p_signed_unsigned_opt_3(p): '''signed_unsigned_opt : ''' - print(p) + print('signed_unsigned_opt', list(p)) # { $$ = true; } () def p_atom2_type_1(p): '''atom2_type : K_byte ''' - print(p) + print('atom2_type', list(p)) # { $$ = 8; } () def p_atom2_type_2(p): '''atom2_type : K_shortint ''' - print(p) + print('atom2_type', list(p)) # { $$ = 16; } () def p_atom2_type_3(p): '''atom2_type : K_int ''' - print(p) + print('atom2_type', list(p)) # { $$ = 32; } () def p_atom2_type_4(p): '''atom2_type : K_longint ''' - print(p) + print('atom2_type', list(p)) # { $$ = 64; } () def p_lpvalue_1(p): '''lpvalue : hierarchy_identifier ''' - print(p) + print('lpvalue', list(p)) + p[0] = p[1] # { PEIdent*tmp = pform_new_ident(*$1); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -4872,7 +4889,7 @@ def p_lpvalue_1(p): () def p_lpvalue_2(p): '''lpvalue : implicit_class_handle '.' hierarchy_identifier ''' - print(p) + print('lpvalue', list(p)) # { pform_name_t*t_name = $1; # while (!$3->empty()) { # t_name->push_back($3->front()); @@ -4887,7 +4904,7 @@ def p_lpvalue_2(p): () def p_lpvalue_3(p): '''lpvalue : '{' expression_list_proper '}' ''' - print(p) + print('lpvalue', list(p)) # { PEConcat*tmp = new PEConcat(*$2); # FILE_NAME(tmp, @1); # delete $2; @@ -4896,14 +4913,14 @@ def p_lpvalue_3(p): () def p_lpvalue_4(p): '''lpvalue : streaming_concatenation ''' - print(p) + print('lpvalue', list(p)) # { yyerror(@1, "sorry: streaming concatenation not supported in l-values."); # $$ = 0; # } () def p_cont_assign_1(p): '''cont_assign : lpvalue '=' expression ''' - print(p) + print('cont_assign', list(p)) # { list*tmp = new list; # tmp->push_back($1); # tmp->push_back($3); @@ -4912,7 +4929,7 @@ def p_cont_assign_1(p): () def p_cont_assign_list_1(p): '''cont_assign_list : cont_assign_list ',' cont_assign ''' - print(p) + print('cont_assign_list', list(p)) # { list*tmp = $1; # tmp->splice(tmp->end(), *$3); # delete $3; @@ -4921,12 +4938,12 @@ def p_cont_assign_list_1(p): () def p_cont_assign_list_2(p): '''cont_assign_list : cont_assign ''' - print(p) + print('cont_assign_list', list(p)) # { $$ = $1; } () def p_module_1(p): '''module : attribute_list_opt module_start lifetime_opt IDENTIFIER _embed0_module module_package_import_list_opt module_parameter_port_list_opt module_port_list_opt module_attribute_foreign ';' _embed1_module timeunits_declaration_opt _embed2_module module_item_list_opt module_end _embed3_module endlabel_opt ''' - print(p) + print('module', list(p)) # { // Last step: check any closing name. This is done late so # // that the parser can look ahead to detect the present # // endlabel_opt but still have the pform_endmodule() called @@ -5012,77 +5029,77 @@ def p__embed3_module(p): () def p_module_start_1(p): '''module_start : K_module ''' - print(p) + print('module_start', list(p)) # { $$ = K_module; } () def p_module_start_2(p): '''module_start : K_macromodule ''' - print(p) + print('module_start', list(p)) # { $$ = K_module; } () def p_module_start_3(p): '''module_start : K_program ''' - print(p) + print('module_start', list(p)) # { $$ = K_program; } () def p_module_start_4(p): '''module_start : K_interface ''' - print(p) + print('module_start', list(p)) # { $$ = K_interface; } () def p_module_end_1(p): '''module_end : K_endmodule ''' - print(p) + print('module_end', list(p)) # { $$ = K_module; } () def p_module_end_2(p): '''module_end : K_endprogram ''' - print(p) + print('module_end', list(p)) # { $$ = K_program; } () def p_module_end_3(p): '''module_end : K_endinterface ''' - print(p) + print('module_end', list(p)) # { $$ = K_interface; } () def p_endlabel_opt_1(p): '''endlabel_opt : ':' IDENTIFIER ''' - print(p) + print('endlabel_opt', list(p)) # { $$ = $2; } () def p_endlabel_opt_2(p): '''endlabel_opt : ''' - print(p) + print('endlabel_opt', list(p)) # { $$ = 0; } () def p_module_attribute_foreign_1(p): '''module_attribute_foreign : K_PSTAR IDENTIFIER K_integer IDENTIFIER '=' STRING ';' K_STARP ''' - print(p) + print('module_attribute_foreign', list(p)) # { $$ = 0; } () def p_module_attribute_foreign_2(p): '''module_attribute_foreign : ''' - print(p) + print('module_attribute_foreign', list(p)) # { $$ = 0; } () def p_module_port_list_opt_1(p): '''module_port_list_opt : '(' list_of_ports ')' ''' - print(p) + print('module_port_list_opt', list(p)) # { $$ = $2; } () def p_module_port_list_opt_2(p): '''module_port_list_opt : '(' list_of_port_declarations ')' ''' - print(p) + print('module_port_list_opt', list(p)) # { $$ = $2; } () def p_module_port_list_opt_3(p): '''module_port_list_opt : ''' - print(p) + print('module_port_list_opt', list(p)) # { $$ = 0; } () def p_module_port_list_opt_4(p): '''module_port_list_opt : '(' error ')' ''' - print(p) + print('module_port_list_opt', list(p)) # { yyerror(@2, "Errors in port declarations."); # yyerrok; # $$ = 0; @@ -5090,31 +5107,31 @@ def p_module_port_list_opt_4(p): () def p_module_parameter_port_list_opt_1(p): '''module_parameter_port_list_opt : ''' - print(p) + print('module_parameter_port_list_opt', list(p)) () def p_module_parameter_port_list_opt_2(p): '''module_parameter_port_list_opt : '#' '(' module_parameter_port_list ')' ''' - print(p) + print('module_parameter_port_list_opt', list(p)) () def p_module_parameter_port_list_1(p): '''module_parameter_port_list : K_parameter param_type parameter_assign ''' - print(p) + print('module_parameter_port_list', list(p)) () def p_module_parameter_port_list_2(p): '''module_parameter_port_list : module_parameter_port_list ',' parameter_assign ''' - print(p) + print('module_parameter_port_list', list(p)) () def p_module_parameter_port_list_3(p): '''module_parameter_port_list : module_parameter_port_list ',' K_parameter param_type parameter_assign ''' - print(p) + print('module_parameter_port_list', list(p)) () def p_module_item_1(p): '''module_item : module ''' - print(p) + print('module_item', list(p)) () def p_module_item_2(p): '''module_item : attribute_list_opt net_type data_type_or_implicit delay3_opt net_variable_list ';' ''' - print(p) + print('module_item', list(p)) # { data_type_t*data_type = $3; # if (data_type == 0) { # data_type = new vector_type_t(IVL_VT_LOGIC, false, 0); @@ -5130,7 +5147,7 @@ def p_module_item_2(p): () def p_module_item_3(p): '''module_item : attribute_list_opt K_wreal delay3 net_variable_list ';' ''' - print(p) + print('module_item', list(p)) # { real_type_t*tmpt = new real_type_t(real_type_t::REAL); # pform_set_data_type(@2, tmpt, $4, NetNet::WIRE, $1); # if ($3 != 0) { @@ -5142,7 +5159,7 @@ def p_module_item_3(p): () def p_module_item_4(p): '''module_item : attribute_list_opt K_wreal net_variable_list ';' ''' - print(p) + print('module_item', list(p)) # { real_type_t*tmpt = new real_type_t(real_type_t::REAL); # pform_set_data_type(@2, tmpt, $3, NetNet::WIRE, $1); # delete $1; @@ -5150,7 +5167,7 @@ def p_module_item_4(p): () def p_module_item_5(p): '''module_item : attribute_list_opt net_type data_type_or_implicit delay3_opt net_decl_assigns ';' ''' - print(p) + print('module_item', list(p)) # { data_type_t*data_type = $3; # if (data_type == 0) { # data_type = new vector_type_t(IVL_VT_LOGIC, false, 0); @@ -5166,7 +5183,7 @@ def p_module_item_5(p): () def p_module_item_6(p): '''module_item : attribute_list_opt net_type data_type_or_implicit drive_strength net_decl_assigns ';' ''' - print(p) + print('module_item', list(p)) # { data_type_t*data_type = $3; # if (data_type == 0) { # data_type = new vector_type_t(IVL_VT_LOGIC, false, 0); @@ -5182,7 +5199,7 @@ def p_module_item_6(p): () def p_module_item_7(p): '''module_item : attribute_list_opt K_wreal net_decl_assigns ';' ''' - print(p) + print('module_item', list(p)) # { real_type_t*data_type = new real_type_t(real_type_t::REAL); # pform_makewire(@2, 0, str_strength, $3, NetNet::WIRE, data_type); # if ($1) { @@ -5194,7 +5211,7 @@ def p_module_item_7(p): () def p_module_item_8(p): '''module_item : K_trireg charge_strength_opt dimensions_opt delay3_opt list_of_identifiers ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@1, "sorry: trireg nets not supported."); # delete $3; # delete $4; @@ -5202,19 +5219,19 @@ def p_module_item_8(p): () def p_module_item_9(p): '''module_item : attribute_list_opt port_direction net_type data_type_or_implicit list_of_port_identifiers ';' ''' - print(p) + print('module_item', list(p)) # { pform_module_define_port(@2, $5, $2, $3, $4, $1); } () def p_module_item_10(p): '''module_item : attribute_list_opt port_direction K_wreal list_of_port_identifiers ';' ''' - print(p) + print('module_item', list(p)) # { real_type_t*real_type = new real_type_t(real_type_t::REAL); # pform_module_define_port(@2, $4, $2, NetNet::WIRE, real_type, $1); # } () def p_module_item_11(p): '''module_item : attribute_list_opt K_inout data_type_or_implicit list_of_port_identifiers ';' ''' - print(p) + print('module_item', list(p)) # { NetNet::Type use_type = $3 ? NetNet::IMPLICIT : NetNet::NONE; # if (vector_type_t*dtype = dynamic_cast ($3)) { # if (dtype->implicit_flag) @@ -5228,7 +5245,7 @@ def p_module_item_11(p): () def p_module_item_12(p): '''module_item : attribute_list_opt K_input data_type_or_implicit list_of_port_identifiers ';' ''' - print(p) + print('module_item', list(p)) # { NetNet::Type use_type = $3 ? NetNet::IMPLICIT : NetNet::NONE; # if (vector_type_t*dtype = dynamic_cast ($3)) { # if (dtype->implicit_flag) @@ -5242,7 +5259,7 @@ def p_module_item_12(p): () def p_module_item_13(p): '''module_item : attribute_list_opt K_output data_type_or_implicit list_of_variable_port_identifiers ';' ''' - print(p) + print('module_item', list(p)) # { NetNet::Type use_type = $3 ? NetNet::IMPLICIT : NetNet::NONE; # if (vector_type_t*dtype = dynamic_cast ($3)) { # if (dtype->implicit_flag) @@ -5272,7 +5289,7 @@ def p_module_item_13(p): () def p_module_item_14(p): '''module_item : attribute_list_opt port_direction net_type data_type_or_implicit error ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@2, "error: Invalid variable list in port declaration."); # if ($1) delete $1; # if ($4) delete $4; @@ -5281,7 +5298,7 @@ def p_module_item_14(p): () def p_module_item_15(p): '''module_item : attribute_list_opt K_inout data_type_or_implicit error ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@2, "error: Invalid variable list in port declaration."); # if ($1) delete $1; # if ($3) delete $3; @@ -5290,7 +5307,7 @@ def p_module_item_15(p): () def p_module_item_16(p): '''module_item : attribute_list_opt K_input data_type_or_implicit error ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@2, "error: Invalid variable list in port declaration."); # if ($1) delete $1; # if ($3) delete $3; @@ -5299,7 +5316,7 @@ def p_module_item_16(p): () def p_module_item_17(p): '''module_item : attribute_list_opt K_output data_type_or_implicit error ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@2, "error: Invalid variable list in port declaration."); # if ($1) delete $1; # if ($3) delete $3; @@ -5308,93 +5325,93 @@ def p_module_item_17(p): () def p_module_item_18(p): '''module_item : DISCIPLINE_IDENTIFIER list_of_identifiers ';' ''' - print(p) + print('module_item', list(p)) # { pform_attach_discipline(@1, $1, $2); } () def p_module_item_19(p): '''module_item : attribute_list_opt _embed0_module_item block_item_decl ''' - print(p) + print('module_item', list(p)) # { delete attributes_in_context; # attributes_in_context = 0; # } () def p_module_item_20(p): '''module_item : K_defparam _embed1_module_item defparam_assign_list ';' ''' - print(p) + print('module_item', list(p)) () def p_module_item_21(p): '''module_item : attribute_list_opt gatetype gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@2, $2, str_strength, 0, $3, $1); } () def p_module_item_22(p): '''module_item : attribute_list_opt gatetype delay3 gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@2, $2, str_strength, $3, $4, $1); } () def p_module_item_23(p): '''module_item : attribute_list_opt gatetype drive_strength gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@2, $2, $3, 0, $4, $1); } () def p_module_item_24(p): '''module_item : attribute_list_opt gatetype drive_strength delay3 gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@2, $2, $3, $4, $5, $1); } () def p_module_item_25(p): '''module_item : attribute_list_opt switchtype gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@2, $2, str_strength, 0, $3, $1); } () def p_module_item_26(p): '''module_item : attribute_list_opt switchtype delay3 gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@2, $2, str_strength, $3, $4, $1); } () def p_module_item_27(p): '''module_item : K_pullup gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@1, PGBuiltin::PULLUP, pull_strength, 0, $2, 0); } () def p_module_item_28(p): '''module_item : K_pulldown gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@1, PGBuiltin::PULLDOWN, pull_strength, 0, $2, 0); } () def p_module_item_29(p): '''module_item : K_pullup '(' dr_strength1 ')' gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@1, PGBuiltin::PULLUP, $3, 0, $5, 0); } () def p_module_item_30(p): '''module_item : K_pullup '(' dr_strength1 ',' dr_strength0 ')' gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@1, PGBuiltin::PULLUP, $3, 0, $7, 0); } () def p_module_item_31(p): '''module_item : K_pullup '(' dr_strength0 ',' dr_strength1 ')' gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@1, PGBuiltin::PULLUP, $5, 0, $7, 0); } () def p_module_item_32(p): '''module_item : K_pulldown '(' dr_strength0 ')' gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@1, PGBuiltin::PULLDOWN, $3, 0, $5, 0); } () def p_module_item_33(p): '''module_item : K_pulldown '(' dr_strength1 ',' dr_strength0 ')' gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@1, PGBuiltin::PULLDOWN, $5, 0, $7, 0); } () def p_module_item_34(p): '''module_item : K_pulldown '(' dr_strength0 ',' dr_strength1 ')' gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_makegates(@1, PGBuiltin::PULLDOWN, $3, 0, $7, 0); } () def p_module_item_35(p): '''module_item : attribute_list_opt IDENTIFIER parameter_value_opt gate_instance_list ';' ''' - print(p) + print('module_item', list(p)) # { perm_string tmp1 = lex_strings.make($2); # pform_make_modgates(@2, tmp1, $3, $4, $1); # delete[]$2; @@ -5402,7 +5419,7 @@ def p_module_item_35(p): () def p_module_item_36(p): '''module_item : attribute_list_opt IDENTIFIER parameter_value_opt error ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@2, "error: Invalid module instantiation"); # delete[]$2; # if ($1) delete $1; @@ -5410,79 +5427,79 @@ def p_module_item_36(p): () def p_module_item_37(p): '''module_item : K_assign drive_strength_opt delay3_opt cont_assign_list ';' ''' - print(p) + print('module_item', list(p)) # { pform_make_pgassign_list($4, $3, $2, @1.text, @1.first_line); } () def p_module_item_38(p): '''module_item : attribute_list_opt K_always statement_item ''' - print(p) + print('module_item', list(p)) # { PProcess*tmp = pform_make_behavior(IVL_PR_ALWAYS, $3, $1); # FILE_NAME(tmp, @2); # } () def p_module_item_39(p): '''module_item : attribute_list_opt K_always_comb statement_item ''' - print(p) + print('module_item', list(p)) # { PProcess*tmp = pform_make_behavior(IVL_PR_ALWAYS_COMB, $3, $1); # FILE_NAME(tmp, @2); # } () def p_module_item_40(p): '''module_item : attribute_list_opt K_always_ff statement_item ''' - print(p) + print('module_item', list(p)) # { PProcess*tmp = pform_make_behavior(IVL_PR_ALWAYS_FF, $3, $1); # FILE_NAME(tmp, @2); # } () def p_module_item_41(p): '''module_item : attribute_list_opt K_always_latch statement_item ''' - print(p) + print('module_item', list(p)) # { PProcess*tmp = pform_make_behavior(IVL_PR_ALWAYS_LATCH, $3, $1); # FILE_NAME(tmp, @2); # } () def p_module_item_42(p): '''module_item : attribute_list_opt K_initial statement_item ''' - print(p) + print('module_item', list(p)) # { PProcess*tmp = pform_make_behavior(IVL_PR_INITIAL, $3, $1); # FILE_NAME(tmp, @2); # } () def p_module_item_43(p): '''module_item : attribute_list_opt K_final statement_item ''' - print(p) + print('module_item', list(p)) # { PProcess*tmp = pform_make_behavior(IVL_PR_FINAL, $3, $1); # FILE_NAME(tmp, @2); # } () def p_module_item_44(p): '''module_item : attribute_list_opt K_analog analog_statement ''' - print(p) + print('module_item', list(p)) # { pform_make_analog_behavior(@2, IVL_PR_ALWAYS, $3); } () def p_module_item_45(p): '''module_item : attribute_list_opt assertion_item ''' - print(p) + print('module_item', list(p)) () def p_module_item_46(p): '''module_item : timeunits_declaration ''' - print(p) + print('module_item', list(p)) () def p_module_item_47(p): '''module_item : class_declaration ''' - print(p) + print('module_item', list(p)) () def p_module_item_48(p): '''module_item : task_declaration ''' - print(p) + print('module_item', list(p)) () def p_module_item_49(p): '''module_item : function_declaration ''' - print(p) + print('module_item', list(p)) () def p_module_item_50(p): '''module_item : K_generate generate_item_list_opt K_endgenerate ''' - print(p) + print('module_item', list(p)) # { // Test for bad nesting. I understand it, but it is illegal. # if (pform_parent_generate()) { # cerr << @1 << ": error: Generate/endgenerate regions cannot nest." << endl; @@ -5494,62 +5511,62 @@ def p_module_item_50(p): () def p_module_item_51(p): '''module_item : K_genvar list_of_identifiers ';' ''' - print(p) + print('module_item', list(p)) # { pform_genvars(@1, $2); } () def p_module_item_52(p): '''module_item : K_for '(' IDENTIFIER '=' expression ';' expression ';' IDENTIFIER '=' expression ')' _embed2_module_item generate_block ''' - print(p) + print('module_item', list(p)) # { pform_endgenerate(); } () def p_module_item_53(p): '''module_item : generate_if generate_block_opt K_else _embed3_module_item generate_block ''' - print(p) + print('module_item', list(p)) # { pform_endgenerate(); } () def p_module_item_54(p): '''module_item : generate_if generate_block_opt %prec less_than_K_else ''' - print(p) + print('module_item', list(p)) # { pform_endgenerate(); } () def p_module_item_55(p): '''module_item : K_case '(' expression ')' _embed4_module_item generate_case_items K_endcase ''' - print(p) + print('module_item', list(p)) # { pform_endgenerate(); } () def p_module_item_56(p): '''module_item : modport_declaration ''' - print(p) + print('module_item', list(p)) () def p_module_item_57(p): '''module_item : package_import_declaration ''' - print(p) + print('module_item', list(p)) () def p_module_item_58(p): '''module_item : attribute_list_opt K_specparam _embed5_module_item specparam_decl ';' ''' - print(p) + print('module_item', list(p)) () def p_module_item_59(p): '''module_item : K_specify _embed6_module_item specify_item_list_opt K_endspecify ''' - print(p) + print('module_item', list(p)) () def p_module_item_60(p): '''module_item : K_specify error K_endspecify ''' - print(p) + print('module_item', list(p)) # { yyerror(@1, "error: syntax error in specify block"); # yyerrok; # } () def p_module_item_61(p): '''module_item : error ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@2, "error: invalid module item."); # yyerrok; # } () def p_module_item_62(p): '''module_item : K_assign error '=' expression ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@1, "error: syntax error in left side " # "of continuous assignment."); # yyerrok; @@ -5557,7 +5574,7 @@ def p_module_item_62(p): () def p_module_item_63(p): '''module_item : K_assign error ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@1, "error: syntax error in " # "continuous assignment"); # yyerrok; @@ -5565,7 +5582,7 @@ def p_module_item_63(p): () def p_module_item_64(p): '''module_item : K_function error K_endfunction endlabel_opt ''' - print(p) + print('module_item', list(p)) # { yyerror(@1, "error: I give up on this " # "function definition."); # if ($4) { @@ -5580,7 +5597,7 @@ def p_module_item_64(p): () def p_module_item_65(p): '''module_item : KK_attribute '(' IDENTIFIER ',' STRING ',' STRING ')' ';' ''' - print(p) + print('module_item', list(p)) # { perm_string tmp3 = lex_strings.make($3); # perm_string tmp5 = lex_strings.make($5); # pform_set_attrib(tmp3, tmp5, $7); @@ -5590,7 +5607,7 @@ def p_module_item_65(p): () def p_module_item_66(p): '''module_item : KK_attribute '(' error ')' ';' ''' - print(p) + print('module_item', list(p)) # { yyerror(@1, "error: Malformed $attribute parameter list."); } () def p__embed0_module_item(p): @@ -5632,41 +5649,41 @@ def p__embed6_module_item(p): () def p_module_item_list_1(p): '''module_item_list : module_item_list module_item ''' - print(p) + print('module_item_list', list(p)) () def p_module_item_list_2(p): '''module_item_list : module_item ''' - print(p) + print('module_item_list', list(p)) () def p_module_item_list_opt_1(p): '''module_item_list_opt : module_item_list ''' - print(p) + print('module_item_list_opt', list(p)) () def p_module_item_list_opt_2(p): '''module_item_list_opt : ''' - print(p) + print('module_item_list_opt', list(p)) () def p_generate_if_1(p): '''generate_if : K_if '(' expression ')' ''' - print(p) + print('generate_if', list(p)) # { pform_start_generate_if(@1, $3); } () def p_generate_case_items_1(p): '''generate_case_items : generate_case_items generate_case_item ''' - print(p) + print('generate_case_items', list(p)) () def p_generate_case_items_2(p): '''generate_case_items : generate_case_item ''' - print(p) + print('generate_case_items', list(p)) () def p_generate_case_item_1(p): '''generate_case_item : expression_list_proper ':' _embed0_generate_case_item generate_block_opt ''' - print(p) + print('generate_case_item', list(p)) # { pform_endgenerate(); } () def p_generate_case_item_2(p): '''generate_case_item : K_default ':' _embed1_generate_case_item generate_block_opt ''' - print(p) + print('generate_case_item', list(p)) # { pform_endgenerate(); } () def p__embed0_generate_case_item(p): @@ -5679,11 +5696,11 @@ def p__embed1_generate_case_item(p): () def p_generate_item_1(p): '''generate_item : module_item ''' - print(p) + print('generate_item', list(p)) () def p_generate_item_2(p): '''generate_item : K_begin generate_item_list_opt K_end ''' - print(p) + print('generate_item', list(p)) # { /* Detect and warn about anachronistic begin/end use */ # if (generation_flag > GN_VER2001 && warn_anachronisms) { # warn_count += 1; @@ -5693,7 +5710,7 @@ def p_generate_item_2(p): () def p_generate_item_3(p): '''generate_item : K_begin ':' IDENTIFIER _embed0_generate_item generate_item_list_opt K_end ''' - print(p) + print('generate_item', list(p)) # { /* Detect and warn about anachronistic named begin/end use */ # if (generation_flag > GN_VER2001 && warn_anachronisms) { # warn_count += 1; @@ -5710,31 +5727,31 @@ def p__embed0_generate_item(p): () def p_generate_item_list_1(p): '''generate_item_list : generate_item_list generate_item ''' - print(p) + print('generate_item_list', list(p)) () def p_generate_item_list_2(p): '''generate_item_list : generate_item ''' - print(p) + print('generate_item_list', list(p)) () def p_generate_item_list_opt_1(p): '''generate_item_list_opt : generate_item_list ''' - print(p) + print('generate_item_list_opt', list(p)) () def p_generate_item_list_opt_2(p): '''generate_item_list_opt : ''' - print(p) + print('generate_item_list_opt', list(p)) () def p_generate_block_1(p): '''generate_block : module_item ''' - print(p) + print('generate_block', list(p)) () def p_generate_block_2(p): '''generate_block : K_begin generate_item_list_opt K_end ''' - print(p) + print('generate_block', list(p)) () def p_generate_block_3(p): '''generate_block : K_begin ':' IDENTIFIER generate_item_list_opt K_end endlabel_opt ''' - print(p) + print('generate_block', list(p)) # { pform_generate_block_name($3); # if ($6) { # if (strcmp($3,$6) != 0) { @@ -5752,15 +5769,15 @@ def p_generate_block_3(p): () def p_generate_block_opt_1(p): '''generate_block_opt : generate_block ''' - print(p) + print('generate_block_opt', list(p)) () def p_generate_block_opt_2(p): '''generate_block_opt : ';' ''' - print(p) + print('generate_block_opt', list(p)) () def p_net_decl_assign_1(p): '''net_decl_assign : IDENTIFIER '=' expression ''' - print(p) + print('net_decl_assign', list(p)) # { net_decl_assign_t*tmp = new net_decl_assign_t; # tmp->next = tmp; # tmp->name = lex_strings.make($1); @@ -5771,7 +5788,7 @@ def p_net_decl_assign_1(p): () def p_net_decl_assigns_1(p): '''net_decl_assigns : net_decl_assigns ',' net_decl_assign ''' - print(p) + print('net_decl_assigns', list(p)) # { net_decl_assign_t*tmp = $1; # $3->next = tmp->next; # tmp->next = $3; @@ -5780,87 +5797,87 @@ def p_net_decl_assigns_1(p): () def p_net_decl_assigns_2(p): '''net_decl_assigns : net_decl_assign ''' - print(p) + print('net_decl_assigns', list(p)) # { $$ = $1; # } () def p_bit_logic_1(p): '''bit_logic : K_logic ''' - print(p) + print('bit_logic', list(p)) # { $$ = IVL_VT_LOGIC; } () def p_bit_logic_2(p): '''bit_logic : K_bool ''' - print(p) + print('bit_logic', list(p)) # { $$ = IVL_VT_BOOL; /* Icarus misc */} () def p_bit_logic_3(p): '''bit_logic : K_bit ''' - print(p) + print('bit_logic', list(p)) # { $$ = IVL_VT_BOOL; /* IEEE1800 / IEEE1364-2009 */} () def p_bit_logic_opt_1(p): '''bit_logic_opt : bit_logic ''' - print(p) + print('bit_logic_opt', list(p)) () def p_bit_logic_opt_2(p): '''bit_logic_opt : ''' - print(p) + print('bit_logic_opt', list(p)) # { $$ = IVL_VT_NO_TYPE; } () def p_net_type_1(p): '''net_type : K_wire ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::WIRE; } () def p_net_type_2(p): '''net_type : K_tri ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::TRI; } () def p_net_type_3(p): '''net_type : K_tri1 ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::TRI1; } () def p_net_type_4(p): '''net_type : K_supply0 ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::SUPPLY0; } () def p_net_type_5(p): '''net_type : K_wand ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::WAND; } () def p_net_type_6(p): '''net_type : K_triand ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::TRIAND; } () def p_net_type_7(p): '''net_type : K_tri0 ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::TRI0; } () def p_net_type_8(p): '''net_type : K_supply1 ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::SUPPLY1; } () def p_net_type_9(p): '''net_type : K_wor ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::WOR; } () def p_net_type_10(p): '''net_type : K_trior ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::TRIOR; } () def p_net_type_11(p): '''net_type : K_wone ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::UNRESOLVED_WIRE; # cerr << @1.text << ":" << @1.first_line << ": warning: " # "'wone' is deprecated, please use 'uwire' " @@ -5869,12 +5886,12 @@ def p_net_type_11(p): () def p_net_type_12(p): '''net_type : K_uwire ''' - print(p) + print('net_type', list(p)) # { $$ = NetNet::UNRESOLVED_WIRE; } () def p_param_type_1(p): '''param_type : bit_logic_opt unsigned_signed_opt dimensions_opt ''' - print(p) + print('param_type', list(p)) # { param_active_range = $3; # param_active_signed = $2; # if (($1 == IVL_VT_NO_TYPE) && ($3 != 0)) @@ -5885,7 +5902,7 @@ def p_param_type_1(p): () def p_param_type_2(p): '''param_type : K_integer ''' - print(p) + print('param_type', list(p)) # { param_active_range = make_range_from_width(integer_width); # param_active_signed = true; # param_active_type = IVL_VT_LOGIC; @@ -5893,7 +5910,7 @@ def p_param_type_2(p): () def p_param_type_3(p): '''param_type : K_time ''' - print(p) + print('param_type', list(p)) # { param_active_range = make_range_from_width(64); # param_active_signed = false; # param_active_type = IVL_VT_LOGIC; @@ -5901,7 +5918,7 @@ def p_param_type_3(p): () def p_param_type_4(p): '''param_type : real_or_realtime ''' - print(p) + print('param_type', list(p)) # { param_active_range = 0; # param_active_signed = true; # param_active_type = IVL_VT_REAL; @@ -5909,7 +5926,7 @@ def p_param_type_4(p): () def p_param_type_5(p): '''param_type : atom2_type ''' - print(p) + print('param_type', list(p)) # { param_active_range = make_range_from_width($1); # param_active_signed = true; # param_active_type = IVL_VT_BOOL; @@ -5917,7 +5934,7 @@ def p_param_type_5(p): () def p_param_type_6(p): '''param_type : TYPE_IDENTIFIER ''' - print(p) + print('param_type', list(p)) # { pform_set_param_from_type(@1, $1.type, $1.text, param_active_range, # param_active_signed, param_active_type); # delete[]$1.text; @@ -5925,23 +5942,23 @@ def p_param_type_6(p): () def p_parameter_assign_list_1(p): '''parameter_assign_list : parameter_assign ''' - print(p) + print('parameter_assign_list', list(p)) () def p_parameter_assign_list_2(p): '''parameter_assign_list : parameter_assign_list ',' parameter_assign ''' - print(p) + print('parameter_assign_list', list(p)) () def p_localparam_assign_list_1(p): '''localparam_assign_list : localparam_assign ''' - print(p) + print('localparam_assign_list', list(p)) () def p_localparam_assign_list_2(p): '''localparam_assign_list : localparam_assign_list ',' localparam_assign ''' - print(p) + print('localparam_assign_list', list(p)) () def p_parameter_assign_1(p): '''parameter_assign : IDENTIFIER '=' expression parameter_value_ranges_opt ''' - print(p) + print('parameter_assign', list(p)) # { PExpr*tmp = $3; # pform_set_parameter(@1, lex_strings.make($1), param_active_type, # param_active_signed, param_active_range, tmp, $4); @@ -5950,7 +5967,7 @@ def p_parameter_assign_1(p): () def p_localparam_assign_1(p): '''localparam_assign : IDENTIFIER '=' expression ''' - print(p) + print('localparam_assign', list(p)) # { PExpr*tmp = $3; # pform_set_localparam(@1, lex_strings.make($1), param_active_type, # param_active_signed, param_active_range, tmp); @@ -5959,82 +5976,82 @@ def p_localparam_assign_1(p): () def p_parameter_value_ranges_opt_1(p): '''parameter_value_ranges_opt : parameter_value_ranges ''' - print(p) + print('parameter_value_ranges_opt', list(p)) # { $$ = $1; } () def p_parameter_value_ranges_opt_2(p): '''parameter_value_ranges_opt : ''' - print(p) + print('parameter_value_ranges_opt', list(p)) # { $$ = 0; } () def p_parameter_value_ranges_1(p): '''parameter_value_ranges : parameter_value_ranges parameter_value_range ''' - print(p) + print('parameter_value_ranges', list(p)) # { $$ = $2; $$->next = $1; } () def p_parameter_value_ranges_2(p): '''parameter_value_ranges : parameter_value_range ''' - print(p) + print('parameter_value_ranges', list(p)) # { $$ = $1; $$->next = 0; } () def p_parameter_value_range_1(p): '''parameter_value_range : from_exclude '[' value_range_expression ':' value_range_expression ']' ''' - print(p) + print('parameter_value_range', list(p)) # { $$ = pform_parameter_value_range($1, false, $3, false, $5); } () def p_parameter_value_range_2(p): '''parameter_value_range : from_exclude '[' value_range_expression ':' value_range_expression ')' ''' - print(p) + print('parameter_value_range', list(p)) # { $$ = pform_parameter_value_range($1, false, $3, true, $5); } () def p_parameter_value_range_3(p): '''parameter_value_range : from_exclude '(' value_range_expression ':' value_range_expression ']' ''' - print(p) + print('parameter_value_range', list(p)) # { $$ = pform_parameter_value_range($1, true, $3, false, $5); } () def p_parameter_value_range_4(p): '''parameter_value_range : from_exclude '(' value_range_expression ':' value_range_expression ')' ''' - print(p) + print('parameter_value_range', list(p)) # { $$ = pform_parameter_value_range($1, true, $3, true, $5); } () def p_parameter_value_range_5(p): '''parameter_value_range : K_exclude expression ''' - print(p) + print('parameter_value_range', list(p)) # { $$ = pform_parameter_value_range(true, false, $2, false, $2); } () def p_value_range_expression_1(p): '''value_range_expression : expression ''' - print(p) + print('value_range_expression', list(p)) # { $$ = $1; } () def p_value_range_expression_2(p): '''value_range_expression : K_inf ''' - print(p) + print('value_range_expression', list(p)) # { $$ = 0; } () def p_value_range_expression_3(p): '''value_range_expression : '+' K_inf ''' - print(p) + print('value_range_expression', list(p)) # { $$ = 0; } () def p_value_range_expression_4(p): '''value_range_expression : '-' K_inf ''' - print(p) + print('value_range_expression', list(p)) # { $$ = 0; } () def p_from_exclude_1(p): '''from_exclude : K_from ''' - print(p) + print('from_exclude', list(p)) # { $$ = false; } () def p_from_exclude_2(p): '''from_exclude : K_exclude ''' - print(p) + print('from_exclude', list(p)) # { $$ = true; } () def p_parameter_value_opt_1(p): '''parameter_value_opt : '#' '(' expression_list_with_nuls ')' ''' - print(p) + print('parameter_value_opt', list(p)) # { struct parmvalue_t*tmp = new struct parmvalue_t; # tmp->by_order = $3; # tmp->by_name = 0; @@ -6043,7 +6060,7 @@ def p_parameter_value_opt_1(p): () def p_parameter_value_opt_2(p): '''parameter_value_opt : '#' '(' parameter_value_byname_list ')' ''' - print(p) + print('parameter_value_opt', list(p)) # { struct parmvalue_t*tmp = new struct parmvalue_t; # tmp->by_order = 0; # tmp->by_name = $3; @@ -6052,7 +6069,7 @@ def p_parameter_value_opt_2(p): () def p_parameter_value_opt_3(p): '''parameter_value_opt : '#' DEC_NUMBER ''' - print(p) + print('parameter_value_opt', list(p)) # { assert($2); # PENumber*tmp = new PENumber($2); # FILE_NAME(tmp, @1); @@ -6067,7 +6084,7 @@ def p_parameter_value_opt_3(p): () def p_parameter_value_opt_4(p): '''parameter_value_opt : '#' REALTIME ''' - print(p) + print('parameter_value_opt', list(p)) # { assert($2); # PEFNumber*tmp = new PEFNumber($2); # FILE_NAME(tmp, @1); @@ -6081,7 +6098,7 @@ def p_parameter_value_opt_4(p): () def p_parameter_value_opt_5(p): '''parameter_value_opt : '#' error ''' - print(p) + print('parameter_value_opt', list(p)) # { yyerror(@1, "error: syntax error in parameter value " # "assignment list."); # $$ = 0; @@ -6089,12 +6106,12 @@ def p_parameter_value_opt_5(p): () def p_parameter_value_opt_6(p): '''parameter_value_opt : ''' - print(p) + print('parameter_value_opt', list(p)) # { $$ = 0; } () def p_parameter_value_byname_1(p): '''parameter_value_byname : '.' IDENTIFIER '(' expression ')' ''' - print(p) + print('parameter_value_byname', list(p)) # { named_pexpr_t*tmp = new named_pexpr_t; # tmp->name = lex_strings.make($2); # tmp->parm = $4; @@ -6104,7 +6121,7 @@ def p_parameter_value_byname_1(p): () def p_parameter_value_byname_2(p): '''parameter_value_byname : '.' IDENTIFIER '(' ')' ''' - print(p) + print('parameter_value_byname', list(p)) # { named_pexpr_t*tmp = new named_pexpr_t; # tmp->name = lex_strings.make($2); # tmp->parm = 0; @@ -6114,7 +6131,7 @@ def p_parameter_value_byname_2(p): () def p_parameter_value_byname_list_1(p): '''parameter_value_byname_list : parameter_value_byname ''' - print(p) + print('parameter_value_byname_list', list(p)) # { list*tmp = new list; # tmp->push_back(*$1); # delete $1; @@ -6123,7 +6140,7 @@ def p_parameter_value_byname_list_1(p): () def p_parameter_value_byname_list_2(p): '''parameter_value_byname_list : parameter_value_byname_list ',' parameter_value_byname ''' - print(p) + print('parameter_value_byname_list', list(p)) # { list*tmp = $1; # tmp->push_back(*$3); # delete $3; @@ -6132,12 +6149,12 @@ def p_parameter_value_byname_list_2(p): () def p_port_1(p): '''port : port_reference ''' - print(p) + print('port', list(p)) # { $$ = $1; } () def p_port_2(p): '''port : '.' IDENTIFIER '(' port_reference ')' ''' - print(p) + print('port', list(p)) # { Module::port_t*tmp = $4; # tmp->name = lex_strings.make($2); # delete[]$2; @@ -6146,7 +6163,7 @@ def p_port_2(p): () def p_port_3(p): '''port : '{' port_reference_list '}' ''' - print(p) + print('port', list(p)) # { Module::port_t*tmp = $2; # tmp->name = perm_string(); # $$ = tmp; @@ -6154,7 +6171,7 @@ def p_port_3(p): () def p_port_4(p): '''port : '.' IDENTIFIER '(' '{' port_reference_list '}' ')' ''' - print(p) + print('port', list(p)) # { Module::port_t*tmp = $5; # tmp->name = lex_strings.make($2); # delete[]$2; @@ -6163,17 +6180,17 @@ def p_port_4(p): () def p_port_opt_1(p): '''port_opt : port ''' - print(p) + print('port_opt', list(p)) # { $$ = $1; } () def p_port_opt_2(p): '''port_opt : ''' - print(p) + print('port_opt', list(p)) # { $$ = 0; } () def p_port_name_1(p): '''port_name : '.' IDENTIFIER '(' expression ')' ''' - print(p) + print('port_name', list(p)) # { named_pexpr_t*tmp = new named_pexpr_t; # tmp->name = lex_strings.make($2); # tmp->parm = $4; @@ -6183,7 +6200,7 @@ def p_port_name_1(p): () def p_port_name_2(p): '''port_name : '.' IDENTIFIER '(' error ')' ''' - print(p) + print('port_name', list(p)) # { yyerror(@3, "error: invalid port connection expression."); # named_pexpr_t*tmp = new named_pexpr_t; # tmp->name = lex_strings.make($2); @@ -6194,7 +6211,7 @@ def p_port_name_2(p): () def p_port_name_3(p): '''port_name : '.' IDENTIFIER '(' ')' ''' - print(p) + print('port_name', list(p)) # { named_pexpr_t*tmp = new named_pexpr_t; # tmp->name = lex_strings.make($2); # tmp->parm = 0; @@ -6204,7 +6221,7 @@ def p_port_name_3(p): () def p_port_name_4(p): '''port_name : '.' IDENTIFIER ''' - print(p) + print('port_name', list(p)) # { named_pexpr_t*tmp = new named_pexpr_t; # tmp->name = lex_strings.make($2); # tmp->parm = new PEIdent(lex_strings.make($2), true); @@ -6215,7 +6232,7 @@ def p_port_name_4(p): () def p_port_name_5(p): '''port_name : K_DOTSTAR ''' - print(p) + print('port_name', list(p)) # { named_pexpr_t*tmp = new named_pexpr_t; # tmp->name = lex_strings.make("*"); # tmp->parm = 0; @@ -6224,7 +6241,7 @@ def p_port_name_5(p): () def p_port_name_list_1(p): '''port_name_list : port_name_list ',' port_name ''' - print(p) + print('port_name_list', list(p)) # { list*tmp = $1; # tmp->push_back(*$3); # delete $3; @@ -6233,7 +6250,7 @@ def p_port_name_list_1(p): () def p_port_name_list_2(p): '''port_name_list : port_name ''' - print(p) + print('port_name_list', list(p)) # { list*tmp = new list; # tmp->push_back(*$1); # delete $1; @@ -6242,7 +6259,7 @@ def p_port_name_list_2(p): () def p_port_reference_1(p): '''port_reference : IDENTIFIER ''' - print(p) + print('port_reference', list(p)) # { Module::port_t*ptmp; # perm_string name = lex_strings.make($1); # ptmp = pform_module_port_reference(name, @1.text, @1.first_line); @@ -6252,7 +6269,7 @@ def p_port_reference_1(p): () def p_port_reference_2(p): '''port_reference : IDENTIFIER '[' expression ':' expression ']' ''' - print(p) + print('port_reference', list(p)) # { index_component_t itmp; # itmp.sel = index_component_t::SEL_PART; # itmp.msb = $3; @@ -6277,7 +6294,7 @@ def p_port_reference_2(p): () def p_port_reference_3(p): '''port_reference : IDENTIFIER '[' expression ']' ''' - print(p) + print('port_reference', list(p)) # { index_component_t itmp; # itmp.sel = index_component_t::SEL_BIT; # itmp.msb = $3; @@ -6301,7 +6318,7 @@ def p_port_reference_3(p): () def p_port_reference_4(p): '''port_reference : IDENTIFIER '[' error ']' ''' - print(p) + print('port_reference', list(p)) # { yyerror(@1, "error: invalid port bit select"); # Module::port_t*ptmp = new Module::port_t; # PEIdent*wtmp = new PEIdent(lex_strings.make($1)); @@ -6314,12 +6331,12 @@ def p_port_reference_4(p): () def p_port_reference_list_1(p): '''port_reference_list : port_reference ''' - print(p) + print('port_reference_list', list(p)) # { $$ = $1; } () def p_port_reference_list_2(p): '''port_reference_list : port_reference_list ',' port_reference ''' - print(p) + print('port_reference_list', list(p)) # { Module::port_t*tmp = $1; # append(tmp->expr, $3->expr); # delete $3; @@ -6328,22 +6345,22 @@ def p_port_reference_list_2(p): () def p_dimensions_opt_1(p): '''dimensions_opt : ''' - print(p) + print('dimensions_opt', list(p)) # { $$ = 0; } () def p_dimensions_opt_2(p): '''dimensions_opt : dimensions ''' - print(p) + print('dimensions_opt', list(p)) # { $$ = $1; } () def p_dimensions_1(p): '''dimensions : variable_dimension ''' - print(p) + print('dimensions', list(p)) # { $$ = $1; } () def p_dimensions_2(p): '''dimensions : dimensions variable_dimension ''' - print(p) + print('dimensions', list(p)) # { list *tmp = $1; # if ($2) { # tmp->splice(tmp->end(), *$2); @@ -6354,7 +6371,7 @@ def p_dimensions_2(p): () def p_register_variable_1(p): '''register_variable : IDENTIFIER dimensions_opt ''' - print(p) + print('register_variable', list(p)) # { perm_string name = lex_strings.make($1); # pform_makewire(@1, name, NetNet::REG, # NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0); @@ -6364,7 +6381,7 @@ def p_register_variable_1(p): () def p_register_variable_2(p): '''register_variable : IDENTIFIER dimensions_opt '=' expression ''' - print(p) + print('register_variable', list(p)) # { if (pform_peek_scope()->var_init_needs_explicit_lifetime() # && (var_lifetime == LexicalScope::INHERITED)) { # cerr << @3 << ": warning: Static variable initialization requires " @@ -6381,7 +6398,7 @@ def p_register_variable_2(p): () def p_register_variable_list_1(p): '''register_variable_list : register_variable ''' - print(p) + print('register_variable_list', list(p)) # { list*tmp = new list; # tmp->push_back(lex_strings.make($1)); # $$ = tmp; @@ -6390,7 +6407,7 @@ def p_register_variable_list_1(p): () def p_register_variable_list_2(p): '''register_variable_list : register_variable_list ',' register_variable ''' - print(p) + print('register_variable_list', list(p)) # { list*tmp = $1; # tmp->push_back(lex_strings.make($3)); # $$ = tmp; @@ -6399,7 +6416,7 @@ def p_register_variable_list_2(p): () def p_net_variable_1(p): '''net_variable : IDENTIFIER dimensions_opt ''' - print(p) + print('net_variable', list(p)) # { perm_string name = lex_strings.make($1); # pform_makewire(@1, name, NetNet::IMPLICIT, # NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0); @@ -6409,7 +6426,7 @@ def p_net_variable_1(p): () def p_net_variable_list_1(p): '''net_variable_list : net_variable ''' - print(p) + print('net_variable_list', list(p)) # { list*tmp = new list; # tmp->push_back(lex_strings.make($1)); # $$ = tmp; @@ -6418,7 +6435,7 @@ def p_net_variable_list_1(p): () def p_net_variable_list_2(p): '''net_variable_list : net_variable_list ',' net_variable ''' - print(p) + print('net_variable_list', list(p)) # { list*tmp = $1; # tmp->push_back(lex_strings.make($3)); # $$ = tmp; @@ -6427,7 +6444,7 @@ def p_net_variable_list_2(p): () def p_event_variable_1(p): '''event_variable : IDENTIFIER dimensions_opt ''' - print(p) + print('event_variable', list(p)) # { if ($2) { # yyerror(@2, "sorry: event arrays are not supported."); # delete $2; @@ -6437,33 +6454,33 @@ def p_event_variable_1(p): () def p_event_variable_list_1(p): '''event_variable_list : event_variable ''' - print(p) + print('event_variable_list', list(p)) # { $$ = list_from_identifier($1); } () def p_event_variable_list_2(p): '''event_variable_list : event_variable_list ',' event_variable ''' - print(p) + print('event_variable_list', list(p)) # { $$ = list_from_identifier($1, $3); } () def p_specify_item_1(p): '''specify_item : K_specparam specparam_decl ';' ''' - print(p) + print('specify_item', list(p)) () def p_specify_item_2(p): '''specify_item : specify_simple_path_decl ';' ''' - print(p) + print('specify_item', list(p)) # { pform_module_specify_path($1); # } () def p_specify_item_3(p): '''specify_item : specify_edge_path_decl ';' ''' - print(p) + print('specify_item', list(p)) # { pform_module_specify_path($1); # } () def p_specify_item_4(p): '''specify_item : K_if '(' expression ')' specify_simple_path_decl ';' ''' - print(p) + print('specify_item', list(p)) # { PSpecPath*tmp = $5; # if (tmp) { # tmp->conditional = true; @@ -6474,7 +6491,7 @@ def p_specify_item_4(p): () def p_specify_item_5(p): '''specify_item : K_if '(' expression ')' specify_edge_path_decl ';' ''' - print(p) + print('specify_item', list(p)) # { PSpecPath*tmp = $5; # if (tmp) { # tmp->conditional = true; @@ -6485,7 +6502,7 @@ def p_specify_item_5(p): () def p_specify_item_6(p): '''specify_item : K_ifnone specify_simple_path_decl ';' ''' - print(p) + print('specify_item', list(p)) # { PSpecPath*tmp = $2; # if (tmp) { # tmp->conditional = true; @@ -6496,7 +6513,7 @@ def p_specify_item_6(p): () def p_specify_item_7(p): '''specify_item : K_ifnone specify_edge_path_decl ';' ''' - print(p) + print('specify_item', list(p)) # { yyerror(@1, "Sorry: ifnone with an edge-sensitive path is " # "not supported."); # yyerrok; @@ -6504,137 +6521,137 @@ def p_specify_item_7(p): () def p_specify_item_8(p): '''specify_item : K_Sfullskew '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # delete $9; # } () def p_specify_item_9(p): '''specify_item : K_Shold '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # } () def p_specify_item_10(p): '''specify_item : K_Snochange '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # delete $9; # } () def p_specify_item_11(p): '''specify_item : K_Speriod '(' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $5; # } () def p_specify_item_12(p): '''specify_item : K_Srecovery '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # } () def p_specify_item_13(p): '''specify_item : K_Srecrem '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # delete $9; # } () def p_specify_item_14(p): '''specify_item : K_Sremoval '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # } () def p_specify_item_15(p): '''specify_item : K_Ssetup '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # } () def p_specify_item_16(p): '''specify_item : K_Ssetuphold '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # delete $9; # } () def p_specify_item_17(p): '''specify_item : K_Sskew '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # } () def p_specify_item_18(p): '''specify_item : K_Stimeskew '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $7; # } () def p_specify_item_19(p): '''specify_item : K_Swidth '(' spec_reference_event ',' delay_value ',' expression spec_notifier_opt ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $5; # delete $7; # } () def p_specify_item_20(p): '''specify_item : K_Swidth '(' spec_reference_event ',' delay_value ')' ';' ''' - print(p) + print('specify_item', list(p)) # { delete $5; # } () def p_specify_item_21(p): '''specify_item : K_pulsestyle_onevent specify_path_identifiers ';' ''' - print(p) + print('specify_item', list(p)) # { delete $2; # } () def p_specify_item_22(p): '''specify_item : K_pulsestyle_ondetect specify_path_identifiers ';' ''' - print(p) + print('specify_item', list(p)) # { delete $2; # } () def p_specify_item_23(p): '''specify_item : K_showcancelled specify_path_identifiers ';' ''' - print(p) + print('specify_item', list(p)) # { delete $2; # } () def p_specify_item_24(p): '''specify_item : K_noshowcancelled specify_path_identifiers ';' ''' - print(p) + print('specify_item', list(p)) # { delete $2; # } () def p_specify_item_list_1(p): '''specify_item_list : specify_item ''' - print(p) + print('specify_item_list', list(p)) () def p_specify_item_list_2(p): '''specify_item_list : specify_item_list specify_item ''' - print(p) + print('specify_item_list', list(p)) () def p_specify_item_list_opt_1(p): '''specify_item_list_opt : ''' - print(p) + print('specify_item_list_opt', list(p)) # { } () def p_specify_item_list_opt_2(p): '''specify_item_list_opt : specify_item_list ''' - print(p) + print('specify_item_list_opt', list(p)) # { } () def p_specify_edge_path_decl_1(p): '''specify_edge_path_decl : specify_edge_path '=' '(' delay_value_list ')' ''' - print(p) + print('specify_edge_path_decl', list(p)) # { $$ = pform_assign_path_delay($1, $4); } () def p_specify_edge_path_decl_2(p): '''specify_edge_path_decl : specify_edge_path '=' delay_value_simple ''' - print(p) + print('specify_edge_path_decl', list(p)) # { list*tmp = new list; # tmp->push_back($3); # $$ = pform_assign_path_delay($1, tmp); @@ -6642,58 +6659,58 @@ def p_specify_edge_path_decl_2(p): () def p_edge_operator_1(p): '''edge_operator : K_posedge ''' - print(p) + print('edge_operator', list(p)) # { $$ = true; } () def p_edge_operator_2(p): '''edge_operator : K_negedge ''' - print(p) + print('edge_operator', list(p)) # { $$ = false; } () def p_specify_edge_path_1(p): '''specify_edge_path : '(' specify_path_identifiers spec_polarity K_EG '(' specify_path_identifiers polarity_operator expression ')' ')' ''' - print(p) + print('specify_edge_path', list(p)) # { int edge_flag = 0; # $$ = pform_make_specify_edge_path(@1, edge_flag, $2, $3, false, $6, $8); } () def p_specify_edge_path_2(p): '''specify_edge_path : '(' edge_operator specify_path_identifiers spec_polarity K_EG '(' specify_path_identifiers polarity_operator expression ')' ')' ''' - print(p) + print('specify_edge_path', list(p)) # { int edge_flag = $2? 1 : -1; # $$ = pform_make_specify_edge_path(@1, edge_flag, $3, $4, false, $7, $9);} () def p_specify_edge_path_3(p): '''specify_edge_path : '(' specify_path_identifiers spec_polarity K_SG '(' specify_path_identifiers polarity_operator expression ')' ')' ''' - print(p) + print('specify_edge_path', list(p)) # { int edge_flag = 0; # $$ = pform_make_specify_edge_path(@1, edge_flag, $2, $3, true, $6, $8); } () def p_specify_edge_path_4(p): '''specify_edge_path : '(' edge_operator specify_path_identifiers spec_polarity K_SG '(' specify_path_identifiers polarity_operator expression ')' ')' ''' - print(p) + print('specify_edge_path', list(p)) # { int edge_flag = $2? 1 : -1; # $$ = pform_make_specify_edge_path(@1, edge_flag, $3, $4, true, $7, $9); } () def p_polarity_operator_1(p): '''polarity_operator : K_PO_POS ''' - print(p) + print('polarity_operator', list(p)) () def p_polarity_operator_2(p): '''polarity_operator : K_PO_NEG ''' - print(p) + print('polarity_operator', list(p)) () def p_polarity_operator_3(p): '''polarity_operator : ':' ''' - print(p) + print('polarity_operator', list(p)) () def p_specify_simple_path_decl_1(p): '''specify_simple_path_decl : specify_simple_path '=' '(' delay_value_list ')' ''' - print(p) + print('specify_simple_path_decl', list(p)) # { $$ = pform_assign_path_delay($1, $4); } () def p_specify_simple_path_decl_2(p): '''specify_simple_path_decl : specify_simple_path '=' delay_value_simple ''' - print(p) + print('specify_simple_path_decl', list(p)) # { list*tmp = new list; # tmp->push_back($3); # $$ = pform_assign_path_delay($1, tmp); @@ -6701,7 +6718,7 @@ def p_specify_simple_path_decl_2(p): () def p_specify_simple_path_decl_3(p): '''specify_simple_path_decl : specify_simple_path '=' '(' error ')' ''' - print(p) + print('specify_simple_path_decl', list(p)) # { yyerror(@3, "Syntax error in delay value list."); # yyerrok; # $$ = 0; @@ -6709,24 +6726,24 @@ def p_specify_simple_path_decl_3(p): () def p_specify_simple_path_1(p): '''specify_simple_path : '(' specify_path_identifiers spec_polarity K_EG specify_path_identifiers ')' ''' - print(p) + print('specify_simple_path', list(p)) # { $$ = pform_make_specify_path(@1, $2, $3, false, $5); } () def p_specify_simple_path_2(p): '''specify_simple_path : '(' specify_path_identifiers spec_polarity K_SG specify_path_identifiers ')' ''' - print(p) + print('specify_simple_path', list(p)) # { $$ = pform_make_specify_path(@1, $2, $3, true, $5); } () def p_specify_simple_path_3(p): '''specify_simple_path : '(' error ')' ''' - print(p) + print('specify_simple_path', list(p)) # { yyerror(@1, "Invalid simple path"); # yyerrok; # } () def p_specify_path_identifiers_1(p): '''specify_path_identifiers : IDENTIFIER ''' - print(p) + print('specify_path_identifiers', list(p)) # { list*tmp = new list; # tmp->push_back(lex_strings.make($1)); # $$ = tmp; @@ -6735,7 +6752,7 @@ def p_specify_path_identifiers_1(p): () def p_specify_path_identifiers_2(p): '''specify_path_identifiers : IDENTIFIER '[' expr_primary ']' ''' - print(p) + print('specify_path_identifiers', list(p)) # { if (gn_specify_blocks_flag) { # yywarn(@4, "Bit selects are not currently supported " # "in path declarations. The declaration " @@ -6749,7 +6766,7 @@ def p_specify_path_identifiers_2(p): () def p_specify_path_identifiers_3(p): '''specify_path_identifiers : IDENTIFIER '[' expr_primary polarity_operator expr_primary ']' ''' - print(p) + print('specify_path_identifiers', list(p)) # { if (gn_specify_blocks_flag) { # yywarn(@4, "Part selects are not currently supported " # "in path declarations. The declaration " @@ -6763,7 +6780,7 @@ def p_specify_path_identifiers_3(p): () def p_specify_path_identifiers_4(p): '''specify_path_identifiers : specify_path_identifiers ',' IDENTIFIER ''' - print(p) + print('specify_path_identifiers', list(p)) # { list*tmp = $1; # tmp->push_back(lex_strings.make($3)); # $$ = tmp; @@ -6772,7 +6789,7 @@ def p_specify_path_identifiers_4(p): () def p_specify_path_identifiers_5(p): '''specify_path_identifiers : specify_path_identifiers ',' IDENTIFIER '[' expr_primary ']' ''' - print(p) + print('specify_path_identifiers', list(p)) # { if (gn_specify_blocks_flag) { # yywarn(@4, "Bit selects are not currently supported " # "in path declarations. The declaration " @@ -6786,7 +6803,7 @@ def p_specify_path_identifiers_5(p): () def p_specify_path_identifiers_6(p): '''specify_path_identifiers : specify_path_identifiers ',' IDENTIFIER '[' expr_primary polarity_operator expr_primary ']' ''' - print(p) + print('specify_path_identifiers', list(p)) # { if (gn_specify_blocks_flag) { # yywarn(@4, "Part selects are not currently supported " # "in path declarations. The declaration " @@ -6800,7 +6817,7 @@ def p_specify_path_identifiers_6(p): () def p_specparam_1(p): '''specparam : IDENTIFIER '=' expression ''' - print(p) + print('specparam', list(p)) # { PExpr*tmp = $3; # pform_set_specparam(@1, lex_strings.make($1), # param_active_range, tmp); @@ -6809,7 +6826,7 @@ def p_specparam_1(p): () def p_specparam_2(p): '''specparam : IDENTIFIER '=' expression ':' expression ':' expression ''' - print(p) + print('specparam', list(p)) # { PExpr*tmp = 0; # switch (min_typ_max_flag) { # case MIN: @@ -6851,14 +6868,14 @@ def p_specparam_2(p): () def p_specparam_3(p): '''specparam : PATHPULSE_IDENTIFIER '=' expression ''' - print(p) + print('specparam', list(p)) # { delete[]$1; # delete $3; # } () def p_specparam_4(p): '''specparam : PATHPULSE_IDENTIFIER '=' '(' expression ',' expression ')' ''' - print(p) + print('specparam', list(p)) # { delete[]$1; # delete $4; # delete $6; @@ -6866,19 +6883,19 @@ def p_specparam_4(p): () def p_specparam_list_1(p): '''specparam_list : specparam ''' - print(p) + print('specparam_list', list(p)) () def p_specparam_list_2(p): '''specparam_list : specparam_list ',' specparam ''' - print(p) + print('specparam_list', list(p)) () def p_specparam_decl_1(p): '''specparam_decl : specparam_list ''' - print(p) + print('specparam_decl', list(p)) () def p_specparam_decl_2(p): '''specparam_decl : dimensions _embed0_specparam_decl specparam_list ''' - print(p) + print('specparam_decl', list(p)) # { param_active_range = 0; } () def p__embed0_specparam_decl(p): @@ -6887,103 +6904,103 @@ def p__embed0_specparam_decl(p): () def p_spec_polarity_1(p): '''spec_polarity : '+' ''' - print(p) + print('spec_polarity', list(p)) # { $$ = '+'; } () def p_spec_polarity_2(p): '''spec_polarity : '-' ''' - print(p) + print('spec_polarity', list(p)) # { $$ = '-'; } () def p_spec_polarity_3(p): '''spec_polarity : ''' - print(p) + print('spec_polarity', list(p)) # { $$ = 0; } () def p_spec_reference_event_1(p): '''spec_reference_event : K_posedge expression ''' - print(p) + print('spec_reference_event', list(p)) # { delete $2; } () def p_spec_reference_event_2(p): '''spec_reference_event : K_negedge expression ''' - print(p) + print('spec_reference_event', list(p)) # { delete $2; } () def p_spec_reference_event_3(p): '''spec_reference_event : K_posedge expr_primary K_TAND expression ''' - print(p) + print('spec_reference_event', list(p)) # { delete $2; # delete $4; # } () def p_spec_reference_event_4(p): '''spec_reference_event : K_negedge expr_primary K_TAND expression ''' - print(p) + print('spec_reference_event', list(p)) # { delete $2; # delete $4; # } () def p_spec_reference_event_5(p): '''spec_reference_event : K_edge '[' edge_descriptor_list ']' expr_primary ''' - print(p) + print('spec_reference_event', list(p)) # { delete $5; } () def p_spec_reference_event_6(p): '''spec_reference_event : K_edge '[' edge_descriptor_list ']' expr_primary K_TAND expression ''' - print(p) + print('spec_reference_event', list(p)) # { delete $5; # delete $7; # } () def p_spec_reference_event_7(p): '''spec_reference_event : expr_primary K_TAND expression ''' - print(p) + print('spec_reference_event', list(p)) # { delete $1; # delete $3; # } () def p_spec_reference_event_8(p): '''spec_reference_event : expr_primary ''' - print(p) + print('spec_reference_event', list(p)) # { delete $1; } () def p_edge_descriptor_list_1(p): '''edge_descriptor_list : edge_descriptor_list ',' K_edge_descriptor ''' - print(p) + print('edge_descriptor_list', list(p)) () def p_edge_descriptor_list_2(p): '''edge_descriptor_list : K_edge_descriptor ''' - print(p) + print('edge_descriptor_list', list(p)) () def p_spec_notifier_opt_1(p): '''spec_notifier_opt : ''' - print(p) + print('spec_notifier_opt', list(p)) # { } () def p_spec_notifier_opt_2(p): '''spec_notifier_opt : spec_notifier ''' - print(p) + print('spec_notifier_opt', list(p)) # { } () def p_spec_notifier_1(p): '''spec_notifier : ',' ''' - print(p) + print('spec_notifier', list(p)) # { args_after_notifier = 0; } () def p_spec_notifier_2(p): '''spec_notifier : ',' hierarchy_identifier ''' - print(p) + print('spec_notifier', list(p)) # { args_after_notifier = 0; delete $2; } () def p_spec_notifier_3(p): '''spec_notifier : spec_notifier ',' ''' - print(p) + print('spec_notifier', list(p)) # { args_after_notifier += 1; } () def p_spec_notifier_4(p): '''spec_notifier : spec_notifier ',' hierarchy_identifier ''' - print(p) + print('spec_notifier', list(p)) # { args_after_notifier += 1; # if (args_after_notifier >= 3) { # cerr << @3 << ": warning: timing checks are not supported " @@ -6994,12 +7011,12 @@ def p_spec_notifier_4(p): () def p_spec_notifier_5(p): '''spec_notifier : IDENTIFIER ''' - print(p) + print('spec_notifier', list(p)) # { args_after_notifier = 0; delete[]$1; } () def p_statement_item_1(p): '''statement_item : K_assign lpvalue '=' expression ';' ''' - print(p) + print('statement_item1', list(p)) # { PCAssign*tmp = new PCAssign($2, $4); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7007,7 +7024,7 @@ def p_statement_item_1(p): () def p_statement_item_2(p): '''statement_item : K_deassign lpvalue ';' ''' - print(p) + print('statement_item2', list(p)) # { PDeassign*tmp = new PDeassign($2); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7015,7 +7032,7 @@ def p_statement_item_2(p): () def p_statement_item_3(p): '''statement_item : K_force lpvalue '=' expression ';' ''' - print(p) + print('statement_item3', list(p)) # { PForce*tmp = new PForce($2, $4); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7023,7 +7040,7 @@ def p_statement_item_3(p): () def p_statement_item_4(p): '''statement_item : K_release lpvalue ';' ''' - print(p) + print('statement_item4', list(p)) # { PRelease*tmp = new PRelease($2); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7031,7 +7048,7 @@ def p_statement_item_4(p): () def p_statement_item_5(p): '''statement_item : K_begin K_end ''' - print(p) + print('statement_item5', list(p)) # { PBlock*tmp = new PBlock(PBlock::BL_SEQ); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7039,7 +7056,7 @@ def p_statement_item_5(p): () def p_statement_item_6(p): '''statement_item : K_begin _embed0_statement_item block_item_decls_opt _embed1_statement_item statement_or_null_list K_end ''' - print(p) + print('statement_item6', list(p)) # { PBlock*tmp; # if ($3) { # pform_pop_scope(); @@ -7057,7 +7074,7 @@ def p_statement_item_6(p): () def p_statement_item_7(p): '''statement_item : K_begin ':' IDENTIFIER _embed2_statement_item block_item_decls_opt statement_or_null_list_opt K_end endlabel_opt ''' - print(p) + print('statement_item7', list(p)) # { pform_pop_scope(); # assert(! current_block_stack.empty()); # PBlock*tmp = current_block_stack.top(); @@ -7080,7 +7097,7 @@ def p_statement_item_7(p): () def p_statement_item_8(p): '''statement_item : K_fork join_keyword ''' - print(p) + print('statement_item7', list(p)) # { PBlock*tmp = new PBlock($2); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7088,7 +7105,7 @@ def p_statement_item_8(p): () def p_statement_item_9(p): '''statement_item : K_fork _embed3_statement_item block_item_decls_opt _embed4_statement_item statement_or_null_list join_keyword ''' - print(p) + print('statement_item9', list(p)) # { PBlock*tmp; # if ($3) { # pform_pop_scope(); @@ -7107,7 +7124,7 @@ def p_statement_item_9(p): () def p_statement_item_10(p): '''statement_item : K_fork ':' IDENTIFIER _embed5_statement_item block_item_decls_opt statement_or_null_list_opt join_keyword endlabel_opt ''' - print(p) + print('statement_item10', list(p)) # { pform_pop_scope(); # assert(! current_block_stack.empty()); # PBlock*tmp = current_block_stack.top(); @@ -7131,7 +7148,7 @@ def p_statement_item_10(p): () def p_statement_item_11(p): '''statement_item : K_disable hierarchy_identifier ';' ''' - print(p) + print('statement_item11', list(p)) # { PDisable*tmp = new PDisable(*$2); # FILE_NAME(tmp, @1); # delete $2; @@ -7140,7 +7157,7 @@ def p_statement_item_11(p): () def p_statement_item_12(p): '''statement_item : K_disable K_fork ';' ''' - print(p) + print('statement_item12', list(p)) # { pform_name_t tmp_name; # PDisable*tmp = new PDisable(tmp_name); # FILE_NAME(tmp, @1); @@ -7149,7 +7166,7 @@ def p_statement_item_12(p): () def p_statement_item_13(p): '''statement_item : K_TRIGGER hierarchy_identifier ';' ''' - print(p) + print('statement_item13', list(p)) # { PTrigger*tmp = new PTrigger(*$2); # FILE_NAME(tmp, @1); # delete $2; @@ -7158,22 +7175,22 @@ def p_statement_item_13(p): () def p_statement_item_14(p): '''statement_item : procedural_assertion_statement ''' - print(p) + print('statement_item14', list(p)) # { $$ = $1; } () def p_statement_item_15(p): '''statement_item : loop_statement ''' - print(p) + print('statement_item15', list(p)) # { $$ = $1; } () def p_statement_item_16(p): '''statement_item : jump_statement ''' - print(p) + print('statement_item16', list(p)) # { $$ = $1; } () def p_statement_item_17(p): '''statement_item : K_case '(' expression ')' case_items K_endcase ''' - print(p) + print('statement_item17', list(p)) # { PCase*tmp = new PCase(NetCase::EQ, $3, $5); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7181,7 +7198,7 @@ def p_statement_item_17(p): () def p_statement_item_18(p): '''statement_item : K_casex '(' expression ')' case_items K_endcase ''' - print(p) + print('statement_item', list(p)) # { PCase*tmp = new PCase(NetCase::EQX, $3, $5); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7189,7 +7206,7 @@ def p_statement_item_18(p): () def p_statement_item_19(p): '''statement_item : K_casez '(' expression ')' case_items K_endcase ''' - print(p) + print('statement_item', list(p)) # { PCase*tmp = new PCase(NetCase::EQZ, $3, $5); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7197,22 +7214,22 @@ def p_statement_item_19(p): () def p_statement_item_20(p): '''statement_item : K_case '(' expression ')' error K_endcase ''' - print(p) + print('statement_item', list(p)) # { yyerrok; } () def p_statement_item_21(p): '''statement_item : K_casex '(' expression ')' error K_endcase ''' - print(p) + print('statement_item', list(p)) # { yyerrok; } () def p_statement_item_22(p): '''statement_item : K_casez '(' expression ')' error K_endcase ''' - print(p) + print('statement_item', list(p)) # { yyerrok; } () def p_statement_item_23(p): '''statement_item : K_if '(' expression ')' statement_or_null %prec less_than_K_else ''' - print(p) + print('statement_item', list(p)) # { PCondit*tmp = new PCondit($3, $5, 0); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7220,7 +7237,7 @@ def p_statement_item_23(p): () def p_statement_item_24(p): '''statement_item : K_if '(' expression ')' statement_or_null K_else statement_or_null ''' - print(p) + print('statement_item', list(p)) # { PCondit*tmp = new PCondit($3, $5, $7); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7228,31 +7245,31 @@ def p_statement_item_24(p): () def p_statement_item_25(p): '''statement_item : K_if '(' error ')' statement_or_null %prec less_than_K_else ''' - print(p) + print('statement_item', list(p)) # { yyerror(@1, "error: Malformed conditional expression."); # $$ = $5; # } () def p_statement_item_26(p): '''statement_item : K_if '(' error ')' statement_or_null K_else statement_or_null ''' - print(p) + print('statement_item', list(p)) # { yyerror(@1, "error: Malformed conditional expression."); # $$ = $5; # } () def p_statement_item_27(p): '''statement_item : compressed_statement ';' ''' - print(p) + print('statement_item', list(p)) # { $$ = $1; } () def p_statement_item_28(p): '''statement_item : inc_or_dec_expression ';' ''' - print(p) + print('statement_item', list(p)) # { $$ = pform_compressed_assign_from_inc_dec(@1, $1); } () def p_statement_item_29(p): '''statement_item : delay1 statement_or_null ''' - print(p) + print('statement_item', list(p)) # { PExpr*del = $1->front(); # assert($1->size() == 1); # delete $1; @@ -7263,7 +7280,7 @@ def p_statement_item_29(p): () def p_statement_item_30(p): '''statement_item : event_control statement_or_null ''' - print(p) + print('statement_item', list(p)) # { PEventStatement*tmp = $1; # if (tmp == 0) { # yyerror(@1, "error: Invalid event control."); @@ -7276,7 +7293,7 @@ def p_statement_item_30(p): () def p_statement_item_31(p): '''statement_item : '@' '*' statement_or_null ''' - print(p) + print('statement_item', list(p)) # { PEventStatement*tmp = new PEventStatement; # FILE_NAME(tmp, @1); # tmp->set_statement($3); @@ -7285,7 +7302,7 @@ def p_statement_item_31(p): () def p_statement_item_32(p): '''statement_item : '@' '(' '*' ')' statement_or_null ''' - print(p) + print('statement_item', list(p)) # { PEventStatement*tmp = new PEventStatement; # FILE_NAME(tmp, @1); # tmp->set_statement($5); @@ -7294,7 +7311,14 @@ def p_statement_item_32(p): () def p_statement_item_33(p): '''statement_item : lpvalue '=' expression ';' ''' - print(p) + print('statement_item33', list(p)) + if p[3]: + expr = Node(syms.expr_stmt, [p[1], Leaf(token.EQUAL, p[2]), p[3] ]) + print ("expr TODO", repr(expr)) + else: + expr = Node(syms.expr_stmt, [p[1], Leaf(token.EQUAL, p[2]), ]) + print ("expr", repr(expr)) + p[0] = expr # { PAssign*tmp = new PAssign($1,$3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7302,7 +7326,7 @@ def p_statement_item_33(p): () def p_statement_item_34(p): '''statement_item : error '=' expression ';' ''' - print(p) + print('statement_item', list(p)) # { yyerror(@2, "Syntax in assignment statement l-value."); # yyerrok; # $$ = new PNoop; @@ -7310,7 +7334,7 @@ def p_statement_item_34(p): () def p_statement_item_35(p): '''statement_item : lpvalue K_LE expression ';' ''' - print(p) + print('statement_item', list(p)) # { PAssignNB*tmp = new PAssignNB($1,$3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7318,7 +7342,7 @@ def p_statement_item_35(p): () def p_statement_item_36(p): '''statement_item : error K_LE expression ';' ''' - print(p) + print('statement_item', list(p)) # { yyerror(@2, "Syntax in assignment statement l-value."); # yyerrok; # $$ = new PNoop; @@ -7326,7 +7350,7 @@ def p_statement_item_36(p): () def p_statement_item_37(p): '''statement_item : lpvalue '=' delay1 expression ';' ''' - print(p) + print('statement_item', list(p)) # { PExpr*del = $3->front(); $3->pop_front(); # assert($3->empty()); # PAssign*tmp = new PAssign($1,del,$4); @@ -7336,7 +7360,7 @@ def p_statement_item_37(p): () def p_statement_item_38(p): '''statement_item : lpvalue K_LE delay1 expression ';' ''' - print(p) + print('statement_item', list(p)) # { PExpr*del = $3->front(); $3->pop_front(); # assert($3->empty()); # PAssignNB*tmp = new PAssignNB($1,del,$4); @@ -7346,7 +7370,7 @@ def p_statement_item_38(p): () def p_statement_item_39(p): '''statement_item : lpvalue '=' event_control expression ';' ''' - print(p) + print('statement_item', list(p)) # { PAssign*tmp = new PAssign($1,0,$3,$4); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7354,7 +7378,7 @@ def p_statement_item_39(p): () def p_statement_item_40(p): '''statement_item : lpvalue '=' K_repeat '(' expression ')' event_control expression ';' ''' - print(p) + print('statement_item', list(p)) # { PAssign*tmp = new PAssign($1,$5,$7,$8); # FILE_NAME(tmp,@1); # tmp->set_lineno(@1.first_line); @@ -7363,7 +7387,7 @@ def p_statement_item_40(p): () def p_statement_item_41(p): '''statement_item : lpvalue K_LE event_control expression ';' ''' - print(p) + print('statement_item', list(p)) # { PAssignNB*tmp = new PAssignNB($1,0,$3,$4); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7371,7 +7395,7 @@ def p_statement_item_41(p): () def p_statement_item_42(p): '''statement_item : lpvalue K_LE K_repeat '(' expression ')' event_control expression ';' ''' - print(p) + print('statement_item', list(p)) # { PAssignNB*tmp = new PAssignNB($1,$5,$7,$8); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7379,7 +7403,7 @@ def p_statement_item_42(p): () def p_statement_item_43(p): '''statement_item : lpvalue '=' dynamic_array_new ';' ''' - print(p) + print('statement_item', list(p)) # { PAssign*tmp = new PAssign($1,$3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7387,7 +7411,7 @@ def p_statement_item_43(p): () def p_statement_item_44(p): '''statement_item : lpvalue '=' class_new ';' ''' - print(p) + print('statement_item', list(p)) # { PAssign*tmp = new PAssign($1,$3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7395,7 +7419,7 @@ def p_statement_item_44(p): () def p_statement_item_45(p): '''statement_item : K_wait '(' expression ')' statement_or_null ''' - print(p) + print('statement_item', list(p)) # { PEventStatement*tmp; # PEEvent*etmp = new PEEvent(PEEvent::POSITIVE, $3); # tmp = new PEventStatement(etmp); @@ -7406,7 +7430,7 @@ def p_statement_item_45(p): () def p_statement_item_46(p): '''statement_item : K_wait K_fork ';' ''' - print(p) + print('statement_item', list(p)) # { PEventStatement*tmp = new PEventStatement((PEEvent*)0); # FILE_NAME(tmp,@1); # $$ = tmp; @@ -7414,7 +7438,7 @@ def p_statement_item_46(p): () def p_statement_item_47(p): '''statement_item : SYSTEM_IDENTIFIER '(' expression_list_with_nuls ')' ';' ''' - print(p) + print('statement_item', list(p)) # { PCallTask*tmp = new PCallTask(lex_strings.make($1), *$3); # FILE_NAME(tmp,@1); # delete[]$1; @@ -7424,7 +7448,7 @@ def p_statement_item_47(p): () def p_statement_item_48(p): '''statement_item : SYSTEM_IDENTIFIER ';' ''' - print(p) + print('statement_item', list(p)) # { listpt; # PCallTask*tmp = new PCallTask(lex_strings.make($1), pt); # FILE_NAME(tmp,@1); @@ -7434,7 +7458,7 @@ def p_statement_item_48(p): () def p_statement_item_49(p): '''statement_item : hierarchy_identifier '(' expression_list_with_nuls ')' ';' ''' - print(p) + print('statement_item', list(p)) # { PCallTask*tmp = pform_make_call_task(@1, *$1, *$3); # delete $1; # delete $3; @@ -7443,7 +7467,7 @@ def p_statement_item_49(p): () def p_statement_item_50(p): '''statement_item : hierarchy_identifier K_with '{' constraint_block_item_list_opt '}' ';' ''' - print(p) + print('statement_item', list(p)) # { /* ....randomize with { } */ # if ($1 && peek_tail_name(*$1) == "randomize") { # if (!gn_system_verilog()) @@ -7462,7 +7486,7 @@ def p_statement_item_50(p): () def p_statement_item_51(p): '''statement_item : implicit_class_handle '.' hierarchy_identifier '(' expression_list_with_nuls ')' ';' ''' - print(p) + print('statement_item', list(p)) # { pform_name_t*t_name = $1; # while (! $3->empty()) { # t_name->push_back($3->front()); @@ -7478,7 +7502,7 @@ def p_statement_item_51(p): () def p_statement_item_52(p): '''statement_item : hierarchy_identifier ';' ''' - print(p) + print('statement_item', list(p)) # { listpt; # PCallTask*tmp = pform_make_call_task(@1, *$1, pt); # delete $1; @@ -7487,7 +7511,7 @@ def p_statement_item_52(p): () def p_statement_item_53(p): '''statement_item : implicit_class_handle '.' K_new '(' expression_list_with_nuls ')' ';' ''' - print(p) + print('statement_item', list(p)) # { PChainConstructor*tmp = new PChainConstructor(*$5); # FILE_NAME(tmp, @3); # delete $1; @@ -7496,7 +7520,7 @@ def p_statement_item_53(p): () def p_statement_item_54(p): '''statement_item : hierarchy_identifier '(' error ')' ';' ''' - print(p) + print('statement_item', list(p)) # { yyerror(@3, "error: Syntax error in task arguments."); # listpt; # PCallTask*tmp = pform_make_call_task(@1, *$1, pt); @@ -7506,7 +7530,7 @@ def p_statement_item_54(p): () def p_statement_item_55(p): '''statement_item : error ';' ''' - print(p) + print('statement_item', list(p)) # { yyerror(@2, "error: malformed statement"); # yyerrok; # $$ = new PNoop; @@ -7576,7 +7600,7 @@ def p__embed5_statement_item(p): () def p_compressed_statement_1(p): '''compressed_statement : lpvalue K_PLUS_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign*tmp = new PAssign($1, '+', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7584,7 +7608,7 @@ def p_compressed_statement_1(p): () def p_compressed_statement_2(p): '''compressed_statement : lpvalue K_MINUS_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign*tmp = new PAssign($1, '-', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7592,7 +7616,7 @@ def p_compressed_statement_2(p): () def p_compressed_statement_3(p): '''compressed_statement : lpvalue K_MUL_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign*tmp = new PAssign($1, '*', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7600,7 +7624,7 @@ def p_compressed_statement_3(p): () def p_compressed_statement_4(p): '''compressed_statement : lpvalue K_DIV_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign*tmp = new PAssign($1, '/', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7608,7 +7632,7 @@ def p_compressed_statement_4(p): () def p_compressed_statement_5(p): '''compressed_statement : lpvalue K_MOD_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign*tmp = new PAssign($1, '%', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7616,7 +7640,7 @@ def p_compressed_statement_5(p): () def p_compressed_statement_6(p): '''compressed_statement : lpvalue K_AND_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign*tmp = new PAssign($1, '&', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7624,7 +7648,7 @@ def p_compressed_statement_6(p): () def p_compressed_statement_7(p): '''compressed_statement : lpvalue K_OR_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign*tmp = new PAssign($1, '|', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7632,7 +7656,7 @@ def p_compressed_statement_7(p): () def p_compressed_statement_8(p): '''compressed_statement : lpvalue K_XOR_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign*tmp = new PAssign($1, '^', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7640,7 +7664,7 @@ def p_compressed_statement_8(p): () def p_compressed_statement_9(p): '''compressed_statement : lpvalue K_LS_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign *tmp = new PAssign($1, 'l', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7648,7 +7672,7 @@ def p_compressed_statement_9(p): () def p_compressed_statement_10(p): '''compressed_statement : lpvalue K_RS_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign*tmp = new PAssign($1, 'r', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7656,7 +7680,7 @@ def p_compressed_statement_10(p): () def p_compressed_statement_11(p): '''compressed_statement : lpvalue K_RSS_EQ expression ''' - print(p) + print('compressed_statement', list(p)) # { PAssign *tmp = new PAssign($1, 'R', $3); # FILE_NAME(tmp, @1); # $$ = tmp; @@ -7664,17 +7688,17 @@ def p_compressed_statement_11(p): () def p_statement_or_null_list_opt_1(p): '''statement_or_null_list_opt : statement_or_null_list ''' - print(p) + print('statement_or_null_list_opt', list(p)) # { $$ = $1; } () def p_statement_or_null_list_opt_2(p): '''statement_or_null_list_opt : ''' - print(p) + print('statement_or_null_list_opt', list(p)) # { $$ = 0; } () def p_statement_or_null_list_1(p): '''statement_or_null_list : statement_or_null_list statement_or_null ''' - print(p) + print('statement_or_null_list', list(p)) # { vector*tmp = $1; # if ($2) tmp->push_back($2); # $$ = tmp; @@ -7682,7 +7706,7 @@ def p_statement_or_null_list_1(p): () def p_statement_or_null_list_2(p): '''statement_or_null_list : statement_or_null ''' - print(p) + print('statement_or_null_list', list(p)) # { vector*tmp = new vector(0); # if ($1) tmp->push_back($1); # $$ = tmp; @@ -7690,22 +7714,22 @@ def p_statement_or_null_list_2(p): () def p_analog_statement_1(p): '''analog_statement : branch_probe_expression K_CONTRIBUTE expression ';' ''' - print(p) + print('analog_statement', list(p)) # { $$ = pform_contribution_statement(@2, $1, $3); } () def p_task_item_1(p): '''task_item : block_item_decl ''' - print(p) + print('task_item', list(p)) # { $$ = new vector(0); } () def p_task_item_2(p): '''task_item : tf_port_declaration ''' - print(p) + print('task_item', list(p)) # { $$ = $1; } () def p_task_item_list_1(p): '''task_item_list : task_item_list task_item ''' - print(p) + print('task_item_list', list(p)) # { vector*tmp = $1; # size_t s1 = tmp->size(); # tmp->resize(s1 + $2->size()); @@ -7717,39 +7741,39 @@ def p_task_item_list_1(p): () def p_task_item_list_2(p): '''task_item_list : task_item ''' - print(p) + print('task_item_list', list(p)) # { $$ = $1; } () def p_task_item_list_opt_1(p): '''task_item_list_opt : task_item_list ''' - print(p) + print('task_item_list_opt', list(p)) # { $$ = $1; } () def p_task_item_list_opt_2(p): '''task_item_list_opt : ''' - print(p) + print('task_item_list_opt', list(p)) # { $$ = 0; } () def p_tf_port_list_opt_1(p): '''tf_port_list_opt : tf_port_list ''' - print(p) + print('tf_port_list_opt', list(p)) # { $$ = $1; } () def p_tf_port_list_opt_2(p): '''tf_port_list_opt : ''' - print(p) + print('tf_port_list_opt', list(p)) # { $$ = 0; } () def p_udp_body_1(p): '''udp_body : K_table udp_entry_list K_endtable ''' - print(p) + print('udp_body', list(p)) # { lex_end_table(); # $$ = $2; # } () def p_udp_body_2(p): '''udp_body : K_table K_endtable ''' - print(p) + print('udp_body', list(p)) # { lex_end_table(); # yyerror(@1, "error: Empty UDP table."); # $$ = 0; @@ -7757,7 +7781,7 @@ def p_udp_body_2(p): () def p_udp_body_3(p): '''udp_body : K_table error K_endtable ''' - print(p) + print('udp_body', list(p)) # { lex_end_table(); # yyerror(@2, "Errors in UDP table"); # yyerrok; @@ -7766,15 +7790,15 @@ def p_udp_body_3(p): () def p_udp_entry_list_1(p): '''udp_entry_list : udp_comb_entry_list ''' - print(p) + print('udp_entry_list', list(p)) () def p_udp_entry_list_2(p): '''udp_entry_list : udp_sequ_entry_list ''' - print(p) + print('udp_entry_list', list(p)) () def p_udp_comb_entry_1(p): '''udp_comb_entry : udp_input_list ':' udp_output_sym ';' ''' - print(p) + print('udp_comb_entry', list(p)) # { char*tmp = new char[strlen($1)+3]; # strcpy(tmp, $1); # char*tp = tmp+strlen(tmp); @@ -7787,7 +7811,7 @@ def p_udp_comb_entry_1(p): () def p_udp_comb_entry_list_1(p): '''udp_comb_entry_list : udp_comb_entry ''' - print(p) + print('udp_comb_entry_list', list(p)) # { list*tmp = new list; # tmp->push_back($1); # delete[]$1; @@ -7796,7 +7820,7 @@ def p_udp_comb_entry_list_1(p): () def p_udp_comb_entry_list_2(p): '''udp_comb_entry_list : udp_comb_entry_list udp_comb_entry ''' - print(p) + print('udp_comb_entry_list', list(p)) # { list*tmp = $1; # tmp->push_back($2); # delete[]$2; @@ -7805,7 +7829,7 @@ def p_udp_comb_entry_list_2(p): () def p_udp_sequ_entry_list_1(p): '''udp_sequ_entry_list : udp_sequ_entry ''' - print(p) + print('udp_sequ_entry_list', list(p)) # { list*tmp = new list; # tmp->push_back($1); # delete[]$1; @@ -7814,7 +7838,7 @@ def p_udp_sequ_entry_list_1(p): () def p_udp_sequ_entry_list_2(p): '''udp_sequ_entry_list : udp_sequ_entry_list udp_sequ_entry ''' - print(p) + print('udp_sequ_entry_list', list(p)) # { list*tmp = $1; # tmp->push_back($2); # delete[]$2; @@ -7823,7 +7847,7 @@ def p_udp_sequ_entry_list_2(p): () def p_udp_sequ_entry_1(p): '''udp_sequ_entry : udp_input_list ':' udp_input_sym ':' udp_output_sym ';' ''' - print(p) + print('udp_sequ_entry', list(p)) # { char*tmp = new char[strlen($1)+5]; # strcpy(tmp, $1); # char*tp = tmp+strlen(tmp); @@ -7837,7 +7861,7 @@ def p_udp_sequ_entry_1(p): () def p_udp_initial_1(p): '''udp_initial : K_initial IDENTIFIER '=' number ';' ''' - print(p) + print('udp_initial', list(p)) # { PExpr*etmp = new PENumber($4); # PEIdent*itmp = new PEIdent(lex_strings.make($2)); # PAssign*atmp = new PAssign(itmp, etmp); @@ -7848,17 +7872,17 @@ def p_udp_initial_1(p): () def p_udp_init_opt_1(p): '''udp_init_opt : udp_initial ''' - print(p) + print('udp_init_opt', list(p)) # { $$ = $1; } () def p_udp_init_opt_2(p): '''udp_init_opt : ''' - print(p) + print('udp_init_opt', list(p)) # { $$ = 0; } () def p_udp_input_list_1(p): '''udp_input_list : udp_input_sym ''' - print(p) + print('udp_input_list', list(p)) # { char*tmp = new char[2]; # tmp[0] = $1; # tmp[1] = 0; @@ -7867,7 +7891,7 @@ def p_udp_input_list_1(p): () def p_udp_input_list_2(p): '''udp_input_list : udp_input_list udp_input_sym ''' - print(p) + print('udp_input_list', list(p)) # { char*tmp = new char[strlen($1)+2]; # strcpy(tmp, $1); # char*tp = tmp+strlen(tmp); @@ -7879,157 +7903,157 @@ def p_udp_input_list_2(p): () def p_udp_input_sym_1(p): '''udp_input_sym : '0' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = '0'; } () def p_udp_input_sym_2(p): '''udp_input_sym : '1' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = '1'; } () def p_udp_input_sym_3(p): '''udp_input_sym : 'x' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'x'; } () def p_udp_input_sym_4(p): '''udp_input_sym : '?' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = '?'; } () def p_udp_input_sym_5(p): '''udp_input_sym : 'b' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'b'; } () def p_udp_input_sym_6(p): '''udp_input_sym : '*' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = '*'; } () def p_udp_input_sym_7(p): '''udp_input_sym : '%' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = '%'; } () def p_udp_input_sym_8(p): '''udp_input_sym : 'f' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'f'; } () def p_udp_input_sym_9(p): '''udp_input_sym : 'F' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'F'; } () def p_udp_input_sym_10(p): '''udp_input_sym : 'l' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'l'; } () def p_udp_input_sym_11(p): '''udp_input_sym : 'h' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'h'; } () def p_udp_input_sym_12(p): '''udp_input_sym : 'B' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'B'; } () def p_udp_input_sym_13(p): '''udp_input_sym : 'r' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'r'; } () def p_udp_input_sym_14(p): '''udp_input_sym : 'R' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'R'; } () def p_udp_input_sym_15(p): '''udp_input_sym : 'M' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'M'; } () def p_udp_input_sym_16(p): '''udp_input_sym : 'n' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'n'; } () def p_udp_input_sym_17(p): '''udp_input_sym : 'N' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'N'; } () def p_udp_input_sym_18(p): '''udp_input_sym : 'p' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'p'; } () def p_udp_input_sym_19(p): '''udp_input_sym : 'P' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'P'; } () def p_udp_input_sym_20(p): '''udp_input_sym : 'Q' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'Q'; } () def p_udp_input_sym_21(p): '''udp_input_sym : 'q' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = 'q'; } () def p_udp_input_sym_22(p): '''udp_input_sym : '_' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = '_'; } () def p_udp_input_sym_23(p): '''udp_input_sym : '+' ''' - print(p) + print('udp_input_sym', list(p)) # { $$ = '+'; } () def p_udp_input_sym_24(p): '''udp_input_sym : DEC_NUMBER ''' - print(p) + print('udp_input_sym', list(p)) # { yyerror(@1, "internal error: Input digits parse as decimal number!"); $$ = '0'; } () def p_udp_output_sym_1(p): '''udp_output_sym : '0' ''' - print(p) + print('udp_output_sym', list(p)) # { $$ = '0'; } () def p_udp_output_sym_2(p): '''udp_output_sym : '1' ''' - print(p) + print('udp_output_sym', list(p)) # { $$ = '1'; } () def p_udp_output_sym_3(p): '''udp_output_sym : 'x' ''' - print(p) + print('udp_output_sym', list(p)) # { $$ = 'x'; } () def p_udp_output_sym_4(p): '''udp_output_sym : '-' ''' - print(p) + print('udp_output_sym', list(p)) # { $$ = '-'; } () def p_udp_output_sym_5(p): '''udp_output_sym : DEC_NUMBER ''' - print(p) + print('udp_output_sym', list(p)) # { yyerror(@1, "internal error: Output digits parse as decimal number!"); $$ = '0'; } () def p_udp_port_decl_1(p): '''udp_port_decl : K_input list_of_identifiers ';' ''' - print(p) + print('udp_port_decl', list(p)) # { $$ = pform_make_udp_input_ports($2); } () def p_udp_port_decl_2(p): '''udp_port_decl : K_output IDENTIFIER ';' ''' - print(p) + print('udp_port_decl', list(p)) # { perm_string pname = lex_strings.make($2); # PWire*pp = new PWire(pname, NetNet::IMPLICIT, NetNet::POUTPUT, IVL_VT_LOGIC); # vector*tmp = new vector(1); @@ -8040,7 +8064,7 @@ def p_udp_port_decl_2(p): () def p_udp_port_decl_3(p): '''udp_port_decl : K_reg IDENTIFIER ';' ''' - print(p) + print('udp_port_decl', list(p)) # { perm_string pname = lex_strings.make($2); # PWire*pp = new PWire(pname, NetNet::REG, NetNet::PIMPLICIT, IVL_VT_LOGIC); # vector*tmp = new vector(1); @@ -8051,7 +8075,7 @@ def p_udp_port_decl_3(p): () def p_udp_port_decl_4(p): '''udp_port_decl : K_reg K_output IDENTIFIER ';' ''' - print(p) + print('udp_port_decl', list(p)) # { perm_string pname = lex_strings.make($3); # PWire*pp = new PWire(pname, NetNet::REG, NetNet::POUTPUT, IVL_VT_LOGIC); # vector*tmp = new vector(1); @@ -8062,12 +8086,12 @@ def p_udp_port_decl_4(p): () def p_udp_port_decls_1(p): '''udp_port_decls : udp_port_decl ''' - print(p) + print('udp_port_decls', list(p)) # { $$ = $1; } () def p_udp_port_decls_2(p): '''udp_port_decls : udp_port_decls udp_port_decl ''' - print(p) + print('udp_port_decls', list(p)) # { vector*tmp = $1; # size_t s1 = $1->size(); # tmp->resize(s1+$2->size()); @@ -8079,7 +8103,7 @@ def p_udp_port_decls_2(p): () def p_udp_port_list_1(p): '''udp_port_list : IDENTIFIER ''' - print(p) + print('udp_port_list', list(p)) # { list*tmp = new list; # tmp->push_back(lex_strings.make($1)); # delete[]$1; @@ -8088,7 +8112,7 @@ def p_udp_port_list_1(p): () def p_udp_port_list_2(p): '''udp_port_list : udp_port_list ',' IDENTIFIER ''' - print(p) + print('udp_port_list', list(p)) # { list*tmp = $1; # tmp->push_back(lex_strings.make($3)); # delete[]$3; @@ -8097,27 +8121,27 @@ def p_udp_port_list_2(p): () def p_udp_reg_opt_1(p): '''udp_reg_opt : K_reg ''' - print(p) + print('udp_reg_opt', list(p)) # { $$ = true; } () def p_udp_reg_opt_2(p): '''udp_reg_opt : ''' - print(p) + print('udp_reg_opt', list(p)) # { $$ = false; } () def p_udp_initial_expr_opt_1(p): '''udp_initial_expr_opt : '=' expression ''' - print(p) + print('udp_initial_expr_opt', list(p)) # { $$ = $2; } () def p_udp_initial_expr_opt_2(p): '''udp_initial_expr_opt : ''' - print(p) + print('udp_initial_expr_opt', list(p)) # { $$ = 0; } () def p_udp_input_declaration_list_1(p): '''udp_input_declaration_list : K_input IDENTIFIER ''' - print(p) + print('udp_input_declaration_list', list(p)) # { list*tmp = new list; # tmp->push_back(lex_strings.make($2)); # $$ = tmp; @@ -8126,7 +8150,7 @@ def p_udp_input_declaration_list_1(p): () def p_udp_input_declaration_list_2(p): '''udp_input_declaration_list : udp_input_declaration_list ',' K_input IDENTIFIER ''' - print(p) + print('udp_input_declaration_list', list(p)) # { list*tmp = $1; # tmp->push_back(lex_strings.make($4)); # $$ = tmp; @@ -8135,7 +8159,7 @@ def p_udp_input_declaration_list_2(p): () def p_udp_primitive_1(p): '''udp_primitive : K_primitive IDENTIFIER '(' udp_port_list ')' ';' udp_port_decls udp_init_opt udp_body K_endprimitive endlabel_opt ''' - print(p) + print('udp_primitive', list(p)) # { perm_string tmp2 = lex_strings.make($2); # pform_make_udp(tmp2, $4, $7, $9, $8, # @2.text, @2.first_line); @@ -8155,7 +8179,7 @@ def p_udp_primitive_1(p): () def p_udp_primitive_2(p): '''udp_primitive : K_primitive IDENTIFIER '(' K_output udp_reg_opt IDENTIFIER udp_initial_expr_opt ',' udp_input_declaration_list ')' ';' udp_body K_endprimitive endlabel_opt ''' - print(p) + print('udp_primitive', list(p)) # { perm_string tmp2 = lex_strings.make($2); # perm_string tmp6 = lex_strings.make($6); # pform_make_udp(tmp2, $5, tmp6, $7, $9, $12, @@ -8177,32 +8201,32 @@ def p_udp_primitive_2(p): () def p_K_packed_opt_1(p): '''K_packed_opt : K_packed ''' - print(p) + print('K_packed_opt', list(p)) # { $$ = true; } () def p_K_packed_opt_2(p): '''K_packed_opt : ''' - print(p) + print('K_packed_opt', list(p)) # { $$ = false; } () def p_K_reg_opt_1(p): '''K_reg_opt : K_reg ''' - print(p) + print('K_reg_opt', list(p)) # { $$ = true; } () def p_K_reg_opt_2(p): '''K_reg_opt : ''' - print(p) + print('K_reg_opt', list(p)) # { $$ = false; } () def p_K_static_opt_1(p): '''K_static_opt : K_static ''' - print(p) + print('K_static_opt', list(p)) # { $$ = true; } () def p_K_static_opt_2(p): '''K_static_opt : ''' - print(p) + print('K_static_opt', list(p)) # { $$ = false; } () -- 2.30.2