ast
Class Formal

java.lang.Object
  extended by ast.ASTNode
      extended by ast.Formal

public class Formal
extends ASTNode

The Formal class represents a formal parameter declaration appearing in a method declaration. It contains a variable type (type ), and a name (name).

See Also:
ASTNode

Field Summary
protected  java.lang.String name
          The name of the formal parameter
protected  java.lang.String type
          The type of the formal parameter
 
Fields inherited from class ast.ASTNode
charNum, lineNum, lineStr
 
Constructor Summary
Formal(int lineNum, java.lang.String type, java.lang.String name)
          Formal constructor
 
Method Summary
 java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
          Visitor method
 java.lang.String getName()
          Get the name of the formal parameter
 java.lang.String getType()
          Get the type of the formal parameter
 
Methods inherited from class ast.ASTNode
getLineNum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected java.lang.String type
The type of the formal parameter


name

protected java.lang.String name
The name of the formal parameter

Constructor Detail

Formal

public Formal(int lineNum,
              java.lang.String type,
              java.lang.String name)
Formal constructor

Parameters:
lineNum - source line number corresponding to this AST node
type - the type of the formal parameter
name - the name of the formal parameter
Method Detail

getType

public java.lang.String getType()
Get the type of the formal parameter

Returns:
type of formal parameter

getName

public java.lang.String getName()
Get the name of the formal parameter

Returns:
name of formal parameter

accept

public java.lang.Object accept(visitor.Visitor v,
                               java.lang.Object o)
Visitor method

Specified by:
accept in class ASTNode
Parameters:
v - visitor object
o - object to pass down
Returns:
result of visiting this node
See Also:
Visitor