Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
fja
eval
Commits
6d0a19c4
Commit
6d0a19c4
authored
Jun 08, 2021
by
Vladimír Štill
Browse files
make: Move grammar generation to makefile
parent
5e02dab8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
6d0a19c4
...
...
@@ -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
regenerate_grammars.sh
deleted
100755 → 0
View file @
5e02dab8
#!/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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment