|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.prorefactor.treeparser.Block
public class Block
For keeping track of blocks, block attributes, and the things that are scoped within those blocks - especially buffer scopes.
Constructor Summary | |
---|---|
Block()
Only to be used for persistence/serialization. |
|
Block(Block parent,
JPNode node)
For constructing nested blocks |
|
Block(SymbolScope symbolScope,
JPNode node)
For constructing a root (method root or program root) block. |
Method Summary | |
---|---|
void |
addBufferScopeReferences(BufferScope bufferScope)
Add a reference to a BufferScope to this and all outer blocks. |
Block |
addFrame(Frame frame)
Called by Frame.setFrameScopeBlock() - not intended to be called by any client code. |
void |
addHiddenCursor(RecordNameNode node)
A "hidden cursor" is a BufferScope which has no side-effects on surrounding blocks like strong, weak, and reference scopes do. |
void |
addStrongBufferScope(RecordNameNode node)
Create a "strong" buffer scope. |
BufferScope |
addWeakBufferScope(TableBuffer symbol)
Create a "weak" buffer scope. |
TableBuffer[] |
getBlockBuffers()
Get the buffers that are scoped to this block |
BufferScope |
getBufferForReference(TableBuffer symbol)
Find or create a buffer for the input BufferSymbol |
Frame |
getDefaultFrame()
From the nearest frame scoping block, get the default (possibly unnamed) frame if it exists. |
java.util.ArrayList<Frame> |
getFrames()
Get a copy of the list of frames scoped to this block. |
JPNode |
getNode()
Get the node for this block. |
Block |
getParent()
This returns the block of the parent scope. |
SymbolScope |
getSymbolScope()
|
boolean |
isBufferLocal(BufferScope buff)
Is a buffer scoped to this or any parent of this block. |
boolean |
isMethodBlock()
A method-block is a block for a function/trigger/internal-procedure. |
boolean |
isProgramBlock()
The program-block is the outer program block (not internal procedure block) |
boolean |
isRootBlock()
A root-block is the root block for any SymbolScope whether program, function, trigger, or internal procedure. |
FieldLookupResult |
lookupField(java.lang.String name,
boolean getBufferScope)
General lookup for Field or Variable. |
protected FieldLookupResult |
lookupUnqualifiedField(java.lang.String name)
Find a field based on buffers which are referenced in nearest enclosing blocks. |
void |
setDefaultFrameExplicit(Frame frame)
Explicitly set the default frame for this block. |
Block |
setDefaultFrameImplicit(Frame frame)
In the nearest frame scoping block, set the default implicit (unnamed) frame. |
void |
setParent(Block parent)
|
void |
writeXferBytes(DataXferStream out)
Implement Xferable. |
void |
writeXferSchema(DataXferStream out)
Implement Xferable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Block()
public Block(Block parent, JPNode node)
public Block(SymbolScope symbolScope, JPNode node)
symbolScope
- node
- Is the Program_root if this is the program root block.Method Detail |
---|
public void addBufferScopeReferences(BufferScope bufferScope)
public Block addFrame(Frame frame)
public void addHiddenCursor(RecordNameNode node)
node
- The RECORD_NAME node. Must have the BufferSymbol linked to it already.public void addStrongBufferScope(RecordNameNode node)
node
- The RECORD_NAME node. It must already have
the BufferSymbol linked to it.public BufferScope addWeakBufferScope(TableBuffer symbol)
node
- The RECORD_NAME node. It must already have
the BufferSymbol linked to it.public TableBuffer[] getBlockBuffers()
public BufferScope getBufferForReference(TableBuffer symbol)
public Frame getDefaultFrame()
public java.util.ArrayList<Frame> getFrames()
public JPNode getNode()
public Block getParent()
public SymbolScope getSymbolScope()
public boolean isBufferLocal(BufferScope buff)
public boolean isMethodBlock()
public boolean isProgramBlock()
public boolean isRootBlock()
public FieldLookupResult lookupField(java.lang.String name, boolean getBufferScope)
protected FieldLookupResult lookupUnqualifiedField(java.lang.String name)
public void setDefaultFrameExplicit(Frame frame)
public Block setDefaultFrameImplicit(Frame frame)
public void setParent(Block parent)
public void writeXferBytes(DataXferStream out) throws java.io.IOException
writeXferBytes
in interface Xferable
java.io.IOException
public void writeXferSchema(DataXferStream out) throws java.io.IOException
writeXferSchema
in interface Xferable
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |