org.erights.e.elang.syntax
Class HilbertHotel

java.lang.Object
  |
  +--org.erights.e.elang.syntax.HilbertHotel

public class HilbertHotel
extends Object

Untamed:


Field Summary
private  int myTempCount
          generated temp variable count
 
Constructor Summary
HilbertHotel()
          Enabled:
 
Method Summary
static String baseName(String name)
          Enabled: If 'name' could have been generated by 'newTemp(base)', return 'base'.
 String newTemp(String name)
          Enabled: generate 'unique' temporary variable names for transformations.
static String rename(String name)
          Enabled: Even if given an ident that could have been generated by newTemp() or rename(), rename() will return names guaranteed not to conflict with each other.
private static int tempSep(String name)
          If 'name' ends in "_", return the index of "_".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myTempCount

private int myTempCount
generated temp variable count

Constructor Detail

HilbertHotel

public HilbertHotel()
Enabled:

Method Detail

newTemp

public String newTemp(String name)
Enabled: generate 'unique' temporary variable names for transformations. Suffix will be odd to make room for the new guests at the Hilbert Hotel. See rename().


tempSep

private static int tempSep(String name)
If 'name' ends in "_", return the index of "_". This is the format of a temp name. Otherwise, return -1.


baseName

public static String baseName(String name)
Enabled: If 'name' could have been generated by 'newTemp(base)', return 'base'.

Otherwise, return 'name'. This is our sort-of demangler.


rename

public static String rename(String name)
Enabled: Even if given an ident that could have been generated by newTemp() or rename(), rename() will return names guaranteed not to conflict with each other.

The argument to rename() is the room assignment before the bus drives up. rename() returns the resulting assignment. Since this transformation is deterministic, rename() is a static method.



comments?