# McCode Grammar files
Excluding `__init__.py` and `builder.py`, the Python
contents of this folder are generated by `ANTLR`
from the grammar files, `C.g4`, `cpp.g4`, `McCommon.g4`,
`McComp.g4` and `McInstr.g4`.

The (re)generation of the various language files can be performed by
calling `builder.py`, e.g.,
```console
python builder.py --verbose
```
Or, if working with the installed package,
```console
mccode-antlr-builder --verbose
```

Building the parser, visitor, and listener implementations requires
`antlr4-tools` to be installed. This can be done via
```console
pip install "antlr4-tools=0.2.1"
```
Other versions of `antlr4-tools` may work, but unannounced changes in its API
have been known to break the build process.

As such, the generated files should not be edited by hand.
Instead, modify the grammar files, and possibly any
functions which make use of `Mc*Visitor` or `CListener`.
