Interface GraphFacade

  • All Known Implementing Classes:
    GraphFacadeImpl

    public interface GraphFacade
    The facade interface of the Execution Graph DSL.

    The facade provides factory methods of graph nodes of the Execution Graph DSL.

    CAUTION: This interface is not expected to be implemented by external programs. Therefore, abstract methods can be added to this interface without prior announcements.

    See org.kink_lang.kink.hostfun.graph for usage.

    See Also:
    Vm.graph
    • Method Detail

      • of

        GraphNode of​(Val val)
        Returns a graph node which emits the val.
        Parameters:
        val - the val to be emitted.
        Returns:
        the graph node which emits the val.
      • call

        CallGraphNodeToRecv call​(FunVal fun)
        Returns a graph node which calls the fun.
        Parameters:
        fun - the fun to call.
        Returns:
        the call graph node which calls the fun.
      • call

        CallGraphNodeToRecv call​(GraphNode owner,
                                 int symHandle)
        Returns a call graph node which calls a method in the owner.
        Parameters:
        owner - the owner of the method.
        symHandle - the sym handle of the method fun.
        Returns:
        the call graph node which calls a method in the owner.
      • call

        CallGraphNodeToArgs call​(String modName,
                                 int symHandle)
        Returns a call graph node which calls a fun in the mod.
        Parameters:
        modName - the name of the mod.
        symHandle - the sym handle of the fun.
        Returns:
        the call graph node which calls a fun in the mod.
      • repr

        GraphNode repr​(Val val)
        Convenient method to call val.repr.
        Parameters:
        val - the val for which the .repr method is called.
        Returns:
        the execution graph to call val.repr.
      • format

        GraphNode format​(String template,
                         GraphNode... args)
        Convenient method to call the Kink method template.format(...args).
        Parameters:
        template - the template for Str.format method, such as "Catch {}".
        args - the args for Str.format method.
        Returns:
        the execution graph to call template.format(...args).
      • raiseFormat

        GraphNode raiseFormat​(String template,
                              GraphNode... args)
        Convenient method to call CORE.raise(template.format(...args)).
        Parameters:
        template - the template for Str.format method, such as "expected a num, but got {}".
        args - the args for Str.format method.
        Returns:
        the execution graph to call CORE.raise(template.format(...args)).