public abstract class ProgramBlock extends Object implements ParseInfo
Modifier and Type | Field and Description |
---|---|
int |
_beginColumn |
int |
_beginLine |
int |
_endColumn |
int |
_endLine |
String |
_filename |
String |
_text |
static String |
PRED_VAR |
Constructor and Description |
---|
ProgramBlock(Program prog) |
Modifier and Type | Method and Description |
---|---|
abstract void |
execute(ExecutionContext ec)
Executes this program block (incl recompilation if required).
|
ScalarObject |
executePredicate(ArrayList<Instruction> inst,
Hop hops,
boolean requiresRecompile,
Types.ValueType retType,
ExecutionContext ec)
Executes given predicate instructions (incl recompilation if required)
|
int |
getBeginColumn() |
int |
getBeginLine() |
abstract ArrayList<ProgramBlock> |
getChildBlocks()
Get the list of child program blocks if nested;
otherwise this method returns null.
|
int |
getEndColumn() |
int |
getEndLine() |
Instruction |
getExitInstruction() |
String |
getFilename() |
Program |
getProgram() |
StatementBlock |
getStatementBlock() |
String |
getText() |
long |
getThreadID() |
boolean |
hasThreadID() |
abstract boolean |
isNested()
Indicates if the program block is nested, i.e.,
if it contains other program blocks (e.g., loops).
|
static boolean |
isThreadID(long tid) |
String |
printBlockErrorLocation() |
void |
setBeginColumn(int passed) |
void |
setBeginLine(int passed) |
void |
setEndColumn(int passed) |
void |
setEndLine(int passed) |
void |
setExitInstruction(Instruction rmVar) |
void |
setFilename(String passed) |
void |
setParseInfo(ParseInfo parseInfo)
Set parse information.
|
void |
setProgram(Program prog) |
void |
setStatementBlock(StatementBlock sb) |
void |
setText(String text) |
void |
setThreadID(long id) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ctxAndFilenameToParseInfo
public static final String PRED_VAR
public String _filename
public int _beginLine
public int _beginColumn
public int _endLine
public int _endColumn
public String _text
public ProgramBlock(Program prog)
public Program getProgram()
public void setProgram(Program prog)
public StatementBlock getStatementBlock()
public void setStatementBlock(StatementBlock sb)
public void setThreadID(long id)
public boolean hasThreadID()
public static boolean isThreadID(long tid)
public long getThreadID()
public void setExitInstruction(Instruction rmVar)
public Instruction getExitInstruction()
public abstract ArrayList<ProgramBlock> getChildBlocks()
public abstract boolean isNested()
public abstract void execute(ExecutionContext ec)
ec
- execution contextpublic ScalarObject executePredicate(ArrayList<Instruction> inst, Hop hops, boolean requiresRecompile, Types.ValueType retType, ExecutionContext ec)
inst
- list of instructionshops
- high-level operatorrequiresRecompile
- true if requires recompileretType
- value type of the return typeec
- execution contextpublic void setFilename(String passed)
setFilename
in interface ParseInfo
public void setBeginLine(int passed)
setBeginLine
in interface ParseInfo
public void setBeginColumn(int passed)
setBeginColumn
in interface ParseInfo
public void setEndLine(int passed)
setEndLine
in interface ParseInfo
public void setEndColumn(int passed)
setEndColumn
in interface ParseInfo
public String getFilename()
getFilename
in interface ParseInfo
public int getBeginLine()
getBeginLine
in interface ParseInfo
public int getBeginColumn()
getBeginColumn
in interface ParseInfo
public int getEndLine()
getEndLine
in interface ParseInfo
public int getEndColumn()
getEndColumn
in interface ParseInfo
public String printBlockErrorLocation()
public void setParseInfo(ParseInfo parseInfo)
parseInfo
- parse information, such as beginning line position, beginning
column position, ending line position, ending column position,
text, and filenameCopyright © 2020 The Apache Software Foundation. All rights reserved.