Name: antlr4-javascript-sparql
Owner: Siren
Description: An UMD module which expose sparql parser lexer listener and visitor
Created: 2015-10-27 16:35:59.0
Updated: 2016-05-19 16:05:55.0
Pushed: 2016-05-19 16:10:21.0
Homepage: null
Size: 124
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
An UMD module which expose sparql parser lexer listener and visitor
This is a UMD module for javascript sparql parser classes
Parser classes where generated from gramar files using antlr4 framework:
-Xmx500M -cp "antlr-4.5-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=JavaScript sparql/SparqlLexer.g4 -o lib
ib/sparql/SparqlLexer.tokens lib/
-Xmx500M -cp "antlr-4.5-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=JavaScript sparql/SparqlParser.g4 -visitor -o lib
Then a few modyfications were made to generated classes.
To build UMD module type:
install -g browserify
serify --ignore-missing main.js -o release/antlr4-sparql.js",
The result module is in **release/antlr4-sparql.js
To use with webpack define following shim antlr4-sparql.js
antlr4 = require('antlr4-base');
sparqlLexer = require('node_modules/antlr4-javascript-sparql/lib/SparqlLexer.js');
sparqlParser = require('node_modules/antlr4-javascript-sparql/lib/SparqlParser.js');
sparqlParserListener = require('node_modules/antlr4-javascript-sparql/lib/SparqlParserListener');
sparqlParserVisitor = require('node_modules/antlr4-javascript-sparql/lib/SparqlParserVisitor');
listener = sparqlParserListener(antlr4);
le.exports = {
arqlLexer: sparqlLexer(antlr4),
arqlParser: sparqlParser(antlr4, listener),
arqlParserListener: listener,
arqlParserVisitor: sparqlParserVisitor(antlr4)