From 9bad0dfccedcc1cd71ee2579486f6729cb9d7749 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 28 Apr 2017 20:26:55 +0200 Subject: [PATCH] LexerParser: move to custom directory --- Source/.gitattributes | 18 --------- Source/CMakeLists.txt | 40 ++++++++++++++----- Source/LexerParser/.gitattributes | 17 ++++++++ .../cmCommandArgumentLexer.cxx | 0 .../cmCommandArgumentLexer.h | 0 .../cmCommandArgumentLexer.in.l | 0 .../cmCommandArgumentParser.cxx | 0 .../cmCommandArgumentParser.y | 1 - .../cmCommandArgumentParserTokens.h | 0 .../{ => LexerParser}/cmDependsJavaLexer.cxx | 0 Source/{ => LexerParser}/cmDependsJavaLexer.h | 0 .../{ => LexerParser}/cmDependsJavaLexer.in.l | 0 .../{ => LexerParser}/cmDependsJavaParser.cxx | 0 .../{ => LexerParser}/cmDependsJavaParser.y | 3 +- .../cmDependsJavaParserTokens.h | 0 Source/{ => LexerParser}/cmExprLexer.cxx | 0 Source/{ => LexerParser}/cmExprLexer.h | 0 Source/{ => LexerParser}/cmExprLexer.in.l | 0 Source/{ => LexerParser}/cmExprParser.cxx | 1 - Source/{ => LexerParser}/cmExprParser.y | 1 - Source/{ => LexerParser}/cmExprParserTokens.h | 0 Source/{ => LexerParser}/cmFortranLexer.cxx | 0 Source/{ => LexerParser}/cmFortranLexer.h | 0 Source/{ => LexerParser}/cmFortranLexer.in.l | 0 Source/{ => LexerParser}/cmFortranParser.cxx | 0 Source/{ => LexerParser}/cmFortranParser.y | 0 .../{ => LexerParser}/cmFortranParserTokens.h | 0 Source/{ => LexerParser}/cmListFileLexer.c | 0 Source/{ => LexerParser}/cmListFileLexer.in.l | 0 bootstrap | 25 ++++++++---- 30 files changed, 65 insertions(+), 41 deletions(-) create mode 100644 Source/LexerParser/.gitattributes rename Source/{ => LexerParser}/cmCommandArgumentLexer.cxx (100%) rename Source/{ => LexerParser}/cmCommandArgumentLexer.h (100%) rename Source/{ => LexerParser}/cmCommandArgumentLexer.in.l (100%) rename Source/{ => LexerParser}/cmCommandArgumentParser.cxx (100%) rename Source/{ => LexerParser}/cmCommandArgumentParser.y (99%) rename Source/{ => LexerParser}/cmCommandArgumentParserTokens.h (100%) rename Source/{ => LexerParser}/cmDependsJavaLexer.cxx (100%) rename Source/{ => LexerParser}/cmDependsJavaLexer.h (100%) rename Source/{ => LexerParser}/cmDependsJavaLexer.in.l (100%) rename Source/{ => LexerParser}/cmDependsJavaParser.cxx (100%) rename Source/{ => LexerParser}/cmDependsJavaParser.y (99%) rename Source/{ => LexerParser}/cmDependsJavaParserTokens.h (100%) rename Source/{ => LexerParser}/cmExprLexer.cxx (100%) rename Source/{ => LexerParser}/cmExprLexer.h (100%) rename Source/{ => LexerParser}/cmExprLexer.in.l (100%) rename Source/{ => LexerParser}/cmExprParser.cxx (99%) rename Source/{ => LexerParser}/cmExprParser.y (99%) rename Source/{ => LexerParser}/cmExprParserTokens.h (100%) rename Source/{ => LexerParser}/cmFortranLexer.cxx (100%) rename Source/{ => LexerParser}/cmFortranLexer.h (100%) rename Source/{ => LexerParser}/cmFortranLexer.in.l (100%) rename Source/{ => LexerParser}/cmFortranParser.cxx (100%) rename Source/{ => LexerParser}/cmFortranParser.y (100%) rename Source/{ => LexerParser}/cmFortranParserTokens.h (100%) rename Source/{ => LexerParser}/cmListFileLexer.c (100%) rename Source/{ => LexerParser}/cmListFileLexer.in.l (100%) diff --git a/Source/.gitattributes b/Source/.gitattributes index f69ad9d357..0f829a368d 100644 --- a/Source/.gitattributes +++ b/Source/.gitattributes @@ -1,20 +1,2 @@ -/cmCommandArgumentLexer.cxx generated -/cmCommandArgumentLexer.h generated -/cmCommandArgumentParser.cxx generated -/cmCommandArgumentParserTokens.h generated -/cmDependsJavaLexer.cxx generated -/cmDependsJavaLexer.h generated -/cmDependsJavaParser.cxx generated -/cmDependsJavaParserTokens.h generated -/cmExprLexer.cxx generated -/cmExprLexer.h generated -/cmExprParser.cxx generated -/cmExprParserTokens.h generated -/cmFortranLexer.cxx generated -/cmFortranLexer.h generated -/cmFortranParser.cxx generated -/cmFortranParserTokens.h generated -/cmListFileLexer.c generated - # Do not format third-party sources. /kwsys/** -format.clang-format diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 7c72a114cf..1ea75bf7af 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -78,6 +78,7 @@ configure_file( include_directories( "${CMake_BINARY_DIR}/Source" "${CMake_SOURCE_DIR}/Source" + "${CMake_SOURCE_DIR}/Source/LexerParser" ${CMAKE_ZLIB_INCLUDES} ${CMAKE_EXPAT_INCLUDES} ${CMAKE_TAR_INCLUDES} @@ -102,14 +103,40 @@ endif() # Sources for CMakeLib # set(SRCS + # Lexers/Parsers + LexerParser/cmCommandArgumentLexer.cxx + LexerParser/cmCommandArgumentLexer.h + LexerParser/cmCommandArgumentLexer.in.l + LexerParser/cmCommandArgumentParser.cxx + LexerParser/cmCommandArgumentParserTokens.h + LexerParser/cmCommandArgumentParser.y + LexerParser/cmDependsJavaLexer.cxx + LexerParser/cmDependsJavaLexer.h + LexerParser/cmDependsJavaLexer.in.l + LexerParser/cmDependsJavaParser.cxx + LexerParser/cmDependsJavaParserTokens.h + LexerParser/cmDependsJavaParser.y + LexerParser/cmExprLexer.cxx + LexerParser/cmExprLexer.h + LexerParser/cmExprLexer.in.l + LexerParser/cmExprParser.cxx + LexerParser/cmExprParserTokens.h + LexerParser/cmExprParser.y + LexerParser/cmFortranLexer.cxx + LexerParser/cmFortranLexer.h + LexerParser/cmFortranLexer.in.l + LexerParser/cmFortranParser.cxx + LexerParser/cmFortranParserTokens.h + LexerParser/cmFortranParser.y + LexerParser/cmListFileLexer.c + LexerParser/cmListFileLexer.in.l + cmArchiveWrite.cxx cmBase32.cxx cmCacheManager.cxx cmCacheManager.h cmCLocaleEnvironmentScope.h cmCLocaleEnvironmentScope.cxx - cmCommandArgumentLexer.cxx - cmCommandArgumentParser.cxx cmCommandArgumentParserHelper.cxx cmCommonTargetGenerator.cxx cmCommonTargetGenerator.h @@ -141,8 +168,6 @@ set(SRCS cmDependsFortran.h cmDependsJava.cxx cmDependsJava.h - cmDependsJavaLexer.cxx - cmDependsJavaParser.cxx cmDependsJavaParserHelper.cxx cmDependsJavaParserHelper.h cmDocumentation.cxx @@ -151,8 +176,6 @@ set(SRCS cmDynamicLoader.cxx cmDynamicLoader.h ${ELF_SRCS} - cmExprLexer.cxx - cmExprParser.cxx cmExprParserHelper.cxx cmExportBuildAndroidMKGenerator.h cmExportBuildAndroidMKGenerator.cxx @@ -192,10 +215,6 @@ set(SRCS cmFilePathChecksum.h cmFileTimeComparison.cxx cmFileTimeComparison.h - cmFortranLexer.cxx - cmFortranLexer.h - cmFortranParser.cxx - cmFortranParser.h cmFortranParserImpl.cxx cmGeneratedFileStream.cxx cmGeneratorExpressionContext.cxx @@ -247,7 +266,6 @@ set(SRCS cmLinkLineDeviceComputer.h cmListFileCache.cxx cmListFileCache.h - cmListFileLexer.c cmLocalCommonGenerator.cxx cmLocalCommonGenerator.h cmLocalGenerator.cxx diff --git a/Source/LexerParser/.gitattributes b/Source/LexerParser/.gitattributes new file mode 100644 index 0000000000..47eedfb4bd --- /dev/null +++ b/Source/LexerParser/.gitattributes @@ -0,0 +1,17 @@ +/cmCommandArgumentLexer.cxx generated +/cmCommandArgumentLexer.h generated +/cmCommandArgumentParser.cxx generated +/cmCommandArgumentParserTokens.h generated +/cmDependsJavaLexer.cxx generated +/cmDependsJavaLexer.h generated +/cmDependsJavaParser.cxx generated +/cmDependsJavaParserTokens.h generated +/cmExprLexer.cxx generated +/cmExprLexer.h generated +/cmExprParser.cxx generated +/cmExprParserTokens.h generated +/cmFortranLexer.cxx generated +/cmFortranLexer.h generated +/cmFortranParser.cxx generated +/cmFortranParserTokens.h generated +/cmListFileLexer.c generated diff --git a/Source/cmCommandArgumentLexer.cxx b/Source/LexerParser/cmCommandArgumentLexer.cxx similarity index 100% rename from Source/cmCommandArgumentLexer.cxx rename to Source/LexerParser/cmCommandArgumentLexer.cxx diff --git a/Source/cmCommandArgumentLexer.h b/Source/LexerParser/cmCommandArgumentLexer.h similarity index 100% rename from Source/cmCommandArgumentLexer.h rename to Source/LexerParser/cmCommandArgumentLexer.h diff --git a/Source/cmCommandArgumentLexer.in.l b/Source/LexerParser/cmCommandArgumentLexer.in.l similarity index 100% rename from Source/cmCommandArgumentLexer.in.l rename to Source/LexerParser/cmCommandArgumentLexer.in.l diff --git a/Source/cmCommandArgumentParser.cxx b/Source/LexerParser/cmCommandArgumentParser.cxx similarity index 100% rename from Source/cmCommandArgumentParser.cxx rename to Source/LexerParser/cmCommandArgumentParser.cxx diff --git a/Source/cmCommandArgumentParser.y b/Source/LexerParser/cmCommandArgumentParser.y similarity index 99% rename from Source/cmCommandArgumentParser.y rename to Source/LexerParser/cmCommandArgumentParser.y index d6c83124e2..55a88dffa3 100644 --- a/Source/cmCommandArgumentParser.y +++ b/Source/LexerParser/cmCommandArgumentParser.y @@ -189,4 +189,3 @@ void cmCommandArgument_yyerror(yyscan_t yyscanner, const char* message) { yyGetParser->Error(message); } - diff --git a/Source/cmCommandArgumentParserTokens.h b/Source/LexerParser/cmCommandArgumentParserTokens.h similarity index 100% rename from Source/cmCommandArgumentParserTokens.h rename to Source/LexerParser/cmCommandArgumentParserTokens.h diff --git a/Source/cmDependsJavaLexer.cxx b/Source/LexerParser/cmDependsJavaLexer.cxx similarity index 100% rename from Source/cmDependsJavaLexer.cxx rename to Source/LexerParser/cmDependsJavaLexer.cxx diff --git a/Source/cmDependsJavaLexer.h b/Source/LexerParser/cmDependsJavaLexer.h similarity index 100% rename from Source/cmDependsJavaLexer.h rename to Source/LexerParser/cmDependsJavaLexer.h diff --git a/Source/cmDependsJavaLexer.in.l b/Source/LexerParser/cmDependsJavaLexer.in.l similarity index 100% rename from Source/cmDependsJavaLexer.in.l rename to Source/LexerParser/cmDependsJavaLexer.in.l diff --git a/Source/cmDependsJavaParser.cxx b/Source/LexerParser/cmDependsJavaParser.cxx similarity index 100% rename from Source/cmDependsJavaParser.cxx rename to Source/LexerParser/cmDependsJavaParser.cxx diff --git a/Source/cmDependsJavaParser.y b/Source/LexerParser/cmDependsJavaParser.y similarity index 99% rename from Source/cmDependsJavaParser.y rename to Source/LexerParser/cmDependsJavaParser.y index 1137f39016..f7eb228188 100644 --- a/Source/cmDependsJavaParser.y +++ b/Source/LexerParser/cmDependsJavaParser.y @@ -242,7 +242,7 @@ jp_DECIMALINTEGERLITERAL yyGetParser->SetCurrentCombine(""); } | -jp_HEXINTEGERLITERAL +jp_HEXINTEGERLITERAL { jpElementStart(1); jpCheckEmpty(1); @@ -3212,4 +3212,3 @@ void cmDependsJava_yyerror(yyscan_t yyscanner, const char* message) { yyGetParser->Error(message); } - diff --git a/Source/cmDependsJavaParserTokens.h b/Source/LexerParser/cmDependsJavaParserTokens.h similarity index 100% rename from Source/cmDependsJavaParserTokens.h rename to Source/LexerParser/cmDependsJavaParserTokens.h diff --git a/Source/cmExprLexer.cxx b/Source/LexerParser/cmExprLexer.cxx similarity index 100% rename from Source/cmExprLexer.cxx rename to Source/LexerParser/cmExprLexer.cxx diff --git a/Source/cmExprLexer.h b/Source/LexerParser/cmExprLexer.h similarity index 100% rename from Source/cmExprLexer.h rename to Source/LexerParser/cmExprLexer.h diff --git a/Source/cmExprLexer.in.l b/Source/LexerParser/cmExprLexer.in.l similarity index 100% rename from Source/cmExprLexer.in.l rename to Source/LexerParser/cmExprLexer.in.l diff --git a/Source/cmExprParser.cxx b/Source/LexerParser/cmExprParser.cxx similarity index 99% rename from Source/cmExprParser.cxx rename to Source/LexerParser/cmExprParser.cxx index 19efca1f03..67664a5f5f 100644 --- a/Source/cmExprParser.cxx +++ b/Source/LexerParser/cmExprParser.cxx @@ -1696,4 +1696,3 @@ void cmExpr_yyerror(yyscan_t yyscanner, const char* message) { cmExpr_yyget_extra(yyscanner)->Error(message); } - diff --git a/Source/cmExprParser.y b/Source/LexerParser/cmExprParser.y similarity index 99% rename from Source/cmExprParser.y rename to Source/LexerParser/cmExprParser.y index 220f7c8e4c..d1c3a97a7c 100644 --- a/Source/cmExprParser.y +++ b/Source/LexerParser/cmExprParser.y @@ -162,4 +162,3 @@ void cmExpr_yyerror(yyscan_t yyscanner, const char* message) { cmExpr_yyget_extra(yyscanner)->Error(message); } - diff --git a/Source/cmExprParserTokens.h b/Source/LexerParser/cmExprParserTokens.h similarity index 100% rename from Source/cmExprParserTokens.h rename to Source/LexerParser/cmExprParserTokens.h diff --git a/Source/cmFortranLexer.cxx b/Source/LexerParser/cmFortranLexer.cxx similarity index 100% rename from Source/cmFortranLexer.cxx rename to Source/LexerParser/cmFortranLexer.cxx diff --git a/Source/cmFortranLexer.h b/Source/LexerParser/cmFortranLexer.h similarity index 100% rename from Source/cmFortranLexer.h rename to Source/LexerParser/cmFortranLexer.h diff --git a/Source/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l similarity index 100% rename from Source/cmFortranLexer.in.l rename to Source/LexerParser/cmFortranLexer.in.l diff --git a/Source/cmFortranParser.cxx b/Source/LexerParser/cmFortranParser.cxx similarity index 100% rename from Source/cmFortranParser.cxx rename to Source/LexerParser/cmFortranParser.cxx diff --git a/Source/cmFortranParser.y b/Source/LexerParser/cmFortranParser.y similarity index 100% rename from Source/cmFortranParser.y rename to Source/LexerParser/cmFortranParser.y diff --git a/Source/cmFortranParserTokens.h b/Source/LexerParser/cmFortranParserTokens.h similarity index 100% rename from Source/cmFortranParserTokens.h rename to Source/LexerParser/cmFortranParserTokens.h diff --git a/Source/cmListFileLexer.c b/Source/LexerParser/cmListFileLexer.c similarity index 100% rename from Source/cmListFileLexer.c rename to Source/LexerParser/cmListFileLexer.c diff --git a/Source/cmListFileLexer.in.l b/Source/LexerParser/cmListFileLexer.in.l similarity index 100% rename from Source/cmListFileLexer.in.l rename to Source/LexerParser/cmListFileLexer.in.l diff --git a/bootstrap b/bootstrap index e957e82c81..9ac3904c6d 100755 --- a/bootstrap +++ b/bootstrap @@ -240,6 +240,10 @@ CMAKE_UNUSED_SOURCES="\ " CMAKE_CXX_SOURCES="\ + LexerParser/cmCommandArgumentLexer \ + LexerParser/cmCommandArgumentParser \ + LexerParser/cmExprLexer \ + LexerParser/cmExprParser \ cmAddCustomCommandCommand \ cmAddCustomTargetCommand \ cmAddDefinitionsCommand \ @@ -255,8 +259,6 @@ CMAKE_CXX_SOURCES="\ cmCPackPropertiesGenerator \ cmCacheManager \ cmCommand \ - cmCommandArgumentLexer \ - cmCommandArgumentParser \ cmCommandArgumentParserHelper \ cmCommandArgumentsHelper \ cmCommands \ @@ -288,8 +290,6 @@ CMAKE_CXX_SOURCES="\ cmExportSet \ cmExportSetMap \ cmExportTryCompileFileGenerator \ - cmExprLexer \ - cmExprParser \ cmExprParserHelper \ cmExternalMakefileProjectGenerator \ cmFileCommand \ @@ -417,7 +417,7 @@ if ${cmake_system_mingw}; then fi CMAKE_C_SOURCES="\ - cmListFileLexer \ + LexerParser/cmListFileLexer \ " if ${cmake_system_mingw}; then @@ -810,6 +810,11 @@ if [ ! -d "cmsys" ]; then cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys" fi +[ -d "LexerParser" ] || mkdir "LexerParser" +if [ ! -d "LexerParser" ]; then + cmake_error 5 "Cannot create directory ${cmake_bootstrap_dir}/LexerParser" +fi + # Delete all the bootstrap files rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log" rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}" @@ -1431,9 +1436,15 @@ cmake_cxx_flags_SystemTools=" -DKWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT} -DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES} " -cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \ +cmake_c_flags="${cmake_c_flags} \ + -I`cmake_escape \"${cmake_bootstrap_dir}\"` \ + -I`cmake_escape \"${cmake_source_dir}/Source\"` \ + -I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \ -I`cmake_escape \"${cmake_source_dir}/Utilities\"`" -cmake_cxx_flags="${cmake_cxx_flags} -I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \ +cmake_cxx_flags="${cmake_cxx_flags} \ + -I`cmake_escape \"${cmake_bootstrap_dir}\"` \ + -I`cmake_escape \"${cmake_source_dir}/Source\"` \ + -I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \ -I`cmake_escape \"${cmake_source_dir}/Utilities\"`" echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile" echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"