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
- Host: GitHub
- URL: https://github.com/TypeFox/chevrotain-allstar
- Owner: TypeFox
- License: mit
- Created: 2022-11-04T11:58:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-31T21:50:11.000Z (almost 3 years ago)
- Last Synced: 2025-02-05T10:01:21.224Z (over 1 year ago)
- Language: TypeScript
- Size: 176 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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()
}
}
```