org.kiama.example.grammar

SemanticAnalyser

class SemanticAnalyser extends AnyRef

Perform name analysis checks for the grammar language. Also, define auxiliary properties nullability, first and follow for grammar symbols. The latter are based on definitions found in the paper "Circular Reference Attributed Grammars - their Evaluation and Applications", by Magnusson and Hedin from LDTA 2003.

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 clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val decl: (NonTermUse) ⇒ Option[Rule]

    Defining ocurrence that is referrred to by this applied occurrence, if there is one.

  9. val defenv: (GrammarTree) ⇒ SymbolTable.Environment

    The defenv is the environment that extends envin with the bindings (if any) that are defined at this node.

  10. val entity: (NonTerm) ⇒ Entity

    The program entity referred to by a non-terminal occurrence.

    The program entity referred to by a non-terminal occurrence. We just look in the environment. If it's not there, then it's unknown.

  11. val env: attribution.Attribution.CachedAttribute[GrammarTree, SymbolTable.Environment]

    The env contains all of the entities that are visible at a node.

    The env contains all of the entities that are visible at a node. In this language, there is only one scope and all defining occurrences are visible anywhere.

  12. val envin: (GrammarTree) ⇒ SymbolTable.Environment

    The envin contains the bindings that are defined "before" the given node.

    The envin contains the bindings that are defined "before" the given node. There are none at the top of the tree and at the first rule. Each other rule gets the defenv of the preceding rule.

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

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

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

    The semantic error messages for a given tree.

  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. val first: (GrammarTree) ⇒ Set[TermSym]

    FIRST set (i.

    FIRST set (i.e., which terminals can appear at the start of a sentence derived from a non-terminal.

  18. val follow: (NonTerm) ⇒ Set[TermSym]

    FOLLOW set (i.

    FOLLOW set (i.e., which terminals can follow this non-terminal in a sentential form).

  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. val grammar: attribution.Attribution.CachedAttribute[GrammarTree, Grammar]

    The grammar that contains a node.

  21. def hashCode(): Int

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

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

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

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

    Definition Classes
    AnyRef
  26. val ntuses: attribution.Attribution.CachedAttribute[Any, List[NonTermUse]]

    Non-terminal applied occurrences in a tree.

  27. val nullable: (GrammarTree) ⇒ Boolean

    Nullability (i.

    Nullability (i.e., can derive the empty sequence).

  28. val rule: attribution.Attribution.CachedAttribute[GrammarTree, Rule]

    The rule that contains a node.

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. val uses: (NonTermDef) ⇒ Seq[NonTermUse]

    Non-terminal uses that are applied occurrences of a given defining occurrence.

  32. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped