Class Labeled

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

public final class Labeled extends Object implements AstNode, Typed
Node with an attached label. This class needed to avoid considering labels as separate nodes. Maybe it's wrong to do so, but it's easier to implement this way, at least for now. Pay attention, that Labeled class violates class hierarchy. It is the most visible within InvokespecialHandler implementation.
Since:
0.2
  • Constructor Details

    • Labeled

      public Labeled(org.eolang.jeo.representation.xmir.XmlNode node, Function<org.eolang.jeo.representation.xmir.XmlNode,AstNode> search)
      Constructor.
      Parameters:
      node - Original node to parse.
      search - Search function to parse child nodes.
    • Labeled

      public Labeled(AstNode node, Label label)
      Constructor.
      Parameters:
      node - Original node
      label - Attached label
  • Method Details

    • origin

      public AstNode origin()
      Original node.
      Returns:
      Node
    • opcodes

      public List<AstNode> opcodes()
      Description copied from interface: AstNode
      Bytecode instructions.
      Specified by:
      opcodes in interface AstNode
      Returns:
      List of opcodes.
    • 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.
    • type

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