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

Class NegExp

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

Representation of negation expression, e.g., -o;

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected