Class Opcode

java.lang.Object
org.eolang.opeo.ast.Opcode
All Implemented Interfaces:
AstNode, Xmir

public final class Opcode extends Object implements AstNode
Opcode output node.
Since:
0.1
  • Constructor Details

    • Opcode

      public Opcode(int opcode, Object... operands)
      Constructor.
      Parameters:
      opcode - Opcode
      operands - Opcode operands
    • Opcode

      public Opcode(int opcode, boolean counting)
      Constructor.
      Parameters:
      opcode - Opcode
      counting - Opcodes counting
    • Opcode

      public Opcode(int opcode, List<Object> operands)
      Constructor.
      Parameters:
      opcode - Opcode
      operands - Opcode operands
    • Opcode

      public Opcode(int bytecode, List<Object> operands, boolean counting)
      Constructor.
      Parameters:
      bytecode - Bytecode
      operands - Opcode operands
      counting - Opcodes counting
  • Method Details

    • toXmir

      public Iterable<org.xembly.Directive> toXmir()
      Description copied from interface: Xmir
      Convert node to XMIR.
      Specified by:
      toXmir in interface Xmir
      Returns:
      XMIR XML.
    • opcodes

      public List<AstNode> opcodes()
      Description copied from interface: AstNode
      Bytecode instructions.
      Specified by:
      opcodes in interface AstNode
      Returns:
      List of opcodes.
    • disableCounting

      public static void disableCounting()
      Disable opcodes counting. It is useful for tests.