/cool

EBNF grammar, lexer and parser for the Cool programming language

Primary LanguageGoThe UnlicenseUnlicense

cool

EBNF grammar, lexer and parser for the Cool programming language.

Grammar

The full language grammar is described in cool.tm using the EBNF-like format specified by TextMapper.

How to generate lexer and parser

Firstly we need to make sure the TextMapper tool is available:

$ go get github.com/inspirer/textmapper/tm-go/cmd/textmapper

Then, we can regenerate all the go code for both the lexer and parser:

$ git clone https://github.com/nazavode/cool.git
$ cd cool
$ make