Ignore:
Timestamp:
Mar 1, 2026, 6:02:30 PM (23 hours ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
d683c2c
Parents:
a9bf505 (diff), 0982b3ec (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/proposals/modules-alvin/1_stitched_modules/README.md

    ra9bf505 rc25202b  
    11## Generating the parser code *(already done, in parser/)*
    22
    3 Using ANTLR4 (v4.13.2) to parse grammars. See https://github.com/antlr/antlr4/blob/master/doc/getting-started.md for details. Run `pip install antlr4-tools` to get `antlr4` and `anltr4-parse` executables. Example command: `antlr4-parse parser/CMOD.g4 compilationUnit -gui testing/noImports.cmod`
     3*The PLG environment is a shared system so you can't do `pip install antlr4-tools` . Instead, run `pipx install antlr4-tools` , then `pipx ensurepath` , exit and relogin to refresh PATH, then `antlr4 -v 4.13.2` (I had to run `~/.local/share/pipx/venvs/antlr4-tools/bin/antlr4 -v 4.13.2` because the path wasn't getting picked up initially). Once this is done, you can run `antlr4` and `antlr4-parse` normally.*
     4
     5Using ANTLR4 (v4.13.2) to parse grammars. See https://github.com/antlr/antlr4/blob/master/doc/getting-started.md for details. Run `pip install antlr4-tools` to get `antlr4` and `anltr4-parse` executables. Example command: `antlr4-parse parser/CMOD.g4 compilationUnit -tree testing/noImports.cmod`
    46
    57CMOD.g4 grammar inspired by https://github.com/antlr/grammars-v4/blob/master/c/C.g4 (though heavily edited afterwards). Ran `antlr4 -Dlanguage=Python3 parser/CMOD.g4` to generate parser code (you can add `-visitor -listener` flags for extra capabilities).
    68
    79## Running the code
     10
     11*The PLG environment is a shared system so you can't do `pip install -r requirements.txt` . Instead, create a venv with `python3 -m venv ./.venv` , then install dependencies with `./.venv/bin/pip install -r requirements.txt` . After that, you can run on example code using `./.venv/bin/python3 Driver.py -r testing testing/noImports.cmod`*
    812
    913Adapted the steps from https://github.com/antlr/antlr4/blob/master/doc/python-target.md to generate output. Run `pip install -r requirements.txt` to get needed libraries, then `python3 Driver.py -r testing testing/noImports.cmod` to run on example code.
Note: See TracChangeset for help on using the changeset viewer.