('right', 'K_PLUS_EQ', 'K_MINUS_EQ', 'K_MUL_EQ', 'K_DIV_EQ',
'K_MOD_EQ', 'K_AND_EQ', 'K_OR_EQ'),
('right', 'K_XOR_EQ', 'K_LS_EQ', 'K_RS_EQ', 'K_RSS_EQ'),
('right', '?', ':', 'K_inside'),
('right', 'K_PLUS_EQ', 'K_MINUS_EQ', 'K_MUL_EQ', 'K_DIV_EQ',
'K_MOD_EQ', 'K_AND_EQ', 'K_OR_EQ'),
('right', 'K_XOR_EQ', 'K_LS_EQ', 'K_RS_EQ', 'K_RSS_EQ'),
('right', '?', ':', 'K_inside'),
- ('left', 'K_LOR'),
- ('left', 'K_LAND'),
- ('left', '|'),
- ('left', '^', 'K_NXOR', 'K_NOR'),
- ('left', '&', 'K_NAND'),
- ('left', 'K_EQ', 'K_NE', 'K_CEQ', 'K_CNE', 'K_WEQ', 'K_WNE'),
- ('left', 'K_GE', 'K_LE', '<', '>'),
- ('left', 'K_LS', 'K_RS', 'K_RSS'),
- ('left', '+', '-'),
- ('left', '*', '/', '%'),
- ('left', 'K_POW'),
- ('left', 'UNARY_PREC'),
- ('nonassoc', 'less_than_K_else'),
- ('nonassoc', 'K_else'),
- ('nonassoc', '('),
- ('nonassoc', 'K_exclude'),
- ('nonassoc', 'no_timeunits_declaration'),
- ('nonassoc', 'one_timeunits_declaration'),
+ ('left', 'K_LOR'),
+ ('left', 'K_LAND'),
+ ('left', '|'),
+ ('left', '^', 'K_NXOR', 'K_NOR'),
+ ('left', '&', 'K_NAND'),
+ ('left', 'K_EQ', 'K_NE', 'K_CEQ', 'K_CNE', 'K_WEQ', 'K_WNE'),
+ ('left', 'K_GE', 'K_LE', '<', '>'),
+ ('left', 'K_LS', 'K_RS', 'K_RSS'),
+ ('left', '+', '-'),
+ ('left', '*', '/', '%'),
+ ('left', 'K_POW'),
+ ('left', 'UNARY_PREC'),
+ ('nonassoc', 'less_than_K_else'),
+ ('nonassoc', 'K_else'),
+ ('nonassoc', '('),
+ ('nonassoc', 'K_exclude'),
+ ('nonassoc', 'no_timeunits_declaration'),
+ ('nonassoc', 'one_timeunits_declaration'),
+]
+
+
+IVL_VT_NO_TYPE = 'VT_NO_TYPE'
+IVL_VT_BOOL = 'VT_BOOL'
+IVL_VT_LOGIC = 'VT_LOGIC'
+"""
+ IVL_VT_VOID = 0, /* Not used */
+ IVL_VT_NO_TYPE = 1, /* Place holder for missing/unknown type. */
+ IVL_VT_REAL = 2,
+ IVL_VT_BOOL = 3,
+ IVL_VT_LOGIC = 4,
+ IVL_VT_STRING = 5,
+ IVL_VT_DARRAY = 6, /* Array (esp. dynamic array) */
+ IVL_VT_CLASS = 7, /* SystemVerilog class instances */
+ IVL_VT_QUEUE = 8, /* SystemVerilog queue instances */
+ IVL_VT_VECTOR = IVL_VT_LOGIC /* For compatibility */
+"""
+
+NN_NONE = 'NONE'
+NN_IMPLICIT = 'IMPLICIT'
+NN_IMPLICIT_REG = 'IMPLICIT_REG'
+NN_INTEGER = 'INTEGER'
+NN_WIRE = 'WIRE'
+NN_TRI = 'TRI'
+NN_TRI1 = 'TRI1'
+NN_SUPPLY0 = 'SUPPLY0'
+NN_SUPPLY1 = 'SUPPLY1'
+NN_WAND = 'WAND'
+NN_TRIAND = 'TRIAND'
+NN_TRI0 = 'TRI0'
+NN_WOR = 'WOR'
+NN_TRIOR = 'TRIOR'
+NN_REG = 'REG'
+NN_UNRESOLVED_WIRE = 'UNRESOLVED_WIRE'
+
+NP_NOT_A_PORT = 'NOT_A_PORT'
+NP_PIMPLICIT = 'PIMPLICIT'
+NP_PINPUT = 'PINPUT'
+NP_POUTPUT = 'POUTPUT'
+NP_PINOUT = 'PINOUT'
+NP_PREF = 'PREF'
+
+
+class DataType:
+ def __init__(self, typ, signed):
+ self.typ = typ
+ self.signed = signed
+
+
+class StatementList:
+ def __init__(self):
+ self.statements = []
+
+ def add_statement(self, s):
+ self.statements += [s]
+
+
- print('data_type_1', list(p))
- # { ivl_variable_type_t use_vtype = $1;
+ if(parse_debug):
+ print('data_type_1', list(p))
+ use_vtype = p[1]
+ reg_flag = False
+ if (use_vtype == IVL_VT_NO_TYPE):
+ use_vtype = IVL_VT_LOGIC
+ reg_flag = True
+ dt = DataType(use_vtype, signed=p[2])
+ dt.dims = p[3]
+ dt.reg_flag = reg_flag
+ p[0] = dt
+
+
+ # { ivl_variable_type_t use_vtype = p[1];
# { list<pform_range_t>*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();
# { list<pform_range_t>*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();
- print('description_8', list(p))
- # { perm_string tmp3 = lex_strings.make($3);
- # pform_set_type_attrib(tmp3, $5, $7);
- # delete[] $3;
- # delete[] $5;
+ if(parse_debug):
+ print('description_8', list(p))
+
+
+ # { perm_string tmp3 = lex_strings.make(p[3]);
+ # pform_set_type_attrib(tmp3, p[5], p[7]);
+ # delete[] p[3];
+ # delete[] p[5];
- print('loop_statement_1', list(p))
- # { PForStatement*tmp = new PForStatement($3, $5, $7, $9, $11);
+ if(parse_debug):
+ print('loop_statement_1', list(p))
+
+
+ # { PForStatement*tmp = new PForStatement(p[3], p[5], p[7], p[9], p[11]);
# pform_pop_scope();
# vector<Statement*>tmp_for_list (1);
# tmp_for_list[0] = tmp_for;
# PBlock*tmp_blk = current_block_stack.top();
# current_block_stack.pop();
# tmp_blk->set_statement(tmp_for_list);
# pform_pop_scope();
# vector<Statement*>tmp_for_list (1);
# tmp_for_list[0] = tmp_for;
# PBlock*tmp_blk = current_block_stack.top();
# current_block_stack.pop();
# tmp_blk->set_statement(tmp_for_list);
# pform_pop_scope();
# vector<Statement*>tmp_for_list(1);
# tmp_for_list[0] = tmp_for;
# PBlock*tmp_blk = current_block_stack.top();
# current_block_stack.pop();
# tmp_blk->set_statement(tmp_for_list);
# pform_pop_scope();
# vector<Statement*>tmp_for_list(1);
# tmp_for_list[0] = tmp_for;
# PBlock*tmp_blk = current_block_stack.top();
# current_block_stack.pop();
# tmp_blk->set_statement(tmp_for_list);
- print('number_1', list(p))
- # { $$ = $1; based_size = 0;}
+ if(parse_debug):
+ print('number_1', list(p))
+
+ p[1] = p[1].replace("'b", "0b")
+ p[1] = p[1].replace("'x", "0x")
+ num = Leaf(token.NUMBER, "%s" % (p[1]))
+ p[0] = num
+
+
+ # { p[0] = p[1]; based_size = 0;}
- print('number_3', list(p))
- num = Leaf(token.NUMBER, "%s:%s" % (p[1], p[2]))
+ if(parse_debug):
+ print('number_3', list(p))
+
+ p[2] = p[2].replace("'b", "0b")
+ p[2] = p[2].replace("'x", "0x")
+
+ num = Leaf(token.NUMBER, "%s" % (p[2]))
# { list<pform_range_t>*pd = make_range_from_width(integer_width);
# vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, true, pd);
# tmp->reg_flag = true;
# tmp->integer_flag = true;
# { list<pform_range_t>*pd = make_range_from_width(integer_width);
# vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, true, pd);
# tmp->reg_flag = true;
# tmp->integer_flag = true;
# { list<pform_range_t>*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();
# { list<pform_range_t>*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();
# { // 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
# // early enough that the lexor can know we are outside the
# // module.
# { // 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
# // early enough that the lexor can know we are outside the
# // module.
# { // 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
# // early enough that the lexor can know we are outside the
# // module.
# { // 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
# // early enough that the lexor can know we are outside the
# // module.
# { // 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
# // early enough that the lexor can know we are outside the
# // module.
# { // 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
# // early enough that the lexor can know we are outside the
# // module.
# { // 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
# // early enough that the lexor can know we are outside the
# // module.
# { // 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
# // early enough that the lexor can know we are outside the
# // module.
- # vector<pform_tf_port_t>*tmp = pform_make_task_ports(@1, $1, IVL_VT_LOGIC, true,
- # range_stub, $3, true);
- # $$ = tmp;
+ # vector<pform_tf_port_t>*tmp = pform_make_task_ports(@1, p[1], IVL_VT_LOGIC, true,
+ # range_stub, p[3], true);
+ # p[0] = tmp;
- print('tf_port_declaration_4', list(p))
- # { vector<pform_tf_port_t>*tmp = pform_make_task_ports(@1, $1, IVL_VT_REAL, true,
- # 0, $3);
- # $$ = tmp;
+ if(parse_debug):
+ print('tf_port_declaration_4', list(p))
+
+
+ # { vector<pform_tf_port_t>*tmp = pform_make_task_ports(@1, p[1], IVL_VT_REAL, true,
+ # 0, p[3]);
+ # p[0] = tmp;
- print('tf_port_declaration_5', list(p))
- # { vector<pform_tf_port_t>*tmp = pform_make_task_ports(@1, $1, IVL_VT_STRING, true,
- # 0, $3);
- # $$ = tmp;
+ if(parse_debug):
+ print('tf_port_declaration_5', list(p))
+
+
+ # { vector<pform_tf_port_t>*tmp = pform_make_task_ports(@1, p[1], IVL_VT_STRING, true,
+ # 0, p[3]);
+ # p[0] = tmp;
# yyerror(@4, "internal error: How can there be an unpacked range here?\n");
# }
# tmp = pform_make_task_ports(@3, use_port_type,
# port_declaration_context.data_type,
# ilist);
# yyerror(@4, "internal error: How can there be an unpacked range here?\n");
# }
# tmp = pform_make_task_ports(@3, use_port_type,
# port_declaration_context.data_type,
# ilist);
# } else {
# // Otherwise, the decorations for this identifier
# // indicate the type. Save the type for any right
# // context that may come later.
# port_declaration_context.port_type = use_port_type;
# } else {
# // Otherwise, the decorations for this identifier
# // indicate the type. Save the type for any right
# // context that may come later.
# port_declaration_context.port_type = use_port_type;
- # if ($1 && $3) {
- # size_t s1 = $1->size();
- # tmp = $1;
- # tmp->resize(tmp->size()+$3->size());
- # for (size_t idx = 0 ; idx < $3->size() ; idx += 1)
- # tmp->at(s1+idx) = $3->at(idx);
- # delete $3;
- # } else if ($1) {
- # tmp = $1;
+ # if (p[1] && p[3]) {
+ # size_t s1 = p[1]->size();
+ # tmp = p[1];
+ # tmp->resize(tmp->size()+p[3]->size());
+ # for (size_t idx = 0 ; idx < p[3]->size() ; idx += 1)
+ # tmp->at(s1+idx) = p[3]->at(idx);
+ # delete p[3];
+ # } else if (p[1]) {
+ # tmp = p[1];
- print('block_item_decl_1', list(p))
- # { if ($1) pform_set_data_type(@1, $1, $2, NetNet::REG, attributes_in_context);
+ if(parse_debug):
+ print('block_item_decl_1', list(p))
+
+
+ # { if (p[1]) pform_set_data_type(@1, p[1], p[2], NetNet::REG, attributes_in_context);
- print('block_item_decl_2', list(p))
- # { if ($2) pform_set_data_type(@2, $2, $3, NetNet::REG, attributes_in_context);
+ if(parse_debug):
+ print('block_item_decl_2', list(p))
+
+
+ # { if (p[2]) pform_set_data_type(@2, p[2], p[3], NetNet::REG, attributes_in_context);
- print('block_item_decl_3', list(p))
- # { if ($2) pform_set_data_type(@2, $2, $3, NetNet::REG, attributes_in_context);
+ if(parse_debug):
+ print('block_item_decl_3', list(p))
+
+
+ # { if (p[2]) pform_set_data_type(@2, p[2], p[3], NetNet::REG, attributes_in_context);
- print('block_item_decl_4', list(p))
- # { if ($3) pform_set_data_type(@3, $3, $4, NetNet::REG, attributes_in_context);
+ if(parse_debug):
+ print('block_item_decl_4', list(p))
+
+
+ # { if (p[3]) pform_set_data_type(@3, p[3], p[4], NetNet::REG, attributes_in_context);
- print('type_declaration_1', list(p))
- # { perm_string name = lex_strings.make($3);
- # pform_set_typedef(name, $2, $4);
- # delete[]$3;
+ if(parse_debug):
+ print('type_declaration_1', list(p))
+
+
+ # { perm_string name = lex_strings.make(p[3]);
+ # pform_set_typedef(name, p[2], p[4]);
+ # delete[]p[3];
# enum_type->base_type = IVL_VT_BOOL;
# enum_type->signed_flag = true;
# enum_type->integer_flag = false;
# enum_type->range.reset(make_range_from_width(32));
# enum_type->base_type = IVL_VT_BOOL;
# enum_type->signed_flag = true;
# enum_type->integer_flag = false;
# enum_type->range.reset(make_range_from_width(32));
- print('enum_name_2', list(p))
- # { perm_string name = lex_strings.make($1);
- # long count = check_enum_seq_value(@1, $3, false);
- # delete[]$1;
- # $$ = make_named_numbers(name, 0, count-1);
- # delete $3;
+ if(parse_debug):
+ print('enum_name_2', list(p))
+
+
+ # { perm_string name = lex_strings.make(p[1]);
+ # long count = check_enum_seq_value(@1, p[3], false);
+ # delete[]p[1];
+ # p[0] = make_named_numbers(name, 0, count-1);
+ # delete p[3];
- print('enum_name_3', 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));
- # delete[]$1;
- # delete $3;
- # delete $5;
+ if(parse_debug):
+ print('enum_name_3', list(p))
+
+
+ # { perm_string name = lex_strings.make(p[1]);
+ # p[0] = make_named_numbers(name, check_enum_seq_value(@1, p[3], true),
+ # check_enum_seq_value(@1, p[5], true));
+ # delete[]p[1];
+ # delete p[3];
+ # delete p[5];
- print('enum_name_5', 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);
- # delete[]$1;
- # delete $3;
+ if(parse_debug):
+ print('enum_name_5', list(p))
+
+
+ # { perm_string name = lex_strings.make(p[1]);
+ # long count = check_enum_seq_value(@1, p[3], false);
+ # p[0] = make_named_numbers(name, 0, count-1, p[6]);
+ # delete[]p[1];
+ # delete p[3];
- print('enum_name_6', 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);
- # delete[]$1;
- # delete $3;
- # delete $5;
+ if(parse_debug):
+ print('enum_name_6', list(p))
+
+
+ # { perm_string name = lex_strings.make(p[1]);
+ # p[0] = make_named_numbers(name, check_enum_seq_value(@1, p[3], true),
+ # check_enum_seq_value(@1, p[5], true), p[8]);
+ # delete[]p[1];
+ # delete p[3];
+ # delete p[5];
+
+
+def PEUnary(op, o1):
+ #Leaf(token.STRING, ' ')
+ try:
+ return Node(syms.atom, [op, o1])
+ except:
+ return "error in PEUnary: "+str(op)+","+str(o1)
+
+
+def PEBinary(op, o1, o2):
+ try:
+ return Node(syms.atom, [o1, Leaf(token.STRING, ' '), op, Leaf(token.STRING, ' '), o2])
+ except:
+ return "error in PEBinary: "+str(op)+","+str(o1)+","+str(o2)
+
+# unary minus
+
+
- print('expression_19', list(p))
- # { PEBinary*tmp = new PEBinary('^', $1, $4);
+ if(parse_debug):
+ print('expression_19', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '^'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBinary('^', p[1], p[4]);
- print('expression_20', list(p))
- # { PEBinary*tmp = new PEBPower('p', $1, $4);
+ if(parse_debug):
+ print('expression_20', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '**'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBPower('p', p[1], p[4]);
- print('expression_21', list(p))
- # { PEBinary*tmp = new PEBinary('*', $1, $4);
+ if(parse_debug):
+ print('expression_21', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '*'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBinary('*', p[1], p[4]);
- print('expression_22', list(p))
- # { PEBinary*tmp = new PEBinary('/', $1, $4);
+ if(parse_debug):
+ print('expression_22', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '/'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBinary('/', p[1], p[4]);
- print('expression_23', list(p))
- # { PEBinary*tmp = new PEBinary('%', $1, $4);
+ if(parse_debug):
+ print('expression_23', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '%'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBinary('%', p[1], p[4]);
- print('expression_26', list(p))
- # { PEBinary*tmp = new PEBinary('&', $1, $4);
+ if(parse_debug > 2):
+ print('expression_26', list(p))
+
+ p[0] = PEBinary(Leaf(token.AMPER, '&'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBinary('&', p[1], p[4]);
- print('expression_27', list(p))
- # { PEBinary*tmp = new PEBinary('|', $1, $4);
+ if(parse_debug > 2):
+ print('expression_27', list(p))
+
+ p[0] = PEBinary(Leaf(token.VBAR, '|'), p[1], p[4])
+
+ # { PEBinary*tmp = new PEBinary('|', p[1], p[4]);
- print('expression_28', list(p))
- # { PEBinary*tmp = new PEBinary('A', $1, $4);
+ if(parse_debug):
+ print('expression_28', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '~&'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBinary('A', p[1], p[4]);
- print('expression_29', list(p))
- # { PEBinary*tmp = new PEBinary('O', $1, $4);
+ if(parse_debug):
+ print('expression_29', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '~|'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBinary('O', p[1], p[4]);
- print('expression_30', list(p))
- # { PEBinary*tmp = new PEBinary('X', $1, $4);
+ if(parse_debug):
+ print('expression_30', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, 'K_XNOR'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBinary('X', p[1], p[4]);
- print('expression_31', list(p))
- # { PEBinary*tmp = new PEBComp('<', $1, $4);
+ if(parse_debug):
+ print('expression_31', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '<'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('<', p[1], p[4]);
- print('expression_32', list(p))
- # { PEBinary*tmp = new PEBComp('>', $1, $4);
+ if(parse_debug):
+ print('expression_32', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '>'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('>', p[1], p[4]);
- print('expression_33', list(p))
- # { PEBinary*tmp = new PEBShift('l', $1, $4);
+ if(parse_debug):
+ print('expression_33', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, 'K_LS'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBShift('l', p[1], p[4]);
- print('expression_34', list(p))
- # { PEBinary*tmp = new PEBShift('r', $1, $4);
+ if(parse_debug):
+ print('expression_34', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, 'K_RS'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBShift('r', p[1], p[4]);
- print('expression_35', list(p))
- # { PEBinary*tmp = new PEBShift('R', $1, $4);
+ if(parse_debug):
+ print('expression_35', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, 'K_RSS'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBShift('R', p[1], p[4]);
- print('expression_36', list(p))
- # { PEBinary*tmp = new PEBComp('e', $1, $4);
+ if(parse_debug):
+ print('expression_36', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '=='), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('e', p[1], p[4]);
- print('expression_37', list(p))
- # { PEBinary*tmp = new PEBComp('E', $1, $4);
+ if(parse_debug):
+ print('expression_37', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, 'K_CEQ'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('E', p[1], p[4]);
- print('expression_38', list(p))
- # { PEBinary*tmp = new PEBComp('w', $1, $4);
+ if(parse_debug):
+ print('expression_38', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, 'K_WEQ'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('w', p[1], p[4]);
- print('expression_39', list(p))
- # { PEBinary*tmp = new PEBComp('L', $1, $4);
+ if(parse_debug):
+ print('expression_39', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '<='), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('L', p[1], p[4]);
- print('expression_40', list(p))
- # { PEBinary*tmp = new PEBComp('G', $1, $4);
+ if(parse_debug):
+ print('expression_40', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '>='), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('G', p[1], p[4]);
- print('expression_41', list(p))
- # { PEBinary*tmp = new PEBComp('n', $1, $4);
+ if(parse_debug):
+ print('expression_41', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '!='), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('n', p[1], p[4]);
- print('expression_42', list(p))
- # { PEBinary*tmp = new PEBComp('N', $1, $4);
+ if(parse_debug):
+ print('expression_42', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, 'K_CNE'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('N', p[1], p[4]);
- print('expression_43', list(p))
- # { PEBinary*tmp = new PEBComp('W', $1, $4);
+ if(parse_debug):
+ print('expression_43', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, 'K_WNE'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBComp('W', p[1], p[4]);
- print('expression_44', list(p))
- # { PEBinary*tmp = new PEBLogic('o', $1, $4);
+ if(parse_debug):
+ print('expression_44', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '||'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBLogic('o', p[1], p[4]);
- print('expression_45', list(p))
- # { PEBinary*tmp = new PEBLogic('a', $1, $4);
+ if(parse_debug):
+ print('expression_45', list(p))
+
+ p[0] = PEBinary(Leaf(token.STRING, '&&'), p[1], p[4])
+
+
+ # { PEBinary*tmp = new PEBLogic('a', p[1], p[4]);
- print('expression_46', list(p))
- # { PETernary*tmp = new PETernary($1, $4, $6);
+ if(parse_debug):
+ print('expression_46', list(p))
+
+ try:
+ p[0] = Node(syms.atom, [p[1], Leaf(token.STRING, ' ? '),
+ p[4], Leaf(token.STRING, ' : '), p[6]])
+ except:
+ p[0] = "error in PETernary"
+
+
+ # { PETernary*tmp = new PETernary(p[1], p[4], p[6]);
- print('expr_primary_9', list(p))
- # { pform_name_t*t_name = $1;
- # while (! $3->empty()) {
- # t_name->push_back($3->front());
- # $3->pop_front();
+ if(parse_debug):
+ print('expr_primary_9', list(p))
+
+
+ # { pform_name_t*t_name = p[1];
+ # while (! p[3]->empty()) {
+ # t_name->push_back(p[3]->front());
+ # p[3]->pop_front();
- print('expr_primary_11', list(p))
- # { perm_string use_name = lex_strings.make($3);
- # PECallFunction*tmp = new PECallFunction($1, use_name, *$5);
+ if(parse_debug):
+ print('expr_primary_11', list(p))
+
+
+ # { perm_string use_name = lex_strings.make(p[3]);
+ # PECallFunction*tmp = new PECallFunction(p[1], use_name, *p[5]);
- print('expr_primary_14', list(p))
- # { pform_name_t*t_name = $1;
- # while (! $3->empty()) {
- # t_name->push_back($3->front());
- # $3->pop_front();
+ if(parse_debug):
+ print('expr_primary_14', list(p))
+
+
+ # { pform_name_t*t_name = p[1];
+ # while (! p[3]->empty()) {
+ # t_name->push_back(p[3]->front());
+ # p[3]->pop_front();
- print('hierarchy_identifier_3', list(p))
- # { pform_name_t * tmp = $1;
+ if(parse_debug):
+ print('hierarchy_identifier_3', list(p))
+
+ p[0] = Node(syms.atom, [p[1], Leaf(
+ token.STRING, '['), p[3], Leaf(token.STRING, ']')])
+
+
+ # { pform_name_t * tmp = p[1];
- print('list_of_port_declarations_2', list(p))
- # { vector<Module::port_t*>*tmp = $1;
- # tmp->push_back($3);
- # $$ = tmp;
+ if(parse_debug):
+ print('list_of_port_declarations_2 FIXME', list(p))
+ # MOVE_TO absyn p[1].append(Leaf(token.NEWLINE, '\n')) # should be a comma
+ # XXX p[3].prefix=' ' # add a space after the NL, must go in parameter
+ p[1].append(p[3])
+ p[0] = p[1]
+
+
+ # { vector<Module::port_t*>*tmp = p[1];
+ # tmp->push_back(p[3]);
+ # p[0] = tmp;
# port_declaration_context.port_type,
# port_declaration_context.port_net_type,
# port_declaration_context.data_type, 0);
# port_declaration_context.port_type,
# port_declaration_context.port_net_type,
# port_declaration_context.data_type, 0);
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::PINPUT,
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::PINPUT,
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::PINOUT,
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::PINOUT,
- # perm_string name = lex_strings.make($5);
- # data_type_t*use_dtype = $4;
- # if ($6) use_dtype = new uarray_type_t(use_dtype, $6);
- # NetNet::Type use_type = $3;
+ # perm_string name = lex_strings.make(p[5]);
+ # data_type_t*use_dtype = p[4];
+ # if (p[6]) use_dtype = new uarray_type_t(use_dtype, p[6]);
+ # NetNet::Type use_type = p[3];
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::POUTPUT,
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::POUTPUT,
- print('lpvalue_2', list(p))
- # { pform_name_t*t_name = $1;
- # while (!$3->empty()) {
- # t_name->push_back($3->front());
- # $3->pop_front();
+ if(parse_debug):
+ print('lpvalue_2', list(p))
+
+
+ # { pform_name_t*t_name = p[1];
+ # while (!p[3]->empty()) {
+ # t_name->push_back(p[3]->front());
+ # p[3]->pop_front();
- print('module_1', list(p))
- clsname = [Leaf(token.NAME, 'class'),
- Leaf(token.NAME, p[4], prefix=' '),
- Leaf(token.COLON, ':')]
- stmt = Node(syms.pass_stmt, [Leaf(token.NAME, "pass"),])
- stmts = Node(syms.small_stmt, [stmt, Leaf(token.NEWLINE, '\n')])
- stmts = Node(syms.stmt, [stmts])
- suite = Node(syms.suite, [Leaf(token.NEWLINE, '\n'),
- Leaf(token.INDENT, ' '),
- stmts,
- Leaf(token.DEDENT, '')
- ])
- clsdecl = Node(syms.classdef, clsname + [suite],
- prefix='', fixers_applied=[])
- clsdecl = Node(syms.compound_stmt, [clsdecl])
- print ("clsdecl", repr(clsdecl))
- print ("clsstr:")
- print (str(clsdecl))
+ if(parse_debug > 2):
+ print('module_1', list(p))
+ clsdecl = absyn.module_1(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
- # // early enough that the lexor can know we are outside the
- # // module.
- # if ($17) {
- # if (strcmp($4,$17) != 0) {
- # switch ($2) {
- # case K_module:
- # yyerror(@17, "error: End label doesn't match "
- # "module name.");
- # break;
- # case K_program:
- # yyerror(@17, "error: End label doesn't match "
- # "program name.");
- # break;
- # case K_interface:
- # yyerror(@17, "error: End label doesn't match "
- # "interface name.");
- # break;
- # default:
- # break;
- # }
- # }
- # if (($2 == K_module) && (! gn_system_verilog())) {
- # yyerror(@8, "error: Module end labels require "
- # "SystemVerilog.");
- # }
- # delete[]$17;
- # }
- # delete[]$4;
- # }
- print('module_item_9', list(p))
- # { pform_module_define_port(@2, $5, $2, $3, $4, $1); }
+ if(parse_debug):
+ print('module_item_9', list(p))
+
+
+ # { pform_module_define_port(@2, p[5], p[2], p[3], p[4], p[1]); }
# if (dtype->implicit_flag)
# use_type = NetNet::NONE;
# else if (dtype->reg_flag)
# use_type = NetNet::REG;
# else
# use_type = NetNet::IMPLICIT_REG;
# if (dtype->implicit_flag)
# use_type = NetNet::NONE;
# else if (dtype->reg_flag)
# use_type = NetNet::REG;
# else
# use_type = NetNet::IMPLICIT_REG;
- print('module_item_21', list(p))
- # { pform_makegates(@2, $2, str_strength, 0, $3, $1); }
+ if(parse_debug):
+ print('module_item_21', list(p))
+
+
+ # { pform_makegates(@2, p[2], str_strength, 0, p[3], p[1]); }
- print('module_item_22', list(p))
- # { pform_makegates(@2, $2, str_strength, $3, $4, $1); }
+ if(parse_debug):
+ print('module_item_22', list(p))
+
+
+ # { pform_makegates(@2, p[2], str_strength, p[3], p[4], p[1]); }
- print('module_item_23', list(p))
- # { pform_makegates(@2, $2, $3, 0, $4, $1); }
+ if(parse_debug):
+ print('module_item_23', list(p))
+
+
+ # { pform_makegates(@2, p[2], p[3], 0, p[4], p[1]); }
- print('module_item_24', list(p))
- # { pform_makegates(@2, $2, $3, $4, $5, $1); }
+ if(parse_debug):
+ print('module_item_24', list(p))
+
+
+ # { pform_makegates(@2, p[2], p[3], p[4], p[5], p[1]); }
- print('module_item_25', list(p))
- # { pform_makegates(@2, $2, str_strength, 0, $3, $1); }
+ if(parse_debug):
+ print('module_item_25', list(p))
+
+
+ # { pform_makegates(@2, p[2], str_strength, 0, p[3], p[1]); }
- print('module_item_26', list(p))
- # { pform_makegates(@2, $2, str_strength, $3, $4, $1); }
+ if(parse_debug):
+ print('module_item_26', list(p))
+
+
+ # { pform_makegates(@2, p[2], str_strength, p[3], p[4], p[1]); }
- print('module_item_27', list(p))
- # { pform_makegates(@1, PGBuiltin::PULLUP, pull_strength, 0, $2, 0); }
+ if(parse_debug):
+ print('module_item_27', list(p))
+
+
+ # { pform_makegates(@1, PGBuiltin::PULLUP, pull_strength, 0, p[2], 0); }
- print('module_item_28', list(p))
- # { pform_makegates(@1, PGBuiltin::PULLDOWN, pull_strength, 0, $2, 0); }
+ if(parse_debug):
+ print('module_item_28', list(p))
+
+
+ # { pform_makegates(@1, PGBuiltin::PULLDOWN, pull_strength, 0, p[2], 0); }
- print('module_item_29', list(p))
- # { pform_makegates(@1, PGBuiltin::PULLUP, $3, 0, $5, 0); }
+ if(parse_debug):
+ print('module_item_29', list(p))
+
+
+ # { pform_makegates(@1, PGBuiltin::PULLUP, p[3], 0, p[5], 0); }
- print('module_item_30', list(p))
- # { pform_makegates(@1, PGBuiltin::PULLUP, $3, 0, $7, 0); }
+ if(parse_debug):
+ print('module_item_30', list(p))
+
+
+ # { pform_makegates(@1, PGBuiltin::PULLUP, p[3], 0, p[7], 0); }
- print('module_item_31', list(p))
- # { pform_makegates(@1, PGBuiltin::PULLUP, $5, 0, $7, 0); }
+ if(parse_debug):
+ print('module_item_31', list(p))
+
+
+ # { pform_makegates(@1, PGBuiltin::PULLUP, p[5], 0, p[7], 0); }
- print('module_item_32', list(p))
- # { pform_makegates(@1, PGBuiltin::PULLDOWN, $3, 0, $5, 0); }
+ if(parse_debug):
+ print('module_item_32', list(p))
+
+
+ # { pform_makegates(@1, PGBuiltin::PULLDOWN, p[3], 0, p[5], 0); }
- print('module_item_33', list(p))
- # { pform_makegates(@1, PGBuiltin::PULLDOWN, $5, 0, $7, 0); }
+ if(parse_debug):
+ print('module_item_33', list(p))
+
+
+ # { pform_makegates(@1, PGBuiltin::PULLDOWN, p[5], 0, p[7], 0); }
- print('module_item_34', list(p))
- # { pform_makegates(@1, PGBuiltin::PULLDOWN, $3, 0, $7, 0); }
+ if(parse_debug):
+ print('module_item_34', list(p))
+
+
+ # { pform_makegates(@1, PGBuiltin::PULLDOWN, p[3], 0, p[7], 0); }
- print('module_item_35', list(p))
- # { perm_string tmp1 = lex_strings.make($2);
- # pform_make_modgates(@2, tmp1, $3, $4, $1);
- # delete[]$2;
+ if(parse_debug):
+ print('module_item_35', list(p))
+
+
+ # { perm_string tmp1 = lex_strings.make(p[2]);
+ # pform_make_modgates(@2, tmp1, p[3], p[4], p[1]);
+ # delete[]p[2];
- print('module_item_37', list(p))
- # { pform_make_pgassign_list($4, $3, $2, @1.text, @1.first_line); }
+ if(parse_debug > 2):
+ print('module_item_37', list(p))
+
+
+ # { pform_make_pgassign_list(p[4], p[3], p[2], @1.text, @1.first_line); }
- print('module_item_39', list(p))
- # { PProcess*tmp = pform_make_behavior(IVL_PR_ALWAYS_COMB, $3, $1);
+ if(parse_debug):
+ print('module_item_39', list(p))
+
+ absyn.always_comb(p[3], p[1])
+
+
+ # { PProcess*tmp = pform_make_behavior(IVL_PR_ALWAYS_COMB, p[3], p[1]);
- print('module_item_40', list(p))
- # { PProcess*tmp = pform_make_behavior(IVL_PR_ALWAYS_FF, $3, $1);
+ if(parse_debug):
+ print('module_item_40', list(p))
+
+ absyn.always_ff(p[3], p[1])
+
+
+ # { PProcess*tmp = pform_make_behavior(IVL_PR_ALWAYS_FF, p[3], p[1]);
- print('module_item_65', list(p))
- # { perm_string tmp3 = lex_strings.make($3);
- # perm_string tmp5 = lex_strings.make($5);
- # pform_set_attrib(tmp3, tmp5, $7);
- # delete[] $3;
- # delete[] $5;
+ if(parse_debug):
+ print('module_item_65', list(p))
+
+
+ # { perm_string tmp3 = lex_strings.make(p[3]);
+ # perm_string tmp5 = lex_strings.make(p[5]);
+ # pform_set_attrib(tmp3, tmp5, p[7]);
+ # delete[] p[3];
+ # delete[] p[5];
- print('param_type_1', list(p))
- # { param_active_range = $3;
- # param_active_signed = $2;
- # if (($1 == IVL_VT_NO_TYPE) && ($3 != 0))
+ if(parse_debug):
+ print('param_type_1', list(p))
+
+
+ # { param_active_range = p[3];
+ # param_active_signed = p[2];
+ # if ((p[1] == IVL_VT_NO_TYPE) && (p[3] != 0))
- print('param_type_6', list(p))
- # { pform_set_param_from_type(@1, $1.type, $1.text, param_active_range,
+ if(parse_debug):
+ print('param_type_6', list(p))
+
+
+ # { pform_set_param_from_type(@1, p[1].type, p[1].text, param_active_range,
- # { PExpr*tmp = $3;
- # pform_set_parameter(@1, lex_strings.make($1), param_active_type,
- # param_active_signed, param_active_range, tmp, $4);
- # delete[]$1;
+
+
+ # { PExpr*tmp = p[3];
+ # pform_set_parameter(@1, lex_strings.make(p[1]), param_active_type,
+ # param_active_signed, param_active_range, tmp, p[4]);
+ # delete[]p[1];
- print('parameter_value_range_1', list(p))
- # { $$ = pform_parameter_value_range($1, false, $3, false, $5); }
+ if(parse_debug):
+ print('parameter_value_range_1', list(p))
+
+
+ # { p[0] = pform_parameter_value_range(p[1], false, p[3], false, p[5]); }
- print('parameter_value_range_2', list(p))
- # { $$ = pform_parameter_value_range($1, false, $3, true, $5); }
+ if(parse_debug):
+ print('parameter_value_range_2', list(p))
+
+
+ # { p[0] = pform_parameter_value_range(p[1], false, p[3], true, p[5]); }
- print('parameter_value_range_3', list(p))
- # { $$ = pform_parameter_value_range($1, true, $3, false, $5); }
+ if(parse_debug):
+ print('parameter_value_range_3', list(p))
+
+
+ # { p[0] = pform_parameter_value_range(p[1], true, p[3], false, p[5]); }
- print('parameter_value_range_4', list(p))
- # { $$ = pform_parameter_value_range($1, true, $3, true, $5); }
+ if(parse_debug):
+ print('parameter_value_range_4', list(p))
+
+
+ # { p[0] = pform_parameter_value_range(p[1], true, p[3], true, p[5]); }
- print('parameter_value_range_5', list(p))
- # { $$ = pform_parameter_value_range(true, false, $2, false, $2); }
+ if(parse_debug):
+ print('parameter_value_range_5', list(p))
+
+
+ # { p[0] = pform_parameter_value_range(true, false, p[2], false, p[2]); }
# pform_makewire(@1, name, NetNet::REG,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# pform_makewire(@1, name, NetNet::REG,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# { if (pform_peek_scope()->var_init_needs_explicit_lifetime()
# && (var_lifetime == LexicalScope::INHERITED)) {
# cerr << @3 << ": warning: Static variable initialization requires "
# "explicit lifetime in this context." << endl;
# warn_count += 1;
# }
# { if (pform_peek_scope()->var_init_needs_explicit_lifetime()
# && (var_lifetime == LexicalScope::INHERITED)) {
# cerr << @3 << ": warning: Static variable initialization requires "
# "explicit lifetime in this context." << endl;
# warn_count += 1;
# }
# pform_makewire(@1, name, NetNet::REG,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# pform_makewire(@1, name, NetNet::REG,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# pform_makewire(@1, name, NetNet::IMPLICIT,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# pform_makewire(@1, name, NetNet::IMPLICIT,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
- print('specify_edge_path_2', list(p))
- # { int edge_flag = $2? 1 : -1;
- # $$ = pform_make_specify_edge_path(@1, edge_flag, $3, $4, false, $7, $9);}
+ if(parse_debug):
+ print('specify_edge_path_2', list(p))
+
+
+ # { int edge_flag = p[2]? 1 : -1;
+ # p[0] = pform_make_specify_edge_path(@1, edge_flag, p[3], p[4], false, p[7], p[9]);}
- print('specify_edge_path_4', list(p))
- # { int edge_flag = $2? 1 : -1;
- # $$ = pform_make_specify_edge_path(@1, edge_flag, $3, $4, true, $7, $9); }
+ if(parse_debug):
+ print('specify_edge_path_4', list(p))
+
+
+ # { int edge_flag = p[2]? 1 : -1;
+ # p[0] = pform_make_specify_edge_path(@1, edge_flag, p[3], p[4], true, p[7], p[9]); }
- print('specify_simple_path_1', list(p))
- # { $$ = pform_make_specify_path(@1, $2, $3, false, $5); }
+ if(parse_debug):
+ print('specify_simple_path_1', list(p))
+
+
+ # { p[0] = pform_make_specify_path(@1, p[2], p[3], false, p[5]); }
- print('specify_simple_path_2', list(p))
- # { $$ = pform_make_specify_path(@1, $2, $3, true, $5); }
+ if(parse_debug):
+ print('specify_simple_path_2', list(p))
+
+
+ # { p[0] = pform_make_specify_path(@1, p[2], p[3], true, p[5]); }
# { if (gn_specify_blocks_flag) {
# yywarn(@4, "Bit selects are not currently supported "
# "in path declarations. The declaration "
# "will be applied to the whole vector.");
# }
# list<perm_string>*tmp = new list<perm_string>;
# { if (gn_specify_blocks_flag) {
# yywarn(@4, "Bit selects are not currently supported "
# "in path declarations. The declaration "
# "will be applied to the whole vector.");
# }
# list<perm_string>*tmp = new list<perm_string>;
# { if (gn_specify_blocks_flag) {
# yywarn(@4, "Part selects are not currently supported "
# "in path declarations. The declaration "
# "will be applied to the whole vector.");
# }
# list<perm_string>*tmp = new list<perm_string>;
# { if (gn_specify_blocks_flag) {
# yywarn(@4, "Part selects are not currently supported "
# "in path declarations. The declaration "
# "will be applied to the whole vector.");
# }
# list<perm_string>*tmp = new list<perm_string>;
# { if (gn_specify_blocks_flag) {
# yywarn(@4, "Bit selects are not currently supported "
# "in path declarations. The declaration "
# "will be applied to the whole vector.");
# }
# { if (gn_specify_blocks_flag) {
# yywarn(@4, "Bit selects are not currently supported "
# "in path declarations. The declaration "
# "will be applied to the whole vector.");
# }
# { if (gn_specify_blocks_flag) {
# yywarn(@4, "Part selects are not currently supported "
# "in path declarations. The declaration "
# "will be applied to the whole vector.");
# }
# { if (gn_specify_blocks_flag) {
# yywarn(@4, "Part selects are not currently supported "
# "in path declarations. The declaration "
# "will be applied to the whole vector.");
# }
- print('statement_item_23', list(p))
- # { PCondit*tmp = new PCondit($3, $5, 0);
+ if(parse_debug):
+ print('statement_item_23', list(p))
+
+ p[0] = absyn.cond_statement3(p[3], p[5], None)
+
+
+ # { PCondit*tmp = new PCondit(p[3], p[5], 0);
- print('statement_item_24', list(p))
- # { PCondit*tmp = new PCondit($3, $5, $7);
+ if(parse_debug):
+ print('statement_item_24', list(p))
+
+ p[0] = absyn.cond_statement3(p[3], p[5], p[7])
+
+ # { PCondit*tmp = new PCondit(p[3], p[5], p[7]);
- print('statement_item_29', list(p))
- # { PExpr*del = $1->front();
- # assert($1->size() == 1);
- # delete $1;
- # PDelayStatement*tmp = new PDelayStatement(del, $2);
+ if(parse_debug):
+ print('statement_item_29', list(p))
+
+
+ # { PExpr*del = p[1]->front();
+ # assert(p[1]->size() == 1);
+ # delete p[1];
+ # PDelayStatement*tmp = new PDelayStatement(del, p[2]);
- expr = Node(syms.expr_stmt, [p[1], Leaf(token.EQUAL, p[2]), p[3] ])
- print ("expr TODO", repr(expr))
+ expr = Node(syms.expr_stmt, [p[1], Leaf(token.EQUAL, p[2]), p[3]])
+ if(parse_debug):
+ print("expr TODO", repr(expr))
- expr = Node(syms.expr_stmt, [p[1], Leaf(token.EQUAL, p[2]), ])
- print ("expr", repr(expr))
- print ("expr (python):'%s'" % expr)
+ expr = Node(syms.expr_stmt, [p[1], Leaf(token.EQUAL, p[2]), ])
+ if(parse_debug):
+ print("expr", repr(expr))
+ if(parse_debug):
+ print("expr (python):'%s'" % expr)
- print('statement_item_37', list(p))
- # { PExpr*del = $3->front(); $3->pop_front();
- # assert($3->empty());
- # PAssign*tmp = new PAssign($1,del,$4);
+ if(parse_debug):
+ print('statement_item_37', list(p))
+
+
+ # { PExpr*del = p[3]->front(); p[3]->pop_front();
+ # assert(p[3]->empty());
+ # PAssign*tmp = new PAssign(p[1],del,p[4]);
- print('statement_item_38', list(p))
- # { PExpr*del = $3->front(); $3->pop_front();
- # assert($3->empty());
- # PAssignNB*tmp = new PAssignNB($1,del,$4);
+ if(parse_debug):
+ print('statement_item_38', list(p))
+
+
+ # { PExpr*del = p[3]->front(); p[3]->pop_front();
+ # assert(p[3]->empty());
+ # PAssignNB*tmp = new PAssignNB(p[1],del,p[4]);
- print('statement_item_51', list(p))
- # { pform_name_t*t_name = $1;
- # while (! $3->empty()) {
- # t_name->push_back($3->front());
- # $3->pop_front();
+ if(parse_debug):
+ print('statement_item_51', list(p))
+
+
+ # { pform_name_t*t_name = p[1];
+ # while (! p[3]->empty()) {
+ # t_name->push_back(p[3]->front());
+ # p[3]->pop_front();
- print('udp_port_decls_2', list(p))
- # { vector<PWire*>*tmp = $1;
- # size_t s1 = $1->size();
- # tmp->resize(s1+$2->size());
- # for (size_t idx = 0 ; idx < $2->size() ; idx += 1)
- # tmp->at(s1+idx) = $2->at(idx);
- # $$ = tmp;
- # delete $2;
+ if(parse_debug):
+ print('udp_port_decls_2', list(p))
+
+
+ # { vector<PWire*>*tmp = p[1];
+ # size_t s1 = p[1]->size();
+ # tmp->resize(s1+p[2]->size());
+ # for (size_t idx = 0 ; idx < p[2]->size() ; idx += 1)
+ # tmp->at(s1+idx) = p[2]->at(idx);
+ # p[0] = tmp;
+ # delete p[2];
- print('udp_primitive_1', list(p))
- # { perm_string tmp2 = lex_strings.make($2);
- # pform_make_udp(tmp2, $4, $7, $9, $8,
+ if(parse_debug):
+ print('udp_primitive_1', list(p))
+
+
+ # { perm_string tmp2 = lex_strings.make(p[2]);
+ # pform_make_udp(tmp2, p[4], p[7], p[9], p[8],
- print('udp_primitive_2', 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,
+ if(parse_debug):
+ print('udp_primitive_2', list(p))
+
+
+ # { perm_string tmp2 = lex_strings.make(p[2]);
+ # perm_string tmp6 = lex_strings.make(p[6]);
+ # pform_make_udp(tmp2, p[5], tmp6, p[7], p[9], p[12],