Makefile.fetch | 1 Repository.mk | 6 RepositoryExternal.mk | 19 RepositoryModule_host.mk | 1 compilerplugins/clang/shouldreturnbool.cxx | 3 compilerplugins/clang/unnecessaryparen.cxx | 2 compilerplugins/clang/useuniqueptr.cxx | 12 compilerplugins/clang/writeonlyvars.cxx | 3 config_host.mk.in | 2 configure.ac | 44 download.lst | 2 external/Module_external.mk | 1 external/ucpp/Executable_ucpp.mk | 33 external/ucpp/Makefile | 14 external/ucpp/Module_ucpp.mk | 20 external/ucpp/README | 3 external/ucpp/UnpackedTarball_ucpp.mk | 20 external/ucpp/ucpp.patch | 11 idlc/CustomTarget_parser_test.mk | 91 idlc/Executable_idlc.mk | 81 idlc/Makefile | 14 idlc/Module_idlc.mk | 25 idlc/README.md | 7 idlc/inc/astattribute.hxx | 107 - idlc/inc/astbasetype.hxx | 50 idlc/inc/astconstant.hxx | 50 idlc/inc/astconstants.hxx | 35 idlc/inc/astdeclaration.hxx | 136 - idlc/inc/astenum.hxx | 45 idlc/inc/astexception.hxx | 35 idlc/inc/astexpression.hxx | 139 - idlc/inc/astinterface.hxx | 129 - idlc/inc/astinterfacemember.hxx | 45 idlc/inc/astmember.hxx | 48 idlc/inc/astmodule.hxx | 44 idlc/inc/astneeds.hxx | 41 idlc/inc/astobserves.hxx | 41 idlc/inc/astoperation.hxx | 54 idlc/inc/astparameter.hxx | 46 idlc/inc/astscope.hxx | 73 idlc/inc/astsequence.hxx | 49 idlc/inc/astservice.hxx | 61 idlc/inc/astservicemember.hxx | 45 idlc/inc/aststack.hxx | 46 idlc/inc/aststruct.hxx | 62 idlc/inc/aststructinstance.hxx | 49 idlc/inc/asttype.hxx | 37 idlc/inc/asttypedef.hxx | 44 idlc/inc/errorhandler.hxx | 118 - idlc/inc/fehelper.hxx | 70 idlc/inc/idlc.hxx | 164 - idlc/inc/idlctypes.hxx | 189 -- idlc/inc/inheritedinterface.hxx | 56 idlc/inc/options.hxx | 76 idlc/source/astconstant.cxx | 123 - idlc/source/astdeclaration.cxx | 164 - idlc/source/astdump.cxx | 420 ---- idlc/source/astenum.cxx | 105 - idlc/source/astexpression.cxx | 1327 -------------- idlc/source/astinterface.cxx | 399 ---- idlc/source/astoperation.cxx | 115 - idlc/source/astscope.cxx | 314 --- idlc/source/astservice.cxx | 54 idlc/source/aststack.cxx | 79 idlc/source/aststruct.cxx | 167 - idlc/source/aststructinstance.cxx | 63 idlc/source/attributeexceptions.hxx | 38 idlc/source/errorhandler.cxx | 583 ------ idlc/source/fehelper.cxx | 102 - idlc/source/idlc.cxx | 400 ---- idlc/source/idlccompile.cxx | 394 ---- idlc/source/idlcmain.cxx | 164 - idlc/source/idlcproduce.cxx | 242 -- idlc/source/options.cxx | 424 ---- idlc/source/parser.y | 2737 ----------------------------- idlc/source/scanner.l | 526 ----- idlc/test/const.idl | 71 idlc/test/enum.idl | 45 idlc/test/exception.idl | 40 idlc/test/identifiers.idl | 43 idlc/test/interface.idl | 71 idlc/test/service.idl | 64 idlc/test/singleton.idl | 61 idlc/test/struct.idl | 121 - idlc/test/typelookup.idl | 80 odk/CustomTarget_check.mk | 2 odk/config/cfgWin.js | 8 odk/docs/tools.html | 144 - odk/settings/std.mk | 2 odk/util/check.pl | 5 offapi/UnoApi_offapi.mk | 1 registry/Executable_regmerge.mk | 29 registry/Module_registry.mk | 1 registry/StaticLibrary_registry_helper.mk | 1 registry/tools/options.cxx | 144 - registry/tools/options.hxx | 57 registry/tools/regmerge.cxx | 183 - solenv/clang-format/excludelist | 41 solenv/flatpak-manifest.in | 7 solenv/gbuild/UnoApi.mk | 32 solenv/qa/python/gbuildtojson.py | 2 udkapi/UnoApi_udkapi.mk | 2 unoidl/README.md | 3 ure/source/README | 4 104 files changed, 10 insertions(+), 12793 deletions(-)
New commits: commit a8485d558fab53291e2530fd9a1be581c1628deb Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Sep 14 17:26:17 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Jun 10 17:15:49 2022 +0200 [API CHANGE] Remove deprecated idlc and regmerge from the SDK * Client code must replace uses of idlc and regmerge with uses of unoidl-write, see the changes to odk/examples/ and ure/source/uretext/ in 40f2aee6584eafcf4cd1d95fcf1f775e5435440d "Provide unoidl-write also for the SDK" for examples. * The new types.rdb format is not compatible with LibreOffice < 4.1. Clients generating extensions containing such files are advised to use appropriate LibreOffice-minimal-version elements. * For compatibility with old extensions, reading the legacy types.rdb format is still supported. * The SDK no longer ships an idl/ sub-directory containing the udkap and offapi .idl files (as, unlike idlc, unoidl-write does not need them). odk/config/cfgWin.js had to be adapted to look (somewhat arbitrarily) for an examples/ sub-directory instead of idl/ when checking for "an sdk folder". gb_UnoApi_package_idlfiles became unused and has been removed. * The idlc and regmerge executables have been removed. Module idlc has been removed except for idlc/test/parser/, which is also used by CustomTarget_unoidl/unoidl-write_test, and which may eventually be moved into module unoidl. Module external/ucpp and the corresponding configure options have also been removed. Change-Id: I42a0231699b863b5ebe2bee63bc32c8f79278cc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122363 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/Makefile.fetch b/Makefile.fetch index ccb3860735cb..8f9b4ba1c6af 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -215,7 +215,6 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,SKIA,SKIA_TARBALL) \ $(call fetch_Optional,STAROFFICE,STAROFFICE_TARBALL) \ $(if $(filter WNT,$(OS)),TWAIN_DSM_TARBALL) \ - $(call fetch_Optional,UCPP,UCPP_TARBALL) \ $(call fetch_Optional,VISIO,VISIO_TARBALL) \ $(call fetch_Optional,WPD,WPD_TARBALL) \ $(call fetch_Optional,WPG,WPG_TARBALL) \ diff --git a/Repository.mk b/Repository.mk index 5ee1546b2504..47a2f9c8202e 100644 --- a/Repository.mk +++ b/Repository.mk @@ -88,10 +88,8 @@ $(eval $(call gb_Helper_register_executables,NONE, \ $(eval $(call gb_Helper_register_executables_for_install,SDK,sdk, \ $(if $(filter MSC,$(COM)),$(if $(filter-out AARCH64,$(CPUNAME)),climaker)) \ cppumaker \ - idlc \ javamaker \ $(call gb_CondExeSp2bv,sp2bv) \ - $(if $(filter UCPP,$(BUILD_TYPE)),ucpp) \ $(if $(filter ODK,$(BUILD_TYPE)),unoapploader) \ unoidl-read \ unoidl-write \ @@ -249,7 +247,6 @@ endif $(eval $(call gb_Helper_register_executables_for_install,UREBIN,ure,\ $(if $(and $(ENABLE_JAVA),$(filter-out HAIKU MACOSX WNT,$(OS)),$(filter DESKTOP,$(BUILD_TYPE))),javaldx) \ $(call gb_CondExeRegistryTools, \ - regmerge \ regview \ ) \ $(call gb_CondExeUno,uno) \ @@ -907,8 +904,6 @@ $(eval $(call gb_Helper_register_packages_for_install,sdk,\ odk_html \ odk_settings \ odk_settings_generated \ - offapi_idl \ - udkapi_idl \ $(if $(ENABLE_JAVA), \ odk_javadoc \ odk_uno_loader_classes \ @@ -1162,7 +1157,6 @@ $(eval $(call gb_ExternalExecutable_register_executables,\ genccode \ gencmn \ python \ - ucpp \ xmllint \ xsltproc \ )) diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 2b2063483d31..938fc6bf761f 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -3929,12 +3929,6 @@ endef endif -define gb_Executable__register_idlc -$(call gb_Executable_add_runtime_dependencies,idlc,\ - $(call gb_ExternalExecutable_get_dependencies,ucpp) \ -) -endef - define gb_Executable__register_localize $(call gb_Executable_add_runtime_dependencies,localize,\ $(foreach exec,cfgex helpex propex treex ulfex xrmex,\ @@ -4005,19 +3999,6 @@ endef endif # SYSTEM_LIBXSLT_FOR_BUILD -ifneq (,$(SYSTEM_UCPP)) - -gb_ExternalExecutable__register_ucpp := - -else # ! SYSTEM_UCPP - -define gb_ExternalExecutable__register_ucpp -$(call gb_ExternalExecutable_set_internal,ucpp,$(INSTDIR_FOR_BUILD)/$(SDKDIRNAME)/bin/ucpp$(gb_Executable_EXT_for_build)) - -endef - -endif # SYSTEM_UCPP - ifeq (,$(PYTHON_FOR_BUILD)) define gb_ExternalExecutable__register_python diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk index 376f3d1404a8..287bd12b8323 100644 --- a/RepositoryModule_host.mk +++ b/RepositoryModule_host.mk @@ -94,7 +94,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\ i18npool \ i18nutil \ idl \ - $(call gb_Helper_optional,DESKTOP,idlc) \ instsetoo_native \ io \ javaunohelper \ diff --git a/compilerplugins/clang/shouldreturnbool.cxx b/compilerplugins/clang/shouldreturnbool.cxx index bc232b472e5e..fa1bd4cbdfb3 100644 --- a/compilerplugins/clang/shouldreturnbool.cxx +++ b/compilerplugins/clang/shouldreturnbool.cxx @@ -47,9 +47,6 @@ public: // false +, slightly odd usage, but not wrong if (loplugin::isSamePathname(fn, SRCDIR "/libreofficekit/qa/tilebench/tilebench.cxx")) return; - // uses the Unix convention of "non-zero return indicates error" - if (loplugin::isSamePathname(fn, SRCDIR "/idlc/source/idlcproduce.cxx")) - return; // template magic if (loplugin::isSamePathname(fn, SRCDIR "/vcl/source/gdi/bmpfast.cxx")) return; diff --git a/compilerplugins/clang/unnecessaryparen.cxx b/compilerplugins/clang/unnecessaryparen.cxx index 29a790702c66..3b9e5f14bbbb 100644 --- a/compilerplugins/clang/unnecessaryparen.cxx +++ b/compilerplugins/clang/unnecessaryparen.cxx @@ -83,8 +83,6 @@ public: // fixing this, makes the source in the .y files look horrible if (loplugin::isSamePathname(fn, WORKDIR "/YaccTarget/unoidl/source/sourceprovider-parser.cxx")) return false; - if (loplugin::isSamePathname(fn, WORKDIR "/YaccTarget/idlc/source/parser.cxx")) - return false; return true; } virtual void run() override diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx index c0ef34b2823a..cf4853f03b2b 100644 --- a/compilerplugins/clang/useuniqueptr.cxx +++ b/compilerplugins/clang/useuniqueptr.cxx @@ -463,9 +463,6 @@ void UseUniquePtr::CheckDeleteLocalVar(const FunctionDecl* functionDecl, const C // complicated if (fn == SRCDIR "/svx/source/sdr/contact/objectcontact.cxx") return; - // memory management in this module is a mess - if (fn == SRCDIR "/idlc/source/aststack.cxx") - return; // complicated if (fn == SRCDIR "/cui/source/customize/cfg.cxx") return; @@ -728,9 +725,6 @@ void UseUniquePtr::CheckLoopDelete(const FunctionDecl* functionDecl, const CXXDe if (loplugin::hasPathnamePrefix(fn, SRCDIR "/vcl/qa/")) return; // linked list - if (fn == SRCDIR "/registry/source/reflwrit.cxx") - return; - // linked list if (fn == SRCDIR "/tools/source/generic/config.cxx") return; // linked lists @@ -848,9 +842,6 @@ void UseUniquePtr::CheckCXXForRangeStmt(const FunctionDecl* functionDecl, const if (!fieldDecl) return; - // appears to just randomly leak stuff, and it involves some lex/yacc stuff - if (fn == SRCDIR "/idlc/source/aststack.cxx") - return; // complicated if (fn == SRCDIR "/vcl/source/gdi/print.cxx") return; @@ -1092,9 +1083,6 @@ bool UseUniquePtr::TraverseConstructorInitializer(CXXCtorInitializer * ctorInit) return true; StringRef fn = getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(ctorInit->getSourceLocation())); - // don't feel like fiddling with the yacc parser - if (loplugin::hasPathnamePrefix(fn, SRCDIR "/idlc/")) - return true; // cannot change URE if (loplugin::hasPathnamePrefix(fn, SRCDIR "/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx")) return true; diff --git a/compilerplugins/clang/writeonlyvars.cxx b/compilerplugins/clang/writeonlyvars.cxx index f5051c99e128..3ea5356e4071 100644 --- a/compilerplugins/clang/writeonlyvars.cxx +++ b/compilerplugins/clang/writeonlyvars.cxx @@ -185,9 +185,6 @@ void WriteOnlyVars::run() // false+ if (loplugin::isSamePathname(fn, SRCDIR "/store/source/storpage.cxx")) return; - // yydebug? - if (loplugin::isSamePathname(fn, SRCDIR "/idlc/source/idlccompile.cxx")) - return; if (fn.contains("/qa/")) return; if (fn.contains("/vcl/workben/")) diff --git a/config_host.mk.in b/config_host.mk.in index 019e1a65561b..c924c13c4832 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -678,8 +678,6 @@ export SYSTEM_REDLAND=@SYSTEM_REDLAND@ export SYSTEM_REVENGE=@SYSTEM_REVENGE@ export SYSTEM_RHINO=@SYSTEM_RHINO@ export SYSTEM_STAROFFICE=@SYSTEM_STAROFFICE@ -export SYSTEM_UCPP=@SYSTEM_UCPP@ -export SYSTEM_UCPP_IS_GCC=@SYSTEM_UCPP_IS_GCC@ export SYSTEM_VISIO=@SYSTEM_VISIO@ export SYSTEM_WPD=@SYSTEM_WPD@ export SYSTEM_WPG=@SYSTEM_WPG@ diff --git a/configure.ac b/configure.ac index 2ff842f2b595..11e697c733f8 100644 --- a/configure.ac +++ b/configure.ac @@ -2214,11 +2214,6 @@ AC_ARG_WITH(system-libxml, [Use libxml/libxslt already on system.]),, [with_system_libxml=auto]) -AC_ARG_WITH(system-ucpp, - AS_HELP_STRING([--with-system-ucpp], - [Use ucpp already on system.]),, - []) - AC_ARG_WITH(system-openldap, AS_HELP_STRING([--with-system-openldap], [Use the OpenLDAP LDAP SDK already on system.]),, @@ -2738,11 +2733,6 @@ AC_ARG_WITH(os-version, [For FreeBSD users, use this option to override the detected OSVERSION.]), ,) -AC_ARG_WITH(idlc-cpp, - AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>], - [Specify the C Preprocessor to use for idlc. Default is ucpp.]), -,) - AC_ARG_WITH(parallelism, AS_HELP_STRING([--with-parallelism], [Number of jobs to run simultaneously during build. Parallel builds can @@ -9057,40 +9047,6 @@ else AC_MSG_RESULT([no]) fi -dnl =================================================================== -dnl Check for C preprocessor to use -dnl =================================================================== -AC_MSG_CHECKING([which C preprocessor to use in idlc]) -SYSTEM_UCPP_IS_GCC= -if test -n "$with_idlc_cpp"; then - AC_MSG_RESULT([$with_idlc_cpp]) - AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp) - AC_MSG_CHECKING([if $with_idlc_cpp is GCC CPP]) - # ucpp will accept -v (to output version), warn about the others as unknown - # and return 1 (due to -v) - # gcc will accept -v (as verbose), --version (to output version) and -nostdinc - # and return 0 (due to --version ) if all options are supported - $SYSTEM_UCPP -v --version -nostdinc >/dev/null 2>/dev/null - if test $? -eq 0; then - SYSTEM_UCPP_IS_GCC=TRUE - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi -else - AC_MSG_RESULT([ucpp]) - AC_MSG_CHECKING([which ucpp to use]) - if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then - AC_MSG_RESULT([external]) - AC_PATH_PROG(SYSTEM_UCPP, ucpp) - else - AC_MSG_RESULT([internal]) - BUILD_TYPE="$BUILD_TYPE UCPP" - fi -fi -AC_SUBST(SYSTEM_UCPP) -AC_SUBST(SYSTEM_UCPP_IS_GCC) - dnl =================================================================== dnl Check for epm (not needed for Windows) dnl =================================================================== diff --git a/download.lst b/download.lst index 257c1248bd0e..fc18292db70a 100644 --- a/download.lst +++ b/download.lst @@ -240,8 +240,6 @@ export SWING_SHA256SUM := 64585ac36a81291a58269ec5347e7e3e2e8596dbacb9221015c208 export SWING_TARBALL := 35c94d2df8893241173de1d16b6034c0-swingExSrc.zip export TWAIN_DSM_SHA256SUM := 82c818be771f242388457aa8c807e4b52aa84dc22b21c6c56184a6b4cbb085e6 export TWAIN_DSM_TARBALL := twaindsm_2.4.1.orig.tar.gz -export UCPP_SHA256SUM := 983941d31ee8d366085cadf28db75eb1f5cb03ba1e5853b98f12f7f51c63b776 -export UCPP_TARBALL := 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz export VISIO_SHA256SUM := 8faf8df870cb27b09a787a1959d6c646faa44d0d8ab151883df408b7166bea4c export VISIO_TARBALL := libvisio-0.1.7.tar.xz export WPD_SHA256SUM := 2465b0b662fdc5d4e3bebcdc9a79027713fb629ca2bff04a3c9251fdec42dd09 diff --git a/external/Module_external.mk b/external/Module_external.mk index c8ad9ae110a6..ed8f4904798a 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -94,7 +94,6 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,SKIA,skia) \ $(call gb_Helper_optional,STAROFFICE,libstaroffice) \ $(if $(filter WNT,$(OS)),twain_dsm) \ - $(call gb_Helper_optional,UCPP,ucpp) \ $(call gb_Helper_optional,VISIO,libvisio) \ $(call gb_Helper_optional,WPD,libwpd) \ $(call gb_Helper_optional,WPG,libwpg) \ diff --git a/external/ucpp/Executable_ucpp.mk b/external/ucpp/Executable_ucpp.mk deleted file mode 100644 index a4be71c4901c..000000000000 --- a/external/ucpp/Executable_ucpp.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_Executable_Executable,ucpp)) - -$(eval $(call gb_Executable_set_warnings_disabled,ucpp)) - -$(eval $(call gb_Executable_use_unpacked,ucpp,ucpp)) - -$(eval $(call gb_Executable_add_defs,ucpp,\ - -DNO_UCPP_BUF \ - -DUCPP_CONFIG \ - -DSTAND_ALONE \ -)) - -$(eval $(call gb_Executable_add_generated_cobjects,ucpp,\ - UnpackedTarball/ucpp/assert \ - UnpackedTarball/ucpp/cpp \ - UnpackedTarball/ucpp/eval \ - UnpackedTarball/ucpp/hash \ - UnpackedTarball/ucpp/lexer \ - UnpackedTarball/ucpp/macro \ - UnpackedTarball/ucpp/mem \ - UnpackedTarball/ucpp/nhash \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/ucpp/Makefile b/external/ucpp/Makefile deleted file mode 100644 index 569ad8a0ba7a..000000000000 --- a/external/ucpp/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) - -include $(module_directory)/../../solenv/gbuild/partial_build.mk - -# vim: set noet sw=4 ts=4: diff --git a/external/ucpp/Module_ucpp.mk b/external/ucpp/Module_ucpp.mk deleted file mode 100644 index dc4c02f5307b..000000000000 --- a/external/ucpp/Module_ucpp.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_Module_Module,ucpp)) - -# if not cross-compiling or we need ucpp for ODK -ifneq (,$(if $(CROSS_COMPILING),,T)$(filter ODK,$(BUILD_TYPE))) -$(eval $(call gb_Module_add_targets,ucpp,\ - Executable_ucpp \ - UnpackedTarball_ucpp \ -)) -endif - -# vim: set noet sw=4 ts=4: diff --git a/external/ucpp/README b/external/ucpp/README deleted file mode 100644 index 9246c701a267..000000000000 --- a/external/ucpp/README +++ /dev/null @@ -1,3 +0,0 @@ -ucpp is a C99 preprocessor - -Used to be hosted at https://code.google.com/p/ucpp/ - not sure where it's gone diff --git a/external/ucpp/UnpackedTarball_ucpp.mk b/external/ucpp/UnpackedTarball_ucpp.mk deleted file mode 100644 index 04d7113b8513..000000000000 --- a/external/ucpp/UnpackedTarball_ucpp.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_UnpackedTarball_UnpackedTarball,ucpp)) - -$(eval $(call gb_UnpackedTarball_set_tarball,ucpp,$(UCPP_TARBALL))) - -$(eval $(call gb_UnpackedTarball_set_patchlevel,ucpp,0)) - -$(eval $(call gb_UnpackedTarball_add_patches,ucpp,\ - external/ucpp/ucpp.patch \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/external/ucpp/ucpp.patch b/external/ucpp/ucpp.patch deleted file mode 100644 index c9c4b92b7f79..000000000000 --- a/external/ucpp/ucpp.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- cpp.c -+++ cpp.c -@@ -2464,7 +2464,7 @@ - warning(-1, "unknown option '%s'", argv[i]); - } else { - if (filename != 0) { -- error(-1, "spurious filename '%s'", argv[i]); -+ error(-1, "spurious duplicate filename '%s' - vs. '%s' ", argv[i], filename); - return 2; - } - filename = argv[i]; diff --git a/idlc/CustomTarget_parser_test.mk b/idlc/CustomTarget_parser_test.mk deleted file mode 100644 index f8c7632bde67..000000000000 --- a/idlc/CustomTarget_parser_test.mk +++ /dev/null @@ -1,91 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_CustomTarget_CustomTarget,idlc/parser_test)) - -# this target is phony to run it every time -.PHONY : $(call gb_CustomTarget_get_target,idlc/parser_test) - -$(call gb_CustomTarget_get_target,idlc/parser_test) : \ - $(call gb_Executable_get_runtime_dependencies,idlc) \ - $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/attribute.tests \ - $(SRCDIR)/idlc/test/parser/constant.tests \ - $(SRCDIR)/idlc/test/parser/constructor.tests \ - $(SRCDIR)/idlc/test/parser/conversion.tests \ - $(SRCDIR)/idlc/test/parser/interfaceinheritance.tests \ - $(SRCDIR)/idlc/test/parser/methodoverload.tests \ - $(SRCDIR)/idlc/test/parser/polystruct.tests \ - $(SRCDIR)/idlc/test/parser/published.tests \ - $(SRCDIR)/idlc/test/parser/struct.tests \ - $(SRCDIR)/idlc/test/parser/typedef.tests \ - | $(call gb_CustomTarget_get_workdir,idlc/parser_test)/.dir -ifneq ($(gb_SUPPRESS_TESTS),) - @true -else - $(call gb_Helper_abbreviate_dirs,( \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/attribute.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/constant.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/constructor.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/conversion.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/interfaceinheritance.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/methodoverload.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/oldstyle.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/polystruct.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/published.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/struct.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {} && \ - $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \ - $(SRCDIR)/idlc/test/parser/typedef.tests \ - $(call gb_CustomTarget_get_workdir,idlc/parser_test)/in.idl 0 \ - $(call gb_Executable_get_command,idlc) \ - -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) {}) \ - > $@.log 2>&1 || (cat $@.log && false)) -endif - -# vim: set noet sw=4 ts=4: diff --git a/idlc/Executable_idlc.mk b/idlc/Executable_idlc.mk deleted file mode 100644 index 8af0c40f111a..000000000000 --- a/idlc/Executable_idlc.mk +++ /dev/null @@ -1,81 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_Executable_Executable,idlc)) - -$(eval $(call gb_Executable_set_include,idlc,\ - -I$(SRCDIR)/idlc/inc \ - -I$(SRCDIR)/idlc/source \ - $$(INCLUDE) \ -)) - -$(eval $(call gb_Executable_use_externals,idlc,\ - boost_headers \ -)) - -$(eval $(call gb_Executable_use_libraries,idlc,\ - reg \ - $(if $(filter TRUE,$(DISABLE_DYNLOADING)),store) \ - sal \ - salhelper \ -)) - -$(eval $(call gb_Executable_add_grammars,idlc,\ - idlc/source/parser \ -)) - -$(eval $(call gb_Executable_add_scanners,idlc,\ - idlc/source/scanner \ -)) - -ifneq (,$(SYSTEM_UCPP)) - -$(eval $(call gb_Executable_add_defs,idlc,\ - -DSYSTEM_UCPP \ - -DUCPP=\"file://$(SYSTEM_UCPP)\" \ -)) - -ifneq ($(SYSTEM_UCPP_IS_GCC),) -$(eval $(call gb_Executable_add_defs,idlc,\ - -DSYSTEM_UCPP_IS_GCC \ -)) -endif - -endif - -$(eval $(call gb_Executable_add_exception_objects,idlc,\ - idlc/source/idlcmain \ - idlc/source/idlc \ - idlc/source/idlccompile \ - idlc/source/idlcproduce \ - idlc/source/errorhandler \ - idlc/source/options \ - idlc/source/fehelper \ - idlc/source/astdeclaration \ - idlc/source/astscope \ - idlc/source/aststack \ - idlc/source/astdump \ - idlc/source/astinterface \ - idlc/source/aststruct \ - idlc/source/aststructinstance \ - idlc/source/astoperation \ - idlc/source/astconstant \ - idlc/source/astenum \ - idlc/source/astexpression \ - idlc/source/astservice \ -)) - -# Without this, e.g. 'make clean; make CustomTarget_idlc/parser_test' may fail on Windows localized -# to something other than listed in Impl_getTextEncodingData, because osl_getThreadTextEncoding() -# returns Windows ACP, calling FullTextEncodingData ctor which loads the not-yet-built library -$(call gb_Executable_add_runtime_dependencies,idlc, \ - $(call gb_CondLibSalTextenc,$(call gb_Library_get_target,sal_textenc)) \ -) - -# vim:set noet sw=4 ts=4: diff --git a/idlc/Makefile b/idlc/Makefile deleted file mode 100644 index 0997e628485b..000000000000 --- a/idlc/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) - -include $(module_directory)/../solenv/gbuild/partial_build.mk - -# vim: set noet sw=4 ts=4: diff --git a/idlc/Module_idlc.mk b/idlc/Module_idlc.mk deleted file mode 100644 index a20d105cd829..000000000000 --- a/idlc/Module_idlc.mk +++ /dev/null @@ -1,25 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_Module_Module,idlc)) - -# if not cross-compiling or we need this for ODK -ifneq (,$(if $(CROSS_COMPILING),,T)$(filter ODK,$(BUILD_TYPE))) - -$(eval $(call gb_Module_add_targets,idlc,\ - Executable_idlc \ -)) - -$(eval $(call gb_Module_add_check_targets,idlc,\ - CustomTarget_parser_test \ -)) - -endif - -# vim:set noet sw=4 ts=4: diff --git a/idlc/README.md b/idlc/README.md deleted file mode 100644 index 621a767b36ea..000000000000 --- a/idlc/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# UNO IDL Compiler (idlc) - -Contains the UNO IDL compiler: `idlc`, depends on preprocessor: `ucpp` - -This compiler generates binary RDB fragments that can be assembled -into a RDB (UNO type library) with the `regmerge` tool, as is done -primarily in the `offapi` and `udkapi` directories. diff --git a/idlc/inc/astattribute.hxx b/idlc/inc/astattribute.hxx deleted file mode 100644 index b9a799f92db3..000000000000 --- a/idlc/inc/astattribute.hxx +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTATTRIBUTE_HXX -#define INCLUDED_IDLC_INC_ASTATTRIBUTE_HXX - -#include "astdeclaration.hxx" -#include "astscope.hxx" - -#include <registry/types.hxx> -#include <rtl/ustring.hxx> - -namespace typereg { class Writer; } - -class AstAttribute final : public AstDeclaration, public AstScope { -public: - AstAttribute( - sal_uInt32 flags, AstType const * type, OString const & name, - AstScope * scope): - AstDeclaration(NT_attribute, name, scope), - AstScope(NT_attribute), m_flags(flags), m_pType(type) - {} - - AstAttribute(NodeType nodeType, sal_uInt32 flags, AstType const * pType, const OString& name, AstScope* pScope) - : AstDeclaration(nodeType, name, pScope), AstScope(nodeType) - , m_flags(flags) - , m_pType(pType) - {} - - void setExceptions( - OUString const * getDoc, DeclList const * getExc, - OUString const * setDoc, DeclList const * setExc) - { - if (getDoc != nullptr) { - m_getDocumentation = *getDoc; - } - if (getExc != nullptr) { - m_getExceptions = *getExc; - } - if (setDoc != nullptr) { - m_setDocumentation = *setDoc; - } - if (setExc != nullptr) { - m_setExceptions = *setExc; - } - } - - DeclList::size_type getGetExceptionCount() const - { return m_getExceptions.size(); } - - DeclList::size_type getSetExceptionCount() const - { return m_setExceptions.size(); } - - bool isReadonly() const - { return ((m_flags & AF_READONLY) == AF_READONLY); } - bool isOptional() const - { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } - bool isBound() const - { return ((m_flags & AF_BOUND) == AF_BOUND); } - bool isMayBeVoid() const - { return ((m_flags & AF_MAYBEVOID) == AF_MAYBEVOID); } - bool isConstrained() const - { return ((m_flags & AF_CONSTRAINED) == AF_CONSTRAINED); } - bool isTransient() const - { return ((m_flags & AF_TRANSIENT) == AF_TRANSIENT); } - bool isMayBeAmbiguous() const - { return ((m_flags & AF_MAYBEAMBIGUOUS) == AF_MAYBEAMBIGUOUS); } - bool isMayBeDefault() const - { return ((m_flags & AF_MAYBEDEFAULT) == AF_MAYBEDEFAULT); } - bool isRemoveable() const - { return ((m_flags & AF_REMOVABLE) == AF_REMOVABLE); } - - void dumpBlob( - typereg::Writer & rBlob, sal_uInt16 index, sal_uInt16 * methodIndex) const; - -private: - void dumpExceptions( - typereg::Writer & writer, OUString const & documentation, - DeclList const & exceptions, RTMethodMode flags, - sal_uInt16 * methodIndex) const; - - const sal_uInt32 m_flags; - AstType const * m_pType; - OUString m_getDocumentation; - DeclList m_getExceptions; - OUString m_setDocumentation; - DeclList m_setExceptions; -}; - -#endif // INCLUDED_IDLC_INC_ASTATTRIBUTE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astbasetype.hxx b/idlc/inc/astbasetype.hxx deleted file mode 100644 index 0b488c8006fd..000000000000 --- a/idlc/inc/astbasetype.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#pragma once - -#include "asttype.hxx" -#include "astexpression.hxx" - - -class AstBaseType final : public AstType -{ -public: - AstBaseType(const ExprType type, const OString& name, AstScope* pScope) - : AstType(NT_predefined, name, pScope) - , m_exprType(type) - {} - - virtual bool isUnsigned() const override { - switch (m_exprType) { - case ET_ushort: - case ET_ulong: - case ET_uhyper: - return true; - default: - return false; - } - } - - ExprType getExprType() const - { return m_exprType; } -private: - const ExprType m_exprType; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astconstant.hxx b/idlc/inc/astconstant.hxx deleted file mode 100644 index fb8b417f4073..000000000000 --- a/idlc/inc/astconstant.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTCONSTANT_HXX -#define INCLUDED_IDLC_INC_ASTCONSTANT_HXX - -#include "astdeclaration.hxx" -#include "astexpression.hxx" - -namespace typereg { class Writer; } - -class AstConstant final : public AstDeclaration -{ -public: - AstConstant(const ExprType type, const NodeType nodeType, - AstExpression* pExpr, const OString& name, AstScope* pScope); - AstConstant(const ExprType type, AstExpression* pExpr, - const OString& name, AstScope* pScope); - virtual ~AstConstant() override; - - AstExpression* getConstValue() - { return m_pConstValue; } - ExprType getConstValueType() const - { return m_constValueType; } - - bool dumpBlob( - typereg::Writer & rBlob, sal_uInt16 index, bool published); -private: - AstExpression* m_pConstValue; - const ExprType m_constValueType; -}; - -#endif // INCLUDED_IDLC_INC_ASTCONSTANT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astconstants.hxx b/idlc/inc/astconstants.hxx deleted file mode 100644 index 6add23a45359..000000000000 --- a/idlc/inc/astconstants.hxx +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTCONSTANTS_HXX -#define INCLUDED_IDLC_INC_ASTCONSTANTS_HXX - -#include "astmodule.hxx" - -class AstConstants final : public AstModule -{ -public: - AstConstants(const OString& name, AstScope* pScope) - : AstModule(NT_constants, name, pScope) - { - } -}; - -#endif // INCLUDED_IDLC_INC_ASTCONSTANTS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astdeclaration.hxx b/idlc/inc/astdeclaration.hxx deleted file mode 100644 index 0707dbc57bb0..000000000000 --- a/idlc/inc/astdeclaration.hxx +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTDECLARATION_HXX -#define INCLUDED_IDLC_INC_ASTDECLARATION_HXX - -#include "idlc.hxx" -#include <registry/registry.hxx> - -class AstScope; - -// Enum defining the different kinds of Ast nodes -enum NodeType -{ - NT_service, // Denotes a service - NT_interface_member, // Denotes an interface which is exported from object - NT_service_member, // Denotes a service which is exported from object - NT_observes, // Denotes an observed interface - NT_needs, // Denotes a needed service - NT_module, // Denotes a module - NT_root, // Denotes the root of AST - NT_interface, // Denotes an interface - NT_constants, // Denotes a constant group - NT_const, // Denotes a constant - NT_exception, // Denotes an exception - NT_attribute, // Denotes an attribute - NT_property, // Denotes a property - NT_operation, // Denotes an operation - NT_parameter, // Denotes an op. parameter - NT_struct, // Denotes either a plain struct type, or a - // polymorphic struct type template - NT_type_parameter, // Denotes a type parameter of a polymorphic struct - // type template - NT_instantiated_struct, // Denotes an instantiated polymorphic struct type - NT_member, // Denotes a member in structure, exception - NT_enum, // Denotes an enumeration - NT_enum_val, // Denotes an enum. value - NT_sequence, // Denotes an IDL sequence - NT_typedef, // Denotes a typedef - NT_predefined, // Denotes a predefined type - NT_singleton // Denotes a singleton -}; - -class AstDeclaration -{ -public: - // Constructors - AstDeclaration(NodeType type, const OString& name, AstScope* pScope); - virtual ~AstDeclaration(); - - AstDeclaration(AstDeclaration const &) = default; - AstDeclaration(AstDeclaration &&) = default; - AstDeclaration & operator =(AstDeclaration const &) = default; - AstDeclaration & operator =(AstDeclaration &&) = default; - - // Data access - const OString& getLocalName() const - { return m_localName; } - const OString& getScopedName() const - { return m_scopedName; } - const OString& getFullName() const - { return m_fullName; } - virtual const char* getRelativName() const - { return m_fullName.getStr()+1; } - AstScope* getScope() - { return m_pScope; } - const AstScope* getScope() const - { return m_pScope; } - NodeType getNodeType() const - { return m_nodeType; } - bool isInMainfile() const - { return m_bInMainFile; } - void setInMainfile(bool bInMainfile) - { m_bInMainFile = bInMainfile; } - bool isImported() const - { return m_bImported; } - void setImported(bool bImported) - { m_bImported = bImported; } - sal_Int32 getLineNumber() const - { return m_lineNumber; } - void setLineNumber(sal_Int32 lineNumber) - { m_lineNumber = lineNumber; } - const OString& getFileName() const - { return m_fileName; } - void setFileName(const OString& rFileName) - { m_fileName = rFileName; } - const OUString& getDocumentation() const - { return m_documentation; } - void setDocumentation(const OUString& rDocumentation) - { m_documentation = rDocumentation; } - - virtual bool isType() const; - - bool hasAncestor(AstDeclaration* pDecl); - - void setPublished() { m_bPublished = true; } - bool isPublished() const { return m_bPublished; } - - virtual bool dump(RegistryKey& rKey); - - bool isPredefined() const { return m_bPredefined; } - void setPredefined(bool bPredefined); - -protected: - OString m_localName; - OString m_scopedName; // full qualified name - OString m_fullName; // full qualified name with '/' as separator - AstScope* m_pScope; - NodeType m_nodeType; - bool m_bImported; // imported ? - bool m_bInMainFile; // defined in main file - bool m_bPublished; - bool m_bPredefined; - sal_Int32 m_lineNumber; // line number defined in - OString m_fileName; // fileName defined in - OUString m_documentation; // fileName defined in -}; - -#endif // INCLUDED_IDLC_INC_ASTDECLARATION_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astenum.hxx b/idlc/inc/astenum.hxx deleted file mode 100644 index dc89d430adb2..000000000000 --- a/idlc/inc/astenum.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTENUM_HXX -#define INCLUDED_IDLC_INC_ASTENUM_HXX - -#include "asttype.hxx" -#include "astscope.hxx" -#include "astconstant.hxx" - -class AstEnum final : public AstType, public AstScope -{ -public: - AstEnum(const OString& name, AstScope* pScope); - - virtual ~AstEnum() override; - - sal_Int32 getEnumValueCount() { return m_enumValueCount++; } - - AstConstant* checkValue(AstExpression* pExpr); - - virtual bool dump(RegistryKey& rKey) override; - -private: - sal_Int32 m_enumValueCount; -}; - -#endif // INCLUDED_IDLC_INC_ASTENUM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astexception.hxx b/idlc/inc/astexception.hxx deleted file mode 100644 index 6c2d549bc9a2..000000000000 --- a/idlc/inc/astexception.hxx +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTEXCEPTION_HXX -#define INCLUDED_IDLC_INC_ASTEXCEPTION_HXX - -#include "aststruct.hxx" - -class AstException final : public AstStruct -{ -public: - AstException(const OString& name, AstException const* pBaseType, AstScope* pScope) - : AstStruct(NT_exception, name, pBaseType, pScope) - { - } -}; - -#endif // INCLUDED_IDLC_INC_ASTEXCEPTION_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astexpression.hxx b/idlc/inc/astexpression.hxx deleted file mode 100644 index 05d20baa51cd..000000000000 --- a/idlc/inc/astexpression.hxx +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTEXPRESSION_HXX -#define INCLUDED_IDLC_INC_ASTEXPRESSION_HXX - -#include <sal/config.h> - -#include <memory> - -#include "idlc.hxx" -#include <optional> - -// Enum to define all the different operators to combine expressions -enum class ExprComb -{ - Add, // '+' - Minus, // '-' - Mul, // '*' - Div, // '/' - Mod, // '%' - Or, // '|' - Xor, // '^' - And, // '&' - Left, // '<<' - Right, // '>>' - UPlus, // unary '+' - UMinus, // unary '-' - NONE, // No operator (missing) - Symbol // a symbol (function or constant name) -}; - -// Enum to define expression type -enum ExprType -{ - ET_short, // Expression value is short - ET_ushort, // Expression value is unsigned short - ET_long, // Expression value is long - ET_ulong, // Expression value is unsigned long - ET_hyper, // Expression value is hyper (64 bit) - ET_uhyper, // Expression value is unsigned hyper - ET_float, // Expression value is 32-bit float - ET_double, // Expression value is 64-bit float - ET_char, // Expression value is char - ET_byte, // Expression value is byte - ET_boolean, // Expression value is boolean - ET_string, // Expression value is char * - ET_any, // Expression value is any of above - ET_void, // Expression value is void (absent) - ET_type, // Expression value is type - ET_none // Expression value is missing -}; - -// Structure to describe value of constant expression and its type -struct AstExprValue -{ - union - { - sal_uInt8 byval; // Contains byte expression value - sal_Int16 sval; // Contains short expression value - sal_uInt16 usval; // Contains unsigned short expr value - sal_Int32 lval; // Contains long expression value - sal_uInt32 ulval; // Contains unsigned long expr value - sal_Int64 hval; // Contains hyper expression value - sal_uInt64 uhval; // Contains unsigned hyper expr value - bool bval; // Contains boolean expression value - float fval; // Contains 32-bit float expr value - double dval; // Contains 64-bit float expr value - } u; - ExprType et; -}; - -const char* exprTypeToString(ExprType t); - -class AstExpression final -{ -public: - // Constructor(s) - AstExpression(ExprComb c, AstExpression *pExpr1, AstExpression *pExpr2); - - AstExpression(sal_Int32 l); - AstExpression(sal_Int32 l, ExprType et); - AstExpression(sal_Int64 h); - AstExpression(sal_uInt64 uh); - AstExpression(double d); - AstExpression(OString* scopedName); - - ~AstExpression(); - - // Data Accessors - AstExprValue* getExprValue() - { return m_exprValue.get(); } - - // Evaluation and value coercion - bool coerce(ExprType type); - - // Evaluate then store value inside this AstExpression - void evaluate(); - - // Compare LONG AstExpression values - bool compareLong(AstExpression *pExpr); - - OString toString(); -private: - // Evaluate different sets of operators - std::unique_ptr<AstExprValue> eval_bin_op(); - std::unique_ptr<AstExprValue> eval_bit_op(); - std::unique_ptr<AstExprValue> eval_un_op(); - std::unique_ptr<AstExprValue> eval_symbol(); - - ExprComb m_combOperator; - std::unique_ptr<AstExpression> - m_subExpr1; - std::unique_ptr<AstExpression> - m_subExpr2; - std::unique_ptr<AstExprValue> - m_exprValue; - std::optional<OString> - m_xSymbolicName; -}; - -#endif // INCLUDED_IDLC_INC_ASTEXPRESSION_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astinterface.hxx b/idlc/inc/astinterface.hxx deleted file mode 100644 index 03c5f22f5f37..000000000000 --- a/idlc/inc/astinterface.hxx +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTINTERFACE_HXX -#define INCLUDED_IDLC_INC_ASTINTERFACE_HXX - -#include "asttype.hxx" -#include "astscope.hxx" -#include "inheritedinterface.hxx" - -#include <map> -#include <vector> - -class AstInterface : public AstType - , public AstScope -{ -public: - typedef std::vector< InheritedInterface > InheritedInterfaces; - - struct DoubleMemberDeclaration { - AstDeclaration const * first; - AstDeclaration const * second; - }; - - typedef std::vector< DoubleMemberDeclaration > DoubleMemberDeclarations; - - struct DoubleDeclarations { - std::vector< AstInterface const * > interfaces; - DoubleMemberDeclarations members; - }; - - AstInterface( - const OString& name, AstInterface const * pInherits, - AstScope* pScope); - virtual ~AstInterface() override; - - AstInterface(AstInterface const &) = default; - AstInterface(AstInterface &&) = default; - AstInterface & operator =(AstInterface const &) = default; - AstInterface & operator =(AstInterface &&) = default; - - InheritedInterfaces const & getAllInheritedInterfaces() const - { return m_inheritedInterfaces; } - - bool hasMandatoryInheritedInterfaces() const - { return m_mandatoryInterfaces > 0; } - - void setDefined() { m_bIsDefined = true; } - bool isDefined() const - { return m_bIsDefined; } - - bool usesSingleInheritance() const { return m_bSingleInheritance; } - - DoubleDeclarations checkInheritedInterfaceClashes( - AstInterface const * ifc, bool optional) const; - - void addInheritedInterface( - AstType const * ifc, bool optional, - OUString const & documentation); - - DoubleMemberDeclarations checkMemberClashes( - AstDeclaration const * member) const; - - void addMember(AstDeclaration /*TODO: const*/ * member); - - void forwardDefined(AstInterface const & def); - - virtual bool dump(RegistryKey& rKey) override; - -private: - enum InterfaceKind { - INTERFACE_INDIRECT_OPTIONAL, INTERFACE_DIRECT_OPTIONAL, - INTERFACE_INDIRECT_MANDATORY, INTERFACE_DIRECT_MANDATORY }; - - struct VisibleMember { - explicit VisibleMember(AstDeclaration const * theMandatory = nullptr): - mandatory(theMandatory) {} - - typedef std::map< OString, AstDeclaration const * > Optionals; - - AstDeclaration const * mandatory; - Optionals optionals; - }; - - typedef std::map< OString, InterfaceKind > VisibleInterfaces; - typedef std::map< OString, VisibleMember > VisibleMembers; - - void checkInheritedInterfaceClashes( - DoubleDeclarations & doubleDeclarations, - std::set< OString > & seenInterfaces, AstInterface const * ifc, - bool direct, bool optional, bool mainOptional) const; - - void checkMemberClashes( - DoubleMemberDeclarations & doubleMembers, AstDeclaration const * member, - bool checkOptional) const; - - void addVisibleInterface( - AstInterface const * ifc, bool direct, bool optional); - - void addOptionalVisibleMembers(AstInterface const * ifc); - - bool increment(sal_uInt16 * counter, char const * sort) const; - - InheritedInterfaces m_inheritedInterfaces; - InheritedInterfaces::size_type m_mandatoryInterfaces; - bool m_bIsDefined; - bool m_bSingleInheritance; - VisibleInterfaces m_visibleInterfaces; - VisibleMembers m_visibleMembers; -}; - -#endif // INCLUDED_IDLC_INC_ASTINTERFACE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astinterfacemember.hxx b/idlc/inc/astinterfacemember.hxx deleted file mode 100644 index 0e290e1875d7..000000000000 --- a/idlc/inc/astinterfacemember.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTINTERFACEMEMBER_HXX -#define INCLUDED_IDLC_INC_ASTINTERFACEMEMBER_HXX - -#include "astinterface.hxx" - -class AstInterfaceMember final : public AstDeclaration -{ -public: - AstInterfaceMember(const sal_uInt32 flags, AstInterface* pRealInterface, - const OString& name, AstScope* pScope) - : AstDeclaration(NT_interface_member, name, pScope) - , m_flags(flags) - , m_pRealInterface(pRealInterface) - {} - - AstInterface* getRealInterface() - { return m_pRealInterface; } - bool isOptional() const - { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } -private: - const sal_uInt32 m_flags; - AstInterface* m_pRealInterface; -}; - -#endif // INCLUDED_IDLC_INC_ASTINTERFACEMEMBER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astmember.hxx b/idlc/inc/astmember.hxx deleted file mode 100644 index 43597d125d87..000000000000 --- a/idlc/inc/astmember.hxx +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_IDLC_INC_ASTMEMBER_HXX -#define INCLUDED_IDLC_INC_ASTMEMBER_HXX - -#include "astdeclaration.hxx" - -class AstScope; -class AstType; - -class AstMember: public AstDeclaration { -public: - AstMember( - AstType const * pType, OString const & name, AstScope * pScope): - AstDeclaration(NT_member, name, pScope), m_pType(pType) {} - - AstType const * getType() const { return m_pType; } - -protected: - AstMember( - NodeType type, AstType const * pType, OString const & name, - AstScope * pScope): - AstDeclaration(type, name, pScope), m_pType(pType) {} - -private: - AstType const * m_pType; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astmodule.hxx b/idlc/inc/astmodule.hxx deleted file mode 100644 index 6178cfbb63da..000000000000 --- a/idlc/inc/astmodule.hxx +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTMODULE_HXX -#define INCLUDED_IDLC_INC_ASTMODULE_HXX - -#include "astdeclaration.hxx" -#include "astscope.hxx" - -class AstModule : public AstDeclaration, public AstScope -{ -public: - AstModule(const OString& name, AstScope* pScope) - : AstDeclaration(NT_module, name, pScope) - , AstScope(NT_module) - { - } - AstModule(NodeType type, const OString& name, AstScope* pScope) - : AstDeclaration(type, name, pScope) - , AstScope(type) - { - } - - virtual bool dump(RegistryKey& rKey) override; -}; - -#endif // INCLUDED_IDLC_INC_ASTMODULE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astneeds.hxx b/idlc/inc/astneeds.hxx deleted file mode 100644 index 13d2dbbef197..000000000000 --- a/idlc/inc/astneeds.hxx +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTNEEDS_HXX -#define INCLUDED_IDLC_INC_ASTNEEDS_HXX - -#include "astservice.hxx" - -class AstNeeds final : public AstDeclaration -{ -public: - AstNeeds(AstService* pRealService, const OString& name, AstScope* pScope) - : AstDeclaration(NT_needs, name, pScope) - , m_pRealService(pRealService) - { - } - - AstService* getRealService() { return m_pRealService; } - -private: - AstService* m_pRealService; -}; - -#endif // INCLUDED_IDLC_INC_ASTNEEDS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astobserves.hxx b/idlc/inc/astobserves.hxx deleted file mode 100644 index 11bb5a6770b3..000000000000 --- a/idlc/inc/astobserves.hxx +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTOBSERVES_HXX -#define INCLUDED_IDLC_INC_ASTOBSERVES_HXX - -#include "astinterface.hxx" - -class AstObserves final : public AstDeclaration -{ -public: - AstObserves(AstInterface* pRealInterface, const OString& name, AstScope* pScope) - : AstDeclaration(NT_observes, name, pScope) - , m_pRealInterface(pRealInterface) - { - } - - AstInterface* getRealInterface() { return m_pRealInterface; } - -private: - AstInterface* m_pRealInterface; -}; - -#endif // INCLUDED_IDLC_INC_ASTOBSERVES_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astoperation.hxx b/idlc/inc/astoperation.hxx deleted file mode 100644 index e3e0335c968e..000000000000 --- a/idlc/inc/astoperation.hxx +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTOPERATION_HXX -#define INCLUDED_IDLC_INC_ASTOPERATION_HXX - -#include "astdeclaration.hxx" -#include "astscope.hxx" - -namespace typereg { class Writer; } - -class AstType; - -class AstOperation final : public AstDeclaration - , public AstScope -{ -public: - AstOperation(AstType const * pReturnType, const OString& name, AstScope* pScope) - : AstDeclaration(NT_operation, name, pScope) - , AstScope(NT_operation) - , m_pReturnType(pReturnType) - {} - - bool isVariadic() const; - - bool isConstructor() const { return m_pReturnType == nullptr; } - - void setExceptions(DeclList const * pExceptions); - - void dumpBlob(typereg::Writer & rBlob, sal_uInt16 index); - -private: - AstType const * m_pReturnType; - DeclList m_exceptions; -}; - -#endif // INCLUDED_IDLC_INC_ASTOPERATION_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astparameter.hxx b/idlc/inc/astparameter.hxx deleted file mode 100644 index cfee3426079b..000000000000 --- a/idlc/inc/astparameter.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_IDLC_INC_ASTPARAMETER_HXX -#define INCLUDED_IDLC_INC_ASTPARAMETER_HXX - -#include "astmember.hxx" - -enum Direction { DIR_IN, DIR_OUT, DIR_INOUT }; - -class AstParameter final : public AstMember { -public: - AstParameter( - Direction direction, bool rest, AstType const * type, - OString const & name, AstScope * scope): - AstMember(NT_parameter, type, name, scope), m_direction(direction), - m_rest(rest) {} - - Direction getDirection() const { return m_direction; } - - bool isRest() const { return m_rest; } - -private: - Direction m_direction; - bool m_rest; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astscope.hxx b/idlc/inc/astscope.hxx deleted file mode 100644 index be7b03828c14..000000000000 --- a/idlc/inc/astscope.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTSCOPE_HXX -#define INCLUDED_IDLC_INC_ASTSCOPE_HXX - -#include <sal/config.h> - -#include <string_view> -#include "idlc.hxx" -#include "astdeclaration.hxx" -#include "astexpression.hxx" - -class AstExpression; - -class AstScope -{ -public: - AstScope(NodeType nodeType); - virtual ~AstScope(); - - AstScope(AstScope const&) = default; - AstScope(AstScope&&) = default; - AstScope& operator=(AstScope const&) = default; - AstScope& operator=(AstScope&&) = default; - - NodeType getScopeNodeType() const { return m_nodeType; } - - AstDeclaration* addDeclaration(AstDeclaration* pDecl); - - sal_uInt32 nMembers() const { return static_cast<sal_uInt32>(m_declarations.size()); } - DeclList::const_iterator getIteratorBegin() const { return m_declarations.begin(); } - DeclList::const_iterator getIteratorEnd() const { return m_declarations.end(); } - sal_uInt16 getNodeCount(NodeType nType) const; - - // Name look up mechanism - AstDeclaration* lookupByName(const OString& scopedName); - // Look up the identifier 'name' specified only in the local scope - AstDeclaration* lookupByNameLocal(std::string_view name) const; - - AstDeclaration* lookupInInherited(const OString& scopedName) const; - - // Look up a predefined type by its ExprType - AstDeclaration* lookupPrimitiveType(ExprType type); - - AstDeclaration* lookupForAdd(AstDeclaration const* pDecl) const; - -protected: - AstDeclaration const* getLast() const { return m_declarations.back(); } - -private: - DeclList m_declarations; - NodeType m_nodeType; -}; - -#endif // INCLUDED_IDLC_INC_ASTSCOPE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astsequence.hxx b/idlc/inc/astsequence.hxx deleted file mode 100644 index e8a2850e23f4..000000000000 --- a/idlc/inc/astsequence.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTSEQUENCE_HXX -#define INCLUDED_IDLC_INC_ASTSEQUENCE_HXX - -#include "asttype.hxx" - -class AstSequence final : public AstType -{ -public: - AstSequence(AstType const* pMemberType, AstScope* pScope) - : AstType(NT_sequence, OString::Concat("[]") + pMemberType->getScopedName(), pScope) - , m_pMemberType(pMemberType) - { - } - - AstType const* getMemberType() const { return m_pMemberType; } - - virtual bool isUnsigned() const override - { - return m_pMemberType != nullptr && m_pMemberType->isUnsigned(); - } - - virtual const char* getRelativName() const override; - -private: - AstType const* m_pMemberType; - mutable std::optional<OString> m_xRelativName; -}; - -#endif // INCLUDED_IDLC_INC_ASTSEQUENCE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astservice.hxx b/idlc/inc/astservice.hxx deleted file mode 100644 index 4ad769cd5e70..000000000000 --- a/idlc/inc/astservice.hxx +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTSERVICE_HXX -#define INCLUDED_IDLC_INC_ASTSERVICE_HXX - -#include "astdeclaration.hxx" -#include "astscope.hxx" - -class AstService final : public AstDeclaration - , public AstScope -{ -public: - AstService(const OString& name, AstScope* pScope) - : AstDeclaration(NT_service, name, pScope) - , AstScope(NT_service) - , m_singleInterfaceBasedService(false) - , m_defaultConstructor(false) - {} - AstService(const NodeType type, const OString& name, AstScope* pScope) - : AstDeclaration(type, name, pScope) - , AstScope(type) - , m_singleInterfaceBasedService(false) - , m_defaultConstructor(false) - {} - - virtual bool dump(RegistryKey& rKey) override; - - void setSingleInterfaceBasedService() - { m_singleInterfaceBasedService = true; } - - void setDefaultConstructor(bool b) { m_defaultConstructor = b; } - - bool isSingleInterfaceBasedService() const - { return m_singleInterfaceBasedService; } - - bool checkLastConstructor() const; - -private: - bool m_singleInterfaceBasedService; - bool m_defaultConstructor; -}; - -#endif // INCLUDED_IDLC_INC_ASTSERVICE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astservicemember.hxx b/idlc/inc/astservicemember.hxx deleted file mode 100644 index 380449b25529..000000000000 --- a/idlc/inc/astservicemember.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTSERVICEMEMBER_HXX -#define INCLUDED_IDLC_INC_ASTSERVICEMEMBER_HXX - -#include "astservice.hxx" - -class AstServiceMember final : public AstDeclaration -{ -public: - AstServiceMember(const sal_uInt32 flags, AstService* pRealService, - const OString& name, AstScope* pScope) - : AstDeclaration(NT_service_member, name, pScope) - , m_flags(flags) - , m_pRealService(pRealService) - {} - - AstService* getRealService() - { return m_pRealService; } - bool isOptional() const - { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } -private: - const sal_uInt32 m_flags; - AstService* m_pRealService; -}; - -#endif // INCLUDED_IDLC_INC_ASTSERVICEMEMBER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/aststack.hxx b/idlc/inc/aststack.hxx deleted file mode 100644 index d36bd4e48e40..000000000000 --- a/idlc/inc/aststack.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#pragma once - -#include <sal/types.h> -#include <vector> - -class AstScope; - -class AstStack final -{ -public: - AstStack(); - ~AstStack(); - - sal_uInt32 depth() const { return m_stack.size(); } - AstScope* top(); - AstScope* bottom(); - AstScope* nextToTop(); - AstScope* topNonNull(); - AstStack* push(AstScope* pScope); - void pop(); - void clear(); - -private: - std::vector<AstScope*> m_stack; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/aststruct.hxx b/idlc/inc/aststruct.hxx deleted file mode 100644 index 5e037d1b5a72..000000000000 --- a/idlc/inc/aststruct.hxx +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTSTRUCT_HXX -#define INCLUDED_IDLC_INC_ASTSTRUCT_HXX - -#include <sal/config.h> - -#include <string_view> - -#include "asttype.hxx" -#include "astscope.hxx" -#include "idlctypes.hxx" - -class AstStruct; - -class AstStruct : public AstType - , public AstScope -{ -public: - AstStruct( - const OString& name, - std::vector< OString > const & typeParameters, - AstStruct const* pBaseType, AstScope* pScope); - - AstStruct(const NodeType type, - const OString& name, - AstStruct const* pBaseType, - AstScope* pScope); - virtual ~AstStruct() override; - - std::size_t getTypeParameterCount() const - { return m_typeParameters.size(); } - - AstDeclaration const * findTypeParameter(std::string_view name) const; - - virtual bool isType() const override; - - virtual bool dump(RegistryKey& rKey) override; -private: - AstStruct const* m_pBaseType; - std::vector<std::unique_ptr<AstDeclaration>> m_typeParameters; -}; - -#endif // INCLUDED_IDLC_INC_ASTSTRUCT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/aststructinstance.hxx b/idlc/inc/aststructinstance.hxx deleted file mode 100644 index 1357aa351970..000000000000 --- a/idlc/inc/aststructinstance.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_IDLC_INC_ASTSTRUCTINSTANCE_HXX -#define INCLUDED_IDLC_INC_ASTSTRUCTINSTANCE_HXX - -#include "asttype.hxx" -#include "idlctypes.hxx" - -class AstScope; - -class AstStructInstance final : public AstType { -public: - AstStructInstance( - AstType const * typeTemplate, DeclList const * typeArguments, - AstScope * scope); - - AstType const * getTypeTemplate() const { return m_typeTemplate; } - - DeclList::const_iterator getTypeArgumentsBegin() const - { return m_typeArguments.begin(); } - - DeclList::const_iterator getTypeArgumentsEnd() const - { return m_typeArguments.end(); } - -private: - AstType const * m_typeTemplate; - DeclList m_typeArguments; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/asttype.hxx b/idlc/inc/asttype.hxx deleted file mode 100644 index 8627429cd01a..000000000000 --- a/idlc/inc/asttype.hxx +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTTYPE_HXX -#define INCLUDED_IDLC_INC_ASTTYPE_HXX - -#include "astdeclaration.hxx" - -class AstType : public AstDeclaration -{ -public: - AstType(const NodeType type, const OString& name, AstScope* pScope) - : AstDeclaration(type, name, pScope) - { - } - - virtual bool isUnsigned() const { return false; } -}; - -#endif // INCLUDED_IDLC_INC_ASTTYPE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/asttypedef.hxx b/idlc/inc/asttypedef.hxx deleted file mode 100644 index 427d63307ba6..000000000000 --- a/idlc/inc/asttypedef.hxx +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ASTTYPEDEF_HXX -#define INCLUDED_IDLC_INC_ASTTYPEDEF_HXX - -#include "asttype.hxx" - -class AstTypeDef final : public AstType -{ -public: - AstTypeDef( - AstType const * baseType, OString const & name, AstScope * scope): - AstType(NT_typedef, name, scope), m_pBaseType(baseType) {} - - AstType const * getBaseType() const - { return m_pBaseType; } - - virtual bool isUnsigned() const override - { return m_pBaseType != nullptr && m_pBaseType->isUnsigned(); } - - virtual bool dump(RegistryKey& rKey) override; -private: - AstType const * m_pBaseType; -}; - -#endif // INCLUDED_IDLC_INC_ASTTYPEDEF_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/errorhandler.hxx b/idlc/inc/errorhandler.hxx deleted file mode 100644 index 9b49f5df441a..000000000000 --- a/idlc/inc/errorhandler.hxx +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_ERRORHANDLER_HXX -#define INCLUDED_IDLC_INC_ERRORHANDLER_HXX - -#include "astdeclaration.hxx" -#include "astexpression.hxx" -#include "astenum.hxx" - -enum class ErrorCode -{ - SyntaxError, // Syntax error in IDL input - // More details will be gleaned from examining - // the parse state - RedefScope, // Redefinition inside defining scope - CoercionFailure, // Coercion failure - ScopeConflict, // Between fwd declare and full declare - IllegalAdd, // Illegal add action - IllegalRaises, // Error in "raises" clause - CantInherit, // Cannot inherit from non-interface - IdentNotFound, // Identifier not found - CannotInheritFromForward, // Cannot inherit from fwd decl interface - ExpectedConstant, // We got something else... - Eval, // Error in evaluating expression - ForwardDeclLookup, // Tried to lookup in fwd declared intf - RecursiveType, // Illegal recursive use of type - NotAType, // Not a type - InterfaceMemberLookup, // interface is not defined or a fwd declaration not exists - ServiceMemberLookup, - DefinedAttributeFlag, - WrongAttributeKeyword, - MissingAttributeKeyword, - BadAttributeFlags, - ExpectedOptional, - MixedInheritance, - DoubleInheritance, - DoubleMember, - ConstructorParameterNotIn, - ConstructorRestParameterNotFirst, - RestParameterNotLast, - RestParameterNotAny, - MethodHasRestParameter, - ReadOnlyAttributeSetExceptions, - UnsignedTypeArgument, - WrongNumberOfTypeArguments, - InstantiatedStructTypeTypedef, - IdenticalTypeParameters, - StructTypeTemplateWithBase, - PublishedForward, - PublishedusesUnpublished, - SimilarConstructors -}; - -enum class WarningCode -{ - WrongNamingConvention // type or identifier doesn't fulfill the UNO naming convention -}; - -class ErrorHandler -{ -public: - // Report errors with varying numbers of arguments - static void error0(ErrorCode e); - static void error1(ErrorCode e, AstDeclaration const * d); - static void error2( - ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2); - static void error3(ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2, AstDeclaration const * d3); - - // Warning - static void warning0(WarningCode e, const char* warningmsg); - - // Report a syntax error in IDL input - static void syntaxError(ParseState state, sal_Int32 lineNumber, const char* errmsg); - - // Report an unsuccessful coercion attempt - static void coercionError(AstExpression *pExpr, ExprType et); - - // Report a failed name lookup attempt - static void lookupError(const OString& n); - // Report a failed name lookup attempt - static void lookupError(ErrorCode e, const OString& n, AstDeclaration const * pScope); - - - // Report a type error - static void noTypeError(AstDeclaration const * pDecl); - - static void inheritanceError(NodeType nodeType, const OString* name, AstDeclaration const * pDecl); - - static void flagError(ErrorCode e, sal_uInt32 flag); - - static void forwardLookupError(const AstDeclaration* pForward, const OString& name); - - static void constantExpected(AstDeclaration const * pDecl, const OString& name); - - static void evalError(AstExpression* pExpr); - - static bool checkPublished(AstDeclaration const * decl, bool bOptional=false); -}; - -#endif // INCLUDED_IDLC_INC_ERRORHANDLER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/fehelper.hxx b/idlc/inc/fehelper.hxx deleted file mode 100644 index be401defcaa1..000000000000 --- a/idlc/inc/fehelper.hxx +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_FEHELPER_HXX -#define INCLUDED_IDLC_INC_FEHELPER_HXX - -#include "asttype.hxx" -#include "astinterface.hxx" - -#include <vector> - -class FeDeclarator final -{ -public: - FeDeclarator(const OString& name); - ~FeDeclarator(); - const OString& getName() const - { return m_name; } - bool checkType(AstDeclaration const * pType) const; - static AstType const * compose(AstDeclaration const * pDecl); -private: - OString m_name; -}; - -typedef ::std::list< FeDeclarator* > FeDeclList; - -class FeInheritanceHeader final -{ -public: - FeInheritanceHeader( - NodeType nodeType, OString* pName, OString const * pInherits, - std::vector< OString > const * typeParameters); - - NodeType getNodeType() const - { return m_nodeType; } - OString* getName() - { return m_pName.get(); } - AstDeclaration* getInherits() - { return m_pInherits; } - - std::vector< OString > const & getTypeParameters() const - { return m_typeParameters; } - -private: - void initializeInherits(OString const * pinherits); - - NodeType m_nodeType; - std::unique_ptr<OString> m_pName; - AstDeclaration* m_pInherits; - std::vector< OString > m_typeParameters; -}; - -#endif // INCLUDED_IDLC_INC_FEHELPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc.hxx b/idlc/inc/idlc.hxx deleted file mode 100644 index 1be11b1457da..000000000000 --- a/idlc/inc/idlc.hxx +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#pragma once - -#include "idlctypes.hxx" -#include "aststack.hxx" -#include "options.hxx" -#include <memory> -#include <string_view> - -#ifdef SAL_UNX -#define SEPARATOR '/' -#define PATH_SEPARATOR "/" -#else -#define SEPARATOR '\\' -#define PATH_SEPARATOR "\\" -#endif - -class AstInterface; -class AstModule; -class AstType; -class Options; -class ErrorHandler; - -class Idlc final -{ -public: - Idlc(Options* pOptions); - ~Idlc(); - - void init(); - - bool dumpDeps(std::string_view rDepFile, - OString const& rTarget); - - Options* getOptions() - { return m_pOptions; } - AstStack* scopes() - { return m_pScopes.get(); } - AstModule* getRoot() - { return m_pRoot.get(); } - const OString& getFileName() const - { return m_fileName; } - void setFileName(const OString& fileName) - { m_fileName = fileName; addInclude(fileName); } - const OString& getMainFileName() const - { return m_mainFileName; } - void setMainFileName(const OString& mainFileName) - { m_mainFileName = mainFileName; } - const OString& getRealFileName() const - { return m_realFileName; } - void setRealFileName(const OString& realFileName) - { m_realFileName = realFileName; } - const OString& getDocumentation() - { - m_bIsDocValid = false; - return m_documentation; - } - void setDocumentation(const OString& documentation) - { - m_documentation = documentation; - m_bIsDocValid = true; - } - OUString processDocumentation(); - bool isInMainFile() const - { return m_bIsInMainfile; } - void setInMainfile(bool bInMainfile) - { m_bIsInMainfile = bInMainfile; } - sal_uInt32 getErrorCount() const - { return m_errorCount; } - void incErrorCount() - { m_errorCount++; } - sal_uInt32 getWarningCount() const - { return m_warningCount; } - void incWarningCount() - { m_warningCount++; } - sal_uInt32 getLineNumber() const - { return m_lineNumber; } - sal_uInt32 getOffsetStart() const - { return m_offsetStart; } - sal_uInt32 getOffsetEnd() const - { return m_offsetEnd; } - void setOffset( sal_uInt32 start, sal_uInt32 end) - { m_offsetStart = start; m_offsetEnd = end; } - void setLineNumber(sal_uInt32 lineNumber) - { m_lineNumber = lineNumber; } - void incLineNumber() - { m_lineNumber++; } - ParseState getParseState() const - { return m_parseState; } - void setParseState(ParseState parseState) - { m_parseState = parseState; } - - void addInclude(const OString& inc) - { m_includes.insert(inc); } - - void setPublished(bool published) { m_published = published; } - bool isPublished() const { return m_published; } - - void reset(); -private: - Options* m_pOptions; - std::unique_ptr<AstStack> m_pScopes; - std::unique_ptr<AstModule> m_pRoot; - OString m_fileName; - OString m_mainFileName; - OString m_realFileName; - OString m_documentation; - bool m_bIsDocValid; - bool m_bGenerateDoc; - bool m_bIsInMainfile; - bool m_published; - sal_uInt32 m_errorCount; - sal_uInt32 m_warningCount; - sal_uInt32 m_lineNumber; - sal_uInt32 m_offsetStart; - sal_uInt32 m_offsetEnd; - ParseState m_parseState; - std::set< OString > m_includes; -}; - - -typedef ::std::pair< OString, OString > sPair_t; -sal_Int32 compileFile(const OString * pathname); - // a null pathname means stdin -sal_Int32 produceFile(const OString& filenameBase, - sPair_t const*const pDepFile); - // filenameBase is filename without ".idl" -void removeIfExists(std::string_view pathname); - -bool copyFile(const OString* source, const OString& target); - // a null source means stdin - -bool isFileUrl(std::string_view fileName); -OString convertToAbsoluteSystemPath(const OString& fileName); -OString convertToFileUrl(const OString& fileName); - -Idlc* idlc(); -Idlc* setIdlc(Options* pOptions); - -AstDeclaration const * resolveTypedefs(AstDeclaration const * type); - -AstDeclaration const * deconstructAndResolveTypedefs( - AstDeclaration const * type, sal_Int32 * rank); - -AstInterface const * resolveInterfaceTypedefs(AstType const * type); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlctypes.hxx b/idlc/inc/idlctypes.hxx deleted file mode 100644 index a2dadfee178a..000000000000 --- a/idlc/inc/idlctypes.hxx +++ /dev/null @@ -1,189 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * ... etc. - the rest is truncated