phrase/[2,3]
phrase(
+*PhraseType,
+*List)
phrase(
+*PhraseType,
+*List,
*Rest)
Used in conjunction with a grammar to parse or generate strings.
Runs through the grammar rules checking whether there is a path by which PhraseType can be rewritten as List.
If List is bound, this goal corresponds to using the grammar for parsing. If List is unbound, this goal corresponds to using the grammar for generation.
phrase/2
succeeds when the list List is a phrase of type
PhraseType (according to the current grammar rules), where
PhraseType is either a non-terminal or, more generally, a
grammar rule body. This predicate is a convenient way to start
execution of grammar rules.
phrase/3
succeeds when the portion of List between the start of
List and the start of Rest is a phrase of type
PhraseType (according to the current grammar rules), where
PhraseType is either a non-terminal or, more generally, a grammar
rule body.
phrase/3
allows variables to occur as non-terminals in grammar
rule bodies, just as call/1
allows variables to occur as goals
in clause bodies.
instantiation_error
type_error
See example in ref-gru-exa.
-->/2
, 'C'/3
, expand_term/2
,
term_expansion/2
ref-gru