Package com.oracle.truffle.api.dsl
Interface NodeFactory<T>
- All Known Implementing Classes:
NodeFactoryBase
public interface NodeFactory<T>
Enables the dynamic creation of generated nodes. It provides an convenient way to instantiate
generated node classes without using reflection.
-
Method Summary
Modifier and TypeMethodDescriptioncreateNode
(Object... arguments) Instantiates the node using the arguments array.Returns a list of children that will be executed by the created node.Returns the node class that will get created bycreateNode(Object...)
.Returns a list of signatures that can be used to invokecreateNode(Object...)
.
-
Method Details
-
createNode
Instantiates the node using the arguments array. The arguments length and types must suffice one of the returned signatures ingetNodeSignatures()
. If the arguments array does not suffice one of the node signatures anIllegalArgumentException
is thrown.- Parameters:
arguments
- the argument values- Returns:
- the instantiated node
- Throws:
IllegalArgumentException
-
getNodeClass
Returns the node class that will get created bycreateNode(Object...)
. The node class does not match exactly to the instantiated object but they are guaranteed to be assignable. -
getNodeSignatures
Returns a list of signatures that can be used to invokecreateNode(Object...)
. -
getExecutionSignature
Returns a list of children that will be executed by the created node. This is useful for base nodes that can execute a variable amount of nodes.
-