piglet.meta
Class PigletLabel

java.lang.Object
  extended by piglet.meta.PigletLabel

public final class PigletLabel
extends java.lang.Object

This class represents a Label that can be used in creating a Label node in a piglet syntaxtree.

Author:
Santoso Wijaya

Method Summary
static PigletLabel createLabel(java.lang.String prefix)
          Returns a unique Label object, with the given prefix.
static Label createLabelNode(PigletLabel plabel)
          Creates and return a piglet syntaxtree node that represents a Label.
static PigletLabel createRawLabel(java.lang.String theLabel)
          Returns a raw Label object with the given label string.
 java.lang.String getLabel()
          Returns the string representation of this Label.
static void reset()
          Resets the static counter of the class' label 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

getLabel

public java.lang.String getLabel()
Returns the string representation of this Label.

Returns:
the string representation of this Label.

toString

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

createLabel

public static PigletLabel createLabel(java.lang.String prefix)
Returns a unique Label object, with the given prefix. Each subsequently created Label object has a unique number attached to the end of the given prefix, regardless of the prefix.

Parameters:
prefix - the prefix
Returns:
a unique Label object

createRawLabel

public static PigletLabel createRawLabel(java.lang.String theLabel)
Returns a raw Label object with the given label string. No numerical suffix is involved.

Parameters:
theLabel - the label string
Returns:
the raw Label object

createLabelNode

public static Label createLabelNode(PigletLabel plabel)
Creates and return a piglet syntaxtree node that represents a Label.

Parameters:
plabel - the label object
Returns:
a piglet syntaxtree node (JTB) that represents a Label

reset

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