Class InstructionSequence


  • public class InstructionSequence
    extends java.lang.Object
    Represents an instruction sequence, a combination of values, operands and nested procedures.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.lang.Object> instructions  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addBoolean​(boolean value)
      Adds a bool value.
      void addInteger​(int value)
      Adds an int value.
      void addName​(java.lang.String name)
      Add a name (ex.
      void addProc​(InstructionSequence child)
      Adds a proc (sub-sequence of instructions).
      void addReal​(float value)
      Adds a real value.
      void execute​(ExecutionContext context)
      Executes the instruction sequence.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • instructions

        private final java.util.List<java.lang.Object> instructions
    • Constructor Detail

      • InstructionSequence

        public InstructionSequence()
    • Method Detail

      • addName

        public void addName​(java.lang.String name)
        Add a name (ex. an operator)
        Parameters:
        name - the name
      • addInteger

        public void addInteger​(int value)
        Adds an int value.
        Parameters:
        value - the value
      • addReal

        public void addReal​(float value)
        Adds a real value.
        Parameters:
        value - the value
      • addBoolean

        public void addBoolean​(boolean value)
        Adds a bool value.
        Parameters:
        value - the value
      • addProc

        public void addProc​(InstructionSequence child)
        Adds a proc (sub-sequence of instructions).
        Parameters:
        child - the child proc
      • execute

        public void execute​(ExecutionContext context)
        Executes the instruction sequence.
        Parameters:
        context - the execution context