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(org.eolang.jeo.representation.xmir.XmlNode node)
      Constructor.
      Parameters:
      node - XMIR node.
    • Opcode

      public Opcode(org.eolang.jeo.representation.xmir.XmlInstruction instruction)
      Constructor.
      Parameters:
      instruction - XMIR instruction.
    • Opcode

      public Opcode(Instruction instruction)
    • 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.
    • opcode

      public int opcode()
      Opcode number.
      Returns:
      Opcode number.
    • params

      public List<Object> params()
      Opcode operands.
      Returns:
      Opcode operands.
    • operand

      public Object operand(int index)
      Instruction operand.
      Parameters:
      index - Operand index.
      Returns:
      Instruction operand.
    • pretty

      public String pretty()
      Pretty representation.
      Returns:
      Human-readable string that represents the opcode.
    • disableCounting

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