Gherkin parser/compiler for Vala. Please see Gherkin3 for details.
libgherkin3
uses autotools
for the build process. For a fresh build, straight after git
cloning this repository, do:
cd gherkin-vala
./autogen.sh
or
cd gherkin-vala
./autogen.sh --prefix /my/personal/directory/to/install/to
if you want to try out libgherkin3
without a system wide install.
Then continue with:
make
make install
To run the test suite:
make test
gherkin-vala
provides three command line tools to get started:
gherkin-generate-ast
gherkin-generate-pickles
gherkin-generate-tokens
A Gherkin .feature
file, after any comments, should start with the Feature
keyword in the human language specified for that file. The default language is English. Save this very basic example as test.feature
:
Feature: A meaningless example
Then run gherkin-generate-ast
with the file:
gherkin-generate-ast test.feature
This will dump the abstract syntax tree as JSON:
{
"node-type" : "Feature",
"location" : {
"line" : 1,
"column" : 1
},
"tags" : [
],
"language" : "en",
"keyword" : "Feature",
"name" : "A meaningless example",
"scenarioDefinitions" : [
],
"comments" : [
]
}
libgherkin3
was generated from the reference implementation, gherkin, and follows that API. Work currently needs to be done on marking internal functions as internal
in Vala and also developing a stable ABI. Anyone wanting to work on the API/ABI should read:
libgherkin3
is written in Vala and so easily generates a GIR
file that can be used to generate a .typelib
file to be read by libgirrepository
and used with libffi
for bindings to languages supporting GIR, for example Python, Javascript, Lua and Haskell.
For anyone wishing to work on API/ABI stability for libgherkin3
and so generate stable language bindings see: