Did you know ... | Search Documentation: |
Pack logtalk -- logtalk-3.86.0/manuals/_sources/libraries/grammars.rst.txt |
.. _library_grammars:
grammars
This library provides Definite Clause Grammars (DCGs) for common parsing tasks. The DCGs support parsing both lists of characters (aka chars) and lists of character codes (aka codes).
Currently, four groups of DCGs are available, each defined in its own file:
blank_grammars.lgt
)number_grammars.lgt
)sequence_grammars.lgt
)ip_grammars.lgt
; depends on number_grammars.lgt
)Open the `../../docs/library_index.html#grammars <../../docs/library_index.html#grammars>`__ link in a web browser.
To load all entities in this library, load the loader.lgt
file:
::
| ?- logtalk_load(grammars(loader))
.
Minimal tests for this library predicates can be run by loading the
tester.lgt
file:
::
| ?- logtalk_load(grammars(tester))
.
The library uses (when necessary) parametric objects where the single
parameter can be either chars
or codes
. The parameter must be
bound when using the DCGs. For example, when using implicit
message-sending:
::
:- uses(blank_grammars(chars), [
white_spaces//0, new_lines//0
])
.