Example language parsers demonstrating the capabilities of the @timkendrick/syntax parser combinator library.
This package contains complete, working parsers for two different languages:
- Lambda Calculus - A functional programming language with variables, abstractions, and applications
- Lisp - An s-expression language with lists, symbols, and string literals
These examples demonstrate real-world usage of the parser combinator library and serve as templates for building your own language parsers.
See the individual grammar files for detailed documentation of syntax, grammar rules, and AST node types.
The examples include auto-generated TypeScript definitions. These are automatically created by running:
pnpm run codegenThe generated files provide complete type definitions for all AST nodes and tokens described in the language grammar.
Each grammar includes comprehensive tests. Run the tests with:
pnpm test