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

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

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
```