├── README.md ├── documents ├── 设计文档-lab1.pdf ├── 设计文档-lab2.pdf ├── 设计文档-lab3.pdf └── 设计文档-lab4.pdf ├── lab1 ├── .idea │ ├── lab1.iml │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── CMakeLists.txt ├── cmake-build-debug │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.14.2 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeSystem.cmake │ │ │ └── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.out │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── CMakeOutput.log │ │ ├── Makefile.cmake │ │ ├── Makefile2 │ │ ├── TargetDirectories.txt │ │ ├── clion-environment.txt │ │ ├── clion-log.txt │ │ ├── cmake.check_cache │ │ ├── feature_tests.bin │ │ ├── feature_tests.c │ │ ├── lab1.dir │ │ │ ├── C.includecache │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── depend.internal │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ ├── main.c.o │ │ │ └── progress.make │ │ └── progress.marks │ ├── Makefile │ ├── cmake_install.cmake │ ├── lab1 │ ├── lab1.cbp │ └── output_file.txt ├── input_file.txt ├── main.c └── output_file.txt ├── lab2 ├── .idea │ ├── lab2.iml │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── CMakeLists.txt ├── action_table.txt ├── cmake-build-debug │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.14.2 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.out │ │ │ └── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.out │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── CMakeOutput.log │ │ ├── Makefile.cmake │ │ ├── Makefile2 │ │ ├── TargetDirectories.txt │ │ ├── clion-environment.txt │ │ ├── clion-log.txt │ │ ├── cmake.check_cache │ │ ├── feature_tests.bin │ │ ├── feature_tests.c │ │ ├── feature_tests.cxx │ │ ├── lab2.dir │ │ │ ├── CXX.includecache │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── depend.internal │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ ├── main.cpp.o │ │ │ └── progress.make │ │ └── progress.marks │ ├── Makefile │ ├── cmake_install.cmake │ ├── lab2 │ └── lab2.cbp ├── goto_table.txt ├── input_file.txt ├── main.cpp └── output_file.txt ├── lab3 ├── .idea │ ├── lab3.iml │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── CMakeLists.txt ├── action_table.txt ├── cmake-build-debug │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.14.2 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.out │ │ │ └── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.out │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── CMakeOutput.log │ │ ├── Makefile.cmake │ │ ├── Makefile2 │ │ ├── TargetDirectories.txt │ │ ├── clion-environment.txt │ │ ├── clion-log.txt │ │ ├── cmake.check_cache │ │ ├── feature_tests.bin │ │ ├── feature_tests.c │ │ ├── feature_tests.cxx │ │ ├── lab3.dir │ │ │ ├── CXX.includecache │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── depend.internal │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ ├── main.cpp.o │ │ │ └── progress.make │ │ └── progress.marks │ ├── Makefile │ ├── cmake_install.cmake │ ├── lab3 │ └── lab3.cbp ├── goto_table.txt ├── input_file.txt ├── main.cpp └── output_file.txt └── lab4 ├── .idea ├── lab4.iml ├── misc.xml ├── modules.xml └── workspace.xml ├── CMakeLists.txt ├── action_table.txt ├── cmake-build-debug ├── CMakeCache.txt ├── CMakeFiles │ ├── 3.14.2 │ │ ├── CMakeCCompiler.cmake │ │ ├── CMakeCXXCompiler.cmake │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ ├── CMakeSystem.cmake │ │ ├── CompilerIdC │ │ │ ├── CMakeCCompilerId.c │ │ │ └── a.out │ │ └── CompilerIdCXX │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ └── a.out │ ├── CMakeDirectoryInformation.cmake │ ├── CMakeOutput.log │ ├── Makefile.cmake │ ├── Makefile2 │ ├── TargetDirectories.txt │ ├── clion-environment.txt │ ├── clion-log.txt │ ├── cmake.check_cache │ ├── feature_tests.bin │ ├── feature_tests.c │ ├── feature_tests.cxx │ ├── lab4.dir │ │ ├── CXX.includecache │ │ ├── DependInfo.cmake │ │ ├── build.make │ │ ├── cmake_clean.cmake │ │ ├── depend.internal │ │ ├── depend.make │ │ ├── flags.make │ │ ├── link.txt │ │ ├── main.cpp.o │ │ └── progress.make │ └── progress.marks ├── Makefile ├── cmake_install.cmake ├── lab4 └── lab4.cbp ├── goto_table.txt ├── input_file.txt ├── main.cpp ├── output_file.txt └── target_code_file.txt /README.md: -------------------------------------------------------------------------------- 1 | # HITsz-Compilation-Principle-Project 2 | 哈工大(深圳)编译原理实验 3 | -------------------------------------------------------------------------------- /documents/设计文档-lab1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/documents/设计文档-lab1.pdf -------------------------------------------------------------------------------- /documents/设计文档-lab2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/documents/设计文档-lab2.pdf -------------------------------------------------------------------------------- /documents/设计文档-lab3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/documents/设计文档-lab3.pdf -------------------------------------------------------------------------------- /documents/设计文档-lab4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/documents/设计文档-lab4.pdf -------------------------------------------------------------------------------- /lab1/.idea/lab1.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lab1/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /lab1/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lab1/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 105 | 106 | 107 | 108 | 109 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 1606198516090 120 | 128 | 129 | 130 | 131 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /lab2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(lab2) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(lab2 main.cpp) -------------------------------------------------------------------------------- /lab2/action_table.txt: -------------------------------------------------------------------------------- 1 | + * ( ) a $ 2 | 0 S1 S2 3 | 1 S6 S7 4 | 2 R6 R6 R6 5 | 3 S11 ACC 6 | 4 R2 S12 R2 7 | 5 R4 R4 R4 8 | 6 S6 S7 9 | 7 R6 R6 R6 10 | 8 S14 S15 11 | 9 R2 S16 R2 12 | 10 R4 R4 R4 13 | 11 S1 S2 14 | 12 S1 S2 15 | 13 S14 S19 16 | 14 S6 S7 17 | 15 R5 R5 R5 18 | 16 S6 S7 19 | 17 R1 S12 R1 20 | 18 R3 R3 R3 21 | 19 R5 R5 R5 22 | 20 R1 S16 R1 23 | 21 R3 R3 R3 -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/3.14.2/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/Library/Developer/CommandLineTools/usr/bin/cc") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "AppleClang") 4 | set(CMAKE_C_COMPILER_VERSION "10.0.0.10001044") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "Darwin") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_SIMULATE_VERSION "") 16 | 17 | 18 | 19 | set(CMAKE_AR "/Library/Developer/CommandLineTools/usr/bin/ar") 20 | set(CMAKE_C_COMPILER_AR "") 21 | set(CMAKE_RANLIB "/Library/Developer/CommandLineTools/usr/bin/ranlib") 22 | set(CMAKE_C_COMPILER_RANLIB "") 23 | set(CMAKE_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld") 24 | set(CMAKE_MT "") 25 | set(CMAKE_COMPILER_IS_GNUCC ) 26 | set(CMAKE_C_COMPILER_LOADED 1) 27 | set(CMAKE_C_COMPILER_WORKS TRUE) 28 | set(CMAKE_C_ABI_COMPILED TRUE) 29 | set(CMAKE_COMPILER_IS_MINGW ) 30 | set(CMAKE_COMPILER_IS_CYGWIN ) 31 | if(CMAKE_COMPILER_IS_CYGWIN) 32 | set(CYGWIN 1) 33 | set(UNIX 1) 34 | endif() 35 | 36 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 37 | 38 | if(CMAKE_COMPILER_IS_MINGW) 39 | set(MINGW 1) 40 | endif() 41 | set(CMAKE_C_COMPILER_ID_RUN 1) 42 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 43 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 44 | set(CMAKE_C_LINKER_PREFERENCE 10) 45 | 46 | # Save compiler ABI information. 47 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 48 | set(CMAKE_C_COMPILER_ABI "") 49 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 50 | 51 | if(CMAKE_C_SIZEOF_DATA_PTR) 52 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 53 | endif() 54 | 55 | if(CMAKE_C_COMPILER_ABI) 56 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 57 | endif() 58 | 59 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 60 | set(CMAKE_LIBRARY_ARCHITECTURE "") 61 | endif() 62 | 63 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 64 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 65 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 66 | endif() 67 | 68 | 69 | 70 | 71 | 72 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include;/Library/Developer/CommandLineTools/usr/include;/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include") 73 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") 74 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib") 75 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks") 76 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/3.14.2/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/Library/Developer/CommandLineTools/usr/bin/c++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "AppleClang") 4 | set(CMAKE_CXX_COMPILER_VERSION "10.0.0.10001044") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "Darwin") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_SIMULATE_VERSION "") 18 | 19 | 20 | 21 | set(CMAKE_AR "/Library/Developer/CommandLineTools/usr/bin/ar") 22 | set(CMAKE_CXX_COMPILER_AR "") 23 | set(CMAKE_RANLIB "/Library/Developer/CommandLineTools/usr/bin/ranlib") 24 | set(CMAKE_CXX_COMPILER_RANLIB "") 25 | set(CMAKE_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld") 26 | set(CMAKE_MT "") 27 | set(CMAKE_COMPILER_IS_GNUCXX ) 28 | set(CMAKE_CXX_COMPILER_LOADED 1) 29 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 30 | set(CMAKE_CXX_ABI_COMPILED TRUE) 31 | set(CMAKE_COMPILER_IS_MINGW ) 32 | set(CMAKE_COMPILER_IS_CYGWIN ) 33 | if(CMAKE_COMPILER_IS_CYGWIN) 34 | set(CYGWIN 1) 35 | set(UNIX 1) 36 | endif() 37 | 38 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 39 | 40 | if(CMAKE_COMPILER_IS_MINGW) 41 | set(MINGW 1) 42 | endif() 43 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 44 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 45 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) 46 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 47 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 48 | 49 | # Save compiler ABI information. 50 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 51 | set(CMAKE_CXX_COMPILER_ABI "") 52 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 53 | 54 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 55 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 56 | endif() 57 | 58 | if(CMAKE_CXX_COMPILER_ABI) 59 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 60 | endif() 61 | 62 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 63 | set(CMAKE_LIBRARY_ARCHITECTURE "") 64 | endif() 65 | 66 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 67 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 68 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 69 | endif() 70 | 71 | 72 | 73 | 74 | 75 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/Library/Developer/CommandLineTools/usr/include/c++/v1;/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include;/Library/Developer/CommandLineTools/usr/include;/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include") 76 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") 77 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib") 78 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks") 79 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/3.14.2/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab2/cmake-build-debug/CMakeFiles/3.14.2/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/3.14.2/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab2/cmake-build-debug/CMakeFiles/3.14.2/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/3.14.2/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Darwin-18.2.0") 2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin") 3 | set(CMAKE_HOST_SYSTEM_VERSION "18.2.0") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Darwin-18.2.0") 9 | set(CMAKE_SYSTEM_NAME "Darwin") 10 | set(CMAKE_SYSTEM_VERSION "18.2.0") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/3.14.2/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab2/cmake-build-debug/CMakeFiles/3.14.2/CompilerIdC/a.out -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/3.14.2/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab2/cmake-build-debug/CMakeFiles/3.14.2/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/DWL/Desktop/projects/lab2") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/DWL/Desktop/projects/lab2/cmake-build-debug") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # The main recursive all target 10 | all: 11 | 12 | .PHONY : all 13 | 14 | # The main recursive preinstall target 15 | preinstall: 16 | 17 | .PHONY : preinstall 18 | 19 | # The main recursive clean target 20 | clean: 21 | 22 | .PHONY : clean 23 | 24 | #============================================================================= 25 | # Special targets provided by cmake. 26 | 27 | # Disable implicit rules so canonical targets will work. 28 | .SUFFIXES: 29 | 30 | 31 | # Remove some rules from gmake that .SUFFIXES does not remove. 32 | SUFFIXES = 33 | 34 | .SUFFIXES: .hpux_make_needs_suffix_list 35 | 36 | 37 | # Suppress display of executed commands. 38 | $(VERBOSE).SILENT: 39 | 40 | 41 | # A target that is always out of date. 42 | cmake_force: 43 | 44 | .PHONY : cmake_force 45 | 46 | #============================================================================= 47 | # Set environment variables for the build. 48 | 49 | # The shell in which to execute make rules. 50 | SHELL = /bin/sh 51 | 52 | # The CMake executable. 53 | CMAKE_COMMAND = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake 54 | 55 | # The command to remove a file. 56 | RM = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E remove -f 57 | 58 | # Escaping for special characters. 59 | EQUALS = = 60 | 61 | # The top-level source directory on which CMake was run. 62 | CMAKE_SOURCE_DIR = /Users/DWL/Desktop/projects/lab2 63 | 64 | # The top-level build directory on which CMake was run. 65 | CMAKE_BINARY_DIR = /Users/DWL/Desktop/projects/lab2/cmake-build-debug 66 | 67 | #============================================================================= 68 | # Target rules for target CMakeFiles/lab2.dir 69 | 70 | # All Build rule for target. 71 | CMakeFiles/lab2.dir/all: 72 | $(MAKE) -f CMakeFiles/lab2.dir/build.make CMakeFiles/lab2.dir/depend 73 | $(MAKE) -f CMakeFiles/lab2.dir/build.make CMakeFiles/lab2.dir/build 74 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles --progress-num=1,2 "Built target lab2" 75 | .PHONY : CMakeFiles/lab2.dir/all 76 | 77 | # Include target in all. 78 | all: CMakeFiles/lab2.dir/all 79 | 80 | .PHONY : all 81 | 82 | # Build rule for subdir invocation for target. 83 | CMakeFiles/lab2.dir/rule: cmake_check_build_system 84 | $(CMAKE_COMMAND) -E cmake_progress_start /Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles 2 85 | $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/lab2.dir/all 86 | $(CMAKE_COMMAND) -E cmake_progress_start /Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles 0 87 | .PHONY : CMakeFiles/lab2.dir/rule 88 | 89 | # Convenience name for target. 90 | lab2: CMakeFiles/lab2.dir/rule 91 | 92 | .PHONY : lab2 93 | 94 | # clean rule for target. 95 | CMakeFiles/lab2.dir/clean: 96 | $(MAKE) -f CMakeFiles/lab2.dir/build.make CMakeFiles/lab2.dir/clean 97 | .PHONY : CMakeFiles/lab2.dir/clean 98 | 99 | # clean rule for target. 100 | clean: CMakeFiles/lab2.dir/clean 101 | 102 | .PHONY : clean 103 | 104 | #============================================================================= 105 | # Special targets to cleanup operation of make. 106 | 107 | # Special rule to run CMake to check the build system integrity. 108 | # No rule that depends on this can have commands that come from listfiles 109 | # because they might be regenerated. 110 | cmake_check_build_system: 111 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 112 | .PHONY : cmake_check_build_system 113 | 114 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles/rebuild_cache.dir 2 | /Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles/edit_cache.dir 3 | /Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles/lab2.dir 4 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/clion-environment.txt: -------------------------------------------------------------------------------- 1 | ToolSet: 1.0 (local)Options: 2 | 3 | Options: -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/clion-log.txt: -------------------------------------------------------------------------------- 1 | /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/DWL/Desktop/projects/lab2 2 | -- The C compiler identification is AppleClang 10.0.0.10001044 3 | -- The CXX compiler identification is AppleClang 10.0.0.10001044 4 | -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc 5 | -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works 6 | -- Detecting C compiler ABI info 7 | -- Detecting C compiler ABI info - done 8 | -- Detecting C compile features 9 | -- Detecting C compile features - done 10 | -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ 11 | -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works 12 | -- Detecting CXX compiler ABI info 13 | -- Detecting CXX compiler ABI info - done 14 | -- Detecting CXX compile features 15 | -- Detecting CXX compile features - done 16 | -- Configuring done 17 | -- Generating done 18 | -- Build files have been written to: /Users/DWL/Desktop/projects/lab2/cmake-build-debug 19 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab2/cmake-build-debug/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/feature_tests.c: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "C_FEATURE:" 4 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "c_function_prototypes\n" 10 | "C_FEATURE:" 11 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "c_restrict\n" 17 | "C_FEATURE:" 18 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "c_static_assert\n" 24 | "C_FEATURE:" 25 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "c_variadic_macros\n" 31 | 32 | }; 33 | 34 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 35 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /Users/DWL/Desktop/projects/lab2/main.cpp 10 | cstdio 11 | - 12 | vector 13 | - 14 | string 15 | - 16 | iostream 17 | - 18 | fstream 19 | - 20 | map 21 | - 22 | set 23 | - 24 | stack 25 | - 26 | queue 27 | - 28 | 29 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/Users/DWL/Desktop/projects/lab2/main.cpp" "/Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles/lab2.dir/main.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "AppleClang") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | ) 14 | 15 | # Targets to which this target links. 16 | set(CMAKE_TARGET_LINKED_INFO_FILES 17 | ) 18 | 19 | # Fortran module output directory. 20 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 21 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /Users/DWL/Desktop/projects/lab2 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /Users/DWL/Desktop/projects/lab2/cmake-build-debug 50 | 51 | # Include any dependencies generated for this target. 52 | include CMakeFiles/lab2.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include CMakeFiles/lab2.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include CMakeFiles/lab2.dir/flags.make 59 | 60 | CMakeFiles/lab2.dir/main.cpp.o: CMakeFiles/lab2.dir/flags.make 61 | CMakeFiles/lab2.dir/main.cpp.o: ../main.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/lab2.dir/main.cpp.o" 63 | /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/lab2.dir/main.cpp.o -c /Users/DWL/Desktop/projects/lab2/main.cpp 64 | 65 | CMakeFiles/lab2.dir/main.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/lab2.dir/main.cpp.i" 67 | /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/DWL/Desktop/projects/lab2/main.cpp > CMakeFiles/lab2.dir/main.cpp.i 68 | 69 | CMakeFiles/lab2.dir/main.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/lab2.dir/main.cpp.s" 71 | /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/DWL/Desktop/projects/lab2/main.cpp -o CMakeFiles/lab2.dir/main.cpp.s 72 | 73 | # Object files for target lab2 74 | lab2_OBJECTS = \ 75 | "CMakeFiles/lab2.dir/main.cpp.o" 76 | 77 | # External object files for target lab2 78 | lab2_EXTERNAL_OBJECTS = 79 | 80 | lab2: CMakeFiles/lab2.dir/main.cpp.o 81 | lab2: CMakeFiles/lab2.dir/build.make 82 | lab2: CMakeFiles/lab2.dir/link.txt 83 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable lab2" 84 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/lab2.dir/link.txt --verbose=$(VERBOSE) 85 | 86 | # Rule to build all files generated by this target. 87 | CMakeFiles/lab2.dir/build: lab2 88 | 89 | .PHONY : CMakeFiles/lab2.dir/build 90 | 91 | CMakeFiles/lab2.dir/clean: 92 | $(CMAKE_COMMAND) -P CMakeFiles/lab2.dir/cmake_clean.cmake 93 | .PHONY : CMakeFiles/lab2.dir/clean 94 | 95 | CMakeFiles/lab2.dir/depend: 96 | cd /Users/DWL/Desktop/projects/lab2/cmake-build-debug && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/DWL/Desktop/projects/lab2 /Users/DWL/Desktop/projects/lab2 /Users/DWL/Desktop/projects/lab2/cmake-build-debug /Users/DWL/Desktop/projects/lab2/cmake-build-debug /Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles/lab2.dir/DependInfo.cmake --color=$(COLOR) 97 | .PHONY : CMakeFiles/lab2.dir/depend 98 | 99 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/lab2.dir/main.cpp.o" 3 | "lab2.pdb" 4 | "lab2" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/lab2.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | CMakeFiles/lab2.dir/main.cpp.o 5 | /Users/DWL/Desktop/projects/lab2/main.cpp 6 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | CMakeFiles/lab2.dir/main.cpp.o: ../main.cpp 5 | 6 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # compile CXX with /Library/Developer/CommandLineTools/usr/bin/c++ 5 | CXX_FLAGS = -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -std=gnu++14 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = 10 | 11 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/link.txt: -------------------------------------------------------------------------------- 1 | /Library/Developer/CommandLineTools/usr/bin/c++ -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/lab2.dir/main.cpp.o -o lab2 2 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/main.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab2/cmake-build-debug/CMakeFiles/lab2.dir/main.cpp.o -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/lab2.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | 4 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Remove some rules from gmake that .SUFFIXES does not remove. 21 | SUFFIXES = 22 | 23 | .SUFFIXES: .hpux_make_needs_suffix_list 24 | 25 | 26 | # Suppress display of executed commands. 27 | $(VERBOSE).SILENT: 28 | 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | 33 | .PHONY : cmake_force 34 | 35 | #============================================================================= 36 | # Set environment variables for the build. 37 | 38 | # The shell in which to execute make rules. 39 | SHELL = /bin/sh 40 | 41 | # The CMake executable. 42 | CMAKE_COMMAND = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake 43 | 44 | # The command to remove a file. 45 | RM = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E remove -f 46 | 47 | # Escaping for special characters. 48 | EQUALS = = 49 | 50 | # The top-level source directory on which CMake was run. 51 | CMAKE_SOURCE_DIR = /Users/DWL/Desktop/projects/lab2 52 | 53 | # The top-level build directory on which CMake was run. 54 | CMAKE_BINARY_DIR = /Users/DWL/Desktop/projects/lab2/cmake-build-debug 55 | 56 | #============================================================================= 57 | # Targets provided globally by CMake. 58 | 59 | # Special rule for the target rebuild_cache 60 | rebuild_cache: 61 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 62 | /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 63 | .PHONY : rebuild_cache 64 | 65 | # Special rule for the target rebuild_cache 66 | rebuild_cache/fast: rebuild_cache 67 | 68 | .PHONY : rebuild_cache/fast 69 | 70 | # Special rule for the target edit_cache 71 | edit_cache: 72 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 73 | /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 74 | .PHONY : edit_cache 75 | 76 | # Special rule for the target edit_cache 77 | edit_cache/fast: edit_cache 78 | 79 | .PHONY : edit_cache/fast 80 | 81 | # The main all target 82 | all: cmake_check_build_system 83 | $(CMAKE_COMMAND) -E cmake_progress_start /Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles /Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles/progress.marks 84 | $(MAKE) -f CMakeFiles/Makefile2 all 85 | $(CMAKE_COMMAND) -E cmake_progress_start /Users/DWL/Desktop/projects/lab2/cmake-build-debug/CMakeFiles 0 86 | .PHONY : all 87 | 88 | # The main clean target 89 | clean: 90 | $(MAKE) -f CMakeFiles/Makefile2 clean 91 | .PHONY : clean 92 | 93 | # The main clean target 94 | clean/fast: clean 95 | 96 | .PHONY : clean/fast 97 | 98 | # Prepare targets for installation. 99 | preinstall: all 100 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 101 | .PHONY : preinstall 102 | 103 | # Prepare targets for installation. 104 | preinstall/fast: 105 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 106 | .PHONY : preinstall/fast 107 | 108 | # clear depends 109 | depend: 110 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 111 | .PHONY : depend 112 | 113 | #============================================================================= 114 | # Target rules for targets named lab2 115 | 116 | # Build rule for target. 117 | lab2: cmake_check_build_system 118 | $(MAKE) -f CMakeFiles/Makefile2 lab2 119 | .PHONY : lab2 120 | 121 | # fast build rule for target. 122 | lab2/fast: 123 | $(MAKE) -f CMakeFiles/lab2.dir/build.make CMakeFiles/lab2.dir/build 124 | .PHONY : lab2/fast 125 | 126 | main.o: main.cpp.o 127 | 128 | .PHONY : main.o 129 | 130 | # target to build an object file 131 | main.cpp.o: 132 | $(MAKE) -f CMakeFiles/lab2.dir/build.make CMakeFiles/lab2.dir/main.cpp.o 133 | .PHONY : main.cpp.o 134 | 135 | main.i: main.cpp.i 136 | 137 | .PHONY : main.i 138 | 139 | # target to preprocess a source file 140 | main.cpp.i: 141 | $(MAKE) -f CMakeFiles/lab2.dir/build.make CMakeFiles/lab2.dir/main.cpp.i 142 | .PHONY : main.cpp.i 143 | 144 | main.s: main.cpp.s 145 | 146 | .PHONY : main.s 147 | 148 | # target to generate assembly for a file 149 | main.cpp.s: 150 | $(MAKE) -f CMakeFiles/lab2.dir/build.make CMakeFiles/lab2.dir/main.cpp.s 151 | .PHONY : main.cpp.s 152 | 153 | # Help Target 154 | help: 155 | @echo "The following are some of the valid targets for this Makefile:" 156 | @echo "... all (the default if no target is provided)" 157 | @echo "... clean" 158 | @echo "... depend" 159 | @echo "... rebuild_cache" 160 | @echo "... edit_cache" 161 | @echo "... lab2" 162 | @echo "... main.o" 163 | @echo "... main.i" 164 | @echo "... main.s" 165 | .PHONY : help 166 | 167 | 168 | 169 | #============================================================================= 170 | # Special targets to cleanup operation of make. 171 | 172 | # Special rule to run CMake to check the build system integrity. 173 | # No rule that depends on this can have commands that come from listfiles 174 | # because they might be regenerated. 175 | cmake_check_build_system: 176 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 177 | .PHONY : cmake_check_build_system 178 | 179 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /Users/DWL/Desktop/projects/lab2 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Is this installation the result of a crosscompile? 31 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 32 | set(CMAKE_CROSSCOMPILING "FALSE") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "/Users/DWL/Desktop/projects/lab2/cmake-build-debug/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /lab2/cmake-build-debug/lab2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab2/cmake-build-debug/lab2 -------------------------------------------------------------------------------- /lab2/cmake-build-debug/lab2.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 90 | 91 | -------------------------------------------------------------------------------- /lab2/goto_table.txt: -------------------------------------------------------------------------------- 1 | A T F 2 | 0 3 4 5 3 | 1 8 9 10 4 | 2 5 | 3 6 | 4 7 | 5 8 | 6 13 9 10 9 | 7 10 | 8 11 | 9 12 | 10 13 | 11 17 5 14 | 12 18 15 | 13 16 | 14 20 10 17 | 15 18 | 16 21 19 | 17 20 | 18 21 | 19 22 | 20 23 | 21 24 | -------------------------------------------------------------------------------- /lab2/input_file.txt: -------------------------------------------------------------------------------- 1 | 7 2 | S->A 3 | A->A+T 4 | A->T 5 | T->T*F 6 | T->F 7 | F->(A) 8 | F->a 9 | + * ( ) a # 10 | S A T F # 11 | a+a*a 12 | 13 | -------------------------------------------------------------------------------- /lab2/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | # include 6 | #include 7 | #include 8 | #include 9 | #include 10 | using namespace std; 11 | 12 | # define INIT_LEN 100 13 | 14 | string ACTION_TABLE_PATH = "/Users/DWL/Downloads/action_table.txt"; 15 | string GOTO_TABLE_PATH = "/Users/DWL/Downloads/goto_table.txt"; 16 | string INPUT_FILE_PATH = "/Users/DWL/Downloads/input_file.txt"; 17 | string OUTPUT_FILE_PATH = "/Users/DWL/Downloads/output_file.txt"; 18 | 19 | int skip = 0; // 跳过第一行 20 | 21 | 22 | /* action表和goto表 */ 23 | pair action[INIT_LEN][INIT_LEN]; // first表示分析动作,1->Shift 2->Reduce, 3->ACC; second表示转移状态或者产生式序号 24 | int goton[INIT_LEN][INIT_LEN]; 25 | 26 | 27 | /* 产生式结构体,左部符号和右部符号串 */ 28 | struct Production { 29 | char left; 30 | vector rights; 31 | /* 重载== */ 32 | bool operator==(Production& rhs) const { 33 | if (left != rhs.left) 34 | return false; 35 | for (int i = 0; i < rights.size(); i++) { 36 | if (i >= rhs.rights.size()) 37 | return false; 38 | if (rights[i] != rhs.rights[i])\ 39 | return false; 40 | } 41 | return true; 42 | } 43 | }; 44 | 45 | /* 文法结构体 */ 46 | struct Grammar { 47 | int num; // 产生式数量 48 | vector T; // 终结符 49 | vector N; // 非终结符 50 | vector prods; //产生式 51 | }grammar; 52 | 53 | 54 | /* 待分析串 */ 55 | string str; 56 | 57 | /* 分析栈 */ 58 | stack> ST; // first是状态,second是符号 59 | 60 | /* 判断ch是否是终结符 */ 61 | int isInT(char ch) 62 | { 63 | for (int i = 0; i < grammar.T.size(); i++) { 64 | if (grammar.T[i] == ch) { 65 | return i + 1; 66 | } 67 | } 68 | return 0; 69 | } 70 | 71 | /* 判断ch是否是非终结符 */ 72 | int isInN(char ch) 73 | { 74 | for (int i = 0; i < grammar.N.size(); i++) { 75 | if (grammar.N[i] == ch) { 76 | return i + 1; 77 | } 78 | } 79 | return 0; 80 | } 81 | 82 | /* 读入ActionTable */ 83 | void readAction(string file_path, pair action[INIT_LEN][INIT_LEN]) { 84 | ifstream file(file_path); 85 | string temp; 86 | if (file.is_open() == false) { 87 | cout << "ERROR: failed to open the file" << endl; 88 | return; 89 | } 90 | while (getline(file, temp)) { 91 | if (skip == 0) { 92 | skip++; 93 | continue; 94 | } 95 | int row_num_pos = temp.find_first_of('\t'); 96 | int row_num = atoi(temp.substr(0, row_num_pos).c_str()); 97 | int j = 0; 98 | for (int i = row_num_pos + 1; i < temp.size();) { 99 | if (temp[i] == '\t') { 100 | action[row_num][++j] = pair(); 101 | i++; 102 | } else { 103 | if (temp[i] == 'A') { 104 | action[row_num][j] = pair(3, 0); 105 | } else if (temp[i] == 'S') { 106 | action[row_num][j] = pair(1, 0); 107 | } else { 108 | action[row_num][j] = pair(2, 0); 109 | } 110 | int k = i + 1; 111 | while (temp[k] != '\t') { 112 | k++; 113 | } 114 | if (temp[i] != 'A') { 115 | action[row_num][j].second = atoi(temp.substr(i + 1, k).c_str()); 116 | } 117 | i = k; 118 | } 119 | } 120 | } 121 | file.close(); 122 | skip = 0; 123 | } 124 | 125 | /* 读入GotoTable*/ 126 | void readGoto(string file_path, int goton[INIT_LEN][INIT_LEN]) { 127 | ifstream file(file_path); 128 | string temp; 129 | if (file.is_open() == false) { 130 | cout << "ERROR: failed to open the file" << endl; 131 | return; 132 | } 133 | while (getline(file, temp)) { 134 | if (skip == 0) { 135 | skip++; 136 | continue; 137 | } 138 | int row_num_pos = temp.find_first_of('\t'); 139 | int row_num = atoi(temp.substr(0, row_num_pos).c_str()); 140 | int j = 0; 141 | for (int i = row_num_pos + 1; i < temp.size();) { 142 | if (temp[i] == '\t') { 143 | goton[row_num][(++j)+1] = 0; 144 | i++; 145 | } else { 146 | int k = i + 1; 147 | while (temp[k] != '\t') { 148 | k++; 149 | } 150 | goton[row_num][j+1] = atoi(temp.substr(i, k).c_str()); 151 | i = k; 152 | } 153 | } 154 | } 155 | file.close(); 156 | skip = 0; 157 | for (int k=0; k<21; k++){ 158 | goton[k][0] = 0; 159 | } 160 | } 161 | 162 | void readInput(string file_path){ 163 | // 备份cin和cout的默认buf 164 | streambuf *cin_backup; 165 | cin_backup = cin.rdbuf(); 166 | 167 | // 打开要参与重定向的文件 168 | fstream in; 169 | in.open(INPUT_FILE_PATH, ios::in); 170 | if (in.fail()) 171 | return; 172 | 173 | // 将input_file.txt内容重定向到cin 174 | cin.rdbuf(in.rdbuf()); 175 | 176 | // 读入产生式个数 177 | cin >> grammar.num; 178 | 179 | // 读入产生式 180 | string s; 181 | for (int i = 0; i < grammar.num; i++) { 182 | cin >> s; 183 | Production tmp; 184 | tmp.left = s[0]; 185 | for (int j = 3; j < s.size(); j++) { 186 | tmp.rights.push_back(s[j]); 187 | } 188 | grammar.prods.push_back(tmp); 189 | } 190 | 191 | char ch; 192 | // 读入终结字符 193 | cin >> ch; 194 | while (ch != '#') { 195 | grammar.T.push_back(ch); 196 | cin >> ch; 197 | } 198 | // 把$当作终结符 199 | grammar.T.push_back('$'); 200 | 201 | // 读入非终结字符 202 | cin >> ch; 203 | while (ch != '#') { 204 | grammar.N.push_back(ch); 205 | cin >> ch; 206 | } 207 | 208 | // 入待分析串并初始化分析栈 209 | cin >> str; 210 | str += '$'; 211 | ST.push(pair(0, '-')); 212 | 213 | cin.rdbuf(cin_backup); 214 | 215 | } 216 | 217 | /* 根据读入文件初始化数据结构 */ 218 | void initGrammar() 219 | { 220 | readInput(INPUT_FILE_PATH); 221 | readAction(ACTION_TABLE_PATH, action); 222 | readGoto(GOTO_TABLE_PATH, goton); 223 | } 224 | 225 | 226 | /* 语法分析程序 */ 227 | void grammaticalAnalysis() 228 | { 229 | 230 | // 备份cout的默认buf 231 | streambuf *cout_backup; 232 | cout_backup = cout.rdbuf(); 233 | 234 | // 打开要参与重定向的文件 235 | fstream out; 236 | out.open(OUTPUT_FILE_PATH, ios::out); 237 | if (out.fail()) 238 | return ; 239 | 240 | // 将cout重定向到output_file.txt 241 | cout.rdbuf(out.rdbuf()); 242 | 243 | // 语法分析算法 244 | int ip = 0; 245 | do { 246 | int s = ST.top().first; // 当前状态 247 | char a = str[ip]; // 缓冲区读入的字符 248 | int j = isInT(a) - 1; // 若是终结字符,返回 249 | 250 | if (action[s][j].first == 1) { // 移进 251 | ST.push(pair(action[s][j].second, a)); 252 | ip = ip + 1; 253 | } else if (action[s][j].first == 2) { // 规约 254 | Production &P = grammar.prods[action[s][j].second]; 255 | // 弹出并输出产生式 256 | cout << P.left << "->"; 257 | for (int i = 0; i < P.rights.size(); i++) { 258 | ST.pop(); 259 | cout << P.rights[i]; 260 | } 261 | cout << endl; 262 | s = ST.top().first; 263 | char A = P.left; 264 | j = isInN(A) - 1; 265 | ST.push(pair(goton[s][j], A)); 266 | } else if (action[s][j].first == 3) { //接受 267 | Production &P = grammar.prods[action[s][j].second]; 268 | // 输出产生式 269 | cout << P.left << "->"; 270 | for (int i = 0; i < P.rights.size(); i++) { 271 | ST.pop(); 272 | cout << P.rights[i]; 273 | } 274 | cout << endl; 275 | break; 276 | } else { 277 | cout << "error" << endl; 278 | } 279 | 280 | } while(1); 281 | 282 | cout.rdbuf(cout_backup); 283 | 284 | } 285 | 286 | int main() 287 | { 288 | initGrammar(); 289 | grammaticalAnalysis(); 290 | return 0; 291 | } -------------------------------------------------------------------------------- /lab2/output_file.txt: -------------------------------------------------------------------------------- 1 | F->a 2 | T->F 3 | A->T 4 | F->a 5 | T->F 6 | F->a 7 | T->T*F 8 | A->A+T 9 | S->A 10 | -------------------------------------------------------------------------------- /lab3/.idea/lab3.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lab3/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /lab3/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lab3/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | 35 | 36 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 108 | 109 | 110 | 111 | 112 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 1607620469437 123 | 128 | 129 | 130 | 131 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /lab4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(lab4) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | add_executable(lab4 main.cpp) -------------------------------------------------------------------------------- /lab4/action_table.txt: -------------------------------------------------------------------------------- 1 | + - * / = ( ) a $ 2 | 0 S1 S2 3 | 1 S5 S6 4 | 2 R9 5 | 3 ACC 6 | 4 S10 7 | 5 S5 S6 8 | 6 R9 R9 R9 R9 R9 9 | 7 S12 S13 S14 10 | 8 R4 R4 S15 S16 R4 11 | 9 R7 R7 R7 R7 R7 12 | 10 S17 S18 13 | 11 S12 S13 S22 14 | 12 S5 S6 15 | 13 S5 S6 16 | 14 R8 17 | 15 S5 S6 18 | 16 S5 S6 19 | 17 S5 S6 20 | 18 R9 R9 R9 R9 R9 21 | 19 S28 S29 R1 22 | 20 R4 R4 S30 S31 R4 23 | 21 R7 R7 R7 R7 R7 24 | 22 R8 R8 R8 R8 R8 25 | 23 R2 R2 S15 S16 R2 26 | 24 R3 R3 S15 S16 R3 27 | 25 R5 R5 R5 R5 R5 28 | 26 R6 R6 R6 R6 R6 29 | 27 S12 S13 S32 30 | 28 S17 S18 31 | 29 S17 S18 32 | 30 S17 S18 33 | 31 S17 S18 34 | 32 R8 R8 R8 R8 R8 35 | 33 R2 R2 S30 S31 R2 36 | 34 R3 R3 S30 S31 R3 37 | 35 R5 R5 R5 R5 R5 38 | 36 R6 R6 R6 R6 R6 -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/3.14.2/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/Library/Developer/CommandLineTools/usr/bin/cc") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "AppleClang") 4 | set(CMAKE_C_COMPILER_VERSION "10.0.0.10001044") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") 8 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") 9 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 10 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 11 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 12 | 13 | set(CMAKE_C_PLATFORM_ID "Darwin") 14 | set(CMAKE_C_SIMULATE_ID "") 15 | set(CMAKE_C_SIMULATE_VERSION "") 16 | 17 | 18 | 19 | set(CMAKE_AR "/Library/Developer/CommandLineTools/usr/bin/ar") 20 | set(CMAKE_C_COMPILER_AR "") 21 | set(CMAKE_RANLIB "/Library/Developer/CommandLineTools/usr/bin/ranlib") 22 | set(CMAKE_C_COMPILER_RANLIB "") 23 | set(CMAKE_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld") 24 | set(CMAKE_MT "") 25 | set(CMAKE_COMPILER_IS_GNUCC ) 26 | set(CMAKE_C_COMPILER_LOADED 1) 27 | set(CMAKE_C_COMPILER_WORKS TRUE) 28 | set(CMAKE_C_ABI_COMPILED TRUE) 29 | set(CMAKE_COMPILER_IS_MINGW ) 30 | set(CMAKE_COMPILER_IS_CYGWIN ) 31 | if(CMAKE_COMPILER_IS_CYGWIN) 32 | set(CYGWIN 1) 33 | set(UNIX 1) 34 | endif() 35 | 36 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 37 | 38 | if(CMAKE_COMPILER_IS_MINGW) 39 | set(MINGW 1) 40 | endif() 41 | set(CMAKE_C_COMPILER_ID_RUN 1) 42 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 43 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 44 | set(CMAKE_C_LINKER_PREFERENCE 10) 45 | 46 | # Save compiler ABI information. 47 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 48 | set(CMAKE_C_COMPILER_ABI "") 49 | set(CMAKE_C_LIBRARY_ARCHITECTURE "") 50 | 51 | if(CMAKE_C_SIZEOF_DATA_PTR) 52 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 53 | endif() 54 | 55 | if(CMAKE_C_COMPILER_ABI) 56 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 57 | endif() 58 | 59 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 60 | set(CMAKE_LIBRARY_ARCHITECTURE "") 61 | endif() 62 | 63 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 64 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 65 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 66 | endif() 67 | 68 | 69 | 70 | 71 | 72 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include;/Library/Developer/CommandLineTools/usr/include;/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include") 73 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") 74 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib") 75 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks") 76 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/3.14.2/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/Library/Developer/CommandLineTools/usr/bin/c++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "AppleClang") 4 | set(CMAKE_CXX_COMPILER_VERSION "10.0.0.10001044") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") 8 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") 9 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 10 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 11 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 12 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 13 | set(CMAKE_CXX20_COMPILE_FEATURES "") 14 | 15 | set(CMAKE_CXX_PLATFORM_ID "Darwin") 16 | set(CMAKE_CXX_SIMULATE_ID "") 17 | set(CMAKE_CXX_SIMULATE_VERSION "") 18 | 19 | 20 | 21 | set(CMAKE_AR "/Library/Developer/CommandLineTools/usr/bin/ar") 22 | set(CMAKE_CXX_COMPILER_AR "") 23 | set(CMAKE_RANLIB "/Library/Developer/CommandLineTools/usr/bin/ranlib") 24 | set(CMAKE_CXX_COMPILER_RANLIB "") 25 | set(CMAKE_LINKER "/Library/Developer/CommandLineTools/usr/bin/ld") 26 | set(CMAKE_MT "") 27 | set(CMAKE_COMPILER_IS_GNUCXX ) 28 | set(CMAKE_CXX_COMPILER_LOADED 1) 29 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 30 | set(CMAKE_CXX_ABI_COMPILED TRUE) 31 | set(CMAKE_COMPILER_IS_MINGW ) 32 | set(CMAKE_COMPILER_IS_CYGWIN ) 33 | if(CMAKE_COMPILER_IS_CYGWIN) 34 | set(CYGWIN 1) 35 | set(UNIX 1) 36 | endif() 37 | 38 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 39 | 40 | if(CMAKE_COMPILER_IS_MINGW) 41 | set(MINGW 1) 42 | endif() 43 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 44 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 45 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP) 46 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 47 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 48 | 49 | # Save compiler ABI information. 50 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 51 | set(CMAKE_CXX_COMPILER_ABI "") 52 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") 53 | 54 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 55 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 56 | endif() 57 | 58 | if(CMAKE_CXX_COMPILER_ABI) 59 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 60 | endif() 61 | 62 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 63 | set(CMAKE_LIBRARY_ARCHITECTURE "") 64 | endif() 65 | 66 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 67 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 68 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 69 | endif() 70 | 71 | 72 | 73 | 74 | 75 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/Library/Developer/CommandLineTools/usr/include/c++/v1;/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include;/Library/Developer/CommandLineTools/usr/include;/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include") 76 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") 77 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib") 78 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks") 79 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/3.14.2/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab4/cmake-build-debug/CMakeFiles/3.14.2/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/3.14.2/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab4/cmake-build-debug/CMakeFiles/3.14.2/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/3.14.2/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Darwin-18.2.0") 2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin") 3 | set(CMAKE_HOST_SYSTEM_VERSION "18.2.0") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Darwin-18.2.0") 9 | set(CMAKE_SYSTEM_NAME "Darwin") 10 | set(CMAKE_SYSTEM_VERSION "18.2.0") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/3.14.2/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab4/cmake-build-debug/CMakeFiles/3.14.2/CompilerIdC/a.out -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/3.14.2/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab4/cmake-build-debug/CMakeFiles/3.14.2/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/DWL/Desktop/projects/lab4") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/DWL/Desktop/projects/lab4/cmake-build-debug") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # The main recursive all target 10 | all: 11 | 12 | .PHONY : all 13 | 14 | # The main recursive preinstall target 15 | preinstall: 16 | 17 | .PHONY : preinstall 18 | 19 | # The main recursive clean target 20 | clean: 21 | 22 | .PHONY : clean 23 | 24 | #============================================================================= 25 | # Special targets provided by cmake. 26 | 27 | # Disable implicit rules so canonical targets will work. 28 | .SUFFIXES: 29 | 30 | 31 | # Remove some rules from gmake that .SUFFIXES does not remove. 32 | SUFFIXES = 33 | 34 | .SUFFIXES: .hpux_make_needs_suffix_list 35 | 36 | 37 | # Suppress display of executed commands. 38 | $(VERBOSE).SILENT: 39 | 40 | 41 | # A target that is always out of date. 42 | cmake_force: 43 | 44 | .PHONY : cmake_force 45 | 46 | #============================================================================= 47 | # Set environment variables for the build. 48 | 49 | # The shell in which to execute make rules. 50 | SHELL = /bin/sh 51 | 52 | # The CMake executable. 53 | CMAKE_COMMAND = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake 54 | 55 | # The command to remove a file. 56 | RM = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E remove -f 57 | 58 | # Escaping for special characters. 59 | EQUALS = = 60 | 61 | # The top-level source directory on which CMake was run. 62 | CMAKE_SOURCE_DIR = /Users/DWL/Desktop/projects/lab4 63 | 64 | # The top-level build directory on which CMake was run. 65 | CMAKE_BINARY_DIR = /Users/DWL/Desktop/projects/lab4/cmake-build-debug 66 | 67 | #============================================================================= 68 | # Target rules for target CMakeFiles/lab4.dir 69 | 70 | # All Build rule for target. 71 | CMakeFiles/lab4.dir/all: 72 | $(MAKE) -f CMakeFiles/lab4.dir/build.make CMakeFiles/lab4.dir/depend 73 | $(MAKE) -f CMakeFiles/lab4.dir/build.make CMakeFiles/lab4.dir/build 74 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles --progress-num=1,2 "Built target lab4" 75 | .PHONY : CMakeFiles/lab4.dir/all 76 | 77 | # Include target in all. 78 | all: CMakeFiles/lab4.dir/all 79 | 80 | .PHONY : all 81 | 82 | # Build rule for subdir invocation for target. 83 | CMakeFiles/lab4.dir/rule: cmake_check_build_system 84 | $(CMAKE_COMMAND) -E cmake_progress_start /Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles 2 85 | $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/lab4.dir/all 86 | $(CMAKE_COMMAND) -E cmake_progress_start /Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles 0 87 | .PHONY : CMakeFiles/lab4.dir/rule 88 | 89 | # Convenience name for target. 90 | lab4: CMakeFiles/lab4.dir/rule 91 | 92 | .PHONY : lab4 93 | 94 | # clean rule for target. 95 | CMakeFiles/lab4.dir/clean: 96 | $(MAKE) -f CMakeFiles/lab4.dir/build.make CMakeFiles/lab4.dir/clean 97 | .PHONY : CMakeFiles/lab4.dir/clean 98 | 99 | # clean rule for target. 100 | clean: CMakeFiles/lab4.dir/clean 101 | 102 | .PHONY : clean 103 | 104 | #============================================================================= 105 | # Special targets to cleanup operation of make. 106 | 107 | # Special rule to run CMake to check the build system integrity. 108 | # No rule that depends on this can have commands that come from listfiles 109 | # because they might be regenerated. 110 | cmake_check_build_system: 111 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 112 | .PHONY : cmake_check_build_system 113 | 114 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles/rebuild_cache.dir 2 | /Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles/edit_cache.dir 3 | /Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles/lab4.dir 4 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/clion-environment.txt: -------------------------------------------------------------------------------- 1 | ToolSet: 1.0 (local)Options: 2 | 3 | Options: -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/clion-log.txt: -------------------------------------------------------------------------------- 1 | /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/DWL/Desktop/projects/lab4 2 | -- The C compiler identification is AppleClang 10.0.0.10001044 3 | -- The CXX compiler identification is AppleClang 10.0.0.10001044 4 | -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc 5 | -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works 6 | -- Detecting C compiler ABI info 7 | -- Detecting C compiler ABI info - done 8 | -- Detecting C compile features 9 | -- Detecting C compile features - done 10 | -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ 11 | -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works 12 | -- Detecting CXX compiler ABI info 13 | -- Detecting CXX compiler ABI info - done 14 | -- Detecting CXX compile features 15 | -- Detecting CXX compile features - done 16 | -- Configuring done 17 | -- Generating done 18 | -- Build files have been written to: /Users/DWL/Desktop/projects/lab4/cmake-build-debug 19 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab4/cmake-build-debug/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/feature_tests.c: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "C_FEATURE:" 4 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "c_function_prototypes\n" 10 | "C_FEATURE:" 11 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "c_restrict\n" 17 | "C_FEATURE:" 18 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "c_static_assert\n" 24 | "C_FEATURE:" 25 | #if ((__clang_major__ * 100) + __clang_minor__) >= 400 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "c_variadic_macros\n" 31 | 32 | }; 33 | 34 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 35 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | /Users/DWL/Desktop/projects/lab4/main.cpp 10 | cstdio 11 | - 12 | vector 13 | - 14 | string 15 | - 16 | iostream 17 | - 18 | fstream 19 | - 20 | map 21 | - 22 | set 23 | - 24 | stack 25 | - 26 | queue 27 | - 28 | sstream 29 | - 30 | 31 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/Users/DWL/Desktop/projects/lab4/main.cpp" "/Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles/lab4.dir/main.cpp.o" 8 | ) 9 | set(CMAKE_CXX_COMPILER_ID "AppleClang") 10 | 11 | # The include file search paths: 12 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 13 | ) 14 | 15 | # Targets to which this target links. 16 | set(CMAKE_TARGET_LINKED_INFO_FILES 17 | ) 18 | 19 | # Fortran module output directory. 20 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 21 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /Users/DWL/Desktop/projects/lab4 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /Users/DWL/Desktop/projects/lab4/cmake-build-debug 50 | 51 | # Include any dependencies generated for this target. 52 | include CMakeFiles/lab4.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include CMakeFiles/lab4.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include CMakeFiles/lab4.dir/flags.make 59 | 60 | CMakeFiles/lab4.dir/main.cpp.o: CMakeFiles/lab4.dir/flags.make 61 | CMakeFiles/lab4.dir/main.cpp.o: ../main.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/lab4.dir/main.cpp.o" 63 | /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/lab4.dir/main.cpp.o -c /Users/DWL/Desktop/projects/lab4/main.cpp 64 | 65 | CMakeFiles/lab4.dir/main.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/lab4.dir/main.cpp.i" 67 | /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /Users/DWL/Desktop/projects/lab4/main.cpp > CMakeFiles/lab4.dir/main.cpp.i 68 | 69 | CMakeFiles/lab4.dir/main.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/lab4.dir/main.cpp.s" 71 | /Library/Developer/CommandLineTools/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /Users/DWL/Desktop/projects/lab4/main.cpp -o CMakeFiles/lab4.dir/main.cpp.s 72 | 73 | # Object files for target lab4 74 | lab4_OBJECTS = \ 75 | "CMakeFiles/lab4.dir/main.cpp.o" 76 | 77 | # External object files for target lab4 78 | lab4_EXTERNAL_OBJECTS = 79 | 80 | lab4: CMakeFiles/lab4.dir/main.cpp.o 81 | lab4: CMakeFiles/lab4.dir/build.make 82 | lab4: CMakeFiles/lab4.dir/link.txt 83 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable lab4" 84 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/lab4.dir/link.txt --verbose=$(VERBOSE) 85 | 86 | # Rule to build all files generated by this target. 87 | CMakeFiles/lab4.dir/build: lab4 88 | 89 | .PHONY : CMakeFiles/lab4.dir/build 90 | 91 | CMakeFiles/lab4.dir/clean: 92 | $(CMAKE_COMMAND) -P CMakeFiles/lab4.dir/cmake_clean.cmake 93 | .PHONY : CMakeFiles/lab4.dir/clean 94 | 95 | CMakeFiles/lab4.dir/depend: 96 | cd /Users/DWL/Desktop/projects/lab4/cmake-build-debug && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/DWL/Desktop/projects/lab4 /Users/DWL/Desktop/projects/lab4 /Users/DWL/Desktop/projects/lab4/cmake-build-debug /Users/DWL/Desktop/projects/lab4/cmake-build-debug /Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles/lab4.dir/DependInfo.cmake --color=$(COLOR) 97 | .PHONY : CMakeFiles/lab4.dir/depend 98 | 99 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/lab4.dir/main.cpp.o" 3 | "lab4.pdb" 4 | "lab4" 5 | ) 6 | 7 | # Per-language clean rules from dependency scanning. 8 | foreach(lang CXX) 9 | include(CMakeFiles/lab4.dir/cmake_clean_${lang}.cmake OPTIONAL) 10 | endforeach() 11 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | CMakeFiles/lab4.dir/main.cpp.o 5 | /Users/DWL/Desktop/projects/lab4/main.cpp 6 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | CMakeFiles/lab4.dir/main.cpp.o: ../main.cpp 5 | 6 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # compile CXX with /Library/Developer/CommandLineTools/usr/bin/c++ 5 | CXX_FLAGS = -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -std=gnu++14 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = 10 | 11 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/link.txt: -------------------------------------------------------------------------------- 1 | /Library/Developer/CommandLineTools/usr/bin/c++ -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/lab4.dir/main.cpp.o -o lab4 2 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/main.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab4/cmake-build-debug/CMakeFiles/lab4.dir/main.cpp.o -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/lab4.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | 4 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.14 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Remove some rules from gmake that .SUFFIXES does not remove. 21 | SUFFIXES = 22 | 23 | .SUFFIXES: .hpux_make_needs_suffix_list 24 | 25 | 26 | # Suppress display of executed commands. 27 | $(VERBOSE).SILENT: 28 | 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | 33 | .PHONY : cmake_force 34 | 35 | #============================================================================= 36 | # Set environment variables for the build. 37 | 38 | # The shell in which to execute make rules. 39 | SHELL = /bin/sh 40 | 41 | # The CMake executable. 42 | CMAKE_COMMAND = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake 43 | 44 | # The command to remove a file. 45 | RM = /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E remove -f 46 | 47 | # Escaping for special characters. 48 | EQUALS = = 49 | 50 | # The top-level source directory on which CMake was run. 51 | CMAKE_SOURCE_DIR = /Users/DWL/Desktop/projects/lab4 52 | 53 | # The top-level build directory on which CMake was run. 54 | CMAKE_BINARY_DIR = /Users/DWL/Desktop/projects/lab4/cmake-build-debug 55 | 56 | #============================================================================= 57 | # Targets provided globally by CMake. 58 | 59 | # Special rule for the target rebuild_cache 60 | rebuild_cache: 61 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 62 | /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 63 | .PHONY : rebuild_cache 64 | 65 | # Special rule for the target rebuild_cache 66 | rebuild_cache/fast: rebuild_cache 67 | 68 | .PHONY : rebuild_cache/fast 69 | 70 | # Special rule for the target edit_cache 71 | edit_cache: 72 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 73 | /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 74 | .PHONY : edit_cache 75 | 76 | # Special rule for the target edit_cache 77 | edit_cache/fast: edit_cache 78 | 79 | .PHONY : edit_cache/fast 80 | 81 | # The main all target 82 | all: cmake_check_build_system 83 | $(CMAKE_COMMAND) -E cmake_progress_start /Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles /Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles/progress.marks 84 | $(MAKE) -f CMakeFiles/Makefile2 all 85 | $(CMAKE_COMMAND) -E cmake_progress_start /Users/DWL/Desktop/projects/lab4/cmake-build-debug/CMakeFiles 0 86 | .PHONY : all 87 | 88 | # The main clean target 89 | clean: 90 | $(MAKE) -f CMakeFiles/Makefile2 clean 91 | .PHONY : clean 92 | 93 | # The main clean target 94 | clean/fast: clean 95 | 96 | .PHONY : clean/fast 97 | 98 | # Prepare targets for installation. 99 | preinstall: all 100 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 101 | .PHONY : preinstall 102 | 103 | # Prepare targets for installation. 104 | preinstall/fast: 105 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 106 | .PHONY : preinstall/fast 107 | 108 | # clear depends 109 | depend: 110 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 111 | .PHONY : depend 112 | 113 | #============================================================================= 114 | # Target rules for targets named lab4 115 | 116 | # Build rule for target. 117 | lab4: cmake_check_build_system 118 | $(MAKE) -f CMakeFiles/Makefile2 lab4 119 | .PHONY : lab4 120 | 121 | # fast build rule for target. 122 | lab4/fast: 123 | $(MAKE) -f CMakeFiles/lab4.dir/build.make CMakeFiles/lab4.dir/build 124 | .PHONY : lab4/fast 125 | 126 | main.o: main.cpp.o 127 | 128 | .PHONY : main.o 129 | 130 | # target to build an object file 131 | main.cpp.o: 132 | $(MAKE) -f CMakeFiles/lab4.dir/build.make CMakeFiles/lab4.dir/main.cpp.o 133 | .PHONY : main.cpp.o 134 | 135 | main.i: main.cpp.i 136 | 137 | .PHONY : main.i 138 | 139 | # target to preprocess a source file 140 | main.cpp.i: 141 | $(MAKE) -f CMakeFiles/lab4.dir/build.make CMakeFiles/lab4.dir/main.cpp.i 142 | .PHONY : main.cpp.i 143 | 144 | main.s: main.cpp.s 145 | 146 | .PHONY : main.s 147 | 148 | # target to generate assembly for a file 149 | main.cpp.s: 150 | $(MAKE) -f CMakeFiles/lab4.dir/build.make CMakeFiles/lab4.dir/main.cpp.s 151 | .PHONY : main.cpp.s 152 | 153 | # Help Target 154 | help: 155 | @echo "The following are some of the valid targets for this Makefile:" 156 | @echo "... all (the default if no target is provided)" 157 | @echo "... clean" 158 | @echo "... depend" 159 | @echo "... rebuild_cache" 160 | @echo "... edit_cache" 161 | @echo "... lab4" 162 | @echo "... main.o" 163 | @echo "... main.i" 164 | @echo "... main.s" 165 | .PHONY : help 166 | 167 | 168 | 169 | #============================================================================= 170 | # Special targets to cleanup operation of make. 171 | 172 | # Special rule to run CMake to check the build system integrity. 173 | # No rule that depends on this can have commands that come from listfiles 174 | # because they might be regenerated. 175 | cmake_check_build_system: 176 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 177 | .PHONY : cmake_check_build_system 178 | 179 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /Users/DWL/Desktop/projects/lab4 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Is this installation the result of a crosscompile? 31 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 32 | set(CMAKE_CROSSCOMPILING "FALSE") 33 | endif() 34 | 35 | if(CMAKE_INSTALL_COMPONENT) 36 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 37 | else() 38 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 39 | endif() 40 | 41 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 42 | "${CMAKE_INSTALL_MANIFEST_FILES}") 43 | file(WRITE "/Users/DWL/Desktop/projects/lab4/cmake-build-debug/${CMAKE_INSTALL_MANIFEST}" 44 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 45 | -------------------------------------------------------------------------------- /lab4/cmake-build-debug/lab4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeilingDu/HITsz-Compilation-Principle-Project/705556165e2a69340c8374798a55f02f2de359ea/lab4/cmake-build-debug/lab4 -------------------------------------------------------------------------------- /lab4/cmake-build-debug/lab4.cbp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 90 | 91 | -------------------------------------------------------------------------------- /lab4/goto_table.txt: -------------------------------------------------------------------------------- 1 | A B T F 2 | 0 3 4 3 | 1 7 8 9 4 | 2 5 | 3 6 | 4 7 | 5 11 8 9 8 | 6 9 | 7 10 | 8 11 | 9 12 | 10 19 20 21 13 | 11 14 | 12 23 9 15 | 13 24 9 16 | 14 17 | 15 25 18 | 16 26 19 | 17 27 8 9 20 | 18 21 | 19 22 | 20 23 | 21 24 | 22 25 | 23 26 | 24 27 | 25 28 | 26 29 | 27 30 | 28 33 21 31 | 29 34 21 32 | 30 35 33 | 31 36 34 | 32 35 | 33 36 | 34 37 | 35 38 | 36 -------------------------------------------------------------------------------- /lab4/input_file.txt: -------------------------------------------------------------------------------- 1 | 10 2 | S->A 3 | A->F=B 4 | B->B+T 5 | B->B-T 6 | B->T 7 | T->T*F 8 | T->T/F 9 | T->F 10 | F->(B) 11 | F->a 12 | + - * / = ( ) a # 13 | S A B T F # 14 | d=(a-b)+(a-c)+(a-c)$ 15 | 16 | -------------------------------------------------------------------------------- /lab4/output_file.txt: -------------------------------------------------------------------------------- 1 | ************* 三地址码 ********** 2 | t1 = a - b 3 | t2 = a - c 4 | t3 = t1 + t2 5 | t4 = a - c 6 | t5 = t3 + t4 7 | d = t5 8 | ************* 三地址码的四元式表示 ********** 9 | op arg1 arg2 result 10 | 2 a b t1 11 | 2 a c t2 12 | 1 t1 t2 t3 13 | 2 a c t4 14 | 1 t3 t4 t5 15 | 0 t5 d 16 | ************* 符号表 ********** 17 | 名字 符号种类 类型 地址 扩展属性指针 18 | c 变量 int 0 NULL 19 | b 变量 int 4 NULL 20 | a 变量 int 8 NULL 21 | d 变量 int 12 NULL 22 | -------------------------------------------------------------------------------- /lab4/target_code_file.txt: -------------------------------------------------------------------------------- 1 | ************* 目标代码序列 ********** 2 | MOV a, R0 3 | SUB b, R0 4 | MOV R0, t1 5 | MOV a, R0 6 | SUB c, R0 7 | MOV R0, t2 8 | MOV t1, R0 9 | ADD t2, R0 10 | MOV R0, t3 11 | MOV a, R0 12 | SUB c, R0 13 | MOV R0, t4 14 | MOV t3, R0 15 | ADD t4, R0 16 | MOV R0, t5 17 | MOV t5, R0 18 | MOV R0, d 19 | --------------------------------------------------------------------------------