public class CodeBlock
extends java.lang.Object
CodeBlocks provides a means of remembering
where variables are defined, as well as their scopes.VariableDeclaration| Constructor and Description |
|---|
CodeBlock(int start)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
CodeBlock |
addChildCodeBlock(int start)
Creates and returns a child (nested) code block.
|
void |
addVariable(JavaScriptVariableDeclaration varDec)
Adds a variable declaration.
|
boolean |
contains(int offset)
Returns whether this code block contains a given offset.
|
void |
debug() |
CodeBlock |
getChildCodeBlock(int index)
Returns a child code block.
|
int |
getChildCodeBlockCount()
Returns the number of child code blocks.
|
int |
getEndOffset()
Returns the end offset of this code block.
|
CodeBlock |
getParent()
Returns the parent code block.
|
int |
getStartOffset()
Returns the start offset of this code block.
|
JavaScriptVariableDeclaration |
getVariableDeclaration(int index)
Returns a variable declaration.
|
int |
getVariableDeclarationCount()
Returns the number of variable declarations in this code block.
|
void |
setEndOffset(int end)
Sets the end offset of this code block.
|
void |
setStartOffSet(int start)
Sets the start offset of this code block.
|
public CodeBlock(int start)
start - The starting offset of the code block.public CodeBlock addChildCodeBlock(int start)
start - The starting offset of the nested code block.public void addVariable(JavaScriptVariableDeclaration varDec)
varDec - The variable declaration.public boolean contains(int offset)
offset - The offset.public CodeBlock getChildCodeBlock(int index)
index - The index of the child code block.getChildCodeBlockCount()public int getChildCodeBlockCount()
getChildCodeBlock(int)public int getEndOffset()
getStartOffset(),
setEndOffset(int)public CodeBlock getParent()
null if there isn't one.public int getStartOffset()
getEndOffset()public JavaScriptVariableDeclaration getVariableDeclaration(int index)
index - The index of the declaration.getVariableDeclarationCount()public int getVariableDeclarationCount()
getVariableDeclaration(int)public void setEndOffset(int end)
end - The end offset.getEndOffset()public void setStartOffSet(int start)
start - the start offsetgetStartOffset()public void debug()