meta_non_terminal(MetaNonTerminalTemplate) meta_non_terminal((MetaNonTerminalTemplate1, MetaNonTerminalTemplate2, ...)) meta_non_terminal([MetaNonTerminalTemplate1, MetaNonTerminalTemplate2, ...]) meta_non_terminal(Entity::MetaNonTerminalTemplate) meta_non_terminal((Entity1::MetaNonTerminalTemplate1, Entity2::MetaNonTerminalTemplate2, ...)) meta_non_terminal([Entity1::MetaNonTerminalTemplate1, Entity2::MetaNonTerminalTemplate2, ...]) meta_non_terminal(Module:MetaNonTerminalTemplate) meta_non_terminal((Module1:MetaNonTerminalTemplate1, Module2:MetaNonTerminalTemplate2, ...)) meta_non_terminal([Module1:MetaNonTerminalTemplate1, Module2:MetaNonTerminalTemplate2, ...])
Declares meta-non-terminals, i.e., non-terminals that have arguments that will be called as non-terminals (or grammar rule bodies). An argument may also be a closure instead of a goal if the non-terminal uses the call//1-N
Logtalk built-in methods to construct and call the actual non-terminal from the closure and the additional arguments.
Meta-arguments which are non-terminals are represented by the integer 0
. Meta-arguments which are closures are represented by a positive integer, N
, representing the number of additional arguments that will be appended to the closure in order to construct the corresponding meta-call. Normal arguments are represented by the atom *
. Meta-arguments are always called in the meta-non-terminal calling context, not in the meta-non-terminal definition context.
Logtalk allows the use of this directive to override the original meta-non-terminal directive. This is sometimes necessary when calling Prolog module meta-non-terminals due to the lack of standardization of the syntax of the meta-non-terminal templates.
meta_non_terminal(+meta_non_terminal_template_term) meta_non_terminal(+object_identifier::+meta_non_terminal_template_term) meta_non_terminal(+category_identifier::+meta_non_terminal_template_term) meta_non_terminal(+module_identifier:+meta_non_terminal_template_term)
:- meta_non_terminal(findall(*, 0, *)). :- meta_non_terminal(forall(0, 0)). :- meta_non_terminal(maplist(2, *, *)).