Latest commit 048dc55 May 9, 2017 @geoffjentry geoffjentry committed on GitHub Move grammar.hgr and add makefiles (#111)
Permalink
..
Failed to load latest commit information.
tests checkpoint Feb 24, 2017
.gitignore checkpoint Feb 24, 2017
Makefile Move grammar.hgr and add makefiles (#111) May 9, 2017
README.md checkpoint Feb 24, 2017
hermes checkpoint Feb 24, 2017
sample.js checkpoint Feb 24, 2017
wdl_parser.js Move grammar.hgr and add makefiles (#111) May 9, 2017

README.md

WDL Parser for JS

wdl_parser.js is a JavaScript parser for WDL.

Usage example is provided at sample.js, which consumes a WDL script and prints AST to console

To run this example make sure that

  • Node.JS and NPM are installed
  • Current folder is javascript

Run the following command:

#Replace <file.wdl> with a WDL file location. Also test cases could be used e.g. ./tests/cases/0/wdl
node sample.js <file.wdl>

How to generate a parser

To run a generation command make sure that

To generate WDL parser run the following command:

python hermes generate ../../grammar.hgr --language=javascript --name=wdl --nodejs --header --directory .

wdl_parser.js will appear in a current folder

Runnings tests

To tun the tests make sure that

  • Node.JS and NPM are installed
  • Current folder is javascript/tests

Install dependencies

npm install

Run tests

npm run test

When tests are finished - results will be printed to the console, indicating state of test run for each folder in javascript/tests/cases/

Below is an example of a successful test run:

JS-WDL Parser
    √ should correctly generate ast for javascript/tests/cases/0 (53ms)
    √ should correctly generate ast for javascript/tests/cases/1
    √ should correctly generate ast for javascript/tests/cases/2
    √ should correctly generate ast for javascript/tests/cases/3
    √ should correctly generate ast for javascript/tests/cases/4
    √ should correctly generate ast for javascript/tests/cases/5


  6 passing (143ms)