class SemanticAnalyser extends AnyRef
- Source
- SemanticAnalyser.scala
- Alphabetic
- By Inheritance
- SemanticAnalyser
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new SemanticAnalyser()
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
checktype(n: Term): Messages
Check types: issue a message if n's type is not compatible with its expected type.
Check types: issue a message if n's type is not compatible with its expected type. The unknown type is compatible with any other type.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
val
defenv: SymbolTable.Environment
Default environment.
Default environment. Contains entities for the pre-defined predicates for lists: cons and nil.
-
val
entity: (NamedLiteral) ⇒ Entity
The program entity referred to by a predicate or atom.
The program entity referred to by a predicate or atom. We just look in the environment. If it's not there, then use the unknown entity. If we have implemented the environments correctly, nothing can be unknown since the first appearance is the defining ocurrence.
-
val
entityin: (NamedLiteral) ⇒ Entity
The entity for a given predicate or atom that is implied by the context.
The entity for a given predicate or atom that is implied by the context. This differs from entity because it doesn't account for information implied by the node itself. Used for type checking since we don't want to use information from this node to check this node (a circularity).
-
val
env: (PrologTree) ⇒ SymbolTable.Environment
The environment containing all bindings visible "after" a particular node in the tree.
The environment containing all bindings visible "after" a particular node in the tree. The only nodes that add bindings are the first occurrence of any particular predicate. Other nodes just pass the environment through: a node with children gets the env coming out of its last child; a node with no children just passes its own envin.
For type checking we record the types of predicate arguments. If this is the defining occurrence of a predicate, we obtain the types of the actual arguments and use those. Otherwise, we use only those argument types for which we don't know anything already.
-
val
envin: (PrologTree) ⇒ SymbolTable.Environment
The environment containing all bindings visible at a particular node in the tree, not including any that are defined at that node.
The environment containing all bindings visible at a particular node in the tree, not including any that are defined at that node. If we are at the top of the tree, initialise the environment to be empty. Otherwise, if we are in a sequence, ask the previous node for its environment, including any definitions there. If we are the first in a sequence or not in a sequence, ask the parent.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
errors: (PrologTree) ⇒ Messages
The semantic error messages for a given tree.
-
val
exptipe: (Term) ⇒ Type
The expected type of a term, given by the context.
The expected type of a term, given by the context. The only place that terms can be used is as predicate arguments, so we look up the predicate to find out what its argument constraints are and select the one that corresponds to this argument. The index property gives us the position of the variable in the argument list.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
val
tipe: (Term) ⇒ Type
The type of a term given by the previous uses.
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
val
varentity: (Var) ⇒ Entity
The variable entity for a particular variable name, given by the context before this occurrence.
-
val
vars: (PrologTree) ⇒ SymbolTable.Environment
The environment containing visible variables *after* this node.
The environment containing visible variables *after* this node. Only updates at variable nodes. If the variable has not been seen before, we insert a binding to a new variable with a type give by the expected type for the context. Otherwise, if the variable has been seen before, if it has an unknown type, then we update that type to the expected type for the context. Otherwise, the variable has been seen before and already has a type constraint, so we don't change anything.
-
val
varsin: (PrologTree) ⇒ SymbolTable.Environment
The environment of variables that are visible at this node.
The environment of variables that are visible at this node. This env gets reset for each clause since the variables of one clause are not related to those in the next clause.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )