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

Grammar Inheritance

Chevrotain supports Grammar Inheritance, This is useful to represent multiple variants of the same grammar for example a grammar for ECMAScript 6 extends an ECMAScript 5.1 grammar.

Chevrotain Grammars are JavaScript classes, so Grammar inheritance is simply JavaScript inheritance with the replacement of the RULE DSL method with OVERRIDE_RULE method when needed.

See executable example for further details.

Edit this page on GitHub
Last Updated: 1/24/26, 5:39 PM
Contributors: Shahar Soel, Soel, bd82, i060847, Austin Turner, I060847, Gaurav
Prev
Syntactic Content Assist
Next
Backtracking