Elektra
0.9.3
|
This plugin uses ANTLR to generate a parser for the YAML serialization format. Apart from the hand written lexer, all other parts of the plugin use standard ANTLR tools, such as
The plugin requires
4.6
or later, andIf packages for those libraries are not available for your system, you can install them manually. For more information about that please take a look at ANTLR’s homepage and at the ReadMe of the ANTLR C++ runtime.
Please note that we only tested the plugin with ANTLR 4.7.1
(and later versions of ANTLR).
In Arch Linux the required packages are called antlr4
and antlr4-runtime
.
In Debian Linux you need the packages antlr4
and libantlr4-runtime-dev
.
To install the dependencies of the plugin using Homebrew, please use the command below.
`` @section autotoc_md963 Mount plugin to
user/tests/yanlr` sudo kdb mount config.yaml user/tests/yanlr yanlr
printf 'all : circles presuppose
' > kdb file user/tests/yanlr
printf 'hello : world
' >> kdb file user/tests/yanlr
kdb ls /tests/yanlr #> user/tests/yanlr/all #> user/tests/yanlr/hello
kdb get user/tests/yanlr/all #> circles presuppose
kdb set user/tests/yanlr 'Mount Eerie' kdb get user/tests/yanlr #> Mount Eerie
kdb set user/tests/yanlr/brand new kdb set user/tests/yanlr/brand/new eyes kdb set user/tests/yanlr/dance/gavin 'Dance!'
kdb ls /tests/yanlr #> user/tests/yanlr #> user/tests/yanlr/all #> user/tests/yanlr/brand #> user/tests/yanlr/brand/new #> user/tests/yanlr/dance/gavin #> user/tests/yanlr/hello
kdb get /tests/yanlr/hello #> world kdb get user/tests/yanlr/brand #> new kdb get /tests/yanlr/dance/gavin #> Dance!
kdb rm -r user/tests/yanlr sudo kdb umount user/tests/yanlr
sudo kdb mount config.yaml user/tests/yanlr yanlr
printf 'primes:
' > kdb file user/tests/yanlr
printf ' - two
' >> kdb file user/tests/yanlr
printf ' - three
' >> kdb file user/tests/yanlr
printf ' - five
' >> kdb file user/tests/yanlr
kdb ls user/tests/yanlr #> user/tests/yanlr/primes #> user/tests/yanlr/primes/#0 #> user/tests/yanlr/primes/#1 #> user/tests/yanlr/primes/#2
kdb set user/tests/yanlr/primes/#3 seven
kdb meta-get user/tests/yanlr/primes array #> #3
kdb rm -r user/tests/yanlr sudo kdb umount user/tests/yanlr
sudo kdb mount config.yaml user/tests/yanlr yanlr
printf 'boolean: true' > kdb file user/tests/yanlr
kdb get user/tests/yanlr/boolean #> 1
kdb rm -r user/tests/yanlr sudo kdb umount user/tests/yanlr
sudo kdb mount config.yaml user/tests/yanlr yanlr
printf '"null":' > kdb file user/tests/yanlr
kdb meta-ls user/tests/yanlr/null #> binary
kdb rm -r user/tests/yanlr sudo kdb umount user/tests/yanlr
sudo kdb mount config.yaml user/tests/yanlr yanlr
printf – 'key: - element 1
' > kdb file user/tests/yanlr
printf – '- element 2 # Incorrect Indentation!' >> kdb file user/tests/yanlr
kdb ls user/tests/yanlr
kdb set user/tests/error "$(2>&1 kdb ls user/tests/yanlr)" kdb set user/tests/error/prefix "$(kdb get user/tests/error | grep 'config.yaml' | head -1 | sed -E 's/(.*)config.yaml.*/\1/')"
kdb set user/tests/error/prefix/length "$(kdb get user/tests/error/prefix | wc -c | sed 's/[ ]*//g')"
kdb get user/tests/error | tail -n6 | cut -c"$(kdb get user/tests/error/prefix/length | tr -d '\n')"- #> config.yaml:2:1: mismatched input '- ' expecting end of map #> - element 2 # Incorrect Indentation! #> ^^ #> config.yaml:2:37: extraneous input 'end of map' expecting end of document #> - element 2 # Incorrect Indentation! #> ^
printf – 'key: - element 1
' > kdb file user/tests/yanlr
printf – ' - element 2 # Fixed!' >> kdb file user/tests/yanlr
kdb ls user/tests/yanlr #> user/tests/yanlr/key #> user/tests/yanlr/key/#0 #> user/tests/yanlr/key/#1
kdb rm -r user/tests/error kdb rm -r user/tests/yanlr sudo kdb umount user/tests/yanlr
storing the value two
. According to the YAML specification the parser should not allow duplicated keys, and instead fail with an error, for the input above.