Skip to content

Commit 80478c3

Browse files
committed
SST/AST code generator
1 parent 41a4b98 commit 80478c3

File tree

31 files changed

+1595
-2
lines changed

31 files changed

+1595
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ language
5454
/org.eclipse.jdt.core.prefs
5555
Python3.g4.stamp
5656
python.gram.stamp
57+
Python.asdl.stamp
5758
*.orig
5859
/*.diff
5960
/testenv

graalpython/com.oracle.graal.python.pegparser.generator/Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
QUIETLY$(MX_VERBOSE) = @
22

3-
PARSER_PATH ?= ../com.oracle.graal.python.pegparser/src/com/oracle/graal/python/pegparser
3+
PEGPARSER_SRC_PATH ?= ../com.oracle.graal.python.pegparser/src
4+
GRAALPY_SRC_PATH ?= ../com.oracle.graal.python/src
5+
PARSER_PATH ?= ${PEGPARSER_SRC_PATH}/com/oracle/graal/python/pegparser
46
INPUT_PATH ?= input_files
57
ifdef MX_PYTHON
68
PYTHON_EXE ?= ${MX_PYTHON}
@@ -14,18 +16,26 @@ PARSER_TARGET=${PARSER_PATH}/Parser.java
1416

1517
GRAMMAR=${INPUT_PATH}/python.gram
1618
TOKENS=${INPUT_PATH}/Tokens
19+
ASDL=${INPUT_PATH}/Python.asdl
1720

1821
PEGEN_FILES=$(shell find pegen pegjava -name '*.py')
22+
ASDL_FILES=$(shell find asdl -name '*.py')
1923

2024
GRAMMAR_STAMP=${GRAMMAR}.stamp
25+
ASDL_STAMP=${ASDL}.stamp
2126

2227
.PHONY: default clean
23-
default: ${GRAMMAR_STAMP}
28+
default: ${GRAMMAR_STAMP} ${ASDL_STAMP}
2429

2530
${GRAMMAR_STAMP}: ${GRAMMAR} ${TOKENS} ${PEGEN_FILES} main_parser_gen.py
2631
$(QUIETLY) ${PYTHON_EXE} main_parser_gen.py ${GRAMMAR} ${TOKENS} ${PARSER_TARGET}
2732
$(QUIETLY) touch $@
2833

34+
${ASDL_STAMP}: ${ASDL} ${ASDL_FILES} main_asdl_gen.py
35+
$(QUIETLY) ${PYTHON_EXE} main_asdl_gen.py ${ASDL} --sst-path ${PEGPARSER_SRC_PATH} --ast-path ${GRAALPY_SRC_PATH}
36+
$(QUIETLY) touch $@
37+
2938
clean:
3039
$(QUIETLY) rm -f ${PARSER_TARGET}
3140
$(QUIETLY) rm -f ${GRAMMAR_STAMP}
41+
$(QUIETLY) rm -f ${ASDL_STAMP}

0 commit comments

Comments
 (0)