XQLint parses XQuery files and returns errors and warnings based on semantic analysis. The XQuery parser is generated using REx Parser Generator (http://www.bottlecaps.de/rex/).
- Optionals (to run tests)
- Walk (https://github.com/coolaj86/node-walk)
- AMD loader (https://github.com/ajaxorg/node-amd-loader)
- asyncjs (https://github.com/fjakobs/async.js)
npm install walk amd-loader asyncjs
The parser can be generated programmatically by using the following XQuery file:
zorba -q generate_xquery_parser.xq -f
Or via http://www.bottlecaps.de/rex/:
REx -ll 2 -backtrack -tree -javascript -a xqlint XQueryParser.ebnf
node run_tests.js --keep-going
To parse a particular XQuery file:
node run_tests.js -f filename
For instance:
node run_tests.js -f queries/zorba/boolean/compare0.xq
node tests/all.js
ACE, aka the Cloud9 editor (https://github.com/ajaxorg/ace), is using this parser to perform XQuery syntax checking and semantic highlighting of the source code.