org.nlogo.command
Class BasicBlockCommand
java.lang.Object
org.nlogo.command.Instruction
org.nlogo.command.Command
org.nlogo.command.BasicBlockCommand
- All Implemented Interfaces:
- Cloneable, org.nlogo.compiler.Branching
public class BasicBlockCommand
- extends Command
- implements org.nlogo.compiler.Branching
Methods inherited from class org.nlogo.command.Instruction |
addProcedureToInliningRecords, agentClassCanPerform, agentClassString, agentClassString, argEvalAgent, argEvalAgentSet, argEvalAgentSet, argEvalBoolean, argEvalBooleanValue, argEvalDouble, argEvalDoubleValue, argEvalIntValue, argEvalLink, argEvalList, argEvalLong, argEvalLongValue, argEvalPatch, argEvalString, argEvalTurtle, assemble, checkAgentClass, checkAgentSetClass, clone, copyFieldsFrom, displayName, dump, dump, getInlinedDepth, getInliningRecords, getPositionAndLength, getSourceEndPosition, getSourceSnippet, getSourceStartPosition, newValidDouble, newValidDouble, optimize0, optimize1, optimize2, setSourceSnippet, throwAgentClassException, token, token, tokenLimitingType, tokenLimitingType, validDouble, wasInlined, workspace |
commandList
public ArrayList commandList
BasicBlockCommand
public BasicBlockCommand(ArrayList commandList)
getBranchTargetOffset
public int getBranchTargetOffset()
- Description copied from interface:
org.nlogo.compiler.Branching
- This offset should refer to the "other" place that execution
could go, besides incrementing by 1. If this method returns
1, then the instruction is not, in fact, branching after all,
since it's only choices are to go to 1 or 1.
Note: some commands may return Integer.MIN_VALUE,
which is a special value that indicates that their
branch destination is either:
1) their destination is not relative to their current location
2) their destination is unknown at compile-time.
An offset of 0 means that the command is "Loopy"
(such as _fdinternal ), and it may not increment the IP at all.
~Forrest (1/4/2007)
- Specified by:
getBranchTargetOffset
in interface org.nlogo.compiler.Branching
setBranchTargetOffset
public void setBranchTargetOffset(int newOffset)
- Specified by:
setBranchTargetOffset
in interface org.nlogo.compiler.Branching
perform
public void perform(Context context)
throws LogoException
- Specified by:
perform
in class Command
- Throws:
LogoException
getSyntax
public org.nlogo.compiler.Syntax getSyntax()
- Specified by:
getSyntax
in class Instruction
toString
public String toString()
- Overrides:
toString
in class Command
init
public void init(Workspace workspace)
- Overrides:
init
in class Instruction