Class BytecodeRepresentation

java.lang.Object
org.eolang.jeo.representation.BytecodeRepresentation
All Implemented Interfaces:
Representation

public final class BytecodeRepresentation extends Object implements Representation
Intermediate representation of a class files which can be optimized from bytecode. You can also use that site to check if bytecode is correct: https://godbolt.org/
Since:
0.1.0
  • Constructor Details

    • BytecodeRepresentation

      public BytecodeRepresentation(Path clazz)
      Constructor.
      Parameters:
      clazz - Path to the class file
    • BytecodeRepresentation

      public BytecodeRepresentation(Bytecode bytecode)
      Constructor.
      Parameters:
      bytecode - Bytecode
    • BytecodeRepresentation

      public BytecodeRepresentation(org.cactoos.scalar.Unchecked<byte[]> input, String source)
      Constructor.
      Parameters:
      input - Input.
      source - The source of the input.
  • Method Details

    • details

      public Details details()
      Description copied from interface: Representation
      Details of representation. Additional info about representation which might include the source file, the name of a class or an object, etc.
      Specified by:
      details in interface Representation
      Returns:
      Representation details instance.
    • toEO

      public com.jcabi.xml.XML toEO()
      Description copied from interface: Representation
      Convert to EOlang XML representation (XMIR).
      Specified by:
      toEO in interface Representation
      Returns:
      XML.
    • toEO

      public com.jcabi.xml.XML toEO(boolean count)
      Converts bytecode into XML.
      Parameters:
      count - Do we add number to opcode name or not?
      Returns:
      XML representation of bytecode.
    • toBytecode

      public Bytecode toBytecode()
      Description copied from interface: Representation
      Convert to bytecode.
      Specified by:
      toBytecode in interface Representation
      Returns:
      Array of bytes.