aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/ExplicitThisLiteralNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/ExplicitThisLiteralNode.java')
-rw-r--r--third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/ExplicitThisLiteralNode.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/ExplicitThisLiteralNode.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/ExplicitThisLiteralNode.java
new file mode 100644
index 0000000000..0c1069843c
--- /dev/null
+++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/ExplicitThisLiteralNode.java
@@ -0,0 +1,44 @@
+package org.checkerframework.dataflow.cfg.node;
+
+import org.checkerframework.javacutil.InternalUtils;
+
+import com.sun.source.tree.IdentifierTree;
+import com.sun.source.tree.Tree;
+
+/**
+ * A node for a reference to 'this'.
+ *
+ * <pre>
+ * <em>this</em>
+ * </pre>
+ *
+ * @author Stefan Heule
+ * @author Charlie Garrett
+ *
+ */
+public class ExplicitThisLiteralNode extends ThisLiteralNode {
+
+ protected Tree tree;
+
+ public ExplicitThisLiteralNode(Tree t) {
+ super(InternalUtils.typeOf(t));
+ assert t instanceof IdentifierTree
+ && ((IdentifierTree) t).getName().contentEquals("this");
+ tree = t;
+ }
+
+ @Override
+ public Tree getTree() {
+ return tree;
+ }
+
+ @Override
+ public <R, P> R accept(NodeVisitor<R, P> visitor, P p) {
+ return visitor.visitExplicitThisLiteral(this, p);
+ }
+
+ @Override
+ public String toString() {
+ return getName();
+ }
+}