geneseo.cs.miniml
Class TailCallNode

java.lang.Object
  |
  +--geneseo.cs.miniml.MinimLParseNode
        |
        +--geneseo.cs.miniml.TailCallNode
All Implemented Interfaces:
ParseNode

public class TailCallNode
extends MinimLParseNode

Represents syntax tree nodes for tail calls (function calls that are the last thing the caller does) in the MinimL compiler.


Constructor Summary
TailCallNode(java.lang.String function, MinimLParseNode actuals)
          Initialize a tail call node from the name of the function it calls and the actual parameter list.
 
Method Summary
 void acceptVisit(MinimLParseVisitor visitor)
          Allow a visitor object to process a tail call.
 MinimLParseNode getActuals()
          Retrieve a tail call's actual parameter list.
 java.lang.String getIdentifier()
          Retrieve the name of the function that a tail call calls.
 void setActuals(MinimLParseNode newActuals)
          Change a tail call's actual parameter list.
 java.lang.String toString()
          Generate a string representing a tail call.
 
Methods inherited from class geneseo.cs.miniml.MinimLParseNode
getAttribute, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TailCallNode

public TailCallNode(java.lang.String function,
                    MinimLParseNode actuals)
Initialize a tail call node from the name of the function it calls and the actual parameter list.
Parameters:
function - The name of the function to call.
actuals - The head of the actual parameter list.
Method Detail

getIdentifier

public java.lang.String getIdentifier()
Retrieve the name of the function that a tail call calls.
Returns:
The function's name.

getActuals

public MinimLParseNode getActuals()
Retrieve a tail call's actual parameter list.
Returns:
The syntax tree node for head of the actual parameter list (from which the rest of the list is accessible).

setActuals

public void setActuals(MinimLParseNode newActuals)
Change a tail call's actual parameter list.
Parameters:
newActuals - The head of the new list of actual parameters.

acceptVisit

public void acceptVisit(MinimLParseVisitor visitor)
                 throws CompilerException
Allow a visitor object to process a tail call. Exactly what the visitor does to the call is up to the visitor.
Overrides:
acceptVisit in class MinimLParseNode
Parameters:
visitor - The visitor object that wishes to process the call.
Throws:
CompilerException - If thrown by the visitor.
See Also:
MinimLParseVisitor

toString

public java.lang.String toString()
Generate a string representing a tail call.
Overrides:
toString in class java.lang.Object
Returns:
A string that indicates that a syntax tree node is a tail call, and the name of the function.