Skip to content
experimental YAML 1.3 implementation in Ada
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Parser_Tools Fixed Text.Builder; use it in Lexer Jan 31, 2018
annotation-test-suite
dropin
server
site
src Fixed Text.Builder; use it in Lexer Jan 31, 2018
test-vms
test Improved aliases handling Nov 12, 2017
util/src
yaml-test-suite git subrepo clone --branch=data https://github.com/yaml/yaml-test-sui… Aug 30, 2017
.gitignore
Changelog.md Changelog for v0.3.0; updated Readme Mar 22, 2018
Makefile
Readme.md Changelog for v0.3.0; updated Readme Mar 22, 2018
copying.txt put everything properly under MIT license Jul 2, 2017
libyaml_dropin-utils.gpr Fixed Text.Builder; use it in Lexer Jan 31, 2018
libyaml_dropin.gpr
yaml-annotation_processor.gpr Extracted annotation processor to own project Nov 30, 2017
yaml-server.gpr Removed +x flag on *.gpr files Sep 7, 2017
yaml-tests.gpr Extracted annotation processor to own project Nov 30, 2017
yaml-utils.gpr Extracted annotation processor to own project Nov 30, 2017
yaml.gpr Some more restructuring Sep 21, 2017

Readme.md

AdaYaml - YAML 1.3 implementation in Ada

This is an implementation of the upcoming YAML 1.3 standard. Since the standard is not completed yet, some features are due to change.

You can use it as YAML 1.2 implementation, it will parse almost all valid YAML 1.2 documents since proposed changes to 1.3 are minimal and only cover edge cases.

Status

Current YAML test suite status:

Total Tests Run:   249
Successful Tests:  244
Failed Assertions: 2
Unexpected Errors: 3

The parser is thoroughly tested and only fails test cases that are expected not to pass in YAML 1.3. Lionel Matias has fuzzy-tested AdaYaml, his findings have been adressed. Benchmarks of AdaYaml show that it currently uses about twice the time libyaml uses for parsing large YAML documents.

The parts of AdaYaml which have not undergone extensive testing are the DOM API and the Presenter.

Installation

You can install AdaYaml easily by executing

gprbuild -p -XMode=release yaml.gpr
gprinstall -XMode=release yaml.gpr

Afterwards, you can with "yaml"; in your projects.

YAML 1.3 Features

Status of YAML 1.3 features, taken from this list:

Number Desciption Status
RFC-001 Remove the 1024 character limit Implemented
RFC-002 Limit content allowed after the '---' header Implemented
RFC-003 Characters that can appear in anchor Implemented
RFC-004 Block sequence entries must use space after dash Implemented
RFC-005 Restrict default implicit types to JSON semantics Not applicable
RFC-006 Disallow carriage return as a break Implemented
RFC-007 Disallow flow collections as implicit keys Implemented
RFC-008 Annotations Can be parsed
RFC-009 Allow unresolvable aliases Implemented
RFC-010 Fixed position of properties and block scalars Implemented
RFC-011 Indentation of block scalars Implemented
RFC-012 Remove wiki-like syntax from folded block scalars Implemented
RFC-013 retracted Not implemented
RFC-014 Anchors always come before tags (when both) Not implemented

General Roadmap

  • Have a basic working lexer
  • Have a basic working parser
  • Have a basic working representer
  • Test against the YAML test suite
  • Implement fancy error reporting (starting line of error with marker)
  • Do some benchmarks
  • Web demo
  • Implement UTF-16 and UTF-32 encodings
  • Make AdaYaml a drop-in replacement for libyaml (provide the C interface)
  • As proof-of-concept, implement the Transformations extension
  • Maybe provide a DOM API

Hacking

You can build the tests with:

make test

This builds the unit tests. The executables will be located in the test/bin directory (be sure that the root folder is the working directory when executing).

If you have GNAT GPL and GNATcoverage, you can also compute code coverage from the testsuite:

make test-coverage-run

The following command builds a small utility that reads a YAML files and outputs a stream of events to the command line:

make utils

It is located in util/bin afterwards. The tool reads either the file specified as first command line parameter, or, in absense of that parameter, from stdin.

To edit the code, you can use GNAT Programming Studio to open the *.gpr files.

License

MIT

You can’t perform that action at this time.