phrase(NonTerminal, Input, Rest)
True if the list Input
can be parsed using the specified non-terminal NonTerminal
. The list Rest
is what remains of the list Input
after parsing succeeded. This method also accepts grammar rule bodies in the first argument (with the limitation that cuts are only supported in local calls).
phrase(+callable, ?list, ?list)
instantiation_error
type_error(callable, NonTerminal)
type_error(list, Input)
type_error(list, Rest)
permission_error(access, private_non_terminal, NonTerminal)
permission_error(access, protected_non_terminal, NonTerminal)
existence_error(non_terminal_declaration, NonTerminal)
| ?- sentence::phrase(noun_phrase, [the, girl, likes, the, boy], Rest). Rest = [likes, the, boy] yes