Jay Taylor's notes

back to listing index

SAP/chevrotain

[web search]
Original source (github.com)
Tags: javascript dsl github.com
Clipped on: 2016-03-11

Skip to content
Javascript parsing DSL
TypeScript JavaScript Other
Latest commit 8bea15d 2 days ago Image (Asset 2/6) alt= bd82 release 0.5.20
.idea Example/Integration test with custom lookahead functions a month ago
docs/tutorial release 0.5.20 2 days ago
examples fix no trailing comma tslint rule name. 15 days ago
libs Replace usage of lodash in the tests with Utils.ts. 2 months ago
release release 0.5.20 2 days ago
scripts * Using ES6 modules in the project files. 2 months ago
src release 0.5.20 2 days ago
test Improve repetition re-sync recovery. 5 days ago
test_integration Attempt to workaround random crashes on karma + chrome + travis 2 months ago
.gitignore * Using ES6 modules in the project files. 2 months ago
.travis.yml release 0.5.20 2 days ago
LICENSE.txt license file a year ago
SAP Individual Contributor License Agreement_v10.pdf SAP Individual Contributor License Agreement a year ago
bower.json release 0.5.20 2 days ago
gruntfile.js Travis-CI build changes. 14 days ago
karma.conf.js Increase logging and retry limit in karam 14 days ago
package.json release 0.5.20 2 days ago
readme.md release 0.5.20 2 days ago
tslint.json Upgrade tslint semicolon rule to NEVER allow semicolons. 14 days ago
upload_docs.bat DevOps: 7 months ago
watch.bat watch.bat no longer contains path to "sh" binary. 14 days ago

readme.md

Image (Asset 3/6) alt= Image (Asset 4/6) alt= Image (Asset 5/6) alt= Image (Asset 6/6) alt= devDependency Status

Chevrotain

Chevrotain is a Javascript parsing DSL for building high performance fault-tolerant recursive decent parsers.

Chevrotain is NOT a parser generator. It solves the same kind of problems as a parser generator, just without any code generation phase.

---> Try it online <---

Features

  1. Lexer Engine based on Regular Expression.

    • Supports Token location tracking.
    • Supports Token skipping (whitespace/comments/...).
    • Allows prioritising shorter matches (Keywords vs Identifiers).
    • No code generation The Lexer does not require any code generation phase.
  2. Parsing DSL for defining the grammar.

    • No code generation.
      • The DSL is just Javascript, not an external language.
      • The Parsing flow is easily debuggable.
      • Short feedback loops.
      • Allows great flexibility for inserting custom Parser actions.
    • Error Reporting with full location information.
    • Strong Error Recovery/Fault-Tolerance capabilities based on Antlr3's algorithms.
    • Automatic lookahead calculation for LL(1) grammars.
    • Supports Custom lookahead logic for LL(k) grammars.
    • Backtracking support.
  3. High performance - (see on JSPerf).

  4. Grammar Reflection/Introspection.

    • The Grammar's structure is known and exposed at runtime.
    • Can be used to implement advanced features such as dynamically generated syntax diagrams or Syntactic error recovery.
  5. Well tested with ~100% code coverage, Unit & Integration tests

Installation

  • npm:  npm install chevrotain 
  • Bower  bower install chevrotain 
  • or download directly from github releases

Getting Started

Online tutorial

Examples Folder

Documentation

Dependencies

None.

Compatibility

Chevrotain should run on any modern Javascript ES5.1 runtime.

  • The CI build runs the tests under:
    • Node.js (0.12 / 4 / 5).
    • latest stable Chrome.
    • latest stable Firefox.
  • Additionally local testing is done on latest versions of Chrome/Firefox/IE.
  • Uses UMD to work with common module loaders (browser global / amd / commonjs).