ReflectiveNodeDeclaration

An implementation of ParserNodeDeclaration that uses reflection to initialize instances.

The arguments of the node class' constructor are filled in using the arguments of the TypeDescription passed to the make function. Keys are mapped to the constructors' argument parameter names, and the first match is used to initialize the class.

This class supports classes with multiple constructors. Refer to the documentation for details on the selection algorithm.

Constructors

Link copied to clipboard
constructor(tClass: KClass<T>)

Properties

Link copied to clipboard
open override val name: String

Name for the provided node (usually the name of the class T).

Functions

Link copied to clipboard
open override fun make(args: TypeDescription<T>): T

This function creates a node of type T from the arguments.