Commit 6d0a19c4 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

make: Move grammar generation to makefile

parent 5e02dab8
......@@ -16,4 +16,13 @@ test: typecheck unit
%.mypy : %
$(MYPY) --check-untyped-defs --warn-redundant-casts --warn-unused-ignores --warn-return-any $<
GRMS=DFA NFA CFG RegEx
grammars : $(GRMS:%=lib/parsing/%Parser.py)
$(GRMS:%=lib/parsing/%Parser.py) : lib/parsing/%Parser.py : lib/parsing/%.g4
antlr4 -Dlanguage=Python3 -visitor $<
@# let's be a bit more permissive for versions
sed -i '/self.checkVersion(".*")/d' $(@:%Parser.py=%*.py)
.PHONY: %.mypy typecheck test unit all
#!/bin/bash
export CLASSPATH=".:/usr/local/lib/antlr-4.8-complete.jar:\$CLASSPATH"
alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.8-complete.jar:\$CLASSPATH" org.antlr.v4.Tool'
antlr4 -Dlanguage=Python3 lib/parsing/DFA.g4
antlr4 -Dlanguage=Python3 lib/parsing/NFA.g4
antlr4 -Dlanguage=Python3 lib/parsing/CFG.g4
antlr4 -Dlanguage=Python3 -visitor lib/parsing/RegEx.g4
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment