Class SLStatementNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.sl.nodes.local.SLScopedNode
com.oracle.truffle.sl.nodes.SLStatementNode
All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode, com.oracle.truffle.api.nodes.NodeInterface, Cloneable
Direct Known Subclasses:
SLBlockNode, SLBreakNode, SLContinueNode, SLDebuggerNode, SLExpressionNode, SLIfNode, SLReturnNode, SLWhileNode

public abstract class SLStatementNode extends SLScopedNode implements com.oracle.truffle.api.instrumentation.InstrumentableNode
The base class of all Truffle nodes for SL. All nodes (even expressions) can be used as statements, i.e., without returning a value. The VirtualFrame provides access to the local variables.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node

    com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children

    Nested classes/interfaces inherited from interface com.oracle.truffle.api.instrumentation.InstrumentableNode

    com.oracle.truffle.api.instrumentation.InstrumentableNode.WrapperNode
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Marks this node as being a StandardTags.RootTag and StandardTags.RootBodyTag for instrumentation purposes.
    final void
    Marks this node as being a StandardTags.StatementTag for instrumentation purposes.
    com.oracle.truffle.api.instrumentation.InstrumentableNode.WrapperNode
    createWrapper(com.oracle.truffle.api.instrumentation.ProbeNode probe)
     
    abstract void
    executeVoid(com.oracle.truffle.api.frame.VirtualFrame frame)
    Execute this node as as statement, where no return value is necessary.
    static String
    formatSourceSection(com.oracle.truffle.api.nodes.Node node)
    Formats a source section of a node in human readable form.
    final int
     
    final int
     
    final int
     
    final com.oracle.truffle.api.source.SourceSection
     
    final boolean
     
    boolean
    hasTag(Class<? extends com.oracle.truffle.api.instrumentation.Tag> tag)
     
    final boolean
     
    final void
    setSourceSection(int charIndex, int length)
     
    final void
     
     

    Methods inherited from class com.oracle.truffle.api.nodes.Node

    accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, reportReplace

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.oracle.truffle.api.instrumentation.InstrumentableNode

    createProbe, findNearestNodeAt, findNearestNodeAt, findProbe, getNodeObject, materializeInstrumentableNodes
  • Constructor Details

    • SLStatementNode

      public SLStatementNode()
  • Method Details

    • getSourceSection

      public final com.oracle.truffle.api.source.SourceSection getSourceSection()
      Overrides:
      getSourceSection in class com.oracle.truffle.api.nodes.Node
    • hasSource

      public final boolean hasSource()
    • isInstrumentable

      public final boolean isInstrumentable()
      Specified by:
      isInstrumentable in interface com.oracle.truffle.api.instrumentation.InstrumentableNode
    • getSourceCharIndex

      public final int getSourceCharIndex()
    • getSourceEndIndex

      public final int getSourceEndIndex()
    • getSourceLength

      public final int getSourceLength()
    • setSourceSection

      public final void setSourceSection(int charIndex, int length)
    • setUnavailableSourceSection

      public final void setUnavailableSourceSection()
    • hasTag

      public boolean hasTag(Class<? extends com.oracle.truffle.api.instrumentation.Tag> tag)
      Specified by:
      hasTag in interface com.oracle.truffle.api.instrumentation.InstrumentableNode
    • createWrapper

      public com.oracle.truffle.api.instrumentation.InstrumentableNode.WrapperNode createWrapper(com.oracle.truffle.api.instrumentation.ProbeNode probe)
      Specified by:
      createWrapper in interface com.oracle.truffle.api.instrumentation.InstrumentableNode
    • executeVoid

      public abstract void executeVoid(com.oracle.truffle.api.frame.VirtualFrame frame)
      Execute this node as as statement, where no return value is necessary.
    • addStatementTag

      public final void addStatementTag()
      Marks this node as being a StandardTags.StatementTag for instrumentation purposes.
    • addRootTag

      public final void addRootTag()
      Marks this node as being a StandardTags.RootTag and StandardTags.RootBodyTag for instrumentation purposes.
    • toString

      public String toString()
      Overrides:
      toString in class com.oracle.truffle.api.nodes.Node
    • formatSourceSection

      public static String formatSourceSection(com.oracle.truffle.api.nodes.Node node)
      Formats a source section of a node in human readable form. If no source section could be found it looks up the parent hierarchy until it finds a source section. Nodes where this was required append a '~' at the end.
      Parameters:
      node - the node to format.
      Returns:
      a formatted source section string