org.enhydra.xml.xmlc.codegen
Class VarNames
java.lang.Object
|
+--org.enhydra.xml.xmlc.codegen.VarNames
- public class VarNames
- extends Object
Generate tmp variable names for use in initialization. Keeps a table of
tmp variable names used in initialize of nodes. Since nodes are recursive,
but the initialization code is an inline block of code, we use this to
recycle as many variables as possible, but not clobber ones that are
currently in use.
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VarNames
public VarNames(String varType,
String varPrefix)
- Construct a new object.
- Parameters:
varType
- Type for the generated variable names.varPrefix
- Prefix for the generated variable names.
getVarName
public String getVarName(int level)
- Get the variable name for the current level.
- Parameters:
level
- current level- Returns:
- the name of the local variable.
getVarDefs
public String getVarDefs()
- Get code to define local variables.
- Returns:
- Line of java code or null if no code was created.
insertVarDefs
public void insertVarDefs(JavaCode body)
- Insert variable definitions at the beginning of the body of a method.
Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.