def p_expression_1(p):
'''expression : expr_primary_or_typename '''
print('expression_1', list(p))
+ p[0] = p[1]
# { $$ = $1; }
()
def p_expression_2(p):
def p_expr_primary_or_typename_1(p):
'''expr_primary_or_typename : expr_primary '''
print('expr_primary_or_typename_1', list(p))
+ p[0] = p[1]
()
def p_expr_primary_or_typename_2(p):
'''expr_primary_or_typename : TYPE_IDENTIFIER '''
print('expr_primary_or_typename_2', list(p))
+ p[0] = p[1]
# { PETypename*tmp = new PETypename($1.type);
# FILE_NAME(tmp,@1);
# $$ = tmp;
def p_expr_primary_1(p):
'''expr_primary : number '''
print('expr_primary_1', list(p))
+ p[0] = p[1]
# { assert($1);
# PENumber*tmp = new PENumber($1);
# FILE_NAME(tmp, @1);
def p_expr_primary_6(p):
'''expr_primary : hierarchy_identifier '''
print('expr_primary_6', list(p))
+ p[0] = p[1]
# { PEIdent*tmp = pform_new_ident(*$1);
# FILE_NAME(tmp, @1);
# $$ = tmp;
def p_lpvalue_1(p):
'''lpvalue : hierarchy_identifier '''
print('lpvalue_1', list(p))
+ p[0] = p[1]
# { PEIdent*tmp = pform_new_ident(*$1);
# FILE_NAME(tmp, @1);
# $$ = tmp;
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('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))
+ p[0] = clsdecl
# { // 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
else:
expr = Node(syms.expr_stmt, [p[1], Leaf(token.EQUAL, p[2]), ])
print ("expr", repr(expr))
+ print ("expr (python):'%s'" % expr)
p[0] = expr
# { PAssign*tmp = new PAssign($1,$3);
# FILE_NAME(tmp, @1);