kiama.example.oberon0.compiler

class Environment

[source: kiama/example/oberon0/compiler/Environment.scala]

class Environment(parent : Environment)
extends AnyRef
An environment to hold name bindings, nested within a parent environment.
Value Summary
val decls : scala.collection.mutable.HashMap[java.lang.String, EnvEntry]
Method Summary
def addDeclsToEnv (decls : scala.List[Declaration]) : Unit
Add declaration list to the environment
def addToEnv (nm : java.lang.String, dec : Declaration) : Unit
Add new entry to the environment. Note: if the entry already exists, it is overwritten by the new entry, but with it' 'multiplyDefined' field set to true
def findDecl (nm : java.lang.String, searchAll : Boolean) : Declaration
Find a declaration in the environment. If a parent is specified, and 'searchAll' is true, then also search parent environments
def isMultiplyDefined (nm : java.lang.String) : Boolean
Return whether the name is multiply defined in this scope
override def toString : java.lang.String
Returns a string representation of the object.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
case class EnvEntry (val dec : Declaration, val multiplyDefined : Boolean) extends scala.Product
Value Details
val decls : scala.collection.mutable.HashMap[java.lang.String, EnvEntry]

Method Details
def addToEnv(nm : java.lang.String, dec : Declaration) : Unit
Add new entry to the environment. Note: if the entry already exists, it is overwritten by the new entry, but with it' 'multiplyDefined' field set to true

def addDeclsToEnv(decls : scala.List[Declaration]) : Unit
Add declaration list to the environment

def findDecl(nm : java.lang.String, searchAll : Boolean) : Declaration
Find a declaration in the environment. If a parent is specified, and 'searchAll' is true, then also search parent environments

def isMultiplyDefined(nm : java.lang.String) : Boolean
Return whether the name is multiply defined in this scope

override def toString : java.lang.String
Returns a string representation of the object.

The default representation is platform dependent.

Returns
a string representation of the object.