Skip to content

PROV-N editor using ACE editor and worker to check ANTLR4 grammar in background. Check live demo.

License

Notifications You must be signed in to change notification settings

h2020-westlife-eu/prov-n-editor

Repository files navigation

ACE Editor for PROVN

with syntax highlighting and syntax validation using ANTL4 grammar and ACE worker.

Proof of concept sample editor.

The editor can communicate with other web apps using cross document messaging API (window.opener.postMessage()).

  • 'submit plain' button sends the message in the form {'contentType':'text/plain','content':'...'}
  • 'submit compressed' button sends the content compressed by LZ algorithm and encoded in base64 in the form {'contentType':'application/x-lzip','content':'FDAmHsGMFcFsFMB2AXEaAOAneAzAlgB4A...'}

The editor can be filled by initial content in following hash parameters:

Live demo

Installation

git clone

It is standalone web page, just put index.html and all related stuff (all repo) into desired location.

Steps

  • get grammar into parser dir
  • generate JavaScript target: antlr4 -Dlanguage=JavaScript PROV_N.g4
  • modify the *.js files to point to antlr4 in vendor/antlr4/index instead of antlr4/index
  • check modify the prov-n-worker.js to point to the generated Lexer, Parser
  • use index.html to directly test the output
  • to build distribution - install webpack and copy-webpack-plugin npm install -g webpack-cli npm install copy-webpack-plugin and execute webpack this will produce dist/ directory which can be copied into desired location - index.html contains relative links.

Related work

PROV-N editor without syntax checking at openprovenance.org/tools/editor/

About

PROV-N editor using ACE editor and worker to check ANTLR4 grammar in background. Check live demo.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages