Skip to content

Commit

Permalink
Modules and Windows Makefile
Browse files Browse the repository at this point in the history
Modules moved into config/modules/ folder and Makefile for Windows added
  • Loading branch information
andrea-deluca committed May 12, 2022
1 parent f9918c8 commit bfcbdbc
Show file tree
Hide file tree
Showing 51 changed files with 29 additions and 5 deletions.
Binary file removed config/java_cup/.DS_Store
Binary file not shown.
Binary file removed config/jflex/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions config/win_makefile/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
build: lib scanner parser
javac -d build source/*.java

lib:
javac -d build modules/java_cup/*.java
javac -d build modules/java_cup/runtime/*.java

scanner:
java -classpath ./build -jar modules/jflex/jflex-full-1.8.2.jar source/scanner.jflex -d source

parser:
java -classpath ./build java_cup.Main -destdir source -parser Parser source/parser.cup

clean:
del /f/r/s source\*.java
del /f/r/s source\*.*~
del /f/r/s build/*

init:
mkdir source build modules
touch source/scanner.jflex source/parser.cup

run:
java -classpath ./build Parser input.txt
10 changes: 5 additions & 5 deletions windows/compdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ then
case $module in
java_cup )
# add java_cup module into modules folder of the project
cp -r $config_path/java_cup ./modules/java_cup
cp -r $config_path/modules/java_cup ./modules/java_cup
echo -e "\nDone. Module $module has been added in modules/ folder!\n" ;;
jflex )
# add jflex module into modules folder of the project
cp -r $config_path/jflex ./modules/jflex
cp -r $config_path/modules/jflex ./modules/jflex
echo -e "\nDone. Module $module has been added in modules/ folder!\n" ;;
* )
# module passed is not found or it is not defined
Expand Down Expand Up @@ -115,9 +115,9 @@ then
mkdir $project/build $project/source $project/modules
cp -r $config_path/scanner.jflex $project/source/scanner.jflex
cp -r $config_path/parser.cup $project/source/parser.cup
cp -r $config_path/java_cup $project/modules/java_cup
cp -r $config_path/jflex $project/modules/jflex
cp $config_path/Makefile $project/Makefile
cp -r $config_path/modules/java_cup $project/modules/java_cup
cp -r $config_path/modules/jflex $project/modules/jflex
cp $config_path/win_makefile/Makefile $project/Makefile
echo -e "\nDone. Your porject is now ready in $project/ folder!"
echo "and start to develop your compiler."
echo -e "\nHave you a good day!"
Expand Down

0 comments on commit bfcbdbc

Please sign in to comment.