Package org.eolang.opeo.ast
Class Opcode
- java.lang.Object
-
- org.eolang.opeo.ast.Opcode
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eolang.opeo.ast.AstNode
AstNode.Empty
-
-
Constructor Summary
Constructors Constructor Description Opcode(int opcode, boolean counting)
Constructor.Opcode(int opcode, Object... operands)
Constructor.Opcode(int opcode, List<Object> operands)
Constructor.Opcode(int bytecode, List<Object> operands, boolean counting)
Constructor.Opcode(org.eolang.jeo.representation.xmir.XmlInstruction instruction)
Constructor.Opcode(org.eolang.jeo.representation.xmir.XmlNode node)
Constructor.Opcode(Instruction instruction)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
disableCounting()
Disable opcodes counting.int
opcode()
Opcode number.List<AstNode>
opcodes()
Bytecode instructions.Object
operand(int index)
Instruction operand.List<Object>
params()
Opcode operands.String
pretty()
Pretty representation.Iterable<org.xembly.Directive>
toXmir()
Convert node to XMIR.
-
-
-
Constructor Detail
-
Opcode
public Opcode(int opcode, Object... operands)
Constructor.- Parameters:
opcode
- Opcodeoperands
- Opcode operands
-
Opcode
public Opcode(int opcode, boolean counting)
Constructor.- Parameters:
opcode
- Opcodecounting
- Opcodes counting
-
Opcode
public Opcode(int opcode, List<Object> operands)
Constructor.- Parameters:
opcode
- Opcodeoperands
- 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)
-
-
Method Detail
-
toXmir
public Iterable<org.xembly.Directive> toXmir()
Description copied from interface:Xmir
Convert node to XMIR.
-
opcodes
public List<AstNode> opcodes()
Description copied from interface:AstNode
Bytecode instructions.
-
opcode
public int opcode()
Opcode number.- Returns:
- Opcode number.
-
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.- To do:
- #65:30min Remove public static method 'disableCounting()' from Opcode. Currently it is used in tests. We should find another way to disable opcodes counting in tests. When we find the way to do it, we should remove this method.
-
-