Class LocalVariable

  • All Implemented Interfaces:
    AstNode, Typed, Xmir

    public final class LocalVariable
    extends Object
    implements AstNode, Typed
    A local variable.

    int local1;

    Since:
    0.2
    To do:
    #329:60min Test local variable unboxing. We should add more tests for store() and opcodes() methods. Now we test only primitive types. It would be nice to test boxed types as well, for example Integer for ISTORE.
    • Constructor Detail

      • LocalVariable

        public LocalVariable​(org.eolang.jeo.representation.xmir.XmlNode node)
        Constructor.
        Parameters:
        node - The XML node that represents variable.
      • LocalVariable

        public LocalVariable​(int identifier,
                             org.objectweb.asm.Type type)
        Constructor.
        Parameters:
        identifier - The identifier of the variable.
        type - The type of the variable.
    • Method Detail

      • 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.
      • type

        public org.objectweb.asm.Type type()
        Description copied from interface: Typed
        Node type.
        Specified by:
        type in interface Typed
        Returns:
        Type.
      • store

        public AstNode store()
        Store opcode for the variable. See Opcodes.ISTORE.
        Returns:
        Opcode to store the variable. See Opcode.