Class CFGTranslationPhaseOne

java.lang.Object
com.sun.source.util.TreeScanner<Node,Void>
org.checkerframework.dataflow.cfg.builder.CFGTranslationPhaseOne
All Implemented Interfaces:
TreeVisitor<Node,Void>

public class CFGTranslationPhaseOne extends TreeScanner<Node,Void>
Class that performs phase one of the translation process. It generates the following information:
  • A sequence of extended nodes.
  • A set of bindings from Labels to positions in the node sequence.
  • A set of leader nodes that give rise to basic blocks in phase two.
  • A mapping from AST tree nodes to Nodes.

The return type of this scanner is Node. For expressions, the corresponding node is returned to allow linking between different nodes.

However, for statements there is usually no single Node that is created, and thus null is returned.

Every visit* method is assumed to add at least one extended node to the list of nodes (which might only be a jump).

The entry point to process a single body (e.g., method, lambda, top-level block) is process(TreePath, UnderlyingAST).

  • Field Details

    • env

      protected final ProcessingEnvironment env
      Annotation processing environment.
    • elements

      protected final Elements elements
      Element utilities.
    • types

      protected final Types types
      Type utilities.
    • trees

      protected final Trees trees
      Tree utilities.
    • treeBuilder

      protected final org.checkerframework.javacutil.trees.TreeBuilder treeBuilder
      TreeBuilder instance.
    • annotationProvider

      protected final org.checkerframework.javacutil.AnnotationProvider annotationProvider
      The annotation provider, e.g., a type factory.
    • assumeAssertionsDisabled

      protected final boolean assumeAssertionsDisabled
      Can assertions be assumed to be disabled?
    • assumeAssertionsEnabled

      protected final boolean assumeAssertionsEnabled
      Can assertions be assumed to be enabled?
    • arithmeticExceptionType

      protected final TypeMirror arithmeticExceptionType
      The ArithmeticException type.
    • arrayIndexOutOfBoundsExceptionType

      protected final TypeMirror arrayIndexOutOfBoundsExceptionType
      The ArrayIndexOutOfBoundsException type.
    • assertionErrorType

      protected final TypeMirror assertionErrorType
      The AssertionError type.
    • classCastExceptionType

      protected final TypeMirror classCastExceptionType
      The ClassCastException type .
    • iterableType

      protected final TypeMirror iterableType
      The Iterable type (erased).
    • negativeArraySizeExceptionType

      protected final TypeMirror negativeArraySizeExceptionType
      The NegativeArraySizeException type.
    • nullPointerExceptionType

      protected final TypeMirror nullPointerExceptionType
      The NullPointerException type .
    • outOfMemoryErrorType

      protected final @Nullable TypeMirror outOfMemoryErrorType
      The OutOfMemoryError type.
    • classCircularityErrorType

      protected final @Nullable TypeMirror classCircularityErrorType
      The ClassCircularityError type.
    • classFormatErrorType

      protected final @Nullable TypeMirror classFormatErrorType
      The ClassFormatErrorType type.
    • noClassDefFoundErrorType

      protected final @Nullable TypeMirror noClassDefFoundErrorType
      The NoClassDefFoundError type.
    • stringType

      protected final TypeMirror stringType
      The String type.
    • throwableType

      protected final TypeMirror throwableType
      The Throwable type.
    • uncheckedExceptionTypes

      protected final Set<TypeMirror> uncheckedExceptionTypes
      Supertypes of all unchecked exceptions. The size is 2 and the contents are RuntimeException and Error.
    • newArrayExceptionTypes

      protected final Set<TypeMirror> newArrayExceptionTypes
      Exceptions that can be thrown by array creation "new SomeType[]". The size is 2 and the contents are NegativeArraySizeException and OutOfMemoryError. This list comes from JLS 15.10.1 "Run-Time Evaluation of Array Creation Expressions".
    • uid

      protected long uid
      The UID for the next unique name.
    • ea

      protected VariableTree ea
      The VariableTree that indicates whether assertions are enabled or not.
  • Constructor Details

    • CFGTranslationPhaseOne

      public CFGTranslationPhaseOne(org.checkerframework.javacutil.trees.TreeBuilder treeBuilder, org.checkerframework.javacutil.AnnotationProvider annotationProvider, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled, ProcessingEnvironment env)
      Parameters:
      treeBuilder - builder for new AST nodes
      annotationProvider - extracts annotations from AST nodes
      assumeAssertionsEnabled - can assertions be assumed to be enabled?
      assumeAssertionsDisabled - can assertions be assumed to be disabled?
      env - annotation processing environment containing type utilities
  • Method Details