Class Instruction

java.lang.Object
com.adobe.xfa.formcalc.Instruction

public final class Instruction extends Object
The class Instruction defines all the instructions that the FormCalc virtual machine is capable of executing, as a collection of static methods. Each instruction corresponds to an opcode of this virtual machine.

An execution path of the virtual machine is just a sequence of instructions stored in FormCalc's virtual code space. Each sequence is terminated with an Stop instruction, to represent the end of an execution path.

All instructions have a common interface, consisting of: a the FormCalc YYPARSENAME. Since the FormCalc virtual machine is a stack machine, i.e., its fetches its operand(s) from a runtime stack, and pushes its result back onto the runtime stack, most instructions are single word instructions. A few instructions, like Load, In, Out and Call are multi-word instructions -- some of their operands are stored in the words following the opcode. Other instructions, like If, For and While, also multi-word instructions, contain control flow information to the different execution paths inherent of conditional and iterative instructions.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    debugBreakPoint(int nScriptID, int nLine, boolean bSet)
    Set or clear a debug break-point.
    boolean
    debugCommand(com.adobe.xfa.formcalc.CalcParser oParser, int eCmd)
    Set internal state to enable either step-over, step-into or step-out.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • debugBreakPoint

      public boolean debugBreakPoint(int nScriptID, int nLine, boolean bSet)
      Set or clear a debug break-point. It sets or clears a flag in the moDebugLineNo array, which is an array of line numbers parallel to the moCodeBase array.
      Parameters:
      nLine - line of source code.
      bSet - true to set a break-point, false to clear it.
      Returns:
      true if successful.
    • debugCommand

      public boolean debugCommand(com.adobe.xfa.formcalc.CalcParser oParser, int eCmd)
      Set internal state to enable either step-over, step-into or step-out. The debug-mode execution loop calls the debug host's Stopped method when mnDebugStopAtStackDepth is greater than or equal to the current stack depth.
      Parameters:
      oParser - the FormCalc parser.
      eCmd - a value of the CalcDebugCommand enum representing step-over, step-into or step-out.
      Returns:
      true if successful.