MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / New

Class New

src/main/java/wyil/lang/WyilFile.java:4364–4395  ·  view source on GitHub ↗

Represents an object allocation expression of the form new e or new e where e is the operand expression. @author David J. Pearce

Source from the content-addressed store, hash-verified

4362 *
4363 */
4364 public static class New extends AbstractExpr implements LVal, UnaryOperator {
4365
4366 public New(Type type, Expr operand) {
4367 super(EXPR_new, type, operand);
4368 }
4369
4370 /**
4371 * Get the operand to be evaluated and stored in the heap. That is,
4372 * <code>e<code> in </code>new e</code>.
4373 */
4374 @Override
4375 public Expr getOperand() {
4376 return (Expr) super.get(1);
4377 }
4378
4379 @Override
4380 public Expr clone(Syntactic.Item[] operands) {
4381 return new New((Type) operands[0], (Expr) operands[1]);
4382 }
4383
4384 @Override
4385 public String toString() {
4386 return "new " + getOperand();
4387 }
4388
4389 public static final Descriptor DESCRIPTOR_0 = new Descriptor(Operands.TWO, Data.ZERO, "EXPR_new") {
4390 @Override
4391 public Syntactic.Item construct(int opcode, Syntactic.Item[] operands, byte[] data) {
4392 return new New((Type) operands[0], (Expr) operands[1]);
4393 }
4394 };
4395 }
4396
4397 public static class LambdaAccess extends AbstractItem implements Expr, Bindable {
4398

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected