Represents an object dereference expression of the form " e->f " where e is the operand expression and f the target field . @author David J. Pearce
| 4318 | * |
| 4319 | */ |
| 4320 | public static class FieldDereference extends AbstractExpr implements LVal, UnaryOperator { |
| 4321 | public FieldDereference(Type type, Expr operand, Identifier field) { |
| 4322 | super(EXPR_fielddereference, type, operand, field); |
| 4323 | } |
| 4324 | |
| 4325 | /** |
| 4326 | * Get the operand to be dereferenced. That is, |
| 4327 | * <code>e<code> in </code>*e</code>. |
| 4328 | */ |
| 4329 | @Override |
| 4330 | public Expr getOperand() { |
| 4331 | return (Expr) super.get(1); |
| 4332 | } |
| 4333 | |
| 4334 | public Identifier getField() { |
| 4335 | return (Identifier) super.get(2); |
| 4336 | } |
| 4337 | |
| 4338 | @Override |
| 4339 | public Expr clone(Syntactic.Item[] operands) { |
| 4340 | return new FieldDereference((Type) operands[0], (Expr) operands[1], (Identifier) operands[2]); |
| 4341 | } |
| 4342 | |
| 4343 | @Override |
| 4344 | public String toString() { |
| 4345 | return getOperand() + "->" + getField(); |
| 4346 | } |
| 4347 | |
| 4348 | public static final Descriptor DESCRIPTOR_0 = new Descriptor(Operands.THREE, Data.ZERO, "EXPR_fielddereference") { |
| 4349 | @Override |
| 4350 | public Syntactic.Item construct(int opcode, Syntactic.Item[] operands, byte[] data) { |
| 4351 | return new FieldDereference((Type) operands[0], (Expr) operands[1], (Identifier) operands[2]); |
| 4352 | } |
| 4353 | }; |
| 4354 | } |
| 4355 | |
| 4356 | /** |
| 4357 | * Represents an <i>object allocation</i> expression of the form |
nothing calls this directly
no outgoing calls
no test coverage detected