MCPcopy Create free account
hub / github.com/LFYSec/MScan / ArrayLengthExp

Class ArrayLengthExp

src/main/java/pascal/taie/ir/exp/ArrayLengthExp.java:31–63  ·  view source on GitHub ↗

Representation of array length expression, e.g., arr.length.

Source from the content-addressed store, hash-verified

29 * Representation of array length expression, e.g., arr.length.
30 */
31public class ArrayLengthExp implements UnaryExp {
32
33 private final Var base;
34
35 public ArrayLengthExp(Var base) {
36 this.base = base;
37 assert base.getType() instanceof ArrayType;
38 }
39
40 public Var getBase() {
41 return base;
42 }
43
44 @Override
45 public Var getOperand() {
46 return base;
47 }
48
49 @Override
50 public PrimitiveType getType() {
51 return PrimitiveType.INT;
52 }
53
54 @Override
55 public <T> T accept(ExpVisitor<T> visitor) {
56 return visitor.visit(this);
57 }
58
59 @Override
60 public String toString() {
61 return base + ".length";
62 }
63}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected