From ececfae87756158efc7b480451f65695ab8525c8 Mon Sep 17 00:00:00 2001 From: quirinecker Date: Thu, 16 Oct 2025 18:54:20 +0200 Subject: [PATCH] initial commit, template added --- .gitignore | 1 + .idea/.gitignore | 10 + .idea/MicroJava.iml | 104 + .idea/codeStyles/Project.xml | 10 + .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/exercise02.iml | 9 + .idea/inspectionProfiles/Project_Default.xml | 8 + .idea/libraries/junit_jupiter.xml | 17 + .idea/misc.xml | 5 + .idea/modules.xml | 8 + .idea/runConfigurations/UE_P_1.xml | 19 + .idea/runConfigurations/UE_P_2.xml | 16 + .idea/runConfigurations/UE_P_3.xml | 17 + .idea/runConfigurations/UE_P_4.xml | 18 + .idea/runConfigurations/UE_P_5.xml | 19 + .idea/runConfigurations/UE_P_6.xml | 13 + .../_for_lecturers__Run_verbose_tracing.xml | 13 + .idea/vcs.xml | 6 + MicroJava Compiler/Prims.mj | 27 + MicroJava Compiler/Prims.obj | Bin 0 -> 92 bytes MicroJava Compiler/StudentList.mj | 87 + MicroJava Compiler/StudentList.obj | Bin 0 -> 586 bytes MicroJava Compiler/StudentListOutput.txt | 6 + MicroJava Compiler/TestProgram.mj | 75 + MicroJava Compiler/TestProgram.obj | Bin 0 -> 383 bytes MicroJava Compiler/Trap.mj | 11 + MicroJava Compiler/src/ssw/mj/Compiler.java | 56 + MicroJava Compiler/src/ssw/mj/Errors.java | 140 ++ .../src/ssw/mj/Interpreter.java | 517 +++++ MicroJava Compiler/src/ssw/mj/Recorder.java | 158 ++ MicroJava Compiler/src/ssw/mj/Run.java | 84 + .../src/ssw/mj/TracingClassLoader.java | 173 ++ MicroJava Compiler/src/ssw/mj/Visualizer.java | 218 ++ .../src/ssw/mj/codegen/Decoder.java | 97 + .../src/ssw/mj/codegen/Label.java | 65 + .../src/ssw/mj/codegen/Operand.java | 152 ++ MicroJava Compiler/src/ssw/mj/impl/Code.java | 294 +++ .../src/ssw/mj/impl/Parser.java | 144 ++ .../src/ssw/mj/impl/Scanner.java | 108 + MicroJava Compiler/src/ssw/mj/impl/Tab.java | 100 + .../src/ssw/mj/scanner/Token.java | 126 ++ MicroJava Compiler/src/ssw/mj/symtab/Obj.java | 144 ++ .../src/ssw/mj/symtab/Scope.java | 58 + .../src/ssw/mj/symtab/Struct.java | 116 ++ MicroJava Tests/resources/animals.mj | 54 + MicroJava Tests/resources/bytecodes.txt | 1842 +++++++++++++++++ MicroJava Tests/resources/relops.mj | 14 + .../tests/ssw/mj/test/CodeGenerationTest.java | 880 ++++++++ .../tests/ssw/mj/test/ParserTest.java | 406 ++++ .../tests/ssw/mj/test/RecoverTest.java | 177 ++ .../tests/ssw/mj/test/ScannerTest.java | 888 ++++++++ .../ssw/mj/test/SimpleCodeGenerationTest.java | 1076 ++++++++++ .../tests/ssw/mj/test/SymbolTableTest.java | 1102 ++++++++++ .../mj/test/support/BaseCompilerTestCase.java | 401 ++++ .../mj/test/support/ByteCodeTestSupport.java | 103 + .../ssw/mj/test/support/Configuration.java | 27 + .../ssw/mj/test/support/SymTabDumper.java | 119 ++ flake.lock | 27 + flake.nix | 28 + lib/apiguardian-api-1.1.2.jar | Bin 0 -> 6806 bytes lib/gson-2.10.1.jar | Bin 0 -> 283367 bytes lib/javassist.jar | Bin 0 -> 794715 bytes lib/junit-jupiter-5.12.2.jar | Bin 0 -> 6366 bytes lib/junit-jupiter-api-5.12.2.jar | Bin 0 -> 233372 bytes lib/junit-jupiter-engine-5.12.2.jar | Bin 0 -> 292002 bytes lib/junit-jupiter-params-5.12.2.jar | Bin 0 -> 601719 bytes lib/junit-platform-commons-1.12.2.jar | Bin 0 -> 151859 bytes lib/junit-platform-engine-1.12.2.jar | Bin 0 -> 255799 bytes lib/opentest4j-1.3.0.jar | Bin 0 -> 14304 bytes 69 files changed, 10398 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/MicroJava.iml create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/exercise02.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/libraries/junit_jupiter.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/runConfigurations/UE_P_1.xml create mode 100644 .idea/runConfigurations/UE_P_2.xml create mode 100644 .idea/runConfigurations/UE_P_3.xml create mode 100644 .idea/runConfigurations/UE_P_4.xml create mode 100644 .idea/runConfigurations/UE_P_5.xml create mode 100644 .idea/runConfigurations/UE_P_6.xml create mode 100644 .idea/runConfigurations/_for_lecturers__Run_verbose_tracing.xml create mode 100644 .idea/vcs.xml create mode 100644 MicroJava Compiler/Prims.mj create mode 100644 MicroJava Compiler/Prims.obj create mode 100644 MicroJava Compiler/StudentList.mj create mode 100644 MicroJava Compiler/StudentList.obj create mode 100644 MicroJava Compiler/StudentListOutput.txt create mode 100644 MicroJava Compiler/TestProgram.mj create mode 100644 MicroJava Compiler/TestProgram.obj create mode 100644 MicroJava Compiler/Trap.mj create mode 100644 MicroJava Compiler/src/ssw/mj/Compiler.java create mode 100644 MicroJava Compiler/src/ssw/mj/Errors.java create mode 100644 MicroJava Compiler/src/ssw/mj/Interpreter.java create mode 100644 MicroJava Compiler/src/ssw/mj/Recorder.java create mode 100644 MicroJava Compiler/src/ssw/mj/Run.java create mode 100644 MicroJava Compiler/src/ssw/mj/TracingClassLoader.java create mode 100644 MicroJava Compiler/src/ssw/mj/Visualizer.java create mode 100644 MicroJava Compiler/src/ssw/mj/codegen/Decoder.java create mode 100644 MicroJava Compiler/src/ssw/mj/codegen/Label.java create mode 100644 MicroJava Compiler/src/ssw/mj/codegen/Operand.java create mode 100644 MicroJava Compiler/src/ssw/mj/impl/Code.java create mode 100644 MicroJava Compiler/src/ssw/mj/impl/Parser.java create mode 100644 MicroJava Compiler/src/ssw/mj/impl/Scanner.java create mode 100644 MicroJava Compiler/src/ssw/mj/impl/Tab.java create mode 100644 MicroJava Compiler/src/ssw/mj/scanner/Token.java create mode 100644 MicroJava Compiler/src/ssw/mj/symtab/Obj.java create mode 100644 MicroJava Compiler/src/ssw/mj/symtab/Scope.java create mode 100644 MicroJava Compiler/src/ssw/mj/symtab/Struct.java create mode 100644 MicroJava Tests/resources/animals.mj create mode 100644 MicroJava Tests/resources/bytecodes.txt create mode 100644 MicroJava Tests/resources/relops.mj create mode 100644 MicroJava Tests/tests/ssw/mj/test/CodeGenerationTest.java create mode 100644 MicroJava Tests/tests/ssw/mj/test/ParserTest.java create mode 100644 MicroJava Tests/tests/ssw/mj/test/RecoverTest.java create mode 100644 MicroJava Tests/tests/ssw/mj/test/ScannerTest.java create mode 100644 MicroJava Tests/tests/ssw/mj/test/SimpleCodeGenerationTest.java create mode 100644 MicroJava Tests/tests/ssw/mj/test/SymbolTableTest.java create mode 100644 MicroJava Tests/tests/ssw/mj/test/support/BaseCompilerTestCase.java create mode 100644 MicroJava Tests/tests/ssw/mj/test/support/ByteCodeTestSupport.java create mode 100644 MicroJava Tests/tests/ssw/mj/test/support/Configuration.java create mode 100644 MicroJava Tests/tests/ssw/mj/test/support/SymTabDumper.java create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 lib/apiguardian-api-1.1.2.jar create mode 100644 lib/gson-2.10.1.jar create mode 100644 lib/javassist.jar create mode 100644 lib/junit-jupiter-5.12.2.jar create mode 100644 lib/junit-jupiter-api-5.12.2.jar create mode 100644 lib/junit-jupiter-engine-5.12.2.jar create mode 100644 lib/junit-jupiter-params-5.12.2.jar create mode 100644 lib/junit-platform-commons-1.12.2.jar create mode 100644 lib/junit-platform-engine-1.12.2.jar create mode 100644 lib/opentest4j-1.3.0.jar diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1fcb152 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +out diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..052f916 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# GitHub Copilot persisted chat sessions +/copilot/chatSessions diff --git a/.idea/MicroJava.iml b/.idea/MicroJava.iml new file mode 100644 index 0000000..275245e --- /dev/null +++ b/.idea/MicroJava.iml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7c86e17 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..307554b --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/exercise02.iml b/.idea/exercise02.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/exercise02.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..e8079f7 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/junit_jupiter.xml b/.idea/libraries/junit_jupiter.xml new file mode 100644 index 0000000..631884c --- /dev/null +++ b/.idea/libraries/junit_jupiter.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..357a5d4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..4cd36c0 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/UE_P_1.xml b/.idea/runConfigurations/UE_P_1.xml new file mode 100644 index 0000000..6da5284 --- /dev/null +++ b/.idea/runConfigurations/UE_P_1.xml @@ -0,0 +1,19 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/UE_P_2.xml b/.idea/runConfigurations/UE_P_2.xml new file mode 100644 index 0000000..32e7d97 --- /dev/null +++ b/.idea/runConfigurations/UE_P_2.xml @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/UE_P_3.xml b/.idea/runConfigurations/UE_P_3.xml new file mode 100644 index 0000000..18d61ee --- /dev/null +++ b/.idea/runConfigurations/UE_P_3.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/UE_P_4.xml b/.idea/runConfigurations/UE_P_4.xml new file mode 100644 index 0000000..a137536 --- /dev/null +++ b/.idea/runConfigurations/UE_P_4.xml @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/UE_P_5.xml b/.idea/runConfigurations/UE_P_5.xml new file mode 100644 index 0000000..ff69013 --- /dev/null +++ b/.idea/runConfigurations/UE_P_5.xml @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/UE_P_6.xml b/.idea/runConfigurations/UE_P_6.xml new file mode 100644 index 0000000..60a4a5f --- /dev/null +++ b/.idea/runConfigurations/UE_P_6.xml @@ -0,0 +1,13 @@ + + + +