Class typcase

java.lang.Object
  extended byTreeNode
      extended byExpression
          extended bytypcase

class typcase
extends Expression

Defines AST constructor 'typcase'.

See TreeNode for full documentation.


Field Summary
 Cases cases
           
 Expression expr
           
protected  int lineNumber
          line in the source file from which this node came.
 
Constructor Summary
typcase(int lineNumber, Expression a1, Cases a2)
          Creates "typcase" AST node.
 
Method Summary
 void code(java.io.PrintStream s)
          Generates code for this expression.
protected  AbstractSymbol copy_AbstractSymbol(AbstractSymbol sym)
          Copies an AbstractSymbol value.
protected  java.lang.Boolean copy_Boolean(java.lang.Boolean b)
          Copies a boolean value.
 TreeNode copy()
          Creates a copy of this node.
protected  void dump_AbstractSymbol(java.io.PrintStream out, int n, AbstractSymbol sym)
          Dumps a printable representation of an AbstactSymbol value.
protected  void dump_Boolean(java.io.PrintStream out, int n, java.lang.Boolean b)
          Dumps a printable representation of a boolean value.
protected  void dump_line(java.io.PrintStream out, int n)
          Dumps a printable representation of current line number This method is used internally by the generated AST classes
 void dump_type(java.io.PrintStream out, int n)
           
 void dump_with_types(java.io.PrintStream out, int n)
           
 void dump(java.io.PrintStream out, int n)
          Pretty-prints this node to this output stream.
 AbstractSymbol get_type()
           
 int getLineNumber()
          Retreives the line number from which this node came.
 Expression set_type(AbstractSymbol s)
           
 TreeNode set(TreeNode other)
          Sets the values of this node object to the values of a given node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expr

public Expression expr

cases

public Cases cases

lineNumber

protected int lineNumber
line in the source file from which this node came.

Constructor Detail

typcase

public typcase(int lineNumber,
               Expression a1,
               Cases a2)
Creates "typcase" AST node.

Parameters:
lineNumber - the line in the source file from which this node came.
a1 - initial value for cases
Method Detail

copy

public TreeNode copy()
Description copied from class: TreeNode
Creates a copy of this node.

Specified by:
copy in class TreeNode
Returns:
a copy of this node

dump

public void dump(java.io.PrintStream out,
                 int n)
Description copied from class: TreeNode
Pretty-prints this node to this output stream.

Specified by:
dump in class TreeNode
Parameters:
out - the output stream
n - the number of spaces to indent the output

dump_with_types

public void dump_with_types(java.io.PrintStream out,
                            int n)
Specified by:
dump_with_types in class Expression

code

public void code(java.io.PrintStream s)
Generates code for this expression. This method is to be completed in programming assignment 5. (You may add or remove parameters as you wish.)

Specified by:
code in class Expression
Parameters:
s - the output stream

get_type

public AbstractSymbol get_type()

set_type

public Expression set_type(AbstractSymbol s)

dump_type

public void dump_type(java.io.PrintStream out,
                      int n)

set

public TreeNode set(TreeNode other)
Sets the values of this node object to the values of a given node.

Parameters:
other - the other node
Returns:
this node

getLineNumber

public int getLineNumber()
Retreives the line number from which this node came.

Returns:
the line number

copy_Boolean

protected java.lang.Boolean copy_Boolean(java.lang.Boolean b)
Copies a boolean value. This method is used internally by the generated AST classes


copy_AbstractSymbol

protected AbstractSymbol copy_AbstractSymbol(AbstractSymbol sym)
Copies an AbstractSymbol value. This method is used internally by the generated AST classes


dump_Boolean

protected void dump_Boolean(java.io.PrintStream out,
                            int n,
                            java.lang.Boolean b)
Dumps a printable representation of a boolean value. This method is used internally by the generated AST classes


dump_AbstractSymbol

protected void dump_AbstractSymbol(java.io.PrintStream out,
                                   int n,
                                   AbstractSymbol sym)
Dumps a printable representation of an AbstactSymbol value. This method is used internally by the generated AST classes


dump_line

protected void dump_line(java.io.PrintStream out,
                         int n)
Dumps a printable representation of current line number This method is used internally by the generated AST classes