sirensolutions/antlr4-javascript-sparql

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

antlr4-javascript-sparql

An UMD module which expose sparql parser lexer listener and visitor

Info

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.

Useage

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)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.