Class EnvVar
java.lang.Object
org.jfuncmachine.compiler.classgen.EnvVar
Associates a name and type with the index of a local variable.
In Java instructions, local variables are referred to by a simple
index number. The parameters to the method have the lowest index numbers.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidgenerateGet(ClassGenerator generator) Generates an instruction to get this variablevoidgenerateSet(ClassGenerator generator) Generates an instruction to set this variablestatic intReturns the opcode used to get variables of a particular typeinthashCode()static intReturns the opcode used to set variables of a particular type
-
Field Details
-
name
The name of the variable -
type
The type of the variable -
index
public final int indexThe index of the variable
-
-
Constructor Details
-
EnvVar
Creates a new EnvVar with a name, type, and index value- Parameters:
name- The name of the variabletype- The type of the variableindex- The index of the variable
-
-
Method Details
-
generateSet
Generates an instruction to set this variable- Parameters:
generator- The class generator currently generating the class
-
setOpcode
Returns the opcode used to set variables of a particular type- Parameters:
t- The type of variable to return the opcode for- Returns:
- The opcode used to store variables of the given type
-
generateGet
Generates an instruction to get this variable- Parameters:
generator- The class generator currently generating the class
-
getOpcode
Returns the opcode used to get variables of a particular type- Parameters:
t- The type of variable to return the opcode for- Returns:
- The opcode used to fetch variables of the given type
-
equals
-
hashCode
public int hashCode()
-