diff options
author | 2017-10-15 23:31:56 -0700 | |
---|---|---|
committer | 2017-10-16 14:16:39 +0200 | |
commit | 6bf3f268f4a01963a2ee13f60178664bb056a802 (patch) | |
tree | 32a870dc293e07af88f52b241c75d9cbd462f63f /third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/UnderlyingAST.java | |
parent | 80a34dc97799961201e6dce20fd58dd08022c032 (diff) |
Update checker framework dataflow and javacutils to 2.1.14
Change-Id: I62ad827fc4bbd54d022097003af63e351e44b98c
Diffstat (limited to 'third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/UnderlyingAST.java')
-rw-r--r-- | third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/UnderlyingAST.java | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/UnderlyingAST.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/UnderlyingAST.java index 5f61468e8c..dd646f110d 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/UnderlyingAST.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/UnderlyingAST.java @@ -6,11 +6,10 @@ import com.sun.source.tree.MethodTree; import com.sun.source.tree.Tree; /** - * Represents an abstract syntax tree of type {@link Tree} that underlies a - * given control flow graph. + * Represents an abstract syntax tree of type {@link Tree} that underlies a given control flow + * graph. * * @author Stefan Heule - * */ public abstract class UnderlyingAST { public enum Kind { @@ -19,9 +18,7 @@ public abstract class UnderlyingAST { /** The underlying code is a lambda expression */ LAMBDA, - /** - * The underlying code is an arbitrary Java statement or expression - */ + /** The underlying code is an arbitrary Java statement or expression */ ARBITRARY_CODE, } @@ -31,18 +28,14 @@ public abstract class UnderlyingAST { this.kind = kind; } - /** - * @return The code that corresponds to the CFG. - */ - abstract public Tree getCode(); + /** @return the code that corresponds to the CFG */ + public abstract Tree getCode(); public Kind getKind() { return kind; } - /** - * If the underlying AST is a method. - */ + /** If the underlying AST is a method. */ public static class CFGMethod extends UnderlyingAST { /** The method declaration */ @@ -76,9 +69,7 @@ public abstract class UnderlyingAST { } } - /** - * If the underlying AST is a lambda. - */ + /** If the underlying AST is a lambda. */ public static class CFGLambda extends UnderlyingAST { private final LambdaExpressionTree lambda; @@ -103,16 +94,18 @@ public abstract class UnderlyingAST { } } - /** - * If the underlying AST is a statement or expression. - */ + /** If the underlying AST is a statement or expression. */ public static class CFGStatement extends UnderlyingAST { protected final Tree code; - public CFGStatement(Tree code) { + /** The class tree this method belongs to. */ + protected final ClassTree classTree; + + public CFGStatement(Tree code, ClassTree classTree) { super(Kind.ARBITRARY_CODE); this.code = code; + this.classTree = classTree; } @Override @@ -120,6 +113,10 @@ public abstract class UnderlyingAST { return code; } + public ClassTree getClassTree() { + return classTree; + } + @Override public String toString() { return "CFGStatement(\n" + code + "\n)"; |