Class NameGenerator

java.lang.Object
net.hydromatic.morel.compile.NameGenerator

public class NameGenerator extends Object
Generates unique names.

Also keeps track of how many times each given name has been used in this program, so that a new occurrence of a name can be given a fresh ordinal.

  • Field Details

  • Constructor Details

    • NameGenerator

      public NameGenerator()
  • Method Details

    • get

      public String get()
      Generates a name that is unique in this program.
    • inc

      public int inc(String name)
      Returns the number of times that "name" has been used for a variable.