Class ClassTable

java.lang.Object
  extended byClassTable

class ClassTable
extends java.lang.Object

This class may be used to contain the semantic information such as the inheritance graph. You may use it or not as you like: it is only here to provide a container for the supplied methods.


Field Summary
private  java.io.PrintStream errorStream
           
private  int semantErrors
           
 
Constructor Summary
ClassTable(Classes cls)
           
 
Method Summary
 boolean errors()
          Returns true if there are any static semantic errors.
private  void installBasicClasses()
          Creates data structures representing basic Cool classes (Object, IO, Int, Bool, String).
static void main(java.lang.String[] args)
           
 java.io.PrintStream semantError()
          Increments semantic error count and returns the print stream for error messages.
 java.io.PrintStream semantError(AbstractSymbol filename, TreeNode t)
          Prints the file name and the line number of the given tree node.
 java.io.PrintStream semantError(class_ c)
          Prints line number and file name of the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

semantErrors

private int semantErrors

errorStream

private java.io.PrintStream errorStream
Constructor Detail

ClassTable

public ClassTable(Classes cls)
Method Detail

installBasicClasses

private void installBasicClasses()
Creates data structures representing basic Cool classes (Object, IO, Int, Bool, String). Please note: as is this method does not do anything useful; you will need to edit it to make if do what you want.


semantError

public java.io.PrintStream semantError(class_ c)
Prints line number and file name of the given class. Also increments semantic error count.

Parameters:
c - the class
Returns:
a print stream to which the rest of the error message is to be printed.

semantError

public java.io.PrintStream semantError(AbstractSymbol filename,
                                       TreeNode t)
Prints the file name and the line number of the given tree node. Also increments semantic error count.

Parameters:
filename - the file name
t - the tree node
Returns:
a print stream to which the rest of the error message is to be printed.

semantError

public java.io.PrintStream semantError()
Increments semantic error count and returns the print stream for error messages.

Returns:
a print stream to which the error message is to be printed.

errors

public boolean errors()
Returns true if there are any static semantic errors.


main

public static void main(java.lang.String[] args)