An open API service indexing awesome lists of open source software.

https://github.com/TypeFox/chevrotain-allstar

Plugin module for the ALL(*) lookahead algorithm in Chevrotain
https://github.com/TypeFox/chevrotain-allstar

Last synced: 8 months ago
JSON representation

Plugin module for the ALL(*) lookahead algorithm in Chevrotain

Awesome Lists containing this project

README

          

# Chevrotain Allstar

This is a lookahead plugin package for the [Chevrotain parser library](https://chevrotain.io/).
It implements the [ALL(*) lookahead algorithm](https://www.antlr.org/papers/allstar-techreport.pdf) introduced for ANTLR4.
The algorithm features unbounded lookahead, compared to the normal LL(*k*) behavior of Chevrotain.

## Usage

When creating your parser, pass an instance of the `LLStarLookaheadStrategy` to the `lookaheadStrategy` property of the base parser constructor options.

```ts
import { LLStarLookaheadStrategy } from "chevrotain-allstar";

class Parser extends EmbeddedActionsParser {
constructor() {
super(tokens, {
lookaheadStrategy: new LLStarLookaheadStrategy()
});
this.performSelfAnalysis()
}
}
```