Separation of Grammar and Semantics

Chevrotain is not limited like many other parsing libraries to only embedding actions inside the grammar, It can also automatically create a Concrete Syntax Treeopen in new window Which can later be traversed using the visitor patternopen in new window.

This implements the design principle of Separation of Concernsopen in new window which enables re-use of the same pure grammar for multiple purposes.

See example of two identical mathematical expression grammars: