org.nlogo.command
Class Instruction

java.lang.Object
  extended by org.nlogo.command.Instruction
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Command, Reporter

public abstract class Instruction
extends Object
implements Cloneable


Field Summary
 int agentBits
           
 Reporter[] args
           
 String blockAgentClassString
           
 Method chosenEvalMethod
           
 int chosenEvalMethodMatchCost
           
 String disassembly
           
 String userSource
           
 World world
           
 
Constructor Summary
Instruction(String agentClassString)
           
Instruction(String agentClassString, String blockAgentClassString)
           
 
Method Summary
 void addProcedureToInliningRecords(Procedure p)
           
 boolean agentClassCanPerform(Class agentClass)
           
 String agentClassString()
           
 void agentClassString(String agentClassString)
           
 Agent argEvalAgent(Context context, int argIndex)
           
 AgentSet argEvalAgentSet(Context context, int argIndex)
           
 AgentSet argEvalAgentSet(Context context, int argIndex, Class type)
           
 Boolean argEvalBoolean(Context context, int argIndex)
           
 boolean argEvalBooleanValue(Context context, int argIndex)
           
 Double argEvalDouble(Context context, int argIndex)
           
 double argEvalDoubleValue(Context context, int argIndex)
           
 int argEvalIntValue(Context context, int argIndex)
           
 Link argEvalLink(Context context, int argIndex)
           
 LogoList argEvalList(Context context, int argIndex)
           
 Long argEvalLong(Context context, int argIndex)
           
 long argEvalLongValue(Context context, int argIndex)
           
 Patch argEvalPatch(Context context, int argIndex)
           
 String argEvalString(Context context, int argIndex)
           
 Turtle argEvalTurtle(Context context, int argIndex)
           
 org.nlogo.compiler.AssembledInstruction assemble(List assembledArgs)
           
 void checkAgentClass(Agent agent, Context context)
           
 void checkAgentSetClass(AgentSet agents, Context context)
           
 Object clone()
           
 void copyFieldsFrom(Instruction sourceInstr)
           
 String displayName()
           
 String dump()
           
 String dump(int indentLevel)
           
 int getInlinedDepth()
           
 ArrayList getInliningRecords()
           
 int[] getPositionAndLength()
           
 int getSourceEndPosition()
           
 String getSourceSnippet()
           
 int getSourceStartPosition()
           
abstract  org.nlogo.compiler.Syntax getSyntax()
           
 void init(Workspace workspace)
           
 Double newValidDouble(double d)
           
static Double newValidDouble(double d, Instruction instr)
           
 Object[] optimize0()
           
 Object[] optimize1(Reporter arg, Object[] subargs)
           
 Object[] optimize2(Reporter arg1, Object[] subargs1, Reporter arg2, Object[] subargs2)
           
 void setSourceSnippet(String s)
           
 void throwAgentClassException(Context context, Class agentClass)
           
 org.nlogo.compiler.Token token()
           
 void token(org.nlogo.compiler.Token token)
           
 org.nlogo.compiler.Token tokenLimitingType()
           
 void tokenLimitingType(org.nlogo.compiler.Token token)
           
 String toString()
           
 double validDouble(double d)
           
 boolean wasInlined()
          Was this instruction inlined by the Inliner phase of compiling?
 Workspace workspace()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

world

public World world

args

public Reporter[] args

agentBits

public int agentBits

blockAgentClassString

public String blockAgentClassString

userSource

public String userSource

disassembly

public String disassembly

chosenEvalMethod

public Method chosenEvalMethod

chosenEvalMethodMatchCost

public int chosenEvalMethodMatchCost
Constructor Detail

Instruction

public Instruction(String agentClassString,
                   String blockAgentClassString)

Instruction

public Instruction(String agentClassString)
Method Detail

workspace

public Workspace workspace()

getSyntax

public abstract org.nlogo.compiler.Syntax getSyntax()

token

public org.nlogo.compiler.Token token()

token

public void token(org.nlogo.compiler.Token token)

tokenLimitingType

public org.nlogo.compiler.Token tokenLimitingType()

tokenLimitingType

public void tokenLimitingType(org.nlogo.compiler.Token token)

getInliningRecords

public ArrayList getInliningRecords()

addProcedureToInliningRecords

public void addProcedureToInliningRecords(Procedure p)

getInlinedDepth

public int getInlinedDepth()

wasInlined

public boolean wasInlined()
Was this instruction inlined by the Inliner phase of compiling?


agentClassString

public String agentClassString()

agentClassString

public void agentClassString(String agentClassString)

init

public void init(Workspace workspace)

getPositionAndLength

public int[] getPositionAndLength()

getSourceStartPosition

public int getSourceStartPosition()

getSourceEndPosition

public int getSourceEndPosition()

setSourceSnippet

public void setSourceSnippet(String s)

getSourceSnippet

public String getSourceSnippet()

displayName

public String displayName()

toString

public String toString()
Overrides:
toString in class Object

dump

public String dump()

dump

public String dump(int indentLevel)

newValidDouble

public static final Double newValidDouble(double d,
                                          Instruction instr)
                                   throws LogoException
Throws:
LogoException

newValidDouble

public Double newValidDouble(double d)
                      throws LogoException
Throws:
LogoException

validDouble

public double validDouble(double d)
                   throws LogoException
Throws:
LogoException

checkAgentClass

public final void checkAgentClass(Agent agent,
                                  Context context)
                           throws LogoException
Throws:
LogoException

checkAgentSetClass

public final void checkAgentSetClass(AgentSet agents,
                                     Context context)
                              throws LogoException
Throws:
LogoException

agentClassCanPerform

public boolean agentClassCanPerform(Class agentClass)

throwAgentClassException

public final void throwAgentClassException(Context context,
                                           Class agentClass)
                                    throws EngineException
Throws:
EngineException

assemble

public org.nlogo.compiler.AssembledInstruction assemble(List assembledArgs)

optimize0

public Object[] optimize0()

optimize1

public Object[] optimize1(Reporter arg,
                          Object[] subargs)

optimize2

public Object[] optimize2(Reporter arg1,
                          Object[] subargs1,
                          Reporter arg2,
                          Object[] subargs2)
                   throws CompilerException
Throws:
CompilerException

argEvalAgent

public Agent argEvalAgent(Context context,
                          int argIndex)
                   throws LogoException
Throws:
LogoException

argEvalAgentSet

public AgentSet argEvalAgentSet(Context context,
                                int argIndex)
                         throws LogoException
Throws:
LogoException

argEvalAgentSet

public AgentSet argEvalAgentSet(Context context,
                                int argIndex,
                                Class type)
                         throws LogoException
Throws:
LogoException

argEvalBoolean

public Boolean argEvalBoolean(Context context,
                              int argIndex)
                       throws LogoException
Throws:
LogoException

argEvalBooleanValue

public boolean argEvalBooleanValue(Context context,
                                   int argIndex)
                            throws LogoException
Throws:
LogoException

argEvalDoubleValue

public double argEvalDoubleValue(Context context,
                                 int argIndex)
                          throws LogoException
Throws:
LogoException

argEvalLongValue

public long argEvalLongValue(Context context,
                             int argIndex)
                      throws LogoException
Throws:
LogoException

argEvalIntValue

public int argEvalIntValue(Context context,
                           int argIndex)
                    throws LogoException
Throws:
LogoException

argEvalList

public LogoList argEvalList(Context context,
                            int argIndex)
                     throws LogoException
Throws:
LogoException

argEvalPatch

public Patch argEvalPatch(Context context,
                          int argIndex)
                   throws LogoException
Throws:
LogoException

argEvalString

public String argEvalString(Context context,
                            int argIndex)
                     throws LogoException
Throws:
LogoException

argEvalDouble

public Double argEvalDouble(Context context,
                            int argIndex)
                     throws LogoException
Throws:
LogoException

argEvalLong

public Long argEvalLong(Context context,
                        int argIndex)
                 throws LogoException
Throws:
LogoException

argEvalTurtle

public Turtle argEvalTurtle(Context context,
                            int argIndex)
                     throws LogoException
Throws:
LogoException

argEvalLink

public Link argEvalLink(Context context,
                        int argIndex)
                 throws LogoException
Throws:
LogoException

copyFieldsFrom

public void copyFieldsFrom(Instruction sourceInstr)

clone

public Object clone()
Overrides:
clone in class Object