public virtual statement mk_return(type ty, Method m) { if (m.Type == T.Void) { return(new empty_statement()); } expression expr = null; if (m.Type.FullName == "char") { expr = new character_literal(new InputElement("'\0'")); } else if (m.Type.IsNumeric && m.Type != T.Decimal) { expr = new integer_literal(new InputElement("0")); } else if (m.Type.IsReferenceType) { expr = new null_literal(new InputElement("null")); } else if (m.Type.IsValueType) { expr = new new_expression(ty, argumentList.New()); } statement stmt = new return_statement(expr); stmt.method = m; return(stmt); }
virtual public void new_expression(new_expression ast, int parent) { // Write("new "); // visit(ast.ty); // EmitargumentList(ast.args); }
public virtual expression new_expression(new_expression ast, int lvalue, int rvalue) { argumentList(ast.args, lvalue, rvalue); return(wrap(ast, rvalue)); }