org.kiama.example.oberon0.L4

NameAnalyser

trait NameAnalyser extends L3.NameAnalyser

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. NameAnalyser
  2. NameAnalyser
  3. SymbolTable
  4. NameAnalyser
  5. NameAnalyser
  6. SymbolTable
  7. SymbolTable
  8. Environments
  9. Analyser
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait Builtin extends Named

    Marker trait for all built-in entities.

  2. case class BuiltinProc(ident: String, params: List[ParamInfo]) extends Entity with NamedEntity with Builtin with Product with Serializable

    A built-in procedure with its parameter information.

  3. case class BuiltinType(ident: String) extends Type with Named with Builtin with Product with Serializable

    A built-in type with an implicit definition that the compiler must have special knowledge about.

  4. case class Constant(ident: String, decl: ConstDecl) extends Entity with NamedEntity with Product with Serializable

    A user-defined constant entity represented by a constant declaration.

  5. abstract class Entity extends AnyRef

    Definition Classes
    Environments
  6. type Environment = Stack[Scope]

    Definition Classes
    Environments
  7. trait ErrorEntity extends Entity

    Definition Classes
    Environments
  8. case class IntegerValue(ident: String, tipe: Type, value: Int) extends Entity with NamedEntity with Builtin with Product with Serializable

    A built-in value of some type that is represented by a particular integer value.

  9. case class Module(ident: String, decl: ModuleDecl) extends Entity with NamedEntity with Product with Serializable

    A user-defined module represented by a module declaration.

  10. trait Named extends AnyRef

    Definition Classes
    Environments
  11. trait NamedEntity extends Entity with Named

    Definition Classes
    Environments
  12. case class ParamInfo(mode: Mode, ident: String, tipe: SymbolTable.Type) extends Product with Serializable

    Information about a particular parameter.

  13. case class Parameter(mode: Mode, varr: SymbolTable.Variable) extends Entity with NamedEntity with Product with Serializable

    A parameter is a variable augmented with a passing mode.

  14. case class Procedure(ident: String, decl: ProcDecl) extends Entity with NamedEntity with Product with Serializable

    A procedure entity represented by a procedure declaration.

  15. type Scope = Map[String, Entity]

    Definition Classes
    Environments
  16. abstract class Type extends Entity

    An entity representing by a user-provided type declaration.

  17. case class UserType(ident: String, tipe: TypeDecl) extends Type with Named with Product with Serializable

    A user-defined type.

  18. case class Variable(ident: String, tipe: TypeDef) extends Entity with NamedEntity with Product with Serializable

    A variable entity including a reference to its types' definition.

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. object MultipleEntity extends Entity with ErrorEntity with Product with Serializable

    Definition Classes
    Environments
  7. object UnknownEntity extends Entity with ErrorEntity with Product with Serializable

    Definition Classes
    Environments
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. lazy val booleanType: BuiltinType

    Built-in Boolean type.

    Built-in Boolean type.

    Definition Classes
    SymbolTable
  10. def check(n: SourceASTNode): Unit

    Check an AST node for semantic errors.

    Check an AST node for semantic errors. Report any errors using the messaging module. This default implementation just ask the node's children to check themselves.

    Definition Classes
    NameAnalyserNameAnalyserNameAnalyserAnalyser
  11. def checkNonLocalVarAccess(u: IdnUse): Unit

    Check for non-local variable and procedure accesses.

    Check for non-local variable and procedure accesses. In the L3 language non-local variable accesses are disallowed, unless they are to a variable at the top level. Non-local procedure accesses are just disallowed.

    Definition Classes
    NameAnalyser
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. def defenv: Environment

    The default environment.

    The default environment.

    Definition Classes
    SymbolTable
  14. def defenvPairs: List[(String, Entity)]

    The default environment with pre-defined procedures added.

    The default environment with pre-defined procedures added.

    Definition Classes
    SymbolTableSymbolTable
  15. def define(env: Environment, i: String, e: Entity): Environment

    Definition Classes
    Environments
  16. def enter(env: Environment): Environment

    Definition Classes
    Environments
  17. lazy val entity: (Identifier) ⇒ Entity

    The program entity referred to by an identifier definition or use.

    The program entity referred to by an identifier definition or use. In the case of a definition it's the thing being defined, so define it to be a reference to the declaration. If it's already defined, return a entity that indicates a multiple definition. In the case of a use, it's the thing defined elsewhere that is being referred to here, so look it up in the environment.

    Definition Classes
    NameAnalyser
  18. def entityFromDecl(n: IdnDef, i: String): Entity

    The entity for an identifier definition as given by its declaration context.

    The entity for an identifier definition as given by its declaration context.

    Definition Classes
    NameAnalyserNameAnalyser
  19. lazy val env: Chain[SourceASTNode, Environment]

    The environment containing bindings for all identifiers visible at the given node.

    The environment containing bindings for all identifiers visible at the given node. It starts at the module declaration with the default environment. At blocks we enter a nested scope which is removed on exit from the block. At constant and type declarations the left-hand side binding is not in scope on the right-hand side. Each identifier definition just adds its binding to the chain. The envout cases for assignment and expression mean that we don't need to traverse into those constructs, since declarations can't occur there.

    Definition Classes
    NameAnalyser
  20. def envin(in: (SourceASTNode) ⇒ Environment): ==>[SourceASTNode, Environment]

    Definition Classes
    NameAnalyserNameAnalyser
  21. def envinl(in: (SourceASTNode) ⇒ Environment): ==>[SourceASTNode, Environment]

    Blocks that are immediately inside procedure decls do not introduce new scopes since the procedure itself does.

    Blocks that are immediately inside procedure decls do not introduce new scopes since the procedure itself does. This computation overrides the one earlier that pushes a scope for all blocks. Don't include the procedure name in the scope of its own body.

    Definition Classes
    NameAnalyser
  22. def envout(out: (SourceASTNode) ⇒ Environment): ==>[SourceASTNode, Environment]

    Definition Classes
    NameAnalyserNameAnalyser
  23. def envoutl(out: (SourceASTNode) ⇒ Environment): ==>[SourceASTNode, Environment]

    Similarly for envin we don't need to leave a scope for a procedure block, since we didn't enter one.

    Similarly for envin we don't need to leave a scope for a procedure block, since we didn't enter one. The IdnDef that is for a ProcDecl needs to be in the outer scope, but not in the scope of its own body. All arguments and local declarations go in the nested scope.

    Definition Classes
    NameAnalyser
  24. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  26. lazy val expconst: (Expression) ⇒ Boolean

    Is an expression expected to be constant or not? Either the expression is the root of an expected constant expression or its parent expression is expected to be constant.

    Is an expression expected to be constant or not? Either the expression is the root of an expected constant expression or its parent expression is expected to be constant.

    Definition Classes
    NameAnalyser
  27. lazy val falseConstant: IntegerValue

    Built-in false constant.

    Built-in false constant.

    Definition Classes
    SymbolTable
  28. def finalize(): Unit

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

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

    Definition Classes
    AnyRef → Any
  31. lazy val integerType: BuiltinType

    Built-in integer type.

    Built-in integer type.

    Definition Classes
    SymbolTable
  32. def isBoolean(e: Type): Boolean

    Return true if the given type is Boolean or an unknown type.

    Return true if the given type is Boolean or an unknown type.

    Definition Classes
    SymbolTable
  33. def isConstant(e: Entity): Boolean

    Return true if the entity is erroneous or is a constant.

    Return true if the entity is erroneous or is a constant.

    Definition Classes
    SymbolTable
  34. def isDefinedInEnv(env: Environment, i: String): Boolean

    Definition Classes
    Environments
  35. def isDefinedInInner(env: Environment, i: String): Boolean

    Definition Classes
    Environments
  36. def isDefinedInOuter(env: Environment, i: String): Boolean

    Definition Classes
    Environments
  37. def isDefinedInScope(scope: Scope, i: String): Boolean

    Definition Classes
    Environments
  38. def isDefinedInScope(env: Environment, i: String): Boolean

    Definition Classes
    Environments
  39. def isError(e: Entity): Boolean

    Return true if the entity is an error, false otherwise.

    Return true if the entity is an error, false otherwise.

    Definition Classes
    SymbolTable
  40. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  41. def isInteger(e: Type): Boolean

    Return true if the given type is integer or an unknown type.

    Return true if the given type is integer or an unknown type.

    Definition Classes
    SymbolTable
  42. def isLvalue(l: Expression): Boolean

    Return true if the expression can legally appear on the left-hand side of an assignment statement.

    Return true if the expression can legally appear on the left-hand side of an assignment statement. At this level only allow identifiers of variables or things we don't know anything about. The true default is used so that this computation can be used in redefinitions.

    Definition Classes
    NameAnalyserNameAnalyser
  43. def isModule(e: Entity): Boolean

    Return true if the entity is erroneous or is a module.

    Return true if the entity is erroneous or is a module.

    Definition Classes
    SymbolTable
  44. def isRvalue(r: IdnExp): Boolean

    Return true if the identifier is an r-value and hence its value can be used (ie.

    Return true if the identifier is an r-value and hence its value can be used (ie. it's erroneous or is a constant, value or variable).

    Definition Classes
    NameAnalyser
  45. def isType(e: Entity): Boolean

    Return true if the entity is erroneous or is a type.

    Return true if the entity is erroneous or is a type.

    Definition Classes
    SymbolTable
  46. def isVariable(e: Entity): Boolean

    Parameters are variables too.

    Parameters are variables too.

    Definition Classes
    SymbolTableSymbolTable
  47. lazy val isconst: (Expression) ⇒ Boolean

    Is an expression constant or not? Unknown entities are constant.

    Is an expression constant or not? Unknown entities are constant. Strictly speaking we only need to support integer expressions here, but we treat Boolean ones as constant in the same way so that we avoid spurious errors. Type analysis will reject Boolean constant expressions anyway.

    Definition Classes
    NameAnalyser
  48. def leave(env: Environment): Environment

    Definition Classes
    Environments
  49. lazy val level: (SourceASTNode) ⇒ Int

    Level of a node considering the module level to be zero and incrementing each time we enter a nested procedure declaration.

    Level of a node considering the module level to be zero and incrementing each time we enter a nested procedure declaration.

    Definition Classes
    NameAnalyser
  50. def lookup(env: Environment, i: String, e: Entity, scope: Boolean): Entity

    Definition Classes
    Environments
  51. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  54. lazy val readProc: BuiltinProc

    The built-in Read procedure.

    The built-in Read procedure.

    Definition Classes
    SymbolTable
  55. def resetEnvironments: Unit

    Definition Classes
    Environments
  56. lazy val rootconstexp: (Expression) ⇒ Boolean

    Is this expression the root of what is expected to be a constant expression? At this level only expressions on the RHS of a constant declaration have this property.

    Is this expression the root of what is expected to be a constant expression? At this level only expressions on the RHS of a constant declaration have this property.

    Definition Classes
    NameAnalyser
  57. def rootconstexpDef: (Expression) ⇒ Boolean

    Definition Classes
    NameAnalyserNameAnalyser
  58. def rootenv(bindings: (String, Entity)*): Environment

    Definition Classes
    Environments
  59. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  60. def toString(): String

    Definition Classes
    AnyRef → Any
  61. lazy val trueConstant: IntegerValue

    Built-in true constant.

    Built-in true constant.

    Definition Classes
    SymbolTable
  62. lazy val unknownType: BuiltinType

    A type that is unknown, eg because the typed thing is erroneously defined.

    A type that is unknown, eg because the typed thing is erroneously defined.

    Definition Classes
    SymbolTable
  63. lazy val value: (Expression) ⇒ Int

    What is the value of an integer expression? Only needs to be valid if the expression is an integer constant (see isconst above) and is defined (eg, no divide by zero.

    What is the value of an integer expression? Only needs to be valid if the expression is an integer constant (see isconst above) and is defined (eg, no divide by zero.) Returns zero in all other cases. FIXME: Ignores issues of overflow.

    Definition Classes
    NameAnalyser
  64. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  67. lazy val writeProc: BuiltinProc

    The built-in Write procedure.

    The built-in Write procedure.

    Definition Classes
    SymbolTable
  68. lazy val writelnProc: BuiltinProc

    The built-in WriteLn procedure.

    The built-in WriteLn procedure.

    Definition Classes
    SymbolTable

Inherited from L3.NameAnalyser

Inherited from L3.SymbolTable

Inherited from L2.NameAnalyser

Inherited from L0.NameAnalyser

Inherited from L0.SymbolTable

Inherited from base.SymbolTable

Inherited from Environments

Inherited from Analyser

Inherited from AnyRef

Inherited from Any

No Group