Chevrotain
Home
Features
Tutorial
Guide
FAQ
Changes
APIs
Playground
Benchmark
Discussions
GitHub
Home
Features
Tutorial
Guide
FAQ
Changes
APIs
Playground
Benchmark
Discussions
GitHub
  • Features

    • Blazing Fast
    • LL(K) Grammars
    • Separation of Grammar and Semantics
    • Easy Debugging
    • Fault Tolerance
    • Multiple Start Rules
    • Customizable Error Messages
    • Parameterized Rules
    • Gates
    • Syntactic Content Assist
    • Grammar Inheritance
    • Backtracking
    • Syntax Diagrams
    • RegExp Based Lexers
    • Position Tracking
    • Token Alternative Matches
    • Token Skipping
    • Token Categories
    • Token Grouping
    • Custom Token Patterns
    • Lexer Modes

Easy Debugging

Chevrotain is an internal JavaScript DSL. This means that Chevrotain grammars are just plain JavaScript source code without any additional levels of abstraction as in parser generators (EBNF vs generated code).

In practical terms this means that debugging a Chevrotain parser is the same as debugging any other JavaScript code, just setup breakpoints or debugger statements using your favorite IDE.

For example:

$.RULE("statement", () => {
  debugger;
  $.RULE("objectItem", () => {
    $.CONSUME(StringLiteral)
    debugger;
    $.CONSUME(Colon);
    $.SUBRULE($.value);
  });
Edit this page on GitHub
Last Updated: 2/28/21, 11:53 PM
Contributors: Soel, bd82
Prev
Separation of Grammar and Semantics
Next
Fault Tolerance