• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

cmake/H15-May-2020-2116

examples/H15-May-2020-8366

.gitignoreH A D15-May-2020234 2726

README.mdH A D15-May-20201.1 KiB2218

config.h.cmakeH A D15-May-202042 21

test_yaml.plH A D15-May-20206.4 KiB179158

yaml.docH A D15-May-2020888 4734

yaml.plH A D15-May-202010.5 KiB306271

yaml4pl.cH A D15-May-202026.4 KiB1,183932

README.md

1# YAML support for SWI-Prolog
2
3This    package    provides     a      SWI-Prolog     wrapper     around
4[libyaml](https://github.com/yaml/libyaml),  a  popular    C-based  YAML
5parser that is used by several languages.
6
7An obvious option to support YAML support is  to write it all in Prolog,
8as        done        by        a        another        [YAML        add
9on](http://www.swi-prolog.org/pack/list?p=yaml). The YAML   spec however
10is rather complicated and several versions   of  YAML have been defined.
11This makes it attractive to reuse a   widespread library that provides a
12YAML parser that is guaranteed to  be   compatible  with YAML support of
13several other languages, dispite the fact   that the wrapper is probably
14not much longer than a Prolog parser.
15
16The generated data  structure  is   compatible  with  SWI-Prolog's  JSON
17libraries as long a no explicit  non-standard YAML tags (e.g., `!!mytype
18value` are used. Documents may be  converted   between  JSON and YAML by
19reading using json_read_dict/2 and writing using yaml_write/2 or reading
20using yaml_read/2 and writing using  json_write_dict/2   as  long as the
21YAML can be expressed in JSON.
22