public class EmitterScope extends Object
Modifier and Type | Class and Description |
---|---|
static class |
EmitterScope.ScopeType
Scope type
|
Constructor and Description |
---|
EmitterScope(EmitterScope parent,
EmitterScope.ScopeType scopeType) |
Modifier and Type | Method and Description |
---|---|
void |
activateBlocks()
Lets the compiler know there are try/on/finally blocks
that need to be handled for this scope.
|
void |
activateBlocks(int instructionPosition)
Activate a try or on block, this will capture the
starting instruction pointer.
|
void |
activateParameterIndexes()
This scope has named parameters
|
void |
addInstr(int instruction)
Adds an instruction
|
int |
addLocal(String reference)
Adds the symbol to the
Locals . |
OuterDesc |
find(String reference)
Finds a reference, generating an
OuterDesc if found |
Constants |
getConstants() |
int |
getCurrentLineNumber() |
DebugSymbols |
getDebugSymbols() |
int |
getInstructionCount() |
Instructions |
getInstructions() |
Labels |
getLabels() |
Locals |
getLocals() |
int |
getMaxstacksize() |
int |
getNumArgs() |
Outers |
getOuters() |
EmitterScope |
getParent() |
int[] |
getRawInstructions()
Retrieves the raw instruction set that has been built up.
|
EmitterScope.ScopeType |
getScopeType() |
boolean |
hasBlocks() |
boolean |
hasConstants() |
boolean |
hasLocals() |
boolean |
hasOuters() |
boolean |
hasParameterIndexes() |
boolean |
hasParent()
Determines if this
EmitterScope has a parent |
boolean |
hasVarargs() |
void |
incrementMaxstacksize(int delta)
Increments the allocated stack size by delta.
|
boolean |
isDebug() |
void |
markLexicalScope()
Mark the beginning of an inner scope
|
int |
popBlock()
Removes the try or on block, returning the
starting instruction pointer.
|
void |
reconcileLabels()
Reconcile the labels, will correctly mark
the
jump labels with the correct instruction
positions. |
void |
setCurrentLineNumber(int currentLineNumber) |
void |
setDebug(boolean debug) |
void |
setNumArgs(int numArgs) |
void |
setVarargs(boolean hasVarargs)
Sets if there are variable arguments passed to
this scope.
|
void |
unmarkLexicalScope()
Leave the scope
|
boolean |
usesLocals() |
public EmitterScope(EmitterScope parent, EmitterScope.ScopeType scopeType)
parent
- scopeType
- public DebugSymbols getDebugSymbols()
public int getNumArgs()
public void setNumArgs(int numArgs)
numArgs
- the numArgs to setpublic boolean hasVarargs()
public void setVarargs(boolean hasVarargs)
hasVarargs
- public boolean hasBlocks()
public void activateBlocks()
public void activateBlocks(int instructionPosition)
instructionPosition
- popBlock()
public int popBlock()
activateBlocks(int)
public boolean hasParameterIndexes()
public void activateParameterIndexes()
public int[] getRawInstructions()
public int getCurrentLineNumber()
public void setCurrentLineNumber(int currentLineNumber)
currentLineNumber
- the currentLineNumber to setpublic boolean hasParent()
EmitterScope
has a parentEmitterScope
public EmitterScope getParent()
public EmitterScope.ScopeType getScopeType()
public boolean isDebug()
public void setDebug(boolean debug)
debug
- the debug to setpublic boolean usesLocals()
public int addLocal(String reference)
Locals
.reference
- public void addInstr(int instruction)
instruction
- public void reconcileLabels()
jump
labels with the correct instruction
positions.public Instructions getInstructions()
public int getInstructionCount()
public void markLexicalScope()
public void unmarkLexicalScope()
public int getMaxstacksize()
public void incrementMaxstacksize(int delta)
delta
- public Constants getConstants()
public boolean hasConstants()
public Outers getOuters()
public boolean hasOuters()
public Labels getLabels()
public Locals getLocals()
public boolean hasLocals()
Copyright © 2010–2015. All rights reserved.