https://github.com/nazavode/cool
EBNF grammar, lexer and parser for the Cool programming language
https://github.com/nazavode/cool
cool ebnf grammar lexer parser
Last synced: 7 months ago
JSON representation
EBNF grammar, lexer and parser for the Cool programming language
- Host: GitHub
- URL: https://github.com/nazavode/cool
- Owner: nazavode
- License: unlicense
- Created: 2019-11-09T15:03:01.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-16T17:09:34.000Z (over 5 years ago)
- Last Synced: 2025-01-13T05:27:55.484Z (9 months ago)
- Topics: cool, ebnf, grammar, lexer, parser
- Language: Go
- Size: 189 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cool
EBNF grammar, lexer and parser for the
[Cool programming language](https://en.wikipedia.org/wiki/Cool_(programming_language)).## Grammar
The full language grammar is described in [cool.tm](cool.tm) using the
EBNF-like format specified by [TextMapper](https://github.com/inspirer/textmapper).## How to generate lexer and parser
Firstly we need to make sure the [TextMapper](https://github.com/inspirer/textmapper) tool is available:
```console
$ go get github.com/inspirer/textmapper/tm-go/cmd/textmapper
```Then, we can regenerate all the `go` code for both the lexer and parser:
```console
$ git clone https://github.com/nazavode/cool.git
$ cd cool
$ make
```