class TypeAnalysis extends DepthFirstAstVisitor[Unit] with Analysis[TypeData]
Unification-based type analysis. The analysis associates a tip.types.Type with each variable declaration and expression node in the AST. It is implemented using tip.solvers.UnionFindSolver.
To novice Scala programmers:
The parameter declData
is declared as "implicit", which means that invocations of TypeAnalysis
obtain its value implicitly:
The call to new TypeAnalysis
in Tip.scala does not explicitly provide this parameter, but it is in scope of
implicit val declData: TypeData = new DeclarationAnalysis(programNode).analyze()
.
The TIP implementation uses implicit parameters many places to provide easy access to the declaration information produced
by DeclarationAnalysis
and the type information produced by TypeAnalysis
.
For more information about implicit parameters in Scala, see https://docs.scala-lang.org/tour/implicit-parameters.html.
- Alphabetic
- By Inheritance
- TypeAnalysis
- Analysis
- DepthFirstAstVisitor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new TypeAnalysis(program: AProgram)(implicit declData: DeclarationData)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- implicit val allFieldNames: List[String]
-
def
analyze(): TypeData
Performs the analysis and returns the result.
Performs the analysis and returns the result.
- Definition Classes
- TypeAnalysis → Analysis
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val log: Logger
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- val solver: UnionFindSolver[Type]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
visit(node: AstNode, arg: Unit): Unit
Generates the constraints for the given sub-AST.
Generates the constraints for the given sub-AST.
- node
the node for which it generates the constraints
- arg
unused for this visitor
- Definition Classes
- TypeAnalysis → DepthFirstAstVisitor
-
def
visitChildren(node: AstNode, arg: Unit): Unit
Recursively perform the visit to the sub-node of the passed node, passing the provided argument.
Recursively perform the visit to the sub-node of the passed node, passing the provided argument.
- node
the node whose children need to be visited
- arg
the argument to be passed to all sub-nodes
- Definition Classes
- DepthFirstAstVisitor
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated