Class ExecutableNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.ExecutableNode
All Implemented Interfaces:
NodeInterface, Cloneable
Direct Known Subclasses:
RootNode

public abstract class ExecutableNode extends Node
Represents an executable node in a Truffle AST. The executable node represents an AST fragment that can be executed using a frame instance created by the framework.
Since:
0.31
See Also:
  • Constructor Details

    • ExecutableNode

      protected ExecutableNode(TruffleLanguage<?> language)
      Creates new executable node with a given language instance. The language instance is obtainable while TruffleLanguage.parse(InlineParsingRequest) is executed.
      Parameters:
      language - the language this executable node is associated with
      Since:
      0.31
  • Method Details

    • execute

      public abstract Object execute(VirtualFrame frame)
      Execute this fragment at the place where it was parsed.
      Parameters:
      frame - the actual frame valid at the parsed location
      Returns:
      the result of the execution, must be an interop type (i.e. either implementing TruffleObject or be a primitive value), or null.
      Since:
      0.31
    • getLanguageInfo

      public final LanguageInfo getLanguageInfo()
      Returns public information about the language. The language can be assumed equal if the instances of the language info instance are the same. To access internal details of the language within the language implementation use a TruffleLanguage.LanguageReference.
      Since:
      0.31
    • getLanguage

      public final <C extends TruffleLanguage> C getLanguage(Class<C> languageClass)
      Returns the language instance associated with this executable node. The language instance is intended for internal use in languages and is only accessible if the concrete type of the language is known. Public information about the language can be accessed using getLanguageInfo(). The language is null if the executable node is not associated with a language. This method is guaranteed to return a PE constant if the root node is also a PE constant.
      Since:
      0.31
      See Also: