treeNodes
Class Attribute

java.lang.Object
  extended by generalHelpers.TreeNode
      extended by treeNodes.AbstractFeature
          extended by treeNodes.Attribute

public class Attribute
extends AbstractFeature

Defines AST constructor 'attr'.

See TreeNode for full documentation.


Field Summary
protected  AbstractExpression init
           
protected  AbstractSymbol type_decl
           
 
Fields inherited from class treeNodes.AbstractFeature
name
 
Fields inherited from class generalHelpers.TreeNode
lineNumber
 
Constructor Summary
Attribute(int lineNumber, AbstractSymbol a1, AbstractSymbol a2, AbstractExpression a3)
          Creates "attr" AST node.
 
Method Summary
 TreeNode copy()
          Creates a copy of this node.
 void dump(java.io.Writer out, int n)
          Pretty-prints this node to this output stream.
 void dumpWithTypes(java.io.Writer out, int n)
           
 AbstractExpression getInit()
           
 AbstractSymbol getType()
           
 
Methods inherited from class treeNodes.AbstractFeature
getName
 
Methods inherited from class generalHelpers.TreeNode
copyAbstractSymbol, copyBoolean, dumpAbstractSymbol, dumpBoolean, dumpLine, getLineNumber, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type_decl

protected AbstractSymbol type_decl

init

protected AbstractExpression init
Constructor Detail

Attribute

public Attribute(int lineNumber,
                 AbstractSymbol a1,
                 AbstractSymbol a2,
                 AbstractExpression a3)
Creates "attr" AST node.

Parameters:
lineNumber - the line in the source file from which this node came.
a0 - initial value for name
a1 - initial value for type_decl
a2 - initial value for init
Method Detail

getType

public AbstractSymbol getType()

getInit

public AbstractExpression getInit()

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.Writer out,
                 int n)
          throws java.io.IOException
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
Throws:
java.io.IOException

dumpWithTypes

public void dumpWithTypes(java.io.Writer out,
                          int n)
                   throws java.io.IOException
Specified by:
dumpWithTypes in class AbstractFeature
Throws:
java.io.IOException