This repository has been archived by the owner on Dec 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] add grammar lab (antlr4) (#119)
增加新的前端实验,使用 antlr4 代替 flex + bison
- Loading branch information
WuK
authored
Jan 12, 2024
1 parent
db47166
commit fcb0f0d
Showing
14 changed files
with
1,441 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,52 @@ | ||
# syntax=docker/dockerfile:1.4 | ||
ARG BASE_IMAGE=debian | ||
ARG BASE_IMAGE=ubuntu | ||
FROM ${BASE_IMAGE} | ||
WORKDIR /autograder | ||
WORKDIR /workspace | ||
VOLUME /workspace | ||
COPY <<build_install.sh <<run.sh . /workspace/SYsU-lang/ | ||
WORKDIR /opt/SYsU-lang | ||
COPY <<build_install.sh <<run.sh . /opt/SYsU-lang | ||
#!/bin/sh | ||
rm -rf \$HOME/sysu | ||
rm -rf \$2 | ||
cmake -G Ninja \\ | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \\ | ||
-DCMAKE_C_COMPILER=clang \\ | ||
-DCMAKE_CXX_COMPILER=clang++ \\ | ||
-DCMAKE_INSTALL_PREFIX=\$HOME/sysu \\ | ||
-DCMAKE_CXX_STANDARD=17 \\ | ||
-DCMAKE_INSTALL_PREFIX=\$2 \\ | ||
-DCMAKE_PREFIX_PATH="$(llvm-config --cmakedir)" \\ | ||
-DCPACK_SOURCE_IGNORE_FILES=".git/;tester/third_party/" \\ | ||
-S /workspace/SYsU-lang \\ | ||
-B \$HOME/sysu/build | ||
cmake --build \$HOME/sysu/build | ||
cmake --build \$HOME/sysu/build -t install | ||
-S \$1 \\ | ||
-B \$2/build | ||
cmake --build \$2/build -j | ||
cmake --build \$2/build -t install | ||
build_install.sh | ||
#!/bin/sh | ||
python3 -m tarfile -e /autograder/submission/*.tar.gz /workspace/submission | ||
rm -rf /workspace/SYsU-lang/generator | ||
cp -r /workspace/submission/*-Source/generator /workspace/SYsU-lang | ||
rm -rf /workspace/SYsU-lang/optimizer | ||
cp -r /workspace/submission/*-Source/optimizer /workspace/SYsU-lang | ||
rm -rf /workspace/submission | ||
\$HOME/build_install | ||
python3 -m tarfile -e /autograder/submission/*.tar.gz /opt/SYsU-lang/submission | ||
rm -rf /opt/SYsU-lang/generator | ||
cp -r /opt/SYsU-lang/submission/*-Source/generator /opt/SYsU-lang | ||
rm -rf /opt/SYsU-lang/optimizer | ||
cp -r /opt/SYsU-lang/submission/*-Source/optimizer /opt/SYsU-lang | ||
rm -rf /opt/SYsU-lang/submission | ||
/opt/SYsU-lang/build_install.sh /opt/SYsU-lang /opt/sysu | ||
mkdir -p /autograder/results | ||
sysu-compiler \\ | ||
--unittest=benchmark_generator_and_optimizer_1 \\ | ||
"/workspace/SYsU-lang/**/*.sysu.c" >/autograder/results/results.json | ||
"/opt/SYsU-lang/**/*.sysu.c" >/autograder/results/results.json | ||
run.sh | ||
RUN <<EOF | ||
apt-get update -y | ||
apt-get upgrade -y | ||
apt-get install -y --no-install-recommends \ | ||
clang llvm-dev zlib1g-dev libzstd-dev \ | ||
lld flex bison cmake python3 ninja-build git | ||
libantlr4-runtime-dev default-jre-headless pkg-config uuid-dev flex bison \ | ||
clang llvm-dev zlib1g-dev libzstd-dev lld python3 cmake ninja-build git | ||
apt-get autoremove -y | ||
apt-get clean -y | ||
rm -rf /var/lib/apt/lists/* | ||
mv /workspace/SYsU-lang/run.sh /autograder/run | ||
mv /opt/SYsU-lang/run.sh /autograder/run | ||
chmod +x /autograder/run | ||
mv /workspace/SYsU-lang/build_install.sh $HOME/build_install | ||
chmod +x $HOME/build_install | ||
$HOME/build_install | ||
chmod +x /opt/SYsU-lang/build_install.sh | ||
/opt/SYsU-lang/build_install.sh /opt/SYsU-lang /opt/sysu | ||
EOF | ||
ENV PATH=/root/sysu/bin:$PATH \ | ||
CPATH=/root/sysu/include:$CPATH \ | ||
LIBRARY_PATH=/root/sysu/lib:$LIBRARY_PATH \ | ||
LD_LIBRARY_PATH=/root/sysu/lib:$LD_LIBRARY_PATH | ||
ENV PATH=/opt/sysu/bin:$PATH \ | ||
CPATH=/opt/sysu/include:$CPATH \ | ||
LIBRARY_PATH=/opt/sysu/lib:$LIBRARY_PATH \ | ||
LD_LIBRARY_PATH=/opt/sysu/lib:$LD_LIBRARY_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.