You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
bd82 e33dc4b26d docs: update relative perf test readme 1 month ago
.circleci ci: drop node 10 add node 16 3 months ago
.github ci: change dependabot to weekly schedule 3 months ago
examples chore(release): release 3 months ago
packages docs: update relative perf test readme 1 month ago
.eslintrc.js fix: resolve multiple issues with bundled artifacts (#1386) 7 months ago
.gitattributes .gitAttributes 1 year ago
.gitignore refactor: more monorepo friendly project structure (#1408) 7 months ago
.prettierignore feat: add package to generate type definitions for CST nodes (#1422) 3 months ago
CONTRIBUTING.md refactor: extract docs website to a separate package (#1394) 7 months ago
LICENSE.txt license file 7 years ago
NOTICE.txt Update NOTICE.txt 3 years ago
greenkeeper.json Expose additional Parser classes variants (#966) 2 years ago
lerna.json chore(release): release 3 months ago
package.json chore: update prettier to 2.3.2 1 month ago
readme.md chore(release): release 3 months ago
tsconfig.base.json refactor: more monorepo friendly project structure (#1408) 7 months ago
tsconfig.json feat: add package to generate type definitions for CST nodes (#1422) 3 months ago
yarn.lock chore: update prettier to 2.3.2 1 month ago

readme.md

Join the chat at https://gitter.im/chevrotain-parser/Lobby npm CircleCI styled with prettier Commitizen friendly

Chevrotain

Introduction

Chevrotain is a blazing fast and feature rich Parser Building Toolkit for JavaScript. It can be used to build parsers/compilers/interpreters for various use cases ranging from simple configuration files, to full fledged programing languages.

A more in depth description of Chevrotain can be found in this great article on: Parsing in JavaScript: Tools and Libraries.

It is important to note that Chevrotain is NOT a parser generator. It solves the same kind of problems as a parser generator, just without any code generation. Chevrotain Grammars are pure code which can be created/debugged/edited as any other pure code without requiring any new tools or processes.

TLDR

Installation

  • npm: npm install chevrotain
  • Browser: The npm package contains Chevrotain as concatenated and minified files ready for use in a browser. These can also be accessed directly via UNPKG in a script tag.
    • Latest:
      • https://unpkg.com/chevrotain/lib/chevrotain.js
      • https://unpkg.com/chevrotain/lib/chevrotain.min.js
      • https://unpkg.com/chevrotain/lib_esm/chevrotain.mjs
      • https://unpkg.com/chevrotain/lib_esm/chevrotain.min.mjs
    • Explicit version number:
      • https://unpkg.com/chevrotain@9.0.2/lib/chevrotain.js
      • https://unpkg.com/chevrotain@9.0.2/lib/chevrotain.min.js
      • https://unpkg.com/chevrotain@9.0.2/lib_esm/chevrotain.mjs
      • https://unpkg.com/chevrotain@9.0.2/lib_esm/chevrotain.min.mjs

Documentation & Resources

Dependencies

There is a single dependency (outside this monorepo) to regexp-to-ast library. This dependency is included in the bundled artifacts, for ease of consumption in browsers.

Compatibility

Chevrotain runs on any modern JavaScript ES5.1 runtime. That includes any modern nodejs version, modern browsers and even IE11.

  • Uses UMD to work with common module loaders (browser global / amd / commonjs).

Contributions

Contributions are greatly appreciated. See CONTRIBUTING.md for details.

Where used

Some interesting samples: