Welcome to JS/CC!

JS/CC is the first available parser development system for JavaScript and ECMAScript-derivatives.

It has been developed both with the intention of building a productive compiler development system and with the intention of creating an easy-to-use academic environment for people interested in how parse table generation is done generally in bottom-up parsing.

JS/CC is a platform-independent software that unions both:

  • A regular expression-based lexical analyzer generator matching individual tokens from the input character stream and
  • A LALR(1) parser generator, computing the parse tables for a given context-free grammar specification to build a stand-alone, working parser.

The context-free grammar fed to JS/CC is defined in a Backus-Naur-Form-based meta language, and allows the insertion of individual semantic code to be evaluated on a rule's reduction. JS/CC itself has been entirely written in JavaScript so it can be executed in many different ways:

  • As platform-independent, browser-based JavaScript embedded on a website, which comes with a graphical parse tree generator;
  • As a Mozilla/Rhino or Nashorn interpreted application; or
  • As a Node.js script.

All versions can be built and run under Linux, Windows, Mac OS X, and any other *nix-based operating system. For production execution, it is recommended to use the command-line versions, which are capable of assembling a complete compiler from a JS/CC parser specification, which is then stored to a .js JavaScript source file.

To use JS/CC and for understanding its internals and behavior, some knowledge of context-free grammars, bottom-up parsing techniques, and compiler construction theory is assumed. To get a fundamental introduction to compiler design and the different techniques and appendages on this topic, I warmly suggest the book Compiler Design in C, written by Allen I. Holub.

Now, enjoy JS/CC!