Return the internal type of a syntactic type.
Return the internal type of a syntactic type. In most cases they are the same. The exception is class types since the class type refers to the class by name, but we need to have it as a reference type that refers to the declaration of that class.
The entity defined by a defining occurrence of an identifier.
The entity defined by a defining occurrence of an identifier. Defined by the context of the occurrence.
The environment containing bindings for things that are being defined.
The environment containing bindings for things that are being
defined. Much of the power of this definition comes from the Kiama
chain method, which threads the attribute through the tree in a
depth-first left-to-right order. The envin and envout definitions
are used to (optionally) update attribute value as it proceeds through
the tree.
The program entity referred to by an identifier definition or use.
The environment to use to lookup names at a node.
The environment to use to lookup names at a node. Defined to be the completed defining environment for the smallest enclosing scope.
The semantic error messages for a given tree.
Return the expected type of a method argument.
Return the expected type of a method argument. We are given the declaration of the method and the argument index. The latter is the count of the node as a child of the CallExp node. The base expression is index 0, the name of the called method is index 1, and the arguments start at index 2. Thus, to lookup this argument in the formal arguments is we need to adjust by two.
What is the expected type of an expression?
Find the entity for a method called i in the class defined by
decl.
Find the entity for a method called i in the class defined by
decl. If the method is not found there and decl's class has a
superclass, look there. Repeat until either the definition is
found or no more superclasses exist, in which case return an
the unknown entity.
Are two types compatible? If either of them are unknown then we assume an error has already been raised elsewhere so we say they are compatible with anything.
Are two types compatible? If either of them are unknown then we assume an error has already been raised elsewhere so we say they are compatible with anything. Otherwise the two types have to be the same.
The type of the normal class in which this node occurs.
The type of the normal class in which this node occurs. Rule 17
What is the type of an expression?
Semantic analysis module containing static checking of Minijava semantic rules, most notably name analysis.