piglet.meta
Class PigletTemp

java.lang.Object
  extended by piglet.meta.PigletTemp
All Implemented Interfaces:
Binding

public final class PigletTemp
extends java.lang.Object
implements Binding

This class represents a Temp object that can be used in the creation of piglet syntaxtree node.

Author:
Santoso Wijaya

Method Summary
static PigletTemp createTemp()
          Returns a unique Temp object.
static Temp createTempNode(PigletTemp temp)
          Creates and return a piglet syntaxtree node that represents a Temp.
 int getOrdinal()
           
static PigletTemp getPreTemp(int ord)
          Returns pre-created, well known Temp objects with ordinals 0-19
static void reset()
          Resets the static counter of the class' Temp number enumerator.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getOrdinal

public int getOrdinal()
Returns:
this Temp's register number

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPreTemp

public static PigletTemp getPreTemp(int ord)
Returns pre-created, well known Temp objects with ordinals 0-19

Parameters:
ord - the ordinal of the pre-Temp object
Returns:
the pre-Temp object

createTemp

public static PigletTemp createTemp()
Returns a unique Temp object. Each subsequently created Temp object gets an ordinal number that is one higher than the previously created Temp object.

Returns:
a Temp object

createTempNode

public static Temp createTempNode(PigletTemp temp)
Creates and return a piglet syntaxtree node that represents a Temp.

Parameters:
temp - the Temp object
Returns:
a piglet syntaxtree node (JTB) that represents a Temp

reset

public static void reset()
Resets the static counter of the class' Temp number enumerator.