org.kiama.example.prolog

SemanticAnalyser

class SemanticAnalyser extends AnyRef

Source
SemanticAnalyser.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SemanticAnalyser
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SemanticAnalyser()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. 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.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. val defenv: SymbolTable.Environment

    Default environment.

    Default environment. Contains entities for the pre-defined predicates for lists: cons and nil.

  10. 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.

  11. 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).

  12. 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.

  13. 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.

  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  16. val errors: attribution.Attribution.CachedAttribute[Any, Seq[Message]]

    The semantic error messages for a given tree.

  17. 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.

  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. val tipe: (Term) ⇒ Type

    The type of a term given by the previous uses.

  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. val varentity: (Var) ⇒ Entity

    The variable entity for a particular variable name, given by the context before this occurrence.

  29. 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.

  30. 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.

  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped