java.lang.Object
org.kink_lang.kink.hostfun.graph.impl.GraphFacadeImpl
- All Implemented Interfaces:
GraphFacade
The implementation of GraphFacade.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a call graph node which calls a fun in the mod.Returns a graph node which calls the fun.Returns a call graph node which calls a method in the owner.Convenient method to call the Kink method template.format(...args).void
init()
Initializses the facade.Returns a graph node which emits the val.raiseFormat
(String template, GraphNode... args) Convenient method to call raise(template.format(...args)).Convenient method to call val.repr.
-
Constructor Details
-
GraphFacadeImpl
Constructs the facade with the vm.- Parameters:
vm
- the vm.
-
-
Method Details
-
init
public void init()Initializses the facade. -
of
Description copied from interface:GraphFacade
Returns a graph node which emits the val.- Specified by:
of
in interfaceGraphFacade
- Parameters:
val
- the val to be emitted.- Returns:
- the graph node which emits the val.
-
call
Description copied from interface:GraphFacade
Returns a graph node which calls the fun.- Specified by:
call
in interfaceGraphFacade
- Parameters:
fun
- the fun to call.- Returns:
- the call graph node which calls the fun.
-
call
Description copied from interface:GraphFacade
Returns a call graph node which calls a method in the owner.- Specified by:
call
in interfaceGraphFacade
- 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
Description copied from interface:GraphFacade
Returns a call graph node which calls a fun in the mod.- Specified by:
call
in interfaceGraphFacade
- 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
Description copied from interface:GraphFacade
Convenient method to call val.repr.- Specified by:
repr
in interfaceGraphFacade
- Parameters:
val
- the val for which the .repr method is called.- Returns:
- the execution graph to call val.repr.
-
format
Description copied from interface:GraphFacade
Convenient method to call the Kink method template.format(...args).- Specified by:
format
in interfaceGraphFacade
- 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
Description copied from interface:GraphFacade
Convenient method to call raise(template.format(...args)).- Specified by:
raiseFormat
in interfaceGraphFacade
- 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 raise(template.format(...args)).
-