geneseo.cs.compiler
Class LabelSeq

java.lang.Object
  |
  +--geneseo.cs.compiler.LabelSeq

public class LabelSeq
extends java.lang.Object

Represents pools from which a compiler can draw unique labels for locations in an assembly language program. Conceptually, these "pools" are infinitely long sequences of strings in a form suitable for labels in most assemblers, from which a compiler can keep drawing the "next" entry.


Constructor Summary
LabelSeq(java.lang.String prefix)
          Initializes a sequence of labels ready to yield its first member.
 
Method Summary
 java.lang.String nextLabel()
          Retrieve the next label from a sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelSeq

public LabelSeq(java.lang.String prefix)
Initializes a sequence of labels ready to yield its first member.
Parameters:
prefix - A string that will prefix all labels in this sequence to distinguish them from those generated by other label sequences.
Method Detail

nextLabel

public java.lang.String nextLabel()
Retrieve the next label from a sequence.
Returns:
The first label not previously returned by this method from the sequence.