Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulzfm/ll1pg
Yet another LL(1) parser generation tool, built in principle.
https://github.com/paulzfm/ll1pg
ll1 parser-generator
Last synced: 10 days ago
JSON representation
Yet another LL(1) parser generation tool, built in principle.
- Host: GitHub
- URL: https://github.com/paulzfm/ll1pg
- Owner: paulzfm
- Created: 2017-04-07T08:13:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-03T14:36:36.000Z (about 5 years ago)
- Last Synced: 2024-08-03T01:39:20.933Z (4 months ago)
- Topics: ll1, parser-generator
- Language: Scala
- Homepage:
- Size: 5.2 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ll1pg
[![Build Status](https://api.cirrus-ci.com/github/paulzfm/ll1pg.svg)](https://cirrus-ci.com/github/paulzfm/ll1pg)
Yet another parser generation tool.
It can generate either a parser class or a LL prediction table in Java.
The input specification file must specify a LL(1) grammar.This tool is now a part of the [decaf](https://github.com/decaf-lang/decaf) project for the undergraduate course
_Principles of Compilation_ in Tsinghua University.## Build
Prebuilt jars will be updated in the release page.
To build from source, simply type `./gradlew build`.
To assemble a standalone jar with all dependencies, type `./gradlew assembly` and you'll find it at `build/libs/`.## Usage
```
java -jar ll1pg.jar [-parser | -table | -check]
```where `` is the destination folder for the generated parser, and `` is the
path of the specification file.
The options mean:- `-parser`: generate a Java parser
- `-table`: generate a LL predication table
- `-check`: simply check if a grammar is LL(1), or else warnings will be reportedSee [here](https://github.com/paulzfm/ll1pg/wiki/1.-Specification-File) for the definition of specification file.
And [here](https://github.com/paulzfm/ll1pg/wiki/2.-Resolving-Conflicts) for how we resolve conflicts
even when your grammar is not LL(1).We strongly recommend you to read our [wiki](https://github.com/paulzfm/ll1pg/wiki) first.
## Demo Projects
To integrate our tool with your project better, please take a closer look at our
demo project [arith](https://github.com/paulzfm/ll1pg/tree/master/demos/arith),
which implements a simple calculator.
Also, the [decaf](https://github.com/decaf-lang/decaf) project is a good practice.