From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/Makefile.am | 74 + languages/ada/AdaAST.hpp | 77 + languages/ada/AdaLexer.cpp | 1507 +++ languages/ada/AdaLexer.hpp | 86 + languages/ada/AdaParser.cpp | 12283 +++++++++++++++++++ languages/ada/AdaParser.hpp | 389 + languages/ada/AdaStoreWalker.cpp | 9439 ++++++++++++++ languages/ada/AdaStoreWalker.hpp | 350 + languages/ada/AdaStoreWalkerTokenTypes.hpp | 307 + languages/ada/AdaStoreWalkerTokenTypes.txt | 289 + languages/ada/AdaTokenTypes.hpp | 306 + languages/ada/AdaTokenTypes.txt | 288 + languages/ada/AdaTreeParserSuper.cpp | 9050 ++++++++++++++ languages/ada/AdaTreeParserSuper.hpp | 241 + languages/ada/AdaTreeParserSuperTokenTypes.hpp | 307 + languages/ada/AdaTreeParserSuperTokenTypes.txt | 289 + languages/ada/Makefile.am | 41 + languages/ada/README | 1 + languages/ada/README.dox | 31 + languages/ada/ada.g | 1982 +++ languages/ada/ada.store.g | 610 + languages/ada/ada.tree.g | 964 ++ languages/ada/ada_utils.cpp | 69 + languages/ada/ada_utils.hpp | 15 + languages/ada/adasupport.cpp | 168 + languages/ada/adasupport.hpp | 13 + languages/ada/adasupportpart.cpp | 376 + languages/ada/adasupportpart.h | 50 + languages/ada/addclass.cpp | 351 + languages/ada/addclass.h | 55 + languages/ada/addclassdlg.ui | 434 + languages/ada/app_templates/Makefile.am | 5 + languages/ada/app_templates/ada.appwizard | 2 + languages/ada/app_templates/adahello/.kdev_ignore | 0 languages/ada/app_templates/adahello/Makefile.am | 16 + languages/ada/app_templates/adahello/ada-Makefile | 2 + .../ada/app_templates/adahello/ada-Makefile.am | 5 + .../ada/app_templates/adahello/ada-Makefile.cvs | 8 + languages/ada/app_templates/adahello/adahello | 10 + .../app_templates/adahello/adahello.kdevtemplate | 132 + languages/ada/app_templates/adahello/adahello.png | Bin 0 -> 10118 bytes languages/ada/app_templates/adahello/app.kdevelop | 84 + .../app_templates/adahello/app.kdevelop.filelist | 1 + languages/ada/app_templates/adahello/configure.in | 10 + languages/ada/app_templates/adahello/main.adb | 8 + .../ada/app_templates/adahello/src-Makefile.am | 8 + languages/ada/backgroundparser.cpp | 77 + languages/ada/backgroundparser.h | 37 + languages/ada/configproblemreporter.ui | 89 + languages/ada/configproblemreporter.ui.h | 39 + languages/ada/configure.in.in | 4 + languages/ada/doc/Makefile.am | 6 + languages/ada/doc/ada.toc | 130 + languages/ada/doc/ada_bugs_gcc.toc | 7 + languages/ada/file_templates/Makefile.am | 3 + languages/ada/file_templates/adb | 12 + languages/ada/file_templates/ads | 12 + languages/ada/kdevadasupport.desktop | 87 + languages/ada/kdevadasupport.rc | 11 + languages/ada/preambles.h | 89 + languages/ada/problemreporter.cpp | 282 + languages/ada/problemreporter.h | 79 + languages/bash/Makefile.am | 20 + languages/bash/README.dox | 15 + languages/bash/app_templates/Makefile.am | 3 + languages/bash/app_templates/bash.appwizard | 2 + .../bash/app_templates/bashhello/.kdev_ignore | 0 languages/bash/app_templates/bashhello/Makefile.am | 16 + .../bash/app_templates/bashhello/app.kdevelop | 82 + languages/bash/app_templates/bashhello/app.sh | 17 + languages/bash/app_templates/bashhello/bashhello | 10 + .../app_templates/bashhello/bashhello.kdevtemplate | 111 + .../bash/app_templates/bashhello/bashhello.png | Bin 0 -> 483 bytes languages/bash/bashsupport_part.cpp | 442 + languages/bash/bashsupport_part.h | 81 + languages/bash/doc/Makefile.am | 6 + languages/bash/doc/bash.toc | 80 + languages/bash/doc/bash_bugs.toc | 7 + languages/bash/kdevbashsupport.desktop | 85 + languages/bash/kdevbashsupport.rc | 11 + languages/cpp/KDevCppSupportIface.cpp | 24 + languages/cpp/KDevCppSupportIface.h | 27 + languages/cpp/Makefile.am | 59 + languages/cpp/README.dox | 34 + languages/cpp/addattributedialog.cpp | 265 + languages/cpp/addattributedialog.h | 60 + languages/cpp/addattributedialogbase.ui | 375 + languages/cpp/addmethoddialog.cpp | 420 + languages/cpp/addmethoddialog.h | 62 + languages/cpp/addmethoddialogbase.ui | 459 + languages/cpp/app_templates/Makefile.am | 10 + .../cpp/app_templates/automakeempty/Makefile.am | 17 + .../cpp/app_templates/automakeempty/app.kdevelop | 101 + .../automakeempty/automakeempty-Makefile.am | 1 + .../automakeempty/automakeempty-Makefile.cvs | 8 + .../automakeempty/automakeempty.kdevtemplate | 99 + .../app_templates/automakeempty/automakeempty.png | Bin 0 -> 8621 bytes .../cpp/app_templates/automakeempty/configure.in | 10 + languages/cpp/app_templates/c.appwizard | 2 + languages/cpp/app_templates/chello/.kdev_ignore | 0 languages/cpp/app_templates/chello/Makefile.am | 18 + languages/cpp/app_templates/chello/app.kdevelop | 107 + languages/cpp/app_templates/chello/c-Makefile.am | 5 + languages/cpp/app_templates/chello/c-Makefile.cvs | 8 + .../cpp/app_templates/chello/chello.kdevtemplate | 253 + languages/cpp/app_templates/chello/chello.png | Bin 0 -> 10118 bytes languages/cpp/app_templates/chello/configure.in | 10 + languages/cpp/app_templates/chello/main.c | 15 + languages/cpp/app_templates/chello/src-Makefile.am | 8 + .../cpp/app_templates/chello_gba/.kdev_ignore | 0 languages/cpp/app_templates/chello_gba/Makefile.am | 18 + .../cpp/app_templates/chello_gba/README.devel | 30 + .../cpp/app_templates/chello_gba/app.kdevelop | 100 + .../cpp/app_templates/chello_gba/c-Makefile.am | 5 + .../cpp/app_templates/chello_gba/c-Makefile.cvs | 8 + .../chello_gba/chellogba.kdevtemplate | 173 + .../cpp/app_templates/chello_gba/chellogba.png | Bin 0 -> 5041 bytes .../cpp/app_templates/chello_gba/configure.in | 10 + languages/cpp/app_templates/chello_gba/font.bmp | Bin 0 -> 1026 bytes languages/cpp/app_templates/chello_gba/font.raw.c | 123 + languages/cpp/app_templates/chello_gba/gba.h | 204 + languages/cpp/app_templates/chello_gba/main.c | 50 + languages/cpp/app_templates/chello_gba/main.h | 12 + .../cpp/app_templates/chello_gba/master.pal.c | 35 + .../cpp/app_templates/chello_gba/src-Makefile.am | 13 + languages/cpp/app_templates/clanlib/.kdev_ignore | 0 languages/cpp/app_templates/clanlib/Makefile.am | 17 + .../cpp/app_templates/clanlib/app-Makefile.am | 1 + languages/cpp/app_templates/clanlib/app-autogen.sh | 2 + .../cpp/app_templates/clanlib/app-configure.in | 22 + languages/cpp/app_templates/clanlib/app.kdevelop | 106 + .../cpp/app_templates/clanlib/clanlib.kdevtemplate | 138 + languages/cpp/app_templates/clanlib/clanlib.png | Bin 0 -> 483 bytes languages/cpp/app_templates/clanlib/main.cpp | 29 + .../cpp/app_templates/clanlib/src-Makefile.am | 4 + .../cpp/app_templates/cmakelibc/CMakeLists.txt | 7 + .../cpp/app_templates/cmakelibc/CMakeLists.txt.src | 19 + languages/cpp/app_templates/cmakelibc/Makefile.am | 16 + languages/cpp/app_templates/cmakelibc/cmakelibc | 7 + .../app_templates/cmakelibc/cmakelibc.kdevtemplate | 139 + .../cpp/app_templates/cmakelibc/cmakelibc.png | Bin 0 -> 10060 bytes languages/cpp/app_templates/cmakelibc/lib.c | 13 + languages/cpp/app_templates/cmakelibc/lib.h | 7 + languages/cpp/app_templates/cmakelibc/test.c | 8 + .../cpp/app_templates/cmakelibcpp/CMakeLists.txt | 8 + .../app_templates/cmakelibcpp/CMakeLists.txt.src | 19 + .../cpp/app_templates/cmakelibcpp/Makefile.am | 16 + .../cpp/app_templates/cmakelibcpp/cmakelibcpp | 7 + .../cmakelibcpp/cmakelibcpp.kdevtemplate | 139 + .../cpp/app_templates/cmakelibcpp/cmakelibcpp.png | Bin 0 -> 10060 bytes languages/cpp/app_templates/cmakelibcpp/lib.cpp | 17 + languages/cpp/app_templates/cmakelibcpp/lib.h | 12 + languages/cpp/app_templates/cmakelibcpp/test.cpp | 9 + .../cpp/app_templates/cmakeqt3app/CMakeLists.txt | 14 + .../app_templates/cmakeqt3app/CMakeLists.txt.src | 28 + .../cpp/app_templates/cmakeqt3app/Makefile.am | 18 + .../cpp/app_templates/cmakeqt3app/cmakeqt3app | 8 + .../cpp/app_templates/cmakeqt3app/cmakeqt3app.cpp | 283 + .../cpp/app_templates/cmakeqt3app/cmakeqt3app.h | 39 + .../cmakeqt3app/cmakeqt3app.kdevtemplate | 126 + .../cpp/app_templates/cmakeqt3app/cmakeqt3app.png | Bin 0 -> 5034 bytes .../cpp/app_templates/cmakeqt3app/fileopen.xpm | 22 + .../cpp/app_templates/cmakeqt3app/fileprint.xpm | 24 + .../cpp/app_templates/cmakeqt3app/filesave.xpm | 22 + languages/cpp/app_templates/cmakeqt3app/main.cpp | 13 + .../cpp/app_templates/cmakesimple/CMakeLists.txt | 15 + .../cpp/app_templates/cmakesimple/Makefile.am | 16 + languages/cpp/app_templates/cmakesimple/README | 30 + .../cpp/app_templates/cmakesimple/cmakesimple | 7 + .../cmakesimple/cmakesimple.kdevtemplate | 112 + .../cpp/app_templates/cmakesimple/cmakesimple.png | Bin 0 -> 12197 bytes languages/cpp/app_templates/cmakesimple/main.cpp | 14 + .../cpp/app_templates/cmakesimplec/CMakeLists.txt | 14 + .../cpp/app_templates/cmakesimplec/Makefile.am | 16 + .../cpp/app_templates/cmakesimplec/cmakesimplec | 7 + .../cmakesimplec/cmakesimplec.kdevtemplate | 115 + .../app_templates/cmakesimplec/cmakesimplec.png | Bin 0 -> 10060 bytes languages/cpp/app_templates/cmakesimplec/main.c | 14 + languages/cpp/app_templates/cpp.appwizard | 2 + .../cpp/app_templates/cppcurseshello/.kdev_ignore | 0 .../cpp/app_templates/cppcurseshello/Makefile.am | 17 + .../app_templates/cppcurseshello/app-configure.in | 21 + .../cpp/app_templates/cppcurseshello/app.kdevelop | 105 + .../app_templates/cppcurseshello/cpp-Makefile.am | 5 + .../app_templates/cppcurseshello/cpp-Makefile.cvs | 7 + .../app_templates/cppcurseshello/cppcurseshello | 10 + .../cppcurseshello/cppcurseshello.kdevtemplate | 143 + .../cppcurseshello/cppcurseshello.png | Bin 0 -> 483 bytes .../cpp/app_templates/cppcurseshello/main.cpp | 49 + .../app_templates/cppcurseshello/src-Makefile.am | 8 + languages/cpp/app_templates/cpphello/.kdev_ignore | 0 languages/cpp/app_templates/cpphello/Makefile.am | 17 + languages/cpp/app_templates/cpphello/app.kdevelop | 105 + languages/cpp/app_templates/cpphello/configure.in | 10 + .../cpp/app_templates/cpphello/cpp-Makefile.am | 5 + .../cpp/app_templates/cpphello/cpp-Makefile.cvs | 8 + .../app_templates/cpphello/cpphello.kdevtemplate | 145 + languages/cpp/app_templates/cpphello/cpphello.png | Bin 0 -> 8621 bytes languages/cpp/app_templates/cpphello/main.cpp | 17 + .../cpp/app_templates/cpphello/src-Makefile.am | 8 + .../cpp/app_templates/cppsdlhello/.kdev_ignore | 0 .../cpp/app_templates/cppsdlhello/Makefile.am | 16 + languages/cpp/app_templates/cppsdlhello/README | 11 + .../cpp/app_templates/cppsdlhello/acinclude.m4 | 167 + .../cpp/app_templates/cppsdlhello/app.kdevelop | 103 + .../cpp/app_templates/cppsdlhello/configure.in | 90 + .../cpp/app_templates/cppsdlhello/cpp-Makefile.am | 5 + .../cpp/app_templates/cppsdlhello/cpp-Makefile.cvs | 8 + .../cpp/app_templates/cppsdlhello/cppsdlhello | 10 + .../cppsdlhello/cppsdlhello.kdevtemplate | 150 + .../cpp/app_templates/cppsdlhello/cppsdlhello.png | Bin 0 -> 10118 bytes languages/cpp/app_templates/cppsdlhello/main.cpp | 29 + .../cpp/app_templates/cppsdlhello/src-Makefile.am | 9 + .../cpp/app_templates/dcopservice/.kdev_ignore | 0 .../cpp/app_templates/dcopservice/Makefile.am | 18 + .../cpp/app_templates/dcopservice/dcopservice | 10 + .../cpp/app_templates/dcopservice/dcopservice.cpp | 49 + .../app_templates/dcopservice/dcopservice.desktop | 43 + .../cpp/app_templates/dcopservice/dcopservice.h | 35 + .../app_templates/dcopservice/dcopservice.kdevelop | 109 + .../dcopservice/dcopservice.kdevtemplate | 202 + .../cpp/app_templates/dcopservice/dcopservice.png | Bin 0 -> 23880 bytes languages/cpp/app_templates/dcopservice/main.cpp | 47 + .../cpp/app_templates/dcopservice/src-Makefile.am | 17 + languages/cpp/app_templates/dcopservice/subdirs | 3 + .../cpp/app_templates/generichello/.kdev_ignore | 0 .../cpp/app_templates/generichello/Makefile.am | 19 + .../cpp/app_templates/generichello/app.kdevelop | 61 + languages/cpp/app_templates/generichello/app.prj | 8 + .../cpp/app_templates/generichello/cpphello.png | Bin 0 -> 10118 bytes .../generichello/generichello.kdevtemplate | 92 + languages/cpp/app_templates/generichello/main.cpp | 17 + .../cpp/app_templates/gnome2mmapp/.kdev_ignore | 0 .../cpp/app_templates/gnome2mmapp/Makefile.am | 21 + languages/cpp/app_templates/gnome2mmapp/acconfig.h | 23 + .../cpp/app_templates/gnome2mmapp/app-Makefile.am | 4 + .../cpp/app_templates/gnome2mmapp/app.kdevelop | 69 + languages/cpp/app_templates/gnome2mmapp/autogen.sh | 40 + languages/cpp/app_templates/gnome2mmapp/config.h | 0 .../cpp/app_templates/gnome2mmapp/configure.in | 57 + .../cpp/app_templates/gnome2mmapp/gnome2mm.cc | 22 + .../cpp/app_templates/gnome2mmapp/gnome2mm.glade | 24 + .../cpp/app_templates/gnome2mmapp/gnome2mm.gladep | 8 + .../cpp/app_templates/gnome2mmapp/gnome2mmapp | 8 + .../gnome2mmapp/gnome2mmapp.kdevtemplate | 186 + .../cpp/app_templates/gnome2mmapp/gnome2mmapp.png | Bin 0 -> 2750 bytes .../cpp/app_templates/gnome2mmapp/main_window.cc | 16 + .../cpp/app_templates/gnome2mmapp/main_window.hh | 19 + .../app_templates/gnome2mmapp/main_window_glade.cc | 30 + .../app_templates/gnome2mmapp/main_window_glade.hh | 49 + .../cpp/app_templates/gnome2mmapp/src-Makefile.am | 14 + languages/cpp/app_templates/gtk2mmapp/.kdev_ignore | 0 languages/cpp/app_templates/gtk2mmapp/Makefile.am | 21 + languages/cpp/app_templates/gtk2mmapp/acconfig.h | 10 + .../cpp/app_templates/gtk2mmapp/app-Makefile.am | 4 + languages/cpp/app_templates/gtk2mmapp/app.kdevelop | 113 + languages/cpp/app_templates/gtk2mmapp/autogen.sh | 33 + languages/cpp/app_templates/gtk2mmapp/config.h | 0 languages/cpp/app_templates/gtk2mmapp/configure.in | 19 + languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc | 15 + languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade | 30 + .../cpp/app_templates/gtk2mmapp/gtk2mm.gladep | 10 + .../app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate | 174 + .../cpp/app_templates/gtk2mmapp/gtk2mmapp.png | Bin 0 -> 2750 bytes .../cpp/app_templates/gtk2mmapp/main_window.cc | 12 + .../cpp/app_templates/gtk2mmapp/main_window.hh | 19 + .../app_templates/gtk2mmapp/main_window_glade.cc | 40 + .../app_templates/gtk2mmapp/main_window_glade.hh | 48 + .../cpp/app_templates/gtk2mmapp/src-Makefile.am | 14 + languages/cpp/app_templates/kapp/.kdev_ignore | 0 languages/cpp/app_templates/kapp/Makefile.am | 19 + languages/cpp/app_templates/kapp/README | 81 + languages/cpp/app_templates/kapp/app.cpp | 247 + languages/cpp/app_templates/kapp/app.desktop | 44 + languages/cpp/app_templates/kapp/app.h | 89 + languages/cpp/app_templates/kapp/app.kdevelop | 168 + languages/cpp/app_templates/kapp/app.kdevses | 13 + languages/cpp/app_templates/kapp/app_client.cpp | 26 + languages/cpp/app_templates/kapp/appiface.h | 17 + languages/cpp/app_templates/kapp/appui.rc | 8 + languages/cpp/app_templates/kapp/appview.cpp | 107 + languages/cpp/app_templates/kapp/appview.h | 77 + languages/cpp/app_templates/kapp/kapp.kdevtemplate | 253 + languages/cpp/app_templates/kapp/kapp.png | Bin 0 -> 6320 bytes languages/cpp/app_templates/kapp/main.cpp | 61 + languages/cpp/app_templates/kapp/pref.cpp | 42 + languages/cpp/app_templates/kapp/pref.h | 37 + languages/cpp/app_templates/kapp/src-Makefile.am | 43 + languages/cpp/app_templates/kapp/subdirs | 3 + .../cpp/app_templates/kateplugin/.kdev_ignore | 0 languages/cpp/app_templates/kateplugin/Makefile.am | 19 + .../kateplugin/hi16-action-plugin.png | Bin 0 -> 292 bytes .../kateplugin/hi22-action-plugin.png | Bin 0 -> 1151 bytes .../kateplugin/kateplugin.kdevtemplate | 213 + .../cpp/app_templates/kateplugin/kateplugin.png | Bin 0 -> 12901 bytes .../cpp/app_templates/kateplugin/plugin.desktop | 76 + .../cpp/app_templates/kateplugin/plugin.kdevelop | 113 + .../cpp/app_templates/kateplugin/plugin_app.cpp | 89 + .../cpp/app_templates/kateplugin/plugin_app.h | 49 + .../cpp/app_templates/kateplugin/plugin_app.rc | 11 + .../cpp/app_templates/kateplugin/src-Makefile.am | 20 + languages/cpp/app_templates/kateplugin/subdirs | 3 + .../cpp/app_templates/kateplugin2/.kdev_ignore | 0 .../cpp/app_templates/kateplugin2/Makefile.am | 19 + .../kateplugin2/hi16-action-plugin.png | Bin 0 -> 292 bytes .../kateplugin2/hi22-action-plugin.png | Bin 0 -> 1151 bytes .../kateplugin2/kateplugin2.kdevtemplate | 214 + .../cpp/app_templates/kateplugin2/kateplugin2.png | Bin 0 -> 12901 bytes .../cpp/app_templates/kateplugin2/plugin.desktop | 76 + .../cpp/app_templates/kateplugin2/plugin.kdevelop | 114 + .../cpp/app_templates/kateplugin2/plugin_app.cpp | 140 + .../cpp/app_templates/kateplugin2/plugin_app.h | 91 + .../cpp/app_templates/kateplugin2/plugin_app.rc | 11 + .../cpp/app_templates/kateplugin2/src-Makefile.am | 21 + languages/cpp/app_templates/kateplugin2/subdirs | 3 + languages/cpp/app_templates/kcmodule/.kdev_ignore | 0 languages/cpp/app_templates/kcmodule/Makefile.am | 17 + .../app_templates/kcmodule/kcmodule.kdevtemplate | 197 + languages/cpp/app_templates/kcmodule/kcmodule.png | Bin 0 -> 16691 bytes languages/cpp/app_templates/kcmodule/module.cpp | 66 + .../cpp/app_templates/kcmodule/module.desktop | 81 + languages/cpp/app_templates/kcmodule/module.h | 32 + .../cpp/app_templates/kcmodule/module.kdevelop | 113 + .../cpp/app_templates/kcmodule/src-Makefile.am | 17 + languages/cpp/app_templates/kcmodule/subdirs | 3 + languages/cpp/app_templates/kconfig35/Makefile.am | 19 + languages/cpp/app_templates/kconfig35/README | 90 + languages/cpp/app_templates/kconfig35/app.cpp | 105 + languages/cpp/app_templates/kconfig35/app.desktop | 40 + languages/cpp/app_templates/kconfig35/app.h | 60 + languages/cpp/app_templates/kconfig35/app.kcfg | 21 + languages/cpp/app_templates/kconfig35/app.kdevelop | 168 + languages/cpp/app_templates/kconfig35/appui.rc | 8 + languages/cpp/app_templates/kconfig35/appview.cpp | 41 + languages/cpp/app_templates/kconfig35/appview.h | 52 + .../cpp/app_templates/kconfig35/appview_base.ui | 33 + .../app_templates/kconfig35/kconfig35.kdevtemplate | 245 + .../cpp/app_templates/kconfig35/kconfig35.png | Bin 0 -> 6975 bytes languages/cpp/app_templates/kconfig35/kxt35.png | Bin 0 -> 6975 bytes languages/cpp/app_templates/kconfig35/main.cpp | 57 + .../cpp/app_templates/kconfig35/prefs-base.ui | 127 + languages/cpp/app_templates/kconfig35/prefs.cpp | 12 + languages/cpp/app_templates/kconfig35/prefs.h | 11 + .../cpp/app_templates/kconfig35/settings.kcfgc | 6 + .../cpp/app_templates/kconfig35/src-Makefile.am | 41 + .../app_templates/kconfig35/src-configure.in.in | 7 + languages/cpp/app_templates/kconfig35/subdirs | 3 + languages/cpp/app_templates/kde4app/CMakeLists.txt | 31 + languages/cpp/app_templates/kde4app/Makefile.am | 19 + languages/cpp/app_templates/kde4app/README | 15 + languages/cpp/app_templates/kde4app/kapp4.cpp | 90 + languages/cpp/app_templates/kde4app/kapp4.desktop | 30 + languages/cpp/app_templates/kde4app/kapp4.h | 53 + languages/cpp/app_templates/kde4app/kapp4.kcfg | 21 + languages/cpp/app_templates/kde4app/kapp4view.cpp | 42 + languages/cpp/app_templates/kde4app/kapp4view.h | 55 + .../cpp/app_templates/kde4app/kapp4view_base.ui | 213 + .../cpp/app_templates/kde4app/kde4app.kdevelop | 205 + .../kde4app/kde4app.kdevelop.filelist | 13 + .../cpp/app_templates/kde4app/kde4app.kdevtemplate | 155 + languages/cpp/app_templates/kde4app/kde4app.png | Bin 0 -> 6320 bytes languages/cpp/app_templates/kde4app/kde4appui.rc | 8 + languages/cpp/app_templates/kde4app/main.cpp | 55 + languages/cpp/app_templates/kde4app/prefs_base.ui | 155 + languages/cpp/app_templates/kde4app/settings.kcfgc | 6 + languages/cpp/app_templates/kdecpp.appwizard | 2 + languages/cpp/app_templates/kdedcop/.kdev_ignore | 0 languages/cpp/app_templates/kdedcop/Makefile.am | 18 + languages/cpp/app_templates/kdedcop/app.cpp | 21 + languages/cpp/app_templates/kdedcop/app.h | 36 + languages/cpp/app_templates/kdedcop/app.kdevelop | 116 + languages/cpp/app_templates/kdedcop/app_iface.h | 19 + .../cpp/app_templates/kdedcop/kdedcop.kdevtemplate | 227 + languages/cpp/app_templates/kdedcop/kdedcop.png | Bin 0 -> 2127 bytes languages/cpp/app_templates/kdedcop/main.cpp | 52 + languages/cpp/app_templates/kdedcop/mainclass.cpp | 31 + languages/cpp/app_templates/kdedcop/mainclass.h | 32 + .../cpp/app_templates/kdedcop/src-Makefile.am | 23 + languages/cpp/app_templates/kdedcop/subdirs | 3 + languages/cpp/app_templates/kdevlang/.kdev_ignore | 0 languages/cpp/app_templates/kdevlang/Makefile.am | 17 + languages/cpp/app_templates/kdevlang/README.dox | 55 + languages/cpp/app_templates/kdevlang/app.kdevelop | 115 + .../kdevlang/kdevlang-configure.in.in | 10 + .../cpp/app_templates/kdevlang/kdevlang.desktop | 14 + .../app_templates/kdevlang/kdevlang.kdevtemplate | 157 + languages/cpp/app_templates/kdevlang/kdevlang.png | Bin 0 -> 483 bytes languages/cpp/app_templates/kdevlang/kdevlang.rc | 11 + .../cpp/app_templates/kdevlang/kdevlang_part.cpp | 154 + .../cpp/app_templates/kdevlang/kdevlang_part.h | 43 + .../cpp/app_templates/kdevlang/src-Makefile.am | 14 + languages/cpp/app_templates/kdevpart/.kdev_ignore | 0 languages/cpp/app_templates/kdevpart/Makefile.am | 19 + languages/cpp/app_templates/kdevpart/README.dox | 55 + languages/cpp/app_templates/kdevpart/app.kdevelop | 116 + .../cpp/app_templates/kdevpart/globalconfig.cpp | 15 + .../cpp/app_templates/kdevpart/globalconfig.h | 22 + .../cpp/app_templates/kdevpart/globalconfigbase.ui | 20 + .../cpp/app_templates/kdevpart/kdevpart.desktop | 83 + .../app_templates/kdevpart/kdevpart.kdevtemplate | 242 + languages/cpp/app_templates/kdevpart/kdevpart.png | Bin 0 -> 483 bytes .../cpp/app_templates/kdevpart/kdevpart_part.cpp | 183 + .../cpp/app_templates/kdevpart/kdevpart_part.h | 45 + .../cpp/app_templates/kdevpart/kdevpart_part.rc | 11 + .../cpp/app_templates/kdevpart/kdevpart_widget.cpp | 21 + .../cpp/app_templates/kdevpart/kdevpart_widget.h | 23 + .../cpp/app_templates/kdevpart/projectconfig.cpp | 15 + .../cpp/app_templates/kdevpart/projectconfig.h | 22 + .../app_templates/kdevpart/projectconfigbase.ui | 20 + .../cpp/app_templates/kdevpart/src-Makefile.am | 20 + languages/cpp/app_templates/kdevpart2/.kdev_ignore | 0 languages/cpp/app_templates/kdevpart2/Makefile.am | 21 + languages/cpp/app_templates/kdevpart2/README.dox | 55 + languages/cpp/app_templates/kdevpart2/app.kdevelop | 148 + .../cpp/app_templates/kdevpart2/globalconfig.cpp | 15 + .../cpp/app_templates/kdevpart2/globalconfig.h | 22 + .../app_templates/kdevpart2/globalconfigbase.ui | 20 + .../kdevpart2/kdevpart-configure.in.in | 10 + .../cpp/app_templates/kdevpart2/kdevpart.desktop | 83 + .../app_templates/kdevpart2/kdevpart2.kdevtemplate | 276 + .../cpp/app_templates/kdevpart2/kdevpart2.png | Bin 0 -> 483 bytes .../cpp/app_templates/kdevpart2/kdevpart_part.cpp | 183 + .../cpp/app_templates/kdevpart2/kdevpart_part.h | 45 + .../cpp/app_templates/kdevpart2/kdevpart_part.rc | 11 + .../app_templates/kdevpart2/kdevpart_widget.cpp | 21 + .../cpp/app_templates/kdevpart2/kdevpart_widget.h | 23 + .../cpp/app_templates/kdevpart2/projectconfig.cpp | 15 + .../cpp/app_templates/kdevpart2/projectconfig.h | 22 + .../app_templates/kdevpart2/projectconfigbase.ui | 20 + .../cpp/app_templates/kdevpart2/src-Makefile.am | 17 + languages/cpp/app_templates/kdevpart2/subdirs | 3 + .../cpp/app_templates/kfileplugin/.kdev_ignore | 0 .../cpp/app_templates/kfileplugin/Makefile.am | 18 + .../cpp/app_templates/kfileplugin/README.devel | 9 + .../cpp/app_templates/kfileplugin/kfile_plugin.cpp | 55 + .../app_templates/kfileplugin/kfile_plugin.desktop | 39 + .../cpp/app_templates/kfileplugin/kfile_plugin.h | 24 + .../cpp/app_templates/kfileplugin/kfileplugin | 8 + .../kfileplugin/kfileplugin.kdevtemplate | 166 + .../cpp/app_templates/kfileplugin/kfileplugin.png | Bin 0 -> 11953 bytes .../cpp/app_templates/kfileplugin/plugin.kdevelop | 114 + .../cpp/app_templates/kfileplugin/src-Makefile.am | 22 + languages/cpp/app_templates/kfileplugin/subdirs | 3 + languages/cpp/app_templates/khello/.kdev_ignore | 0 languages/cpp/app_templates/khello/Makefile.am | 18 + languages/cpp/app_templates/khello/app.cpp | 23 + languages/cpp/app_templates/khello/app.desktop | 40 + languages/cpp/app_templates/khello/app.h | 32 + languages/cpp/app_templates/khello/app.kdevelop | 115 + languages/cpp/app_templates/khello/appui.rc | 8 + .../cpp/app_templates/khello/khello.kdevtemplate | 220 + languages/cpp/app_templates/khello/khello.png | Bin 0 -> 3573 bytes languages/cpp/app_templates/khello/main.cpp | 51 + languages/cpp/app_templates/khello/src-Makefile.am | 35 + languages/cpp/app_templates/khello/subdirs | 3 + languages/cpp/app_templates/khello2/.kdev_ignore | 0 languages/cpp/app_templates/khello2/Makefile.am | 18 + languages/cpp/app_templates/khello2/app.cpp | 19 + languages/cpp/app_templates/khello2/app.desktop | 40 + languages/cpp/app_templates/khello2/app.h | 32 + languages/cpp/app_templates/khello2/app.kdevelop | 115 + languages/cpp/app_templates/khello2/appui.rc | 8 + .../cpp/app_templates/khello2/khello2.kdevtemplate | 230 + languages/cpp/app_templates/khello2/khello2.png | Bin 0 -> 3155 bytes languages/cpp/app_templates/khello2/main.cpp | 51 + .../cpp/app_templates/khello2/src-Makefile.am | 35 + languages/cpp/app_templates/khello2/subdirs | 3 + languages/cpp/app_templates/khello2/widget.cpp | 30 + languages/cpp/app_templates/khello2/widget.h | 30 + languages/cpp/app_templates/khello2/widgetbase.ui | 52 + languages/cpp/app_templates/kicker/.kdev_ignore | 0 languages/cpp/app_templates/kicker/Makefile.am | 17 + languages/cpp/app_templates/kicker/applet.cpp | 72 + languages/cpp/app_templates/kicker/applet.desktop | 40 + languages/cpp/app_templates/kicker/applet.h | 107 + languages/cpp/app_templates/kicker/applet.kdevelop | 115 + .../cpp/app_templates/kicker/kicker.kdevtemplate | 194 + languages/cpp/app_templates/kicker/kicker.png | Bin 0 -> 8356 bytes languages/cpp/app_templates/kicker/src-Makefile.am | 15 + languages/cpp/app_templates/kicker/subdirs | 3 + languages/cpp/app_templates/kioslave/.kdev_ignore | 0 languages/cpp/app_templates/kioslave/Makefile.am | 17 + .../app_templates/kioslave/kioslave.kdevtemplate | 183 + languages/cpp/app_templates/kioslave/kioslave.png | Bin 0 -> 9524 bytes languages/cpp/app_templates/kioslave/slave.cpp | 88 + languages/cpp/app_templates/kioslave/slave.h | 23 + .../cpp/app_templates/kioslave/slave.kdevelop | 113 + .../cpp/app_templates/kioslave/slave.protocol | 39 + .../cpp/app_templates/kioslave/src-Makefile.am | 14 + languages/cpp/app_templates/kioslave/subdirs | 3 + languages/cpp/app_templates/kmake/Makefile.am | 16 + languages/cpp/app_templates/kmake/app.cpp | 33 + languages/cpp/app_templates/kmake/app.desktop | 44 + languages/cpp/app_templates/kmake/app.kdevelop | 111 + languages/cpp/app_templates/kmake/app.pro | 7 + languages/cpp/app_templates/kmake/appui.rc | 3 + .../cpp/app_templates/kmake/kmake.kdevtemplate | 148 + languages/cpp/app_templates/kmake/kmake.png | Bin 0 -> 5063 bytes languages/cpp/app_templates/kmake/mainview.ui | 76 + languages/cpp/app_templates/kmake/mainviewimp.cpp | 23 + languages/cpp/app_templates/kmake/mainviewimp.h | 19 + languages/cpp/app_templates/kmake/src.pro | 29 + languages/cpp/app_templates/kmod/.kdev_ignore | 0 languages/cpp/app_templates/kmod/Makefile.am | 17 + languages/cpp/app_templates/kmod/kmod-driver.c | 22 + languages/cpp/app_templates/kmod/kmod.kdevelop | 93 + languages/cpp/app_templates/kmod/kmod.kdevtemplate | 89 + languages/cpp/app_templates/kmod/kmod.png | Bin 0 -> 483 bytes languages/cpp/app_templates/kmod/src-Makefile | 30 + .../cpp/app_templates/kofficepart/.kdev_ignore | 0 .../cpp/app_templates/kofficepart/Makefile.am | 21 + .../app_templates/kofficepart/kde-configure.in.in | 42 + .../cpp/app_templates/kofficepart/kopart.desktop | 9 + .../cpp/app_templates/kofficepart/kopart.kdevelop | 113 + .../app_templates/kofficepart/kopart.kdevtemplate | 231 + languages/cpp/app_templates/kofficepart/kopart.png | Bin 0 -> 10017 bytes languages/cpp/app_templates/kofficepart/kopart.rc | 10 + .../app_templates/kofficepart/kopart_aboutdata.h | 24 + .../app_templates/kofficepart/kopart_factory.cpp | 76 + .../cpp/app_templates/kofficepart/kopart_factory.h | 33 + .../cpp/app_templates/kofficepart/kopart_part.cpp | 69 + .../cpp/app_templates/kofficepart/kopart_part.h | 30 + .../cpp/app_templates/kofficepart/kopart_view.cpp | 52 + .../cpp/app_templates/kofficepart/kopart_view.h | 34 + languages/cpp/app_templates/kofficepart/main.cpp | 33 + .../cpp/app_templates/kofficepart/src-Makefile.am | 41 + languages/cpp/app_templates/kofficepart/subdirs | 3 + .../cpp/app_templates/kofficepart/x-kopart.desktop | 40 + .../cpp/app_templates/konqnavpanel/.kdev_ignore | 0 .../cpp/app_templates/konqnavpanel/Makefile.am | 18 + .../app_templates/konqnavpanel/konqnavpanel.cpp | 34 + .../konqnavpanel/konqnavpanel.desktop | 39 + .../cpp/app_templates/konqnavpanel/konqnavpanel.h | 43 + .../konqnavpanel/konqnavpanel.kdevelop | 115 + .../konqnavpanel/konqnavpanel.kdevtemplate | 192 + .../app_templates/konqnavpanel/konqnavpanel.png | Bin 0 -> 19783 bytes .../cpp/app_templates/konqnavpanel/src-Makefile.am | 11 + languages/cpp/app_templates/konqnavpanel/subdirs | 3 + languages/cpp/app_templates/kpartapp/.kdev_ignore | 0 languages/cpp/app_templates/kpartapp/Makefile.am | 17 + languages/cpp/app_templates/kpartapp/app.cpp | 209 + languages/cpp/app_templates/kpartapp/app.desktop | 18 + languages/cpp/app_templates/kpartapp/app.h | 76 + languages/cpp/app_templates/kpartapp/app.kdevelop | 115 + languages/cpp/app_templates/kpartapp/app_part.cpp | 201 + languages/cpp/app_templates/kpartapp/app_part.h | 86 + languages/cpp/app_templates/kpartapp/app_part.rc | 17 + languages/cpp/app_templates/kpartapp/app_shell.rc | 28 + .../app_templates/kpartapp/kpartapp.kdevtemplate | 237 + languages/cpp/app_templates/kpartapp/kpartapp.png | Bin 0 -> 5041 bytes languages/cpp/app_templates/kpartapp/main.cpp | 57 + .../cpp/app_templates/kpartapp/src-Makefile.am | 53 + languages/cpp/app_templates/kpartapp/subdirs | 3 + .../cpp/app_templates/kpartplugin/.kdev_ignore | 0 .../cpp/app_templates/kpartplugin/Makefile.am | 19 + .../kpartplugin/hi16-action-plugin.png | Bin 0 -> 292 bytes .../kpartplugin/hi22-action-plugin.png | Bin 0 -> 1151 bytes .../kpartplugin/kpartplugin.kdevtemplate | 204 + .../cpp/app_templates/kpartplugin/kpartplugin.png | Bin 0 -> 16772 bytes .../cpp/app_templates/kpartplugin/plugin.kdevelop | 114 + .../cpp/app_templates/kpartplugin/plugin_app.cpp | 109 + .../cpp/app_templates/kpartplugin/plugin_app.h | 34 + .../cpp/app_templates/kpartplugin/plugin_app.rc | 11 + .../cpp/app_templates/kpartplugin/src-Makefile.am | 22 + languages/cpp/app_templates/kpartplugin/subdirs | 3 + languages/cpp/app_templates/kscons_kmdi/INSTALL | 83 + .../cpp/app_templates/kscons_kmdi/Makefile.am | 21 + languages/cpp/app_templates/kscons_kmdi/QUICKSTART | 164 + languages/cpp/app_templates/kscons_kmdi/README | 111 + .../cpp/app_templates/kscons_kmdi/SConscript-doc | 92 + .../cpp/app_templates/kscons_kmdi/SConscript-src | 60 + languages/cpp/app_templates/kscons_kmdi/SConstruct | 112 + languages/cpp/app_templates/kscons_kmdi/VERSION | 1 + languages/cpp/app_templates/kscons_kmdi/app.kcfg | 12 + .../cpp/app_templates/kscons_kmdi/app.kdevelop | 169 + .../cpp/app_templates/kscons_kmdi/app_part.cpp | 159 + languages/cpp/app_templates/kscons_kmdi/app_part.h | 74 + .../cpp/app_templates/kscons_kmdi/app_part.rc | 17 + .../cpp/app_templates/kscons_kmdi/app_shell.rc | 33 + .../cpp/app_templates/kscons_kmdi/appkmdi.cpp | 394 + languages/cpp/app_templates/kscons_kmdi/appkmdi.h | 82 + .../cpp/app_templates/kscons_kmdi/appkmdiView.cpp | 63 + .../cpp/app_templates/kscons_kmdi/appkmdiView.h | 29 + .../cpp/app_templates/kscons_kmdi/kmdikonsole.cpp | 76 + .../cpp/app_templates/kscons_kmdi/kmdikonsole.h | 32 + .../kscons_kmdi/kscons_kmdi.kdevtemplate | 271 + .../cpp/app_templates/kscons_kmdi/kscons_kmdi.png | Bin 0 -> 13151 bytes languages/cpp/app_templates/kscons_kmdi/main.cpp | 60 + .../cpp/app_templates/kscons_kmdi/messages.sh | 60 + languages/cpp/app_templates/kscons_kmdi/prefs.ui | 30 + .../cpp/app_templates/kscons_kmdi/settings.kcfgc | 6 + languages/cpp/app_templates/kscons_kmdi/tips | 6 + languages/cpp/app_templates/kscons_kxt/INSTALL | 83 + languages/cpp/app_templates/kscons_kxt/Makefile.am | 21 + languages/cpp/app_templates/kscons_kxt/QUICKSTART | 164 + languages/cpp/app_templates/kscons_kxt/README | 111 + .../cpp/app_templates/kscons_kxt/SConscript-doc | 92 + .../cpp/app_templates/kscons_kxt/SConscript-src | 72 + languages/cpp/app_templates/kscons_kxt/SConstruct | 112 + languages/cpp/app_templates/kscons_kxt/VERSION | 1 + languages/cpp/app_templates/kscons_kxt/app.cpp | 177 + languages/cpp/app_templates/kscons_kxt/app.h | 73 + languages/cpp/app_templates/kscons_kxt/app.kcfg | 21 + .../cpp/app_templates/kscons_kxt/app.kdevelop | 169 + languages/cpp/app_templates/kscons_kxt/appui.rc | 8 + languages/cpp/app_templates/kscons_kxt/appview.cpp | 41 + languages/cpp/app_templates/kscons_kxt/appview.h | 52 + .../cpp/app_templates/kscons_kxt/appview_base.ui | 35 + .../kscons_kxt/kscons_kxt.kdevtemplate | 253 + .../cpp/app_templates/kscons_kxt/kscons_kxt.png | Bin 0 -> 13698 bytes languages/cpp/app_templates/kscons_kxt/main.cpp | 57 + languages/cpp/app_templates/kscons_kxt/messages.sh | 60 + .../cpp/app_templates/kscons_kxt/prefs-base.ui | 129 + languages/cpp/app_templates/kscons_kxt/prefs.cpp | 12 + languages/cpp/app_templates/kscons_kxt/prefs.h | 11 + .../cpp/app_templates/kscons_kxt/settings.kcfgc | 6 + languages/cpp/app_templates/kscons_kxt/tips | 6 + .../cpp/app_templates/kscreensaver/.kdev_ignore | 0 .../cpp/app_templates/kscreensaver/Makefile.am | 19 + .../app_templates/kscreensaver/kscreensaver.cpp | 107 + .../kscreensaver/kscreensaver.desktop | 124 + .../cpp/app_templates/kscreensaver/kscreensaver.h | 35 + .../kscreensaver/kscreensaver.kdevelop | 113 + .../kscreensaver/kscreensaver.kdevtemplate | 203 + .../app_templates/kscreensaver/kscreensaver.png | Bin 0 -> 12032 bytes .../app_templates/kscreensaver/kscreensaverui.ui | 79 + .../cpp/app_templates/kscreensaver/src-Makefile.am | 24 + languages/cpp/app_templates/kscreensaver/subdirs | 3 + languages/cpp/app_templates/kxt/.kdev_ignore | 0 languages/cpp/app_templates/kxt/Makefile.am | 19 + languages/cpp/app_templates/kxt/README | 86 + languages/cpp/app_templates/kxt/app.cpp | 154 + languages/cpp/app_templates/kxt/app.desktop | 40 + languages/cpp/app_templates/kxt/app.h | 66 + languages/cpp/app_templates/kxt/app.kcfg | 21 + languages/cpp/app_templates/kxt/app.kdevelop | 169 + languages/cpp/app_templates/kxt/appui.rc | 8 + languages/cpp/app_templates/kxt/appview.cpp | 41 + languages/cpp/app_templates/kxt/appview.h | 52 + languages/cpp/app_templates/kxt/appview_base.ui | 33 + languages/cpp/app_templates/kxt/kxt.kdevtemplate | 269 + languages/cpp/app_templates/kxt/kxt.png | Bin 0 -> 3947 bytes languages/cpp/app_templates/kxt/main.cpp | 57 + languages/cpp/app_templates/kxt/prefs-base.ui | 127 + languages/cpp/app_templates/kxt/prefs.cpp | 12 + languages/cpp/app_templates/kxt/prefs.h | 11 + languages/cpp/app_templates/kxt/preview.png | Bin 0 -> 7712 bytes languages/cpp/app_templates/kxt/settings.kcfgc | 6 + languages/cpp/app_templates/kxt/src-Makefile.am | 41 + .../cpp/app_templates/kxt/src-configure.in.in | 7 + languages/cpp/app_templates/kxt/subdirs | 3 + .../cpp/app_templates/makefileempty/Makefile.am | 17 + .../cpp/app_templates/makefileempty/app.kdevelop | 101 + .../makefileempty/makefileempty-Makefile | 0 .../makefileempty/makefileempty.kdevtemplate | 85 + .../app_templates/makefileempty/makefileempty.png | Bin 0 -> 8621 bytes languages/cpp/app_templates/noatunui/.kdev_ignore | 0 languages/cpp/app_templates/noatunui/Makefile.am | 17 + languages/cpp/app_templates/noatunui/noatunui | 8 + .../app_templates/noatunui/noatunui.kdevtemplate | 195 + languages/cpp/app_templates/noatunui/noatunui.png | Bin 0 -> 5433 bytes .../cpp/app_templates/noatunui/plugin.kdevelop | 111 + languages/cpp/app_templates/noatunui/plugin.plugin | 8 + .../cpp/app_templates/noatunui/plugin_app.cpp | 15 + .../cpp/app_templates/noatunui/plugin_impl.cpp | 301 + languages/cpp/app_templates/noatunui/plugin_impl.h | 78 + .../cpp/app_templates/noatunui/src-Makefile.am | 24 + languages/cpp/app_templates/noatunui/subdirs | 3 + .../cpp/app_templates/noatunvisual/.kdev_ignore | 0 .../cpp/app_templates/noatunvisual/Makefile.am | 18 + .../cpp/app_templates/noatunvisual/noatunvisual | 8 + .../noatunvisual/noatunvisual-configure.in.in | 36 + .../noatunvisual/noatunvisual.kdevtemplate | 205 + .../app_templates/noatunvisual/noatunvisual.png | Bin 0 -> 68585 bytes .../cpp/app_templates/noatunvisual/plugin.kdevelop | 118 + .../cpp/app_templates/noatunvisual/plugin.plugin | 8 + .../cpp/app_templates/noatunvisual/plugin_app.cpp | 58 + .../cpp/app_templates/noatunvisual/plugin_app.h | 36 + .../cpp/app_templates/noatunvisual/plugin_impl.cpp | 276 + .../cpp/app_templates/noatunvisual/plugin_impl.h | 77 + .../cpp/app_templates/noatunvisual/src-Makefile.am | 19 + languages/cpp/app_templates/noatunvisual/subdirs | 3 + languages/cpp/app_templates/opieapp/.kdev_ignore | 0 languages/cpp/app_templates/opieapp/Example.png | Bin 0 -> 1262 bytes languages/cpp/app_templates/opieapp/Makefile.am | 18 + languages/cpp/app_templates/opieapp/app.kdevelop | 143 + languages/cpp/app_templates/opieapp/app.pro | 38 + languages/cpp/app_templates/opieapp/example.cpp | 32 + .../cpp/app_templates/opieapp/example.desktop | 37 + languages/cpp/app_templates/opieapp/example.h | 20 + languages/cpp/app_templates/opieapp/examplebase.ui | 49 + .../cpp/app_templates/opieapp/opieapp.kdevtemplate | 149 + languages/cpp/app_templates/opieapp/opieapp.png | Bin 0 -> 483 bytes .../cpp/app_templates/opieapplet/.kdev_ignore | 0 languages/cpp/app_templates/opieapplet/Example.png | Bin 0 -> 1262 bytes languages/cpp/app_templates/opieapplet/Makefile.am | 18 + .../cpp/app_templates/opieapplet/app.kdevelop | 158 + languages/cpp/app_templates/opieapplet/app.pro | 38 + .../opieapplet/opieapplet.kdevtemplate | 135 + .../cpp/app_templates/opieapplet/opieapplet.png | Bin 0 -> 483 bytes .../cpp/app_templates/opieapplet/simpleimpl.cpp | 162 + .../cpp/app_templates/opieapplet/simpleimpl.h | 75 + languages/cpp/app_templates/opieinput/.kdev_ignore | 0 languages/cpp/app_templates/opieinput/Example.png | Bin 0 -> 1262 bytes languages/cpp/app_templates/opieinput/Makefile.am | 17 + languages/cpp/app_templates/opieinput/app.kdevelop | 159 + languages/cpp/app_templates/opieinput/app.pro | 38 + .../app_templates/opieinput/opieinput.kdevtemplate | 129 + .../cpp/app_templates/opieinput/opieinput.png | Bin 0 -> 483 bytes .../cpp/app_templates/opieinput/simpleimpl.cpp | 157 + languages/cpp/app_templates/opieinput/simpleimpl.h | 50 + languages/cpp/app_templates/opiemenu/.kdev_ignore | 0 languages/cpp/app_templates/opiemenu/Example.png | Bin 0 -> 1262 bytes languages/cpp/app_templates/opiemenu/Makefile.am | 18 + languages/cpp/app_templates/opiemenu/app.kdevelop | 158 + languages/cpp/app_templates/opiemenu/app.pro | 38 + .../app_templates/opiemenu/opiemenu.kdevtemplate | 132 + languages/cpp/app_templates/opiemenu/opiemenu.png | Bin 0 -> 483 bytes .../cpp/app_templates/opiemenu/simpleimpl.cpp | 78 + languages/cpp/app_templates/opiemenu/simpleimpl.h | 32 + languages/cpp/app_templates/opienet/.kdev_ignore | 0 languages/cpp/app_templates/opienet/Example.png | Bin 0 -> 1262 bytes languages/cpp/app_templates/opienet/Makefile.am | 19 + languages/cpp/app_templates/opienet/app.kdevelop | 143 + languages/cpp/app_templates/opienet/app.pro | 39 + .../cpp/app_templates/opienet/opienet.kdevtemplate | 142 + languages/cpp/app_templates/opienet/opienet.png | Bin 0 -> 483 bytes .../cpp/app_templates/opienet/simmplemodule.h | 36 + .../cpp/app_templates/opienet/simpleiface.cpp | 43 + languages/cpp/app_templates/opienet/simpleiface.h | 22 + .../cpp/app_templates/opienet/simplemodule.cpp | 71 + languages/cpp/app_templates/opienet/simplemodule.h | 36 + languages/cpp/app_templates/opietoday/.kdev_ignore | 0 languages/cpp/app_templates/opietoday/Example.png | Bin 0 -> 1262 bytes languages/cpp/app_templates/opietoday/Makefile.am | 19 + languages/cpp/app_templates/opietoday/app.kdevelop | 143 + languages/cpp/app_templates/opietoday/app.pro | 38 + .../cpp/app_templates/opietoday/exampleplugin.cpp | 60 + .../cpp/app_templates/opietoday/exampleplugin.h | 34 + .../app_templates/opietoday/examplepluginimpl.cpp | 30 + .../app_templates/opietoday/examplepluginimpl.h | 23 + .../opietoday/examplepluginwidget.cpp | 55 + .../app_templates/opietoday/examplepluginwidget.h | 28 + .../app_templates/opietoday/opietoday.kdevtemplate | 151 + .../cpp/app_templates/opietoday/opietoday.png | Bin 0 -> 483 bytes languages/cpp/app_templates/prc-tool/.kdev_ignore | 0 languages/cpp/app_templates/prc-tool/Makefile.am | 17 + languages/cpp/app_templates/prc-tool/callback.h | 24 + languages/cpp/app_templates/prc-tool/palmhello.c | 117 + .../cpp/app_templates/prc-tool/palmhello.pbitm | 32 + languages/cpp/app_templates/prc-tool/palmhello.rcp | 11 + .../cpp/app_templates/prc-tool/palmhelloRsc.h | 1 + languages/cpp/app_templates/prc-tool/prc-tool | 11 + .../cpp/app_templates/prc-tool/prc-tool.kdevelop | 51 + .../app_templates/prc-tool/prc-tool.kdevtemplate | 136 + languages/cpp/app_templates/prc-tool/src-Makefile | 63 + languages/cpp/app_templates/qmakeapp/.kdev_ignore | 0 languages/cpp/app_templates/qmakeapp/Makefile.am | 18 + languages/cpp/app_templates/qmakeapp/fileopen.xpm | 22 + languages/cpp/app_templates/qmakeapp/fileprint.xpm | 24 + languages/cpp/app_templates/qmakeapp/filesave.xpm | 22 + languages/cpp/app_templates/qmakeapp/main.cpp | 13 + languages/cpp/app_templates/qmakeapp/qmakeapp | 11 + languages/cpp/app_templates/qmakeapp/qmakeapp.cpp | 283 + languages/cpp/app_templates/qmakeapp/qmakeapp.h | 39 + .../cpp/app_templates/qmakeapp/qmakeapp.kdevelop | 112 + .../app_templates/qmakeapp/qmakeapp.kdevtemplate | 182 + languages/cpp/app_templates/qmakeapp/qmakeapp.png | Bin 0 -> 5034 bytes languages/cpp/app_templates/qmakeapp/qmakeapp.pro | 6 + languages/cpp/app_templates/qmakeapp/src.pro | 10 + languages/cpp/app_templates/qmakeempty/Makefile.am | 18 + .../app_templates/qmakeempty/qmakeempty.kdevelop | 113 + .../qmakeempty/qmakeempty.kdevtemplate | 131 + .../cpp/app_templates/qmakeempty/qmakeempty.png | Bin 0 -> 26767 bytes .../cpp/app_templates/qmakeempty/qmakeempty.pro | 0 .../cpp/app_templates/qmakesimple/.kdev_ignore | 0 .../cpp/app_templates/qmakesimple/Makefile.am | 16 + .../cpp/app_templates/qmakesimple/app.kdevelop | 100 + languages/cpp/app_templates/qmakesimple/app.pro | 2 + languages/cpp/app_templates/qmakesimple/main.cpp | 15 + .../cpp/app_templates/qmakesimple/qmakesimple | 11 + .../qmakesimple/qmakesimple.kdevtemplate | 158 + .../cpp/app_templates/qmakesimple/qmakesimple.png | Bin 0 -> 12036 bytes languages/cpp/app_templates/qmakesimple/src.pro | 4 + languages/cpp/app_templates/qt4hello/Makefile.am | 18 + languages/cpp/app_templates/qt4hello/ReadMe | 11 + languages/cpp/app_templates/qt4hello/main.cpp | 11 + .../cpp/app_templates/qt4hello/qt4hello.kdevelop | 113 + .../app_templates/qt4hello/qt4hello.kdevtemplate | 160 + languages/cpp/app_templates/qt4hello/qt4hello.png | Bin 0 -> 26767 bytes languages/cpp/app_templates/qt4hello/qt4hello.pro | 5 + languages/cpp/app_templates/qt4hello/src.pro | 8 + languages/cpp/app_templates/qt4makeapp/Makefile.am | 19 + languages/cpp/app_templates/qt4makeapp/ReadMe | 11 + .../cpp/app_templates/qt4makeapp/application.qrc | 10 + .../cpp/app_templates/qt4makeapp/editcopy.xpm | 193 + languages/cpp/app_templates/qt4makeapp/editcut.xpm | 252 + .../cpp/app_templates/qt4makeapp/editpaste.xpm | 295 + languages/cpp/app_templates/qt4makeapp/filenew.xpm | 216 + .../cpp/app_templates/qt4makeapp/fileopen.xpm | 295 + .../cpp/app_templates/qt4makeapp/filesave.xpm | 295 + languages/cpp/app_templates/qt4makeapp/main.cpp | 14 + languages/cpp/app_templates/qt4makeapp/qt4makeapp | 11 + .../cpp/app_templates/qt4makeapp/qt4makeapp.cpp | 285 + .../cpp/app_templates/qt4makeapp/qt4makeapp.h | 65 + .../app_templates/qt4makeapp/qt4makeapp.kdevelop | 113 + .../qt4makeapp/qt4makeapp.kdevtemplate | 207 + .../cpp/app_templates/qt4makeapp/qt4makeapp.png | Bin 0 -> 16908 bytes .../cpp/app_templates/qt4makeapp/qt4makeapp.pro | 5 + languages/cpp/app_templates/qt4makeapp/src.pro | 10 + languages/cpp/app_templates/qtopia4app/Example.png | Bin 0 -> 1262 bytes languages/cpp/app_templates/qtopia4app/Makefile.am | 19 + .../cpp/app_templates/qtopia4app/app.kdevelop | 163 + languages/cpp/app_templates/qtopia4app/app.pro | 31 + languages/cpp/app_templates/qtopia4app/example.cpp | 40 + .../cpp/app_templates/qtopia4app/example.desktop | 37 + languages/cpp/app_templates/qtopia4app/example.h | 24 + .../cpp/app_templates/qtopia4app/example.html | 15 + .../cpp/app_templates/qtopia4app/examplebase.ui | 44 + languages/cpp/app_templates/qtopia4app/main.cpp | 7 + .../qtopia4app/qtopia4app.kdevtemplate | 193 + .../cpp/app_templates/qtopia4app/qtopia4app.png | Bin 0 -> 483 bytes languages/cpp/app_templates/qtopiaapp/.kdev_ignore | 0 languages/cpp/app_templates/qtopiaapp/Example.png | Bin 0 -> 1262 bytes languages/cpp/app_templates/qtopiaapp/Makefile.am | 19 + languages/cpp/app_templates/qtopiaapp/app.kdevelop | 131 + languages/cpp/app_templates/qtopiaapp/app.pro | 10 + .../cpp/app_templates/qtopiaapp/example.control | 11 + languages/cpp/app_templates/qtopiaapp/example.cpp | 29 + .../cpp/app_templates/qtopiaapp/example.desktop | 37 + languages/cpp/app_templates/qtopiaapp/example.h | 18 + languages/cpp/app_templates/qtopiaapp/example.html | 15 + .../cpp/app_templates/qtopiaapp/examplebase.ui | 49 + languages/cpp/app_templates/qtopiaapp/main.cpp | 13 + languages/cpp/app_templates/qtopiaapp/qtopiaapp | 11 + .../app_templates/qtopiaapp/qtopiaapp.kdevtemplate | 153 + .../cpp/app_templates/qtopiaapp/qtopiaapp.png | Bin 0 -> 483 bytes languages/cpp/app_templates/win32gui/.kdev_ignore | 0 languages/cpp/app_templates/win32gui/Makefile.am | 18 + languages/cpp/app_templates/win32gui/app.cpp | 12 + languages/cpp/app_templates/win32gui/app.kdevelop | 192 + .../cpp/app_templates/win32gui/src-Makefile.am | 8 + .../app_templates/win32gui/win32gui-Makefile.am | 5 + .../app_templates/win32gui/win32gui-Makefile.cvs | 8 + .../app_templates/win32gui/win32gui-configure.in | 10 + .../app_templates/win32gui/win32gui.kdevtemplate | 137 + languages/cpp/app_templates/win32gui/win32gui.png | Bin 0 -> 10082 bytes .../cpp/app_templates/win32hello/.kdev_ignore | 0 languages/cpp/app_templates/win32hello/Makefile.am | 18 + languages/cpp/app_templates/win32hello/app.cpp | 16 + .../cpp/app_templates/win32hello/app.kdevelop | 164 + .../cpp/app_templates/win32hello/src-Makefile.am | 8 + .../cpp/app_templates/win32hello/win32-Makefile.am | 5 + .../app_templates/win32hello/win32-Makefile.cvs | 8 + .../app_templates/win32hello/win32-configure.in | 10 + .../win32hello/win32hello.kdevtemplate | 136 + .../cpp/app_templates/win32hello/win32hello.png | Bin 0 -> 4991 bytes languages/cpp/app_templates/wxhello/.kdev_ignore | 0 languages/cpp/app_templates/wxhello/Makefile.am | 18 + languages/cpp/app_templates/wxhello/app.cpp | 52 + languages/cpp/app_templates/wxhello/app.desktop | 39 + languages/cpp/app_templates/wxhello/app.h | 36 + languages/cpp/app_templates/wxhello/app.kdevelop | 114 + .../cpp/app_templates/wxhello/src-Makefile.am | 14 + languages/cpp/app_templates/wxhello/subdirs | 1 + languages/cpp/app_templates/wxhello/wxhello | 105 + .../cpp/app_templates/wxhello/wxhello.kdevtemplate | 192 + languages/cpp/app_templates/wxhello/wxhello.png | Bin 0 -> 3894 bytes languages/cpp/ast_utils.cpp | 190 + languages/cpp/ast_utils.h | 34 + languages/cpp/backgroundparser.cpp | 552 + languages/cpp/backgroundparser.h | 122 + languages/cpp/bithelpers.h | 37 + languages/cpp/ccconfigwidget.cpp | 590 + languages/cpp/ccconfigwidget.h | 74 + languages/cpp/ccconfigwidgetbase.ui | 1798 +++ languages/cpp/classgeneratorconfig.cpp | 236 + languages/cpp/classgeneratorconfig.h | 81 + languages/cpp/classgeneratorconfigbase.ui | 261 + languages/cpp/codecompletionentry.h | 57 + languages/cpp/codeinformationrepository.cpp | 339 + languages/cpp/codeinformationrepository.h | 58 + languages/cpp/compiler/Makefile.am | 6 + languages/cpp/compiler/gccoptions/Makefile.am | 20 + .../cpp/compiler/gccoptions/gccoptionsplugin.cpp | 705 ++ .../cpp/compiler/gccoptions/gccoptionsplugin.h | 63 + .../cpp/compiler/gccoptions/kdevg77options.desktop | 56 + .../cpp/compiler/gccoptions/kdevgccoptions.desktop | 54 + .../cpp/compiler/gccoptions/kdevgppoptions.desktop | 56 + languages/cpp/completiondebug.cpp | 56 + languages/cpp/completiondebug.h | 221 + languages/cpp/computerecoverypoints.h | 190 + languages/cpp/configproblemreporter.ui | 189 + languages/cpp/configproblemreporter.ui.h | 98 + languages/cpp/configuration | 2 + languages/cpp/cpp_tags.h | 432 + languages/cpp/cppcodecompletion.cpp | 4492 +++++++ languages/cpp/cppcodecompletion.h | 324 + languages/cpp/cppcodecompletionconfig.cpp | 151 + languages/cpp/cppcodecompletionconfig.h | 310 + languages/cpp/cppevaluation.cpp | 483 + languages/cpp/cppevaluation.h | 367 + languages/cpp/cppimplementationwidget.cpp | 100 + languages/cpp/cppimplementationwidget.h | 43 + languages/cpp/cppnewclassdlg.cpp | 2242 ++++ languages/cpp/cppnewclassdlg.h | 292 + languages/cpp/cppnewclassdlgbase.ui | 1290 ++ languages/cpp/cppsplitheadersourceconfig.cpp | 82 + languages/cpp/cppsplitheadersourceconfig.h | 74 + languages/cpp/cppsupport_events.h | 75 + languages/cpp/cppsupport_utils.cpp | 139 + languages/cpp/cppsupport_utils.h | 28 + languages/cpp/cppsupportfactory.cpp | 42 + languages/cpp/cppsupportfactory.h | 33 + languages/cpp/cppsupportpart.cpp | 3186 +++++ languages/cpp/cppsupportpart.h | 661 + languages/cpp/cpptemplates | 22 + languages/cpp/creategettersetter.ui | 232 + languages/cpp/creategettersetterconfiguration.cpp | 62 + languages/cpp/creategettersetterconfiguration.h | 117 + languages/cpp/creategettersetterdialog.cpp | 122 + languages/cpp/creategettersetterdialog.h | 41 + languages/cpp/createpcsdialog.cpp | 358 + languages/cpp/createpcsdialog.h | 59 + languages/cpp/createpcsdialogbase.ui | 168 + languages/cpp/debugger/DESIGN.txt | 113 + languages/cpp/debugger/Makefile.am | 33 + languages/cpp/debugger/TODO.txt | 218 + languages/cpp/debugger/breakpoint.cpp | 719 ++ languages/cpp/debugger/breakpoint.h | 313 + languages/cpp/debugger/dbgcontroller.cpp | 40 + languages/cpp/debugger/dbgcontroller.h | 128 + languages/cpp/debugger/dbgpsdlg.cpp | 203 + languages/cpp/debugger/dbgpsdlg.h | 59 + languages/cpp/debugger/dbgtoolbar.cpp | 498 + languages/cpp/debugger/dbgtoolbar.h | 85 + languages/cpp/debugger/debuggerconfigwidget.cpp | 138 + languages/cpp/debugger/debuggerconfigwidget.h | 43 + languages/cpp/debugger/debuggerconfigwidgetbase.ui | 453 + languages/cpp/debugger/debuggerdcopinterface.h | 29 + languages/cpp/debugger/debuggerpart.cpp | 1272 ++ languages/cpp/debugger/debuggerpart.h | 164 + languages/cpp/debugger/debuggertracingdialog.cpp | 104 + languages/cpp/debugger/debuggertracingdialog.h | 42 + .../cpp/debugger/debuggertracingdialogbase.ui | 141 + languages/cpp/debugger/disassemblewidget.cpp | 173 + languages/cpp/debugger/disassemblewidget.h | 69 + languages/cpp/debugger/framestackwidget.cpp | 645 + languages/cpp/debugger/framestackwidget.h | 183 + languages/cpp/debugger/gdbbreakpointwidget.cpp | 1262 ++ languages/cpp/debugger/gdbbreakpointwidget.h | 174 + languages/cpp/debugger/gdbcommand.cpp | 142 + languages/cpp/debugger/gdbcommand.h | 271 + languages/cpp/debugger/gdbcontroller.cpp | 1860 +++ languages/cpp/debugger/gdbcontroller.h | 358 + languages/cpp/debugger/gdboutputwidget.cpp | 376 + languages/cpp/debugger/gdboutputwidget.h | 137 + languages/cpp/debugger/gdbparser.cpp | 432 + languages/cpp/debugger/gdbparser.h | 59 + languages/cpp/debugger/gdbtable.cpp | 55 + languages/cpp/debugger/gdbtable.h | 39 + .../cpp/debugger/hi16-action-breakpoint_add.png | Bin 0 -> 225 bytes .../cpp/debugger/hi16-action-breakpoint_delete.png | Bin 0 -> 239 bytes .../debugger/hi16-action-breakpoint_delete_all.png | Bin 0 -> 239 bytes .../cpp/debugger/hi16-action-breakpoint_edit.png | Bin 0 -> 277 bytes languages/cpp/debugger/kdevdebugger.desktop | 86 + languages/cpp/debugger/kdevdebugger.rc | 93 + languages/cpp/debugger/label_with_double_click.cpp | 14 + languages/cpp/debugger/label_with_double_click.h | 20 + languages/cpp/debugger/memviewdlg.cpp | 486 + languages/cpp/debugger/memviewdlg.h | 118 + languages/cpp/debugger/mi/Makefile.am | 12 + languages/cpp/debugger/mi/gdbmi.cpp | 128 + languages/cpp/debugger/mi/gdbmi.h | 221 + languages/cpp/debugger/mi/milexer.cpp | 290 + languages/cpp/debugger/mi/milexer.h | 147 + languages/cpp/debugger/mi/miparser.cpp | 345 + languages/cpp/debugger/mi/miparser.h | 82 + languages/cpp/debugger/mi/tokens.h | 34 + languages/cpp/debugger/stty.cpp | 386 + languages/cpp/debugger/stty.h | 72 + languages/cpp/debugger/tests/README.txt | 4 + languages/cpp/debugger/tests/breakpoints/Makefile | 4 + .../cpp/debugger/tests/breakpoints/README.txt | 2 + .../tests/breakpoints/breakpoints.kdevelop | 163 + languages/cpp/debugger/tests/breakpoints/foo.cpp | 10 + languages/cpp/debugger/tests/breakpoints/main.cpp | 38 + languages/cpp/debugger/tests/dll/Makefile | 8 + languages/cpp/debugger/tests/dll/README.txt | 3 + languages/cpp/debugger/tests/dll/dll.kdevelop | 158 + languages/cpp/debugger/tests/dll/helper.cpp | 6 + languages/cpp/debugger/tests/dll/main.cpp | 15 + .../cpp/debugger/tests/infinite_loop/Makefile | 4 + .../cpp/debugger/tests/infinite_loop/README.txt | 3 + .../debugger/tests/infinite_loop/infinite_loop.cpp | 17 + .../tests/infinite_loop/infinite_loop.kdevelop | 109 + .../cpp/debugger/tests/print_pointers/Makefile | 3 + .../tests/print_pointers/print_pointers.cpp | 95 + .../tests/print_pointers/print_pointers.kdevelop | 218 + languages/cpp/debugger/tests/segfault/Makefile | 4 + languages/cpp/debugger/tests/segfault/README.txt | 3 + languages/cpp/debugger/tests/segfault/segfault.cpp | 7 + .../cpp/debugger/tests/segfault/segfault.kdevelop | 163 + languages/cpp/debugger/tests/threads/Makefile | 4 + languages/cpp/debugger/tests/threads/README.txt | 4 + languages/cpp/debugger/tests/threads/threads.cpp | 26 + .../cpp/debugger/tests/threads/threads.kdevelop | 101 + languages/cpp/debugger/tests/tracing/Makefile | 4 + languages/cpp/debugger/tests/tracing/main.cpp | 15 + .../cpp/debugger/tests/tracing/tracing.kdevelop | 163 + languages/cpp/debugger/tests/two_module/Makefile | 4 + languages/cpp/debugger/tests/two_module/README.txt | 2 + languages/cpp/debugger/tests/two_module/main.cpp | 8 + .../cpp/debugger/tests/two_module/src/foo.cpp | 12 + .../debugger/tests/two_module/two_module.kdevelop | 163 + languages/cpp/debugger/variablewidget.cpp | 2002 +++ languages/cpp/debugger/variablewidget.h | 466 + languages/cpp/declarationinfo.h | 72 + languages/cpp/doc/Makefile.am | 7 + languages/cpp/doc/c++_bugs_gcc.toc | 7 + languages/cpp/doc/clanlib.toc | 384 + languages/cpp/doc/cppannotations.toc | 456 + languages/cpp/doc/gnome1.toc | 424 + languages/cpp/doc/gnustep.toc | 184 + languages/cpp/doc/gtk_bugs.toc | 7 + languages/cpp/doc/kde2book.toc | 2875 +++++ languages/cpp/doc/kdetemplates.toc | 9 + languages/cpp/doc/libc.toc | 858 ++ languages/cpp/doc/libstdc++.toc | 19 + languages/cpp/doc/qt-kdev3.toc | 39 + languages/cpp/doc/stl.toc | 487 + languages/cpp/doc/wxwidgets_bugs.toc | 7 + languages/cpp/doxydoc.cpp | 148 + languages/cpp/doxydoc.h | 59 + languages/cpp/expressioninfo.h | 99 + languages/cpp/file_templates/Makefile.am | 3 + languages/cpp/file_templates/c | 11 + languages/cpp/file_templates/cpp | 11 + languages/cpp/file_templates/h | 11 + languages/cpp/file_templates/l | 35 + languages/cpp/file_templates/ll | 42 + languages/cpp/file_templates/y | 40 + languages/cpp/file_templates/yy | 40 + languages/cpp/includefiles.cpp | 2 + languages/cpp/includefiles.h | 14 + languages/cpp/includepathresolver.cpp | 577 + languages/cpp/includepathresolver.h | 76 + languages/cpp/kdevcppsupport.desktop | 86 + languages/cpp/kdevcppsupport.rc | 30 + languages/cpp/kdevcsupport.desktop | 85 + languages/cpp/kdevdeepcopy.h | 14 + languages/cpp/kdevdriver.cpp | 206 + languages/cpp/kdevdriver.h | 58 + languages/cpp/main.cpp | 283 + languages/cpp/newclass_templates/Makefile.am | 4 + languages/cpp/newclass_templates/cpp_header | 31 + languages/cpp/newclass_templates/cpp_source | 9 + languages/cpp/newclass_templates/gtk_header | 24 + languages/cpp/newclass_templates/gtk_source | 35 + languages/cpp/newclass_templates/objc_header | 11 + languages/cpp/newclass_templates/objc_source | 4 + languages/cpp/pcsimporter/Makefile.am | 3 + .../cpp/pcsimporter/customimporter/Makefile.am | 12 + .../customimporter/kdevcustomimporter.cpp | 118 + .../customimporter/kdevcustomimporter.h | 40 + .../customimporter/kdevpcscustomimporter.desktop | 44 + .../pcsimporter/customimporter/settingsdialog.cpp | 107 + .../pcsimporter/customimporter/settingsdialog.h | 48 + .../customimporter/settingsdialogbase.ui | 62 + .../cpp/pcsimporter/kdelibsimporter/Makefile.am | 11 + .../kdelibsimporter/kdevkdelibsimporter.cpp | 119 + .../kdelibsimporter/kdevkdelibsimporter.desktop | 49 + .../kdelibsimporter/kdevkdelibsimporter.h | 40 + .../pcsimporter/kdelibsimporter/settingsdialog.cpp | 101 + .../pcsimporter/kdelibsimporter/settingsdialog.h | 44 + .../kdelibsimporter/settingsdialogbase.ui | 131 + languages/cpp/pcsimporter/qt4importer/Makefile.am | 11 + .../pcsimporter/qt4importer/kdevqt4importer.cpp | 107 + .../qt4importer/kdevqt4importer.desktop | 34 + .../cpp/pcsimporter/qt4importer/kdevqt4importer.h | 39 + .../cpp/pcsimporter/qt4importer/settingsdialog.cpp | 115 + .../cpp/pcsimporter/qt4importer/settingsdialog.h | 46 + .../pcsimporter/qt4importer/settingsdialogbase.ui | 79 + languages/cpp/pcsimporter/qtimporter/Makefile.am | 11 + .../cpp/pcsimporter/qtimporter/kdevqtimporter.cpp | 73 + .../pcsimporter/qtimporter/kdevqtimporter.desktop | 37 + .../cpp/pcsimporter/qtimporter/kdevqtimporter.h | 37 + .../cpp/pcsimporter/qtimporter/settingsdialog.cpp | 122 + .../cpp/pcsimporter/qtimporter/settingsdialog.h | 46 + .../pcsimporter/qtimporter/settingsdialogbase.ui | 139 + languages/cpp/problemreporter.cpp | 441 + languages/cpp/problemreporter.h | 156 + languages/cpp/qtbuildconfig.cpp | 216 + languages/cpp/qtbuildconfig.h | 90 + languages/cpp/qtdesignercppintegration.cpp | 218 + languages/cpp/qtdesignercppintegration.h | 40 + languages/cpp/safetycounter.h | 59 + languages/cpp/setuphelper.cpp | 91 + languages/cpp/setuphelper.h | 42 + languages/cpp/simplecontext.cpp | 68 + languages/cpp/simplecontext.h | 171 + languages/cpp/simpletype.cpp | 1051 ++ languages/cpp/simpletype.h | 819 ++ languages/cpp/simpletypecachebinder.h | 348 + languages/cpp/simpletypecatalog.cpp | 375 + languages/cpp/simpletypecatalog.h | 119 + languages/cpp/simpletypefunction.cpp | 726 ++ languages/cpp/simpletypefunction.h | 341 + languages/cpp/simpletypenamespace.cpp | 438 + languages/cpp/simpletypenamespace.h | 165 + languages/cpp/store_walker.cpp | 1081 ++ languages/cpp/store_walker.h | 141 + languages/cpp/storeconverter.cpp | 149 + languages/cpp/storeconverter.h | 48 + languages/cpp/stringhelpers.cpp | 299 + languages/cpp/stringhelpers.h | 118 + languages/cpp/subclassing_template/.kdev_ignore | 0 languages/cpp/subclassing_template/Makefile.am | 5 + .../subclassing_template/subclass_qt4_template.cpp | 16 + .../subclassing_template/subclass_qt4_template.h | 28 + .../cpp/subclassing_template/subclass_template.cpp | 15 + .../cpp/subclassing_template/subclass_template.h | 27 + languages/cpp/subclassingdlg.cpp | 536 + languages/cpp/subclassingdlg.h | 85 + languages/cpp/subclassingdlgbase.ui | 244 + languages/cpp/tag_creator.cpp | 884 ++ languages/cpp/tag_creator.h | 131 + languages/cpp/templates/Makefile.am | 2 + languages/cpp/templates/default.cpp | 12 + languages/cpp/templates/default.h | 12 + languages/cpp/typedecoration.h | 119 + languages/cpp/typedesc.cpp | 788 ++ languages/cpp/typedesc.h | 403 + languages/csharp/Makefile.am | 25 + languages/csharp/README.dox | 46 + languages/csharp/app_templates/Makefile.am | 3 + languages/csharp/app_templates/csharp.appwizard | 2 + languages/csharp/csharpconfigwidget.cpp | 38 + languages/csharp/csharpconfigwidget.h | 34 + languages/csharp/csharpconfigwidgetbase.ui | 101 + languages/csharp/csharpdoc.cpp | 133 + languages/csharp/csharpdoc.h | 25 + languages/csharp/csharpdoc.protocol | 9 + languages/csharp/csharpsupportpart.cpp | 331 + languages/csharp/csharpsupportpart.h | 59 + languages/csharp/doc/Makefile.am | 6 + languages/csharp/file_templates/Makefile.am | 4 + languages/csharp/kdevcsharpsupport.desktop | 57 + languages/csharp/kdevcsharpsupport.rc | 14 + languages/fortran/Makefile.am | 20 + languages/fortran/README.dox | 48 + languages/fortran/app_templates/Makefile.am | 3 + languages/fortran/app_templates/fortran.appwizard | 2 + .../app_templates/fortranhello/.kdev_ignore | 0 .../fortran/app_templates/fortranhello/Makefile.am | 17 + .../app_templates/fortranhello/app.kdevelop | 113 + .../app_templates/fortranhello/configure.in | 10 + .../app_templates/fortranhello/fortran-Makefile.am | 5 + .../fortranhello/fortran-Makefile.cvs | 8 + .../app_templates/fortranhello/fortranhello | 10 + .../fortranhello/fortranhello.kdevtemplate | 140 + .../app_templates/fortranhello/fortranhello.png | Bin 0 -> 10118 bytes .../fortran/app_templates/fortranhello/main.f | 7 + .../app_templates/fortranhello/src-Makefile.am | 8 + languages/fortran/compiler/Makefile.am | 6 + languages/fortran/compiler/pgioptions/Makefile.am | 18 + .../compiler/pgioptions/kdevpgf77options.desktop | 53 + .../compiler/pgioptions/kdevpghpfoptions.desktop | 50 + .../compiler/pgioptions/pgioptionsfactory.cpp | 69 + .../compiler/pgioptions/pgioptionsfactory.h | 34 + .../compiler/pgioptions/pgioptionsplugin.cpp | 324 + .../fortran/compiler/pgioptions/pgioptionsplugin.h | 55 + languages/fortran/doc/Makefile.am | 6 + languages/fortran/doc/fortran_bugs_gcc.toc | 7 + languages/fortran/file_templates/Makefile.am | 2 + languages/fortran/file_templates/f | 11 + languages/fortran/file_templates/f77 | 11 + languages/fortran/file_templates/f90 | 11 + languages/fortran/file_templates/f95 | 11 + languages/fortran/file_templates/for | 11 + languages/fortran/file_templates/fpp | 11 + languages/fortran/file_templates/ftn | 11 + languages/fortran/fixedformparser.cpp | 94 + languages/fortran/fixedformparser.h | 35 + languages/fortran/fortransupportpart.cpp | 287 + languages/fortran/fortransupportpart.h | 53 + languages/fortran/ftnchekconfigwidget.cpp | 290 + languages/fortran/ftnchekconfigwidget.h | 41 + languages/fortran/ftnchekconfigwidgetbase.ui | 584 + languages/fortran/kdevfortransupport.desktop | 80 + languages/fortran/kdevfortransupport.rc | 9 + languages/java/JavaAST.hpp | 77 + languages/java/JavaLexer.cpp | 2183 ++++ languages/java/JavaLexer.hpp | 132 + languages/java/JavaRecognizer.cpp | 6540 ++++++++++ languages/java/JavaRecognizer.hpp | 423 + languages/java/JavaStoreWalker.cpp | 3441 ++++++ languages/java/JavaStoreWalker.hpp | 164 + languages/java/JavaStoreWalkerTokenTypes.hpp | 169 + languages/java/JavaStoreWalkerTokenTypes.txt | 151 + languages/java/JavaTokenTypes.hpp | 168 + languages/java/JavaTokenTypes.txt | 150 + languages/java/KDevJavaSupportIface.cpp | 24 + languages/java/KDevJavaSupportIface.h | 26 + languages/java/Makefile.am | 37 + languages/java/README.dox | 48 + languages/java/app_templates/Makefile.am | 3 + languages/java/app_templates/java.appwizard | 2 + .../java/app_templates/javahello/.kdev_ignore | 0 languages/java/app_templates/javahello/Main.java | 7 + languages/java/app_templates/javahello/Makefile.am | 16 + languages/java/app_templates/javahello/build.xml | 37 + languages/java/app_templates/javahello/javahello | 11 + .../app_templates/javahello/javahello.filelist | 2 + .../app_templates/javahello/javahello.kdevelop | 69 + .../app_templates/javahello/javahello.kdevtemplate | 124 + .../java/app_templates/javahello/javahello.png | Bin 0 -> 483 bytes languages/java/app_templates/kappjava/.kdev_ignore | 0 languages/java/app_templates/kappjava/Makefile.am | 17 + languages/java/app_templates/kappjava/app.desktop | 41 + languages/java/app_templates/kappjava/app.java | 281 + languages/java/app_templates/kappjava/app.kdevelop | 88 + .../java/app_templates/kappjava/app_client.java | 28 + languages/java/app_templates/kappjava/appui.rc | 8 + languages/java/app_templates/kappjava/appview.java | 115 + languages/java/app_templates/kappjava/kappjava | 10 + .../app_templates/kappjava/kappjava.kdevtemplate | 163 + languages/java/app_templates/kappjava/kappjava.png | Bin 0 -> 5063 bytes languages/java/app_templates/kappjava/pref.java | 52 + .../java/app_templates/kappjava/src-Makefile.am | 18 + languages/java/app_templates/kappjava/subdirs | 3 + .../java/app_templates/superwaba/.kdev_ignore | 0 languages/java/app_templates/superwaba/Makefile.am | 16 + .../java/app_templates/superwaba/src-Makefile | 226 + languages/java/app_templates/superwaba/superwaba | 54 + .../app_templates/superwaba/superwaba.kdevtemplate | 166 + .../java/app_templates/superwaba/superwaba.png | Bin 0 -> 1100 bytes languages/java/app_templates/superwaba/sw.filelist | 1 + languages/java/app_templates/superwaba/sw.java | 97 + languages/java/app_templates/superwaba/sw.kdevelop | 94 + languages/java/backgroundparser.cpp | 363 + languages/java/backgroundparser.h | 86 + languages/java/configproblemreporter.ui | 257 + languages/java/configproblemreporter.ui.h | 74 + languages/java/doc/Makefile.am | 6 + languages/java/doc/java_bugs_gcc.toc | 7 + languages/java/doc/java_bugs_sun.toc | 7 + languages/java/doc/sw.toc | 146 + languages/java/driver.cpp | 227 + languages/java/driver.h | 139 + languages/java/file_templates/Makefile.am | 4 + languages/java/file_templates/java | 6 + languages/java/java.g | 1318 ++ languages/java/java.store.g | 521 + languages/java/java.tree.g | 331 + languages/java/javasupport_events.h | 60 + languages/java/javasupport_utils.cpp | 52 + languages/java/javasupport_utils.h | 21 + languages/java/javasupportfactory.cpp | 39 + languages/java/javasupportfactory.h | 31 + languages/java/javasupportpart.cpp | 908 ++ languages/java/javasupportpart.h | 165 + languages/java/javatemplates | 3 + languages/java/kdevdeepcopy.h | 12 + languages/java/kdevdriver.cpp | 44 + languages/java/kdevdriver.h | 30 + languages/java/kdevjavasupport.desktop | 85 + languages/java/kdevjavasupport.rc | 4 + languages/java/newclass_templates/Makefile.am | 4 + languages/java/newclass_templates/java_source | 9 + languages/java/problemreporter.cpp | 299 + languages/java/problemreporter.h | 74 + languages/kjssupport/Makefile.am | 22 + languages/kjssupport/jscodecompletion.cpp | 174 + languages/kjssupport/jscodecompletion.h | 53 + languages/kjssupport/kdevkjssupport.desktop | 54 + languages/kjssupport/kdevkjssupport.rc | 11 + languages/kjssupport/kjsproblems.cpp | 78 + languages/kjssupport/kjsproblems.h | 43 + languages/kjssupport/kjssupport_part.cpp | 448 + languages/kjssupport/kjssupport_part.h | 85 + .../kjssupport/subclassing_template/Makefile.am | 3 + .../subclassing_template/subclass_template.js | 2 + languages/kjssupport/subclassingdlg.cpp | 461 + languages/kjssupport/subclassingdlg.h | 85 + languages/kjssupport/subclassingdlgbase.ui | 253 + languages/kjssupport/template/Makefile.am | 20 + languages/kjssupport/template/app.js | 18 + languages/kjssupport/template/app.kdevelop | 45 + languages/kjssupport/template/jshello | 6 + languages/kjssupport/template/script | 13 + languages/kjssupport/x-javascript-source.desktop | 4 + languages/lib/Makefile.am | 6 + languages/lib/debugger/Mainpage.dox | 36 + languages/lib/debugger/Makefile.am | 13 + languages/lib/debugger/debugger.cpp | 209 + languages/lib/debugger/debugger.h | 132 + languages/lib/debugger/kdevdebugger.cpp | 182 + languages/lib/debugger/kdevdebugger.h | 88 + languages/lib/designer_integration/Mainpage.dox | 48 + languages/lib/designer_integration/Makefile.am | 16 + .../designer_integration/implementationwidget.cpp | 158 + .../designer_integration/implementationwidget.h | 86 + .../implementationwidgetbase.ui | 267 + .../designer_integration/qtdesignerintegration.cpp | 195 + .../designer_integration/qtdesignerintegration.h | 80 + languages/lib/interfaces/Mainpage.dox | 10 + languages/lib/interfaces/Makefile.am | 16 + .../lib/interfaces/kdeveloppcsimporter.desktop | 39 + languages/lib/interfaces/kdevpcsimporter.cpp | 36 + languages/lib/interfaces/kdevpcsimporter.h | 49 + languages/pascal/Makefile.am | 33 + languages/pascal/PascalAST.hpp | 51 + languages/pascal/PascalLexer.cpp | 1309 ++ languages/pascal/PascalLexer.hpp | 121 + languages/pascal/PascalParser.cpp | 9744 +++++++++++++++ languages/pascal/PascalParser.hpp | 422 + languages/pascal/PascalStoreWalker.cpp | 3409 +++++ languages/pascal/PascalStoreWalker.hpp | 172 + languages/pascal/PascalStoreWalkerTokenTypes.hpp | 206 + languages/pascal/PascalStoreWalkerTokenTypes.txt | 188 + languages/pascal/PascalTokenTypes.hpp | 206 + languages/pascal/PascalTokenTypes.txt | 188 + languages/pascal/README.dox | 26 + languages/pascal/app_templates/Makefile.am | 3 + languages/pascal/app_templates/fpcgtk/.kdev_ignore | 0 languages/pascal/app_templates/fpcgtk/Makefile.am | 16 + languages/pascal/app_templates/fpcgtk/app.kdevelop | 86 + languages/pascal/app_templates/fpcgtk/fpcgtk | 9 + .../app_templates/fpcgtk/fpcgtk.kdevtemplate | 114 + languages/pascal/app_templates/fpcgtk/fpcgtk.png | Bin 0 -> 483 bytes languages/pascal/app_templates/fpcgtk/main.pp | 84 + .../pascal/app_templates/fpchello/.kdev_ignore | 0 .../pascal/app_templates/fpchello/Makefile.am | 16 + .../pascal/app_templates/fpchello/app.kdevelop | 86 + languages/pascal/app_templates/fpchello/fpchello | 9 + .../app_templates/fpchello/fpchello.kdevtemplate | 115 + .../pascal/app_templates/fpchello/fpchello.png | Bin 0 -> 483 bytes languages/pascal/app_templates/fpchello/main.pp | 5 + .../pascal/app_templates/fpcsharedlib/.kdev_ignore | 0 .../pascal/app_templates/fpcsharedlib/Makefile.am | 16 + .../pascal/app_templates/fpcsharedlib/app.kdevelop | 86 + .../pascal/app_templates/fpcsharedlib/fpcsharedlib | 9 + .../fpcsharedlib/fpcsharedlib.kdevtemplate | 115 + .../app_templates/fpcsharedlib/fpcsharedlib.png | Bin 0 -> 483 bytes .../pascal/app_templates/fpcsharedlib/main.pp | 11 + languages/pascal/app_templates/pascal.appwizard | 2 + .../pascal/app_templates/pascalhello/.kdev_ignore | 0 .../pascal/app_templates/pascalhello/Makefile.am | 16 + .../pascal/app_templates/pascalhello/app.kdevelop | 83 + languages/pascal/app_templates/pascalhello/main.pp | 5 + .../pascal/app_templates/pascalhello/pascalhello | 10 + .../pascalhello/pascalhello.kdevtemplate | 116 + .../app_templates/pascalhello/pascalhello.png | Bin 0 -> 10118 bytes languages/pascal/backgroundparser.cpp | 95 + languages/pascal/backgroundparser.h | 35 + languages/pascal/compiler/Makefile.am | 6 + languages/pascal/compiler/dccoptions/Makefile.am | 16 + .../compiler/dccoptions/dccoptionsplugin.cpp | 114 + .../pascal/compiler/dccoptions/dccoptionsplugin.h | 56 + .../compiler/dccoptions/kdevdccoptions.desktop | 54 + .../pascal/compiler/dccoptions/optiontabs.cpp | 399 + languages/pascal/compiler/dccoptions/optiontabs.h | 116 + languages/pascal/compiler/fpcoptions/Makefile.am | 20 + .../compiler/fpcoptions/fpcoptionsplugin.cpp | 126 + .../pascal/compiler/fpcoptions/fpcoptionsplugin.h | 63 + .../compiler/fpcoptions/kdevfpcoptions.desktop | 55 + .../pascal/compiler/fpcoptions/optiontabs.cpp | 657 + languages/pascal/compiler/fpcoptions/optiontabs.h | 161 + languages/pascal/configproblemreporter.ui | 88 + languages/pascal/doc/Makefile.am | 6 + languages/pascal/doc/pascal_bugs_fp.toc | 7 + languages/pascal/file_templates/Makefile.am | 2 + languages/pascal/file_templates/dpr | 12 + languages/pascal/file_templates/pas-program | 12 + languages/pascal/file_templates/pas-unit | 19 + languages/pascal/file_templates/pp-program | 12 + languages/pascal/file_templates/pp-unit | 19 + languages/pascal/kdevpascalsupport.desktop | 84 + languages/pascal/kdevpascalsupport.rc | 3 + languages/pascal/pascal.g | 1212 ++ languages/pascal/pascal.tree.g | 468 + languages/pascal/pascalsupport_part.cpp | 323 + languages/pascal/pascalsupport_part.h | 62 + languages/pascal/pascaltemplates | 30 + languages/pascal/problemreporter.cpp | 289 + languages/pascal/problemreporter.h | 78 + languages/perl/Makefile.am | 25 + languages/perl/README.dox | 46 + languages/perl/app_templates/Makefile.am | 3 + languages/perl/app_templates/perl.appwizard | 2 + .../perl/app_templates/perlhello/.kdev_ignore | 0 languages/perl/app_templates/perlhello/Makefile.am | 16 + .../perl/app_templates/perlhello/app.kdevelop | 77 + languages/perl/app_templates/perlhello/app.pl | 43 + languages/perl/app_templates/perlhello/perlhello | 10 + .../app_templates/perlhello/perlhello.kdevtemplate | 108 + .../perl/app_templates/perlhello/perlhello.png | Bin 0 -> 17622 bytes languages/perl/doc/Makefile.am | 6 + languages/perl/doc/perl.toc | 54 + languages/perl/doc/perl_bugs.toc | 7 + languages/perl/file_templates/Makefile.am | 4 + languages/perl/file_templates/pl | 43 + languages/perl/file_templates/pm | 68 + languages/perl/kdevperlsupport.desktop | 85 + languages/perl/kdevperlsupport.rc | 14 + languages/perl/perlconfigwidget.cpp | 38 + languages/perl/perlconfigwidget.h | 34 + languages/perl/perlconfigwidgetbase.ui | 101 + languages/perl/perldoc.cpp | 133 + languages/perl/perldoc.h | 25 + languages/perl/perldoc.protocol | 9 + languages/perl/perlparser.cpp | 494 + languages/perl/perlparser.h | 87 + languages/perl/perlsupportpart.cpp | 330 + languages/perl/perlsupportpart.h | 59 + languages/php/Makefile.am | 24 + languages/php/README.dox | 32 + languages/php/app_templates/Makefile.am | 3 + languages/php/app_templates/php.appwizard | 2 + languages/php/app_templates/phphello/.kdev_ignore | 0 languages/php/app_templates/phphello/Makefile.am | 16 + languages/php/app_templates/phphello/app.kdevelop | 87 + languages/php/app_templates/phphello/app.php | 28 + languages/php/app_templates/phphello/phphello | 25 + .../app_templates/phphello/phphello.kdevtemplate | 108 + languages/php/app_templates/phphello/phphello.png | Bin 0 -> 483 bytes languages/php/data/Makefile.am | 6 + languages/php/data/phpfunctions | 1657 +++ languages/php/doc/Makefile.am | 6 + languages/php/doc/php.toc | 7069 +++++++++++ languages/php/doc/php_bugs.toc | 7 + languages/php/file_templates/Makefile.am | 4 + languages/php/file_templates/php | 12 + languages/php/kdevphpsupport.desktop | 86 + languages/php/kdevphpsupport.rc | 18 + languages/php/phpcodecompletion.cpp | 712 ++ languages/php/phpcodecompletion.h | 103 + languages/php/phpconfigdata.cpp | 88 + languages/php/phpconfigdata.h | 155 + languages/php/phpconfigwidget.cpp | 161 + languages/php/phpconfigwidget.h | 32 + languages/php/phpconfigwidgetbase.ui | 561 + languages/php/phperrorview.cpp | 422 + languages/php/phperrorview.h | 104 + languages/php/phpfile.cpp | 639 + languages/php/phpfile.h | 119 + languages/php/phphtmlview.cpp | 39 + languages/php/phphtmlview.h | 42 + languages/php/phpinfodlg.ui | 87 + languages/php/phpnewclassdlg.cpp | 123 + languages/php/phpnewclassdlg.h | 42 + languages/php/phpnewclassdlgbase.ui | 201 + languages/php/phpparser.cpp | 160 + languages/php/phpparser.h | 73 + languages/php/phpsupport_event.h | 110 + languages/php/phpsupportpart.cpp | 751 ++ languages/php/phpsupportpart.h | 133 + languages/php/phptemplates | 4 + languages/python/Makefile.am | 31 + languages/python/README.dox | 48 + languages/python/app_templates/Makefile.am | 3 + languages/python/app_templates/pyqt/.kdev_ignore | 0 languages/python/app_templates/pyqt/Makefile.am | 20 + .../python/app_templates/pyqt/app-Makefile.am | 14 + languages/python/app_templates/pyqt/app-autogen.sh | 10 + .../python/app_templates/pyqt/app-configure.ac | 32 + languages/python/app_templates/pyqt/app.kdevelop | 81 + languages/python/app_templates/pyqt/app.py | 271 + .../python/app_templates/pyqt/documentdetails.ui | 80 + languages/python/app_templates/pyqt/fileopen.pyxpm | 19 + .../python/app_templates/pyqt/fileprint.pyxpm | 21 + languages/python/app_templates/pyqt/filesave.pyxpm | 19 + languages/python/app_templates/pyqt/install-sh | 0 languages/python/app_templates/pyqt/missing | 0 languages/python/app_templates/pyqt/mkinstalldirs | 0 languages/python/app_templates/pyqt/pyqt | 10 + .../python/app_templates/pyqt/pyqt-am-preproc.py | 85 + .../python/app_templates/pyqt/pyqt.kdevtemplate | 168 + languages/python/app_templates/pyqt/pyqt.png | Bin 0 -> 8800 bytes .../python/app_templates/pyqt/templates-ui-dialog | 20 + .../python/app_templates/pyqt/templates-ui-mainwin | 436 + languages/python/app_templates/python.appwizard | 2 + .../python/app_templates/pythonhello/.kdev_ignore | 0 .../python/app_templates/pythonhello/Makefile.am | 15 + .../python/app_templates/pythonhello/app.kdevelop | 84 + languages/python/app_templates/pythonhello/app.py | 7 + .../python/app_templates/pythonhello/pythonhello | 12 + .../pythonhello/pythonhello.kdevtemplate | 107 + .../app_templates/pythonhello/pythonhello.png | Bin 0 -> 12443 bytes languages/python/app_templates/pytk/.kdev_ignore | 0 languages/python/app_templates/pytk/Makefile.am | 15 + languages/python/app_templates/pytk/app.kdevelop | 82 + languages/python/app_templates/pytk/app.py | 4 + languages/python/app_templates/pytk/pytk | 12 + .../python/app_templates/pytk/pytk.kdevtemplate | 107 + languages/python/app_templates/pytk/pytk.png | Bin 0 -> 2420 bytes languages/python/doc/Makefile.am | 6 + languages/python/doc/python.toc | 1571 +++ languages/python/doc/python_bugs.toc | 7 + languages/python/file_templates/Makefile.am | 4 + languages/python/file_templates/py | 7 + languages/python/kde_pydoc.py | 131 + languages/python/kdevpythonsupport.desktop | 85 + languages/python/kdevpythonsupport.rc | 16 + languages/python/pydoc.cpp | 113 + languages/python/pydoc.h | 30 + languages/python/pydoc.protocol | 9 + languages/python/pythonconfigwidget.cpp | 38 + languages/python/pythonconfigwidget.h | 34 + languages/python/pythonconfigwidgetbase.ui | 121 + languages/python/pythonimplementationwidget.cpp | 77 + languages/python/pythonimplementationwidget.h | 37 + languages/python/pythonsupportpart.cpp | 410 + languages/python/pythonsupportpart.h | 66 + languages/python/qtdesignerpythonintegration.cpp | 97 + languages/python/qtdesignerpythonintegration.h | 37 + languages/ruby/Makefile.am | 31 + languages/ruby/README | 3 + languages/ruby/README.dox | 43 + languages/ruby/app_templates/Makefile.am | 3 + .../ruby/app_templates/dcopservice/Makefile.am | 18 + .../app_templates/dcopservice/app-configure.in.in | 51 + languages/ruby/app_templates/dcopservice/app.cpp | 30 + .../app_templates/dcopservice/dcopservice.desktop | 43 + .../app_templates/dcopservice/dcopservice.kdevelop | 91 + .../ruby/app_templates/dcopservice/dcopservice.rb | 37 + .../dcopservice/dcopserviceruby.kdevtemplate | 199 + .../app_templates/dcopservice/dcopserviceruby.png | Bin 0 -> 23880 bytes languages/ruby/app_templates/dcopservice/main.rb | 30 + .../ruby/app_templates/dcopservice/src-Makefile.am | 15 + languages/ruby/app_templates/dcopservice/subdirs | 3 + languages/ruby/app_templates/kapp/Makefile.am | 19 + languages/ruby/app_templates/kapp/README | 81 + languages/ruby/app_templates/kapp/app-Makefile.am | 1 + .../ruby/app_templates/kapp/app-configure.in.in | 45 + languages/ruby/app_templates/kapp/app.cpp | 30 + languages/ruby/app_templates/kapp/app.desktop | 44 + languages/ruby/app_templates/kapp/app.kdevelop | 90 + languages/ruby/app_templates/kapp/app.rb | 216 + languages/ruby/app_templates/kapp/app_client.rb | 18 + languages/ruby/app_templates/kapp/appiface.rb | 14 + languages/ruby/app_templates/kapp/appui.rc | 8 + languages/ruby/app_templates/kapp/appview.rb | 103 + .../ruby/app_templates/kapp/kappruby.kdevtemplate | 238 + languages/ruby/app_templates/kapp/kappruby.png | Bin 0 -> 5063 bytes languages/ruby/app_templates/kapp/main.rb | 40 + languages/ruby/app_templates/kapp/pref.rb | 38 + languages/ruby/app_templates/kapp/src-Makefile.am | 43 + languages/ruby/app_templates/kapp/subdirs | 3 + languages/ruby/app_templates/kxt/Makefile.am | 20 + languages/ruby/app_templates/kxt/README | 38 + languages/ruby/app_templates/kxt/app-Makefile.am | 1 + .../ruby/app_templates/kxt/app-configure.in.in | 45 + languages/ruby/app_templates/kxt/app.cpp | 30 + languages/ruby/app_templates/kxt/app.desktop | 40 + languages/ruby/app_templates/kxt/app.kcfg | 21 + languages/ruby/app_templates/kxt/app.kdevelop | 90 + languages/ruby/app_templates/kxt/app.rb | 94 + languages/ruby/app_templates/kxt/appui.rc | 8 + languages/ruby/app_templates/kxt/appview.rb | 55 + languages/ruby/app_templates/kxt/appview_base.ui | 33 + .../ruby/app_templates/kxt/kxtruby.kdevtemplate | 251 + languages/ruby/app_templates/kxt/kxtruby.png | Bin 0 -> 7841 bytes languages/ruby/app_templates/kxt/main.rb | 41 + languages/ruby/app_templates/kxt/prefs-base.ui | 127 + languages/ruby/app_templates/kxt/prefs.rb | 7 + languages/ruby/app_templates/kxt/previewruby.png | Bin 0 -> 7712 bytes languages/ruby/app_templates/kxt/settings.kcfgc | 6 + languages/ruby/app_templates/kxt/src-Makefile.am | 48 + languages/ruby/app_templates/kxt/subdirs | 3 + languages/ruby/app_templates/qtruby/.kdev_ignore | 0 languages/ruby/app_templates/qtruby/Makefile.am | 16 + languages/ruby/app_templates/qtruby/README | 29 + languages/ruby/app_templates/qtruby/app-Makefile | 7 + languages/ruby/app_templates/qtruby/app.filelist | 2 + languages/ruby/app_templates/qtruby/app.kdevelop | 85 + languages/ruby/app_templates/qtruby/app.rb | 12 + .../ruby/app_templates/qtruby/qtruby.kdevtemplate | 114 + languages/ruby/app_templates/qtruby/qtruby.png | Bin 0 -> 3435 bytes .../ruby/app_templates/qtruby4app/Makefile.am | 20 + languages/ruby/app_templates/qtruby4app/ReadMe | 6 + .../ruby/app_templates/qtruby4app/app-Makefile | 18 + .../ruby/app_templates/qtruby4app/app.filelist | 3 + .../ruby/app_templates/qtruby4app/application.qrc | 10 + .../ruby/app_templates/qtruby4app/editcopy.xpm | 193 + .../ruby/app_templates/qtruby4app/editcut.xpm | 252 + .../ruby/app_templates/qtruby4app/editpaste.xpm | 295 + .../ruby/app_templates/qtruby4app/filenew.xpm | 216 + .../ruby/app_templates/qtruby4app/fileopen.xpm | 295 + .../ruby/app_templates/qtruby4app/filesave.xpm | 295 + languages/ruby/app_templates/qtruby4app/main.rb | 10 + .../app_templates/qtruby4app/qrc_application.rb | 2281 ++++ .../app_templates/qtruby4app/qtruby4app.kdevelop | 83 + .../qtruby4app/qtruby4app.kdevtemplate | 166 + .../ruby/app_templates/qtruby4app/qtruby4app.png | Bin 0 -> 16908 bytes .../ruby/app_templates/qtruby4app/qtruby4app.rb | 263 + languages/ruby/app_templates/qtrubyapp/Makefile.am | 18 + languages/ruby/app_templates/qtrubyapp/README | 29 + .../ruby/app_templates/qtrubyapp/app-Makefile | 7 + .../ruby/app_templates/qtrubyapp/app.filelist | 3 + .../ruby/app_templates/qtrubyapp/fileopen.xpm | 22 + .../ruby/app_templates/qtrubyapp/fileprint.xpm | 24 + .../ruby/app_templates/qtrubyapp/filesave.xpm | 22 + languages/ruby/app_templates/qtrubyapp/main.rb | 10 + .../app_templates/qtrubyapp/qtrubyapp.kdevelop | 83 + .../app_templates/qtrubyapp/qtrubyapp.kdevtemplate | 140 + .../ruby/app_templates/qtrubyapp/qtrubyapp.png | Bin 0 -> 5245 bytes .../ruby/app_templates/qtrubyapp/qtrubyapp.rb | 253 + languages/ruby/app_templates/rails/CMakeLists.txt | 20 + languages/ruby/app_templates/rails/Makefile.am | 16 + languages/ruby/app_templates/rails/app.kdevelop | 107 + .../ruby/app_templates/rails/rails.kdevtemplate | 72 + languages/ruby/app_templates/rails/rails.png | Bin 0 -> 12062 bytes languages/ruby/app_templates/ruby.appwizard | 2 + .../ruby/app_templates/rubyhello/.kdev_ignore | 0 languages/ruby/app_templates/rubyhello/Makefile.am | 16 + .../ruby/app_templates/rubyhello/app.kdevelop | 91 + languages/ruby/app_templates/rubyhello/app.rb | 3 + languages/ruby/app_templates/rubyhello/rubyhello | 9 + .../app_templates/rubyhello/rubyhello.kdevtemplate | 105 + .../ruby/app_templates/rubyhello/rubyhello.png | Bin 0 -> 483 bytes languages/ruby/debugger/Makefile.am | 25 + languages/ruby/debugger/breakpoint.cpp | 343 + languages/ruby/debugger/breakpoint.h | 214 + languages/ruby/debugger/dbgcommand.cpp | 47 + languages/ruby/debugger/dbgcommand.h | 64 + languages/ruby/debugger/dbgcontroller.cpp | 46 + languages/ruby/debugger/dbgcontroller.h | 161 + languages/ruby/debugger/dbgpsdlg.cpp | 170 + languages/ruby/debugger/dbgpsdlg.h | 60 + languages/ruby/debugger/dbgtoolbar.cpp | 483 + languages/ruby/debugger/dbgtoolbar.h | 90 + languages/ruby/debugger/debuggee.rb | 1214 ++ languages/ruby/debugger/debuggerpart.cpp | 785 ++ languages/ruby/debugger/debuggerpart.h | 110 + languages/ruby/debugger/framestackwidget.cpp | 272 + languages/ruby/debugger/framestackwidget.h | 115 + .../ruby/debugger/hi16-action-breakpoint_add.png | Bin 0 -> 225 bytes .../debugger/hi16-action-breakpoint_delete.png | Bin 0 -> 239 bytes .../debugger/hi16-action-breakpoint_delete_all.png | Bin 0 -> 239 bytes .../ruby/debugger/hi16-action-breakpoint_edit.png | Bin 0 -> 277 bytes languages/ruby/debugger/kdevrbdebugger.desktop | 73 + languages/ruby/debugger/kdevrbdebugger.rc | 68 + languages/ruby/debugger/rdbbreakpointwidget.cpp | 921 ++ languages/ruby/debugger/rdbbreakpointwidget.h | 120 + languages/ruby/debugger/rdbcommand.cpp | 81 + languages/ruby/debugger/rdbcommand.h | 99 + languages/ruby/debugger/rdbcontroller.cpp | 1414 +++ languages/ruby/debugger/rdbcontroller.h | 192 + languages/ruby/debugger/rdboutputwidget.cpp | 171 + languages/ruby/debugger/rdboutputwidget.h | 69 + languages/ruby/debugger/rdbparser.cpp | 350 + languages/ruby/debugger/rdbparser.h | 41 + languages/ruby/debugger/rdbtable.cpp | 62 + languages/ruby/debugger/rdbtable.h | 45 + languages/ruby/debugger/stty.cpp | 370 + languages/ruby/debugger/stty.h | 71 + languages/ruby/debugger/variablewidget.cpp | 1018 ++ languages/ruby/debugger/variablewidget.h | 348 + languages/ruby/doc/Makefile.am | 6 + languages/ruby/doc/qtruby.toc | 9 + languages/ruby/doc/rails.toc | 9 + languages/ruby/doc/ruby.toc | 1399 +++ languages/ruby/doc/ruby_bugs.toc | 7 + languages/ruby/file_templates/Makefile.am | 5 + languages/ruby/file_templates/css | 11 + languages/ruby/file_templates/html.erb | 4 + languages/ruby/file_templates/js | 11 + languages/ruby/file_templates/js.rjs | 7 + languages/ruby/file_templates/rb | 7 + languages/ruby/file_templates/rhtml | 4 + languages/ruby/file_templates/rjs | 7 + languages/ruby/file_templates/rxml | 7 + languages/ruby/file_templates/xml.builder | 7 + languages/ruby/kdevrubysupport.desktop | 84 + languages/ruby/kdevrubysupport.rc | 20 + languages/ruby/play_run.psd | Bin 0 -> 58270 bytes languages/ruby/qtdesignerrubyintegration.cpp | 93 + languages/ruby/qtdesignerrubyintegration.h | 35 + languages/ruby/ruby_config.png | Bin 0 -> 12433 bytes languages/ruby/ruby_config.psd | Bin 0 -> 55515 bytes languages/ruby/ruby_run.png | Bin 0 -> 6986 bytes languages/ruby/rubyconfigwidget.cpp | 53 + languages/ruby/rubyconfigwidget.h | 27 + languages/ruby/rubyconfigwidgetbase.ui | 363 + languages/ruby/rubyimplementationwidget.cpp | 70 + languages/ruby/rubyimplementationwidget.h | 35 + languages/ruby/rubysupport_part.cpp | 908 ++ languages/ruby/rubysupport_part.h | 74 + languages/ruby/rubytemplates | 101 + languages/sql/Makefile.am | 20 + languages/sql/README.dox | 40 + languages/sql/app_templates/Makefile.am | 3 + languages/sql/app_templates/sql.appwizard | 2 + languages/sql/app_templates/sqlsimple/.kdev_ignore | 0 languages/sql/app_templates/sqlsimple/Makefile.am | 16 + languages/sql/app_templates/sqlsimple/app.kdevelop | 84 + languages/sql/app_templates/sqlsimple/app.sql | 1 + languages/sql/app_templates/sqlsimple/sqlsimple | 7 + .../app_templates/sqlsimple/sqlsimple.kdevtemplate | 106 + .../sql/app_templates/sqlsimple/sqlsimple.png | Bin 0 -> 483 bytes languages/sql/doc/Makefile.am | 6 + languages/sql/kdevsqlsupport.desktop | 85 + languages/sql/kdevsqlsupport.rc | 14 + languages/sql/sqlactions.cpp | 103 + languages/sql/sqlactions.h | 41 + languages/sql/sqlconfigwidget.ui | 189 + languages/sql/sqlconfigwidget.ui.h | 244 + languages/sql/sqloutputwidget.cpp | 127 + languages/sql/sqloutputwidget.h | 43 + languages/sql/sqlsupport_part.cpp | 284 + languages/sql/sqlsupport_part.h | 55 + 1713 files changed, 237231 insertions(+) create mode 100644 languages/Makefile.am create mode 100644 languages/ada/AdaAST.hpp create mode 100644 languages/ada/AdaLexer.cpp create mode 100644 languages/ada/AdaLexer.hpp create mode 100644 languages/ada/AdaParser.cpp create mode 100644 languages/ada/AdaParser.hpp create mode 100644 languages/ada/AdaStoreWalker.cpp create mode 100644 languages/ada/AdaStoreWalker.hpp create mode 100644 languages/ada/AdaStoreWalkerTokenTypes.hpp create mode 100644 languages/ada/AdaStoreWalkerTokenTypes.txt create mode 100644 languages/ada/AdaTokenTypes.hpp create mode 100644 languages/ada/AdaTokenTypes.txt create mode 100644 languages/ada/AdaTreeParserSuper.cpp create mode 100644 languages/ada/AdaTreeParserSuper.hpp create mode 100644 languages/ada/AdaTreeParserSuperTokenTypes.hpp create mode 100644 languages/ada/AdaTreeParserSuperTokenTypes.txt create mode 100644 languages/ada/Makefile.am create mode 100644 languages/ada/README create mode 100644 languages/ada/README.dox create mode 100644 languages/ada/ada.g create mode 100644 languages/ada/ada.store.g create mode 100644 languages/ada/ada.tree.g create mode 100644 languages/ada/ada_utils.cpp create mode 100644 languages/ada/ada_utils.hpp create mode 100644 languages/ada/adasupport.cpp create mode 100644 languages/ada/adasupport.hpp create mode 100644 languages/ada/adasupportpart.cpp create mode 100644 languages/ada/adasupportpart.h create mode 100644 languages/ada/addclass.cpp create mode 100644 languages/ada/addclass.h create mode 100644 languages/ada/addclassdlg.ui create mode 100644 languages/ada/app_templates/Makefile.am create mode 100644 languages/ada/app_templates/ada.appwizard create mode 100644 languages/ada/app_templates/adahello/.kdev_ignore create mode 100644 languages/ada/app_templates/adahello/Makefile.am create mode 100644 languages/ada/app_templates/adahello/ada-Makefile create mode 100644 languages/ada/app_templates/adahello/ada-Makefile.am create mode 100644 languages/ada/app_templates/adahello/ada-Makefile.cvs create mode 100644 languages/ada/app_templates/adahello/adahello create mode 100644 languages/ada/app_templates/adahello/adahello.kdevtemplate create mode 100644 languages/ada/app_templates/adahello/adahello.png create mode 100644 languages/ada/app_templates/adahello/app.kdevelop create mode 100644 languages/ada/app_templates/adahello/app.kdevelop.filelist create mode 100644 languages/ada/app_templates/adahello/configure.in create mode 100644 languages/ada/app_templates/adahello/main.adb create mode 100644 languages/ada/app_templates/adahello/src-Makefile.am create mode 100644 languages/ada/backgroundparser.cpp create mode 100644 languages/ada/backgroundparser.h create mode 100644 languages/ada/configproblemreporter.ui create mode 100644 languages/ada/configproblemreporter.ui.h create mode 100644 languages/ada/configure.in.in create mode 100644 languages/ada/doc/Makefile.am create mode 100644 languages/ada/doc/ada.toc create mode 100644 languages/ada/doc/ada_bugs_gcc.toc create mode 100644 languages/ada/file_templates/Makefile.am create mode 100644 languages/ada/file_templates/adb create mode 100644 languages/ada/file_templates/ads create mode 100644 languages/ada/kdevadasupport.desktop create mode 100644 languages/ada/kdevadasupport.rc create mode 100644 languages/ada/preambles.h create mode 100644 languages/ada/problemreporter.cpp create mode 100644 languages/ada/problemreporter.h create mode 100644 languages/bash/Makefile.am create mode 100644 languages/bash/README.dox create mode 100644 languages/bash/app_templates/Makefile.am create mode 100644 languages/bash/app_templates/bash.appwizard create mode 100644 languages/bash/app_templates/bashhello/.kdev_ignore create mode 100644 languages/bash/app_templates/bashhello/Makefile.am create mode 100644 languages/bash/app_templates/bashhello/app.kdevelop create mode 100644 languages/bash/app_templates/bashhello/app.sh create mode 100644 languages/bash/app_templates/bashhello/bashhello create mode 100644 languages/bash/app_templates/bashhello/bashhello.kdevtemplate create mode 100644 languages/bash/app_templates/bashhello/bashhello.png create mode 100644 languages/bash/bashsupport_part.cpp create mode 100644 languages/bash/bashsupport_part.h create mode 100644 languages/bash/doc/Makefile.am create mode 100644 languages/bash/doc/bash.toc create mode 100644 languages/bash/doc/bash_bugs.toc create mode 100644 languages/bash/kdevbashsupport.desktop create mode 100644 languages/bash/kdevbashsupport.rc create mode 100644 languages/cpp/KDevCppSupportIface.cpp create mode 100644 languages/cpp/KDevCppSupportIface.h create mode 100644 languages/cpp/Makefile.am create mode 100644 languages/cpp/README.dox create mode 100644 languages/cpp/addattributedialog.cpp create mode 100644 languages/cpp/addattributedialog.h create mode 100644 languages/cpp/addattributedialogbase.ui create mode 100644 languages/cpp/addmethoddialog.cpp create mode 100644 languages/cpp/addmethoddialog.h create mode 100644 languages/cpp/addmethoddialogbase.ui create mode 100644 languages/cpp/app_templates/Makefile.am create mode 100644 languages/cpp/app_templates/automakeempty/Makefile.am create mode 100644 languages/cpp/app_templates/automakeempty/app.kdevelop create mode 100644 languages/cpp/app_templates/automakeempty/automakeempty-Makefile.am create mode 100644 languages/cpp/app_templates/automakeempty/automakeempty-Makefile.cvs create mode 100644 languages/cpp/app_templates/automakeempty/automakeempty.kdevtemplate create mode 100644 languages/cpp/app_templates/automakeempty/automakeempty.png create mode 100644 languages/cpp/app_templates/automakeempty/configure.in create mode 100644 languages/cpp/app_templates/c.appwizard create mode 100644 languages/cpp/app_templates/chello/.kdev_ignore create mode 100644 languages/cpp/app_templates/chello/Makefile.am create mode 100644 languages/cpp/app_templates/chello/app.kdevelop create mode 100644 languages/cpp/app_templates/chello/c-Makefile.am create mode 100644 languages/cpp/app_templates/chello/c-Makefile.cvs create mode 100644 languages/cpp/app_templates/chello/chello.kdevtemplate create mode 100644 languages/cpp/app_templates/chello/chello.png create mode 100644 languages/cpp/app_templates/chello/configure.in create mode 100644 languages/cpp/app_templates/chello/main.c create mode 100644 languages/cpp/app_templates/chello/src-Makefile.am create mode 100644 languages/cpp/app_templates/chello_gba/.kdev_ignore create mode 100644 languages/cpp/app_templates/chello_gba/Makefile.am create mode 100644 languages/cpp/app_templates/chello_gba/README.devel create mode 100644 languages/cpp/app_templates/chello_gba/app.kdevelop create mode 100644 languages/cpp/app_templates/chello_gba/c-Makefile.am create mode 100644 languages/cpp/app_templates/chello_gba/c-Makefile.cvs create mode 100644 languages/cpp/app_templates/chello_gba/chellogba.kdevtemplate create mode 100644 languages/cpp/app_templates/chello_gba/chellogba.png create mode 100644 languages/cpp/app_templates/chello_gba/configure.in create mode 100644 languages/cpp/app_templates/chello_gba/font.bmp create mode 100644 languages/cpp/app_templates/chello_gba/font.raw.c create mode 100644 languages/cpp/app_templates/chello_gba/gba.h create mode 100644 languages/cpp/app_templates/chello_gba/main.c create mode 100644 languages/cpp/app_templates/chello_gba/main.h create mode 100644 languages/cpp/app_templates/chello_gba/master.pal.c create mode 100644 languages/cpp/app_templates/chello_gba/src-Makefile.am create mode 100644 languages/cpp/app_templates/clanlib/.kdev_ignore create mode 100644 languages/cpp/app_templates/clanlib/Makefile.am create mode 100644 languages/cpp/app_templates/clanlib/app-Makefile.am create mode 100644 languages/cpp/app_templates/clanlib/app-autogen.sh create mode 100644 languages/cpp/app_templates/clanlib/app-configure.in create mode 100644 languages/cpp/app_templates/clanlib/app.kdevelop create mode 100644 languages/cpp/app_templates/clanlib/clanlib.kdevtemplate create mode 100644 languages/cpp/app_templates/clanlib/clanlib.png create mode 100644 languages/cpp/app_templates/clanlib/main.cpp create mode 100644 languages/cpp/app_templates/clanlib/src-Makefile.am create mode 100644 languages/cpp/app_templates/cmakelibc/CMakeLists.txt create mode 100644 languages/cpp/app_templates/cmakelibc/CMakeLists.txt.src create mode 100644 languages/cpp/app_templates/cmakelibc/Makefile.am create mode 100644 languages/cpp/app_templates/cmakelibc/cmakelibc create mode 100644 languages/cpp/app_templates/cmakelibc/cmakelibc.kdevtemplate create mode 100644 languages/cpp/app_templates/cmakelibc/cmakelibc.png create mode 100644 languages/cpp/app_templates/cmakelibc/lib.c create mode 100644 languages/cpp/app_templates/cmakelibc/lib.h create mode 100644 languages/cpp/app_templates/cmakelibc/test.c create mode 100644 languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt create mode 100644 languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt.src create mode 100644 languages/cpp/app_templates/cmakelibcpp/Makefile.am create mode 100644 languages/cpp/app_templates/cmakelibcpp/cmakelibcpp create mode 100644 languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.kdevtemplate create mode 100644 languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.png create mode 100644 languages/cpp/app_templates/cmakelibcpp/lib.cpp create mode 100644 languages/cpp/app_templates/cmakelibcpp/lib.h create mode 100644 languages/cpp/app_templates/cmakelibcpp/test.cpp create mode 100644 languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt create mode 100644 languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt.src create mode 100644 languages/cpp/app_templates/cmakeqt3app/Makefile.am create mode 100644 languages/cpp/app_templates/cmakeqt3app/cmakeqt3app create mode 100644 languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.cpp create mode 100644 languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.h create mode 100644 languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.kdevtemplate create mode 100644 languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.png create mode 100644 languages/cpp/app_templates/cmakeqt3app/fileopen.xpm create mode 100644 languages/cpp/app_templates/cmakeqt3app/fileprint.xpm create mode 100644 languages/cpp/app_templates/cmakeqt3app/filesave.xpm create mode 100644 languages/cpp/app_templates/cmakeqt3app/main.cpp create mode 100644 languages/cpp/app_templates/cmakesimple/CMakeLists.txt create mode 100644 languages/cpp/app_templates/cmakesimple/Makefile.am create mode 100644 languages/cpp/app_templates/cmakesimple/README create mode 100644 languages/cpp/app_templates/cmakesimple/cmakesimple create mode 100644 languages/cpp/app_templates/cmakesimple/cmakesimple.kdevtemplate create mode 100644 languages/cpp/app_templates/cmakesimple/cmakesimple.png create mode 100644 languages/cpp/app_templates/cmakesimple/main.cpp create mode 100644 languages/cpp/app_templates/cmakesimplec/CMakeLists.txt create mode 100644 languages/cpp/app_templates/cmakesimplec/Makefile.am create mode 100644 languages/cpp/app_templates/cmakesimplec/cmakesimplec create mode 100644 languages/cpp/app_templates/cmakesimplec/cmakesimplec.kdevtemplate create mode 100644 languages/cpp/app_templates/cmakesimplec/cmakesimplec.png create mode 100644 languages/cpp/app_templates/cmakesimplec/main.c create mode 100644 languages/cpp/app_templates/cpp.appwizard create mode 100644 languages/cpp/app_templates/cppcurseshello/.kdev_ignore create mode 100644 languages/cpp/app_templates/cppcurseshello/Makefile.am create mode 100644 languages/cpp/app_templates/cppcurseshello/app-configure.in create mode 100644 languages/cpp/app_templates/cppcurseshello/app.kdevelop create mode 100644 languages/cpp/app_templates/cppcurseshello/cpp-Makefile.am create mode 100644 languages/cpp/app_templates/cppcurseshello/cpp-Makefile.cvs create mode 100644 languages/cpp/app_templates/cppcurseshello/cppcurseshello create mode 100644 languages/cpp/app_templates/cppcurseshello/cppcurseshello.kdevtemplate create mode 100644 languages/cpp/app_templates/cppcurseshello/cppcurseshello.png create mode 100644 languages/cpp/app_templates/cppcurseshello/main.cpp create mode 100644 languages/cpp/app_templates/cppcurseshello/src-Makefile.am create mode 100644 languages/cpp/app_templates/cpphello/.kdev_ignore create mode 100644 languages/cpp/app_templates/cpphello/Makefile.am create mode 100644 languages/cpp/app_templates/cpphello/app.kdevelop create mode 100644 languages/cpp/app_templates/cpphello/configure.in create mode 100644 languages/cpp/app_templates/cpphello/cpp-Makefile.am create mode 100644 languages/cpp/app_templates/cpphello/cpp-Makefile.cvs create mode 100644 languages/cpp/app_templates/cpphello/cpphello.kdevtemplate create mode 100644 languages/cpp/app_templates/cpphello/cpphello.png create mode 100644 languages/cpp/app_templates/cpphello/main.cpp create mode 100644 languages/cpp/app_templates/cpphello/src-Makefile.am create mode 100644 languages/cpp/app_templates/cppsdlhello/.kdev_ignore create mode 100644 languages/cpp/app_templates/cppsdlhello/Makefile.am create mode 100644 languages/cpp/app_templates/cppsdlhello/README create mode 100644 languages/cpp/app_templates/cppsdlhello/acinclude.m4 create mode 100644 languages/cpp/app_templates/cppsdlhello/app.kdevelop create mode 100644 languages/cpp/app_templates/cppsdlhello/configure.in create mode 100644 languages/cpp/app_templates/cppsdlhello/cpp-Makefile.am create mode 100644 languages/cpp/app_templates/cppsdlhello/cpp-Makefile.cvs create mode 100644 languages/cpp/app_templates/cppsdlhello/cppsdlhello create mode 100644 languages/cpp/app_templates/cppsdlhello/cppsdlhello.kdevtemplate create mode 100644 languages/cpp/app_templates/cppsdlhello/cppsdlhello.png create mode 100644 languages/cpp/app_templates/cppsdlhello/main.cpp create mode 100644 languages/cpp/app_templates/cppsdlhello/src-Makefile.am create mode 100644 languages/cpp/app_templates/dcopservice/.kdev_ignore create mode 100644 languages/cpp/app_templates/dcopservice/Makefile.am create mode 100644 languages/cpp/app_templates/dcopservice/dcopservice create mode 100644 languages/cpp/app_templates/dcopservice/dcopservice.cpp create mode 100644 languages/cpp/app_templates/dcopservice/dcopservice.desktop create mode 100644 languages/cpp/app_templates/dcopservice/dcopservice.h create mode 100644 languages/cpp/app_templates/dcopservice/dcopservice.kdevelop create mode 100644 languages/cpp/app_templates/dcopservice/dcopservice.kdevtemplate create mode 100644 languages/cpp/app_templates/dcopservice/dcopservice.png create mode 100644 languages/cpp/app_templates/dcopservice/main.cpp create mode 100644 languages/cpp/app_templates/dcopservice/src-Makefile.am create mode 100644 languages/cpp/app_templates/dcopservice/subdirs create mode 100644 languages/cpp/app_templates/generichello/.kdev_ignore create mode 100644 languages/cpp/app_templates/generichello/Makefile.am create mode 100644 languages/cpp/app_templates/generichello/app.kdevelop create mode 100644 languages/cpp/app_templates/generichello/app.prj create mode 100644 languages/cpp/app_templates/generichello/cpphello.png create mode 100644 languages/cpp/app_templates/generichello/generichello.kdevtemplate create mode 100644 languages/cpp/app_templates/generichello/main.cpp create mode 100644 languages/cpp/app_templates/gnome2mmapp/.kdev_ignore create mode 100644 languages/cpp/app_templates/gnome2mmapp/Makefile.am create mode 100644 languages/cpp/app_templates/gnome2mmapp/acconfig.h create mode 100644 languages/cpp/app_templates/gnome2mmapp/app-Makefile.am create mode 100644 languages/cpp/app_templates/gnome2mmapp/app.kdevelop create mode 100755 languages/cpp/app_templates/gnome2mmapp/autogen.sh create mode 100644 languages/cpp/app_templates/gnome2mmapp/config.h create mode 100644 languages/cpp/app_templates/gnome2mmapp/configure.in create mode 100644 languages/cpp/app_templates/gnome2mmapp/gnome2mm.cc create mode 100644 languages/cpp/app_templates/gnome2mmapp/gnome2mm.glade create mode 100644 languages/cpp/app_templates/gnome2mmapp/gnome2mm.gladep create mode 100644 languages/cpp/app_templates/gnome2mmapp/gnome2mmapp create mode 100644 languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.kdevtemplate create mode 100644 languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.png create mode 100644 languages/cpp/app_templates/gnome2mmapp/main_window.cc create mode 100644 languages/cpp/app_templates/gnome2mmapp/main_window.hh create mode 100644 languages/cpp/app_templates/gnome2mmapp/main_window_glade.cc create mode 100644 languages/cpp/app_templates/gnome2mmapp/main_window_glade.hh create mode 100644 languages/cpp/app_templates/gnome2mmapp/src-Makefile.am create mode 100644 languages/cpp/app_templates/gtk2mmapp/.kdev_ignore create mode 100644 languages/cpp/app_templates/gtk2mmapp/Makefile.am create mode 100644 languages/cpp/app_templates/gtk2mmapp/acconfig.h create mode 100644 languages/cpp/app_templates/gtk2mmapp/app-Makefile.am create mode 100644 languages/cpp/app_templates/gtk2mmapp/app.kdevelop create mode 100755 languages/cpp/app_templates/gtk2mmapp/autogen.sh create mode 100644 languages/cpp/app_templates/gtk2mmapp/config.h create mode 100644 languages/cpp/app_templates/gtk2mmapp/configure.in create mode 100644 languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc create mode 100644 languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade create mode 100644 languages/cpp/app_templates/gtk2mmapp/gtk2mm.gladep create mode 100644 languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate create mode 100644 languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.png create mode 100644 languages/cpp/app_templates/gtk2mmapp/main_window.cc create mode 100644 languages/cpp/app_templates/gtk2mmapp/main_window.hh create mode 100644 languages/cpp/app_templates/gtk2mmapp/main_window_glade.cc create mode 100644 languages/cpp/app_templates/gtk2mmapp/main_window_glade.hh create mode 100644 languages/cpp/app_templates/gtk2mmapp/src-Makefile.am create mode 100644 languages/cpp/app_templates/kapp/.kdev_ignore create mode 100644 languages/cpp/app_templates/kapp/Makefile.am create mode 100644 languages/cpp/app_templates/kapp/README create mode 100644 languages/cpp/app_templates/kapp/app.cpp create mode 100644 languages/cpp/app_templates/kapp/app.desktop create mode 100644 languages/cpp/app_templates/kapp/app.h create mode 100644 languages/cpp/app_templates/kapp/app.kdevelop create mode 100644 languages/cpp/app_templates/kapp/app.kdevses create mode 100644 languages/cpp/app_templates/kapp/app_client.cpp create mode 100644 languages/cpp/app_templates/kapp/appiface.h create mode 100644 languages/cpp/app_templates/kapp/appui.rc create mode 100644 languages/cpp/app_templates/kapp/appview.cpp create mode 100644 languages/cpp/app_templates/kapp/appview.h create mode 100644 languages/cpp/app_templates/kapp/kapp.kdevtemplate create mode 100644 languages/cpp/app_templates/kapp/kapp.png create mode 100644 languages/cpp/app_templates/kapp/main.cpp create mode 100644 languages/cpp/app_templates/kapp/pref.cpp create mode 100644 languages/cpp/app_templates/kapp/pref.h create mode 100644 languages/cpp/app_templates/kapp/src-Makefile.am create mode 100644 languages/cpp/app_templates/kapp/subdirs create mode 100644 languages/cpp/app_templates/kateplugin/.kdev_ignore create mode 100644 languages/cpp/app_templates/kateplugin/Makefile.am create mode 100644 languages/cpp/app_templates/kateplugin/hi16-action-plugin.png create mode 100644 languages/cpp/app_templates/kateplugin/hi22-action-plugin.png create mode 100644 languages/cpp/app_templates/kateplugin/kateplugin.kdevtemplate create mode 100644 languages/cpp/app_templates/kateplugin/kateplugin.png create mode 100644 languages/cpp/app_templates/kateplugin/plugin.desktop create mode 100644 languages/cpp/app_templates/kateplugin/plugin.kdevelop create mode 100644 languages/cpp/app_templates/kateplugin/plugin_app.cpp create mode 100644 languages/cpp/app_templates/kateplugin/plugin_app.h create mode 100644 languages/cpp/app_templates/kateplugin/plugin_app.rc create mode 100644 languages/cpp/app_templates/kateplugin/src-Makefile.am create mode 100644 languages/cpp/app_templates/kateplugin/subdirs create mode 100644 languages/cpp/app_templates/kateplugin2/.kdev_ignore create mode 100644 languages/cpp/app_templates/kateplugin2/Makefile.am create mode 100644 languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png create mode 100644 languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png create mode 100644 languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate create mode 100644 languages/cpp/app_templates/kateplugin2/kateplugin2.png create mode 100644 languages/cpp/app_templates/kateplugin2/plugin.desktop create mode 100644 languages/cpp/app_templates/kateplugin2/plugin.kdevelop create mode 100644 languages/cpp/app_templates/kateplugin2/plugin_app.cpp create mode 100644 languages/cpp/app_templates/kateplugin2/plugin_app.h create mode 100644 languages/cpp/app_templates/kateplugin2/plugin_app.rc create mode 100644 languages/cpp/app_templates/kateplugin2/src-Makefile.am create mode 100644 languages/cpp/app_templates/kateplugin2/subdirs create mode 100644 languages/cpp/app_templates/kcmodule/.kdev_ignore create mode 100644 languages/cpp/app_templates/kcmodule/Makefile.am create mode 100644 languages/cpp/app_templates/kcmodule/kcmodule.kdevtemplate create mode 100644 languages/cpp/app_templates/kcmodule/kcmodule.png create mode 100644 languages/cpp/app_templates/kcmodule/module.cpp create mode 100644 languages/cpp/app_templates/kcmodule/module.desktop create mode 100644 languages/cpp/app_templates/kcmodule/module.h create mode 100644 languages/cpp/app_templates/kcmodule/module.kdevelop create mode 100644 languages/cpp/app_templates/kcmodule/src-Makefile.am create mode 100644 languages/cpp/app_templates/kcmodule/subdirs create mode 100644 languages/cpp/app_templates/kconfig35/Makefile.am create mode 100644 languages/cpp/app_templates/kconfig35/README create mode 100644 languages/cpp/app_templates/kconfig35/app.cpp create mode 100644 languages/cpp/app_templates/kconfig35/app.desktop create mode 100644 languages/cpp/app_templates/kconfig35/app.h create mode 100644 languages/cpp/app_templates/kconfig35/app.kcfg create mode 100644 languages/cpp/app_templates/kconfig35/app.kdevelop create mode 100644 languages/cpp/app_templates/kconfig35/appui.rc create mode 100644 languages/cpp/app_templates/kconfig35/appview.cpp create mode 100644 languages/cpp/app_templates/kconfig35/appview.h create mode 100644 languages/cpp/app_templates/kconfig35/appview_base.ui create mode 100644 languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate create mode 100644 languages/cpp/app_templates/kconfig35/kconfig35.png create mode 100644 languages/cpp/app_templates/kconfig35/kxt35.png create mode 100644 languages/cpp/app_templates/kconfig35/main.cpp create mode 100644 languages/cpp/app_templates/kconfig35/prefs-base.ui create mode 100644 languages/cpp/app_templates/kconfig35/prefs.cpp create mode 100644 languages/cpp/app_templates/kconfig35/prefs.h create mode 100644 languages/cpp/app_templates/kconfig35/settings.kcfgc create mode 100644 languages/cpp/app_templates/kconfig35/src-Makefile.am create mode 100644 languages/cpp/app_templates/kconfig35/src-configure.in.in create mode 100644 languages/cpp/app_templates/kconfig35/subdirs create mode 100644 languages/cpp/app_templates/kde4app/CMakeLists.txt create mode 100644 languages/cpp/app_templates/kde4app/Makefile.am create mode 100644 languages/cpp/app_templates/kde4app/README create mode 100644 languages/cpp/app_templates/kde4app/kapp4.cpp create mode 100644 languages/cpp/app_templates/kde4app/kapp4.desktop create mode 100644 languages/cpp/app_templates/kde4app/kapp4.h create mode 100644 languages/cpp/app_templates/kde4app/kapp4.kcfg create mode 100644 languages/cpp/app_templates/kde4app/kapp4view.cpp create mode 100644 languages/cpp/app_templates/kde4app/kapp4view.h create mode 100644 languages/cpp/app_templates/kde4app/kapp4view_base.ui create mode 100644 languages/cpp/app_templates/kde4app/kde4app.kdevelop create mode 100644 languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist create mode 100644 languages/cpp/app_templates/kde4app/kde4app.kdevtemplate create mode 100644 languages/cpp/app_templates/kde4app/kde4app.png create mode 100644 languages/cpp/app_templates/kde4app/kde4appui.rc create mode 100644 languages/cpp/app_templates/kde4app/main.cpp create mode 100644 languages/cpp/app_templates/kde4app/prefs_base.ui create mode 100644 languages/cpp/app_templates/kde4app/settings.kcfgc create mode 100644 languages/cpp/app_templates/kdecpp.appwizard create mode 100644 languages/cpp/app_templates/kdedcop/.kdev_ignore create mode 100644 languages/cpp/app_templates/kdedcop/Makefile.am create mode 100644 languages/cpp/app_templates/kdedcop/app.cpp create mode 100644 languages/cpp/app_templates/kdedcop/app.h create mode 100644 languages/cpp/app_templates/kdedcop/app.kdevelop create mode 100644 languages/cpp/app_templates/kdedcop/app_iface.h create mode 100644 languages/cpp/app_templates/kdedcop/kdedcop.kdevtemplate create mode 100644 languages/cpp/app_templates/kdedcop/kdedcop.png create mode 100644 languages/cpp/app_templates/kdedcop/main.cpp create mode 100644 languages/cpp/app_templates/kdedcop/mainclass.cpp create mode 100644 languages/cpp/app_templates/kdedcop/mainclass.h create mode 100644 languages/cpp/app_templates/kdedcop/src-Makefile.am create mode 100644 languages/cpp/app_templates/kdedcop/subdirs create mode 100644 languages/cpp/app_templates/kdevlang/.kdev_ignore create mode 100644 languages/cpp/app_templates/kdevlang/Makefile.am create mode 100644 languages/cpp/app_templates/kdevlang/README.dox create mode 100644 languages/cpp/app_templates/kdevlang/app.kdevelop create mode 100644 languages/cpp/app_templates/kdevlang/kdevlang-configure.in.in create mode 100644 languages/cpp/app_templates/kdevlang/kdevlang.desktop create mode 100644 languages/cpp/app_templates/kdevlang/kdevlang.kdevtemplate create mode 100644 languages/cpp/app_templates/kdevlang/kdevlang.png create mode 100644 languages/cpp/app_templates/kdevlang/kdevlang.rc create mode 100644 languages/cpp/app_templates/kdevlang/kdevlang_part.cpp create mode 100644 languages/cpp/app_templates/kdevlang/kdevlang_part.h create mode 100644 languages/cpp/app_templates/kdevlang/src-Makefile.am create mode 100644 languages/cpp/app_templates/kdevpart/.kdev_ignore create mode 100644 languages/cpp/app_templates/kdevpart/Makefile.am create mode 100644 languages/cpp/app_templates/kdevpart/README.dox create mode 100644 languages/cpp/app_templates/kdevpart/app.kdevelop create mode 100644 languages/cpp/app_templates/kdevpart/globalconfig.cpp create mode 100644 languages/cpp/app_templates/kdevpart/globalconfig.h create mode 100644 languages/cpp/app_templates/kdevpart/globalconfigbase.ui create mode 100644 languages/cpp/app_templates/kdevpart/kdevpart.desktop create mode 100644 languages/cpp/app_templates/kdevpart/kdevpart.kdevtemplate create mode 100644 languages/cpp/app_templates/kdevpart/kdevpart.png create mode 100644 languages/cpp/app_templates/kdevpart/kdevpart_part.cpp create mode 100644 languages/cpp/app_templates/kdevpart/kdevpart_part.h create mode 100644 languages/cpp/app_templates/kdevpart/kdevpart_part.rc create mode 100644 languages/cpp/app_templates/kdevpart/kdevpart_widget.cpp create mode 100644 languages/cpp/app_templates/kdevpart/kdevpart_widget.h create mode 100644 languages/cpp/app_templates/kdevpart/projectconfig.cpp create mode 100644 languages/cpp/app_templates/kdevpart/projectconfig.h create mode 100644 languages/cpp/app_templates/kdevpart/projectconfigbase.ui create mode 100644 languages/cpp/app_templates/kdevpart/src-Makefile.am create mode 100644 languages/cpp/app_templates/kdevpart2/.kdev_ignore create mode 100644 languages/cpp/app_templates/kdevpart2/Makefile.am create mode 100644 languages/cpp/app_templates/kdevpart2/README.dox create mode 100644 languages/cpp/app_templates/kdevpart2/app.kdevelop create mode 100644 languages/cpp/app_templates/kdevpart2/globalconfig.cpp create mode 100644 languages/cpp/app_templates/kdevpart2/globalconfig.h create mode 100644 languages/cpp/app_templates/kdevpart2/globalconfigbase.ui create mode 100644 languages/cpp/app_templates/kdevpart2/kdevpart-configure.in.in create mode 100644 languages/cpp/app_templates/kdevpart2/kdevpart.desktop create mode 100644 languages/cpp/app_templates/kdevpart2/kdevpart2.kdevtemplate create mode 100644 languages/cpp/app_templates/kdevpart2/kdevpart2.png create mode 100644 languages/cpp/app_templates/kdevpart2/kdevpart_part.cpp create mode 100644 languages/cpp/app_templates/kdevpart2/kdevpart_part.h create mode 100644 languages/cpp/app_templates/kdevpart2/kdevpart_part.rc create mode 100644 languages/cpp/app_templates/kdevpart2/kdevpart_widget.cpp create mode 100644 languages/cpp/app_templates/kdevpart2/kdevpart_widget.h create mode 100644 languages/cpp/app_templates/kdevpart2/projectconfig.cpp create mode 100644 languages/cpp/app_templates/kdevpart2/projectconfig.h create mode 100644 languages/cpp/app_templates/kdevpart2/projectconfigbase.ui create mode 100644 languages/cpp/app_templates/kdevpart2/src-Makefile.am create mode 100644 languages/cpp/app_templates/kdevpart2/subdirs create mode 100644 languages/cpp/app_templates/kfileplugin/.kdev_ignore create mode 100644 languages/cpp/app_templates/kfileplugin/Makefile.am create mode 100644 languages/cpp/app_templates/kfileplugin/README.devel create mode 100644 languages/cpp/app_templates/kfileplugin/kfile_plugin.cpp create mode 100644 languages/cpp/app_templates/kfileplugin/kfile_plugin.desktop create mode 100644 languages/cpp/app_templates/kfileplugin/kfile_plugin.h create mode 100644 languages/cpp/app_templates/kfileplugin/kfileplugin create mode 100644 languages/cpp/app_templates/kfileplugin/kfileplugin.kdevtemplate create mode 100644 languages/cpp/app_templates/kfileplugin/kfileplugin.png create mode 100644 languages/cpp/app_templates/kfileplugin/plugin.kdevelop create mode 100644 languages/cpp/app_templates/kfileplugin/src-Makefile.am create mode 100644 languages/cpp/app_templates/kfileplugin/subdirs create mode 100644 languages/cpp/app_templates/khello/.kdev_ignore create mode 100644 languages/cpp/app_templates/khello/Makefile.am create mode 100644 languages/cpp/app_templates/khello/app.cpp create mode 100644 languages/cpp/app_templates/khello/app.desktop create mode 100644 languages/cpp/app_templates/khello/app.h create mode 100644 languages/cpp/app_templates/khello/app.kdevelop create mode 100644 languages/cpp/app_templates/khello/appui.rc create mode 100644 languages/cpp/app_templates/khello/khello.kdevtemplate create mode 100644 languages/cpp/app_templates/khello/khello.png create mode 100644 languages/cpp/app_templates/khello/main.cpp create mode 100644 languages/cpp/app_templates/khello/src-Makefile.am create mode 100644 languages/cpp/app_templates/khello/subdirs create mode 100644 languages/cpp/app_templates/khello2/.kdev_ignore create mode 100644 languages/cpp/app_templates/khello2/Makefile.am create mode 100644 languages/cpp/app_templates/khello2/app.cpp create mode 100644 languages/cpp/app_templates/khello2/app.desktop create mode 100644 languages/cpp/app_templates/khello2/app.h create mode 100644 languages/cpp/app_templates/khello2/app.kdevelop create mode 100644 languages/cpp/app_templates/khello2/appui.rc create mode 100644 languages/cpp/app_templates/khello2/khello2.kdevtemplate create mode 100644 languages/cpp/app_templates/khello2/khello2.png create mode 100644 languages/cpp/app_templates/khello2/main.cpp create mode 100644 languages/cpp/app_templates/khello2/src-Makefile.am create mode 100644 languages/cpp/app_templates/khello2/subdirs create mode 100644 languages/cpp/app_templates/khello2/widget.cpp create mode 100644 languages/cpp/app_templates/khello2/widget.h create mode 100644 languages/cpp/app_templates/khello2/widgetbase.ui create mode 100644 languages/cpp/app_templates/kicker/.kdev_ignore create mode 100644 languages/cpp/app_templates/kicker/Makefile.am create mode 100644 languages/cpp/app_templates/kicker/applet.cpp create mode 100644 languages/cpp/app_templates/kicker/applet.desktop create mode 100644 languages/cpp/app_templates/kicker/applet.h create mode 100644 languages/cpp/app_templates/kicker/applet.kdevelop create mode 100644 languages/cpp/app_templates/kicker/kicker.kdevtemplate create mode 100644 languages/cpp/app_templates/kicker/kicker.png create mode 100644 languages/cpp/app_templates/kicker/src-Makefile.am create mode 100644 languages/cpp/app_templates/kicker/subdirs create mode 100644 languages/cpp/app_templates/kioslave/.kdev_ignore create mode 100644 languages/cpp/app_templates/kioslave/Makefile.am create mode 100644 languages/cpp/app_templates/kioslave/kioslave.kdevtemplate create mode 100644 languages/cpp/app_templates/kioslave/kioslave.png create mode 100644 languages/cpp/app_templates/kioslave/slave.cpp create mode 100644 languages/cpp/app_templates/kioslave/slave.h create mode 100644 languages/cpp/app_templates/kioslave/slave.kdevelop create mode 100644 languages/cpp/app_templates/kioslave/slave.protocol create mode 100644 languages/cpp/app_templates/kioslave/src-Makefile.am create mode 100644 languages/cpp/app_templates/kioslave/subdirs create mode 100644 languages/cpp/app_templates/kmake/Makefile.am create mode 100644 languages/cpp/app_templates/kmake/app.cpp create mode 100644 languages/cpp/app_templates/kmake/app.desktop create mode 100644 languages/cpp/app_templates/kmake/app.kdevelop create mode 100644 languages/cpp/app_templates/kmake/app.pro create mode 100644 languages/cpp/app_templates/kmake/appui.rc create mode 100644 languages/cpp/app_templates/kmake/kmake.kdevtemplate create mode 100644 languages/cpp/app_templates/kmake/kmake.png create mode 100644 languages/cpp/app_templates/kmake/mainview.ui create mode 100644 languages/cpp/app_templates/kmake/mainviewimp.cpp create mode 100644 languages/cpp/app_templates/kmake/mainviewimp.h create mode 100644 languages/cpp/app_templates/kmake/src.pro create mode 100644 languages/cpp/app_templates/kmod/.kdev_ignore create mode 100644 languages/cpp/app_templates/kmod/Makefile.am create mode 100644 languages/cpp/app_templates/kmod/kmod-driver.c create mode 100644 languages/cpp/app_templates/kmod/kmod.kdevelop create mode 100644 languages/cpp/app_templates/kmod/kmod.kdevtemplate create mode 100644 languages/cpp/app_templates/kmod/kmod.png create mode 100644 languages/cpp/app_templates/kmod/src-Makefile create mode 100644 languages/cpp/app_templates/kofficepart/.kdev_ignore create mode 100644 languages/cpp/app_templates/kofficepart/Makefile.am create mode 100644 languages/cpp/app_templates/kofficepart/kde-configure.in.in create mode 100644 languages/cpp/app_templates/kofficepart/kopart.desktop create mode 100644 languages/cpp/app_templates/kofficepart/kopart.kdevelop create mode 100644 languages/cpp/app_templates/kofficepart/kopart.kdevtemplate create mode 100644 languages/cpp/app_templates/kofficepart/kopart.png create mode 100644 languages/cpp/app_templates/kofficepart/kopart.rc create mode 100644 languages/cpp/app_templates/kofficepart/kopart_aboutdata.h create mode 100644 languages/cpp/app_templates/kofficepart/kopart_factory.cpp create mode 100644 languages/cpp/app_templates/kofficepart/kopart_factory.h create mode 100644 languages/cpp/app_templates/kofficepart/kopart_part.cpp create mode 100644 languages/cpp/app_templates/kofficepart/kopart_part.h create mode 100644 languages/cpp/app_templates/kofficepart/kopart_view.cpp create mode 100644 languages/cpp/app_templates/kofficepart/kopart_view.h create mode 100644 languages/cpp/app_templates/kofficepart/main.cpp create mode 100644 languages/cpp/app_templates/kofficepart/src-Makefile.am create mode 100644 languages/cpp/app_templates/kofficepart/subdirs create mode 100644 languages/cpp/app_templates/kofficepart/x-kopart.desktop create mode 100644 languages/cpp/app_templates/konqnavpanel/.kdev_ignore create mode 100644 languages/cpp/app_templates/konqnavpanel/Makefile.am create mode 100644 languages/cpp/app_templates/konqnavpanel/konqnavpanel.cpp create mode 100644 languages/cpp/app_templates/konqnavpanel/konqnavpanel.desktop create mode 100644 languages/cpp/app_templates/konqnavpanel/konqnavpanel.h create mode 100644 languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevelop create mode 100644 languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevtemplate create mode 100644 languages/cpp/app_templates/konqnavpanel/konqnavpanel.png create mode 100644 languages/cpp/app_templates/konqnavpanel/src-Makefile.am create mode 100644 languages/cpp/app_templates/konqnavpanel/subdirs create mode 100644 languages/cpp/app_templates/kpartapp/.kdev_ignore create mode 100644 languages/cpp/app_templates/kpartapp/Makefile.am create mode 100644 languages/cpp/app_templates/kpartapp/app.cpp create mode 100644 languages/cpp/app_templates/kpartapp/app.desktop create mode 100644 languages/cpp/app_templates/kpartapp/app.h create mode 100644 languages/cpp/app_templates/kpartapp/app.kdevelop create mode 100644 languages/cpp/app_templates/kpartapp/app_part.cpp create mode 100644 languages/cpp/app_templates/kpartapp/app_part.h create mode 100644 languages/cpp/app_templates/kpartapp/app_part.rc create mode 100644 languages/cpp/app_templates/kpartapp/app_shell.rc create mode 100644 languages/cpp/app_templates/kpartapp/kpartapp.kdevtemplate create mode 100644 languages/cpp/app_templates/kpartapp/kpartapp.png create mode 100644 languages/cpp/app_templates/kpartapp/main.cpp create mode 100644 languages/cpp/app_templates/kpartapp/src-Makefile.am create mode 100644 languages/cpp/app_templates/kpartapp/subdirs create mode 100644 languages/cpp/app_templates/kpartplugin/.kdev_ignore create mode 100644 languages/cpp/app_templates/kpartplugin/Makefile.am create mode 100644 languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png create mode 100644 languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png create mode 100644 languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate create mode 100644 languages/cpp/app_templates/kpartplugin/kpartplugin.png create mode 100644 languages/cpp/app_templates/kpartplugin/plugin.kdevelop create mode 100644 languages/cpp/app_templates/kpartplugin/plugin_app.cpp create mode 100644 languages/cpp/app_templates/kpartplugin/plugin_app.h create mode 100644 languages/cpp/app_templates/kpartplugin/plugin_app.rc create mode 100644 languages/cpp/app_templates/kpartplugin/src-Makefile.am create mode 100644 languages/cpp/app_templates/kpartplugin/subdirs create mode 100644 languages/cpp/app_templates/kscons_kmdi/INSTALL create mode 100644 languages/cpp/app_templates/kscons_kmdi/Makefile.am create mode 100644 languages/cpp/app_templates/kscons_kmdi/QUICKSTART create mode 100644 languages/cpp/app_templates/kscons_kmdi/README create mode 100644 languages/cpp/app_templates/kscons_kmdi/SConscript-doc create mode 100644 languages/cpp/app_templates/kscons_kmdi/SConscript-src create mode 100644 languages/cpp/app_templates/kscons_kmdi/SConstruct create mode 100644 languages/cpp/app_templates/kscons_kmdi/VERSION create mode 100644 languages/cpp/app_templates/kscons_kmdi/app.kcfg create mode 100644 languages/cpp/app_templates/kscons_kmdi/app.kdevelop create mode 100644 languages/cpp/app_templates/kscons_kmdi/app_part.cpp create mode 100644 languages/cpp/app_templates/kscons_kmdi/app_part.h create mode 100644 languages/cpp/app_templates/kscons_kmdi/app_part.rc create mode 100644 languages/cpp/app_templates/kscons_kmdi/app_shell.rc create mode 100644 languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp create mode 100644 languages/cpp/app_templates/kscons_kmdi/appkmdi.h create mode 100644 languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp create mode 100644 languages/cpp/app_templates/kscons_kmdi/appkmdiView.h create mode 100644 languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp create mode 100644 languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h create mode 100644 languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate create mode 100644 languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png create mode 100644 languages/cpp/app_templates/kscons_kmdi/main.cpp create mode 100755 languages/cpp/app_templates/kscons_kmdi/messages.sh create mode 100644 languages/cpp/app_templates/kscons_kmdi/prefs.ui create mode 100644 languages/cpp/app_templates/kscons_kmdi/settings.kcfgc create mode 100644 languages/cpp/app_templates/kscons_kmdi/tips create mode 100644 languages/cpp/app_templates/kscons_kxt/INSTALL create mode 100644 languages/cpp/app_templates/kscons_kxt/Makefile.am create mode 100644 languages/cpp/app_templates/kscons_kxt/QUICKSTART create mode 100644 languages/cpp/app_templates/kscons_kxt/README create mode 100644 languages/cpp/app_templates/kscons_kxt/SConscript-doc create mode 100644 languages/cpp/app_templates/kscons_kxt/SConscript-src create mode 100644 languages/cpp/app_templates/kscons_kxt/SConstruct create mode 100644 languages/cpp/app_templates/kscons_kxt/VERSION create mode 100644 languages/cpp/app_templates/kscons_kxt/app.cpp create mode 100644 languages/cpp/app_templates/kscons_kxt/app.h create mode 100644 languages/cpp/app_templates/kscons_kxt/app.kcfg create mode 100644 languages/cpp/app_templates/kscons_kxt/app.kdevelop create mode 100644 languages/cpp/app_templates/kscons_kxt/appui.rc create mode 100644 languages/cpp/app_templates/kscons_kxt/appview.cpp create mode 100644 languages/cpp/app_templates/kscons_kxt/appview.h create mode 100644 languages/cpp/app_templates/kscons_kxt/appview_base.ui create mode 100644 languages/cpp/app_templates/kscons_kxt/kscons_kxt.kdevtemplate create mode 100644 languages/cpp/app_templates/kscons_kxt/kscons_kxt.png create mode 100644 languages/cpp/app_templates/kscons_kxt/main.cpp create mode 100755 languages/cpp/app_templates/kscons_kxt/messages.sh create mode 100644 languages/cpp/app_templates/kscons_kxt/prefs-base.ui create mode 100644 languages/cpp/app_templates/kscons_kxt/prefs.cpp create mode 100644 languages/cpp/app_templates/kscons_kxt/prefs.h create mode 100644 languages/cpp/app_templates/kscons_kxt/settings.kcfgc create mode 100644 languages/cpp/app_templates/kscons_kxt/tips create mode 100644 languages/cpp/app_templates/kscreensaver/.kdev_ignore create mode 100644 languages/cpp/app_templates/kscreensaver/Makefile.am create mode 100644 languages/cpp/app_templates/kscreensaver/kscreensaver.cpp create mode 100644 languages/cpp/app_templates/kscreensaver/kscreensaver.desktop create mode 100644 languages/cpp/app_templates/kscreensaver/kscreensaver.h create mode 100644 languages/cpp/app_templates/kscreensaver/kscreensaver.kdevelop create mode 100644 languages/cpp/app_templates/kscreensaver/kscreensaver.kdevtemplate create mode 100644 languages/cpp/app_templates/kscreensaver/kscreensaver.png create mode 100644 languages/cpp/app_templates/kscreensaver/kscreensaverui.ui create mode 100644 languages/cpp/app_templates/kscreensaver/src-Makefile.am create mode 100644 languages/cpp/app_templates/kscreensaver/subdirs create mode 100644 languages/cpp/app_templates/kxt/.kdev_ignore create mode 100644 languages/cpp/app_templates/kxt/Makefile.am create mode 100644 languages/cpp/app_templates/kxt/README create mode 100644 languages/cpp/app_templates/kxt/app.cpp create mode 100644 languages/cpp/app_templates/kxt/app.desktop create mode 100644 languages/cpp/app_templates/kxt/app.h create mode 100644 languages/cpp/app_templates/kxt/app.kcfg create mode 100644 languages/cpp/app_templates/kxt/app.kdevelop create mode 100644 languages/cpp/app_templates/kxt/appui.rc create mode 100644 languages/cpp/app_templates/kxt/appview.cpp create mode 100644 languages/cpp/app_templates/kxt/appview.h create mode 100644 languages/cpp/app_templates/kxt/appview_base.ui create mode 100644 languages/cpp/app_templates/kxt/kxt.kdevtemplate create mode 100644 languages/cpp/app_templates/kxt/kxt.png create mode 100644 languages/cpp/app_templates/kxt/main.cpp create mode 100644 languages/cpp/app_templates/kxt/prefs-base.ui create mode 100644 languages/cpp/app_templates/kxt/prefs.cpp create mode 100644 languages/cpp/app_templates/kxt/prefs.h create mode 100644 languages/cpp/app_templates/kxt/preview.png create mode 100644 languages/cpp/app_templates/kxt/settings.kcfgc create mode 100644 languages/cpp/app_templates/kxt/src-Makefile.am create mode 100644 languages/cpp/app_templates/kxt/src-configure.in.in create mode 100644 languages/cpp/app_templates/kxt/subdirs create mode 100644 languages/cpp/app_templates/makefileempty/Makefile.am create mode 100644 languages/cpp/app_templates/makefileempty/app.kdevelop create mode 100644 languages/cpp/app_templates/makefileempty/makefileempty-Makefile create mode 100644 languages/cpp/app_templates/makefileempty/makefileempty.kdevtemplate create mode 100644 languages/cpp/app_templates/makefileempty/makefileempty.png create mode 100644 languages/cpp/app_templates/noatunui/.kdev_ignore create mode 100644 languages/cpp/app_templates/noatunui/Makefile.am create mode 100644 languages/cpp/app_templates/noatunui/noatunui create mode 100644 languages/cpp/app_templates/noatunui/noatunui.kdevtemplate create mode 100644 languages/cpp/app_templates/noatunui/noatunui.png create mode 100644 languages/cpp/app_templates/noatunui/plugin.kdevelop create mode 100644 languages/cpp/app_templates/noatunui/plugin.plugin create mode 100644 languages/cpp/app_templates/noatunui/plugin_app.cpp create mode 100644 languages/cpp/app_templates/noatunui/plugin_impl.cpp create mode 100644 languages/cpp/app_templates/noatunui/plugin_impl.h create mode 100644 languages/cpp/app_templates/noatunui/src-Makefile.am create mode 100644 languages/cpp/app_templates/noatunui/subdirs create mode 100644 languages/cpp/app_templates/noatunvisual/.kdev_ignore create mode 100644 languages/cpp/app_templates/noatunvisual/Makefile.am create mode 100644 languages/cpp/app_templates/noatunvisual/noatunvisual create mode 100644 languages/cpp/app_templates/noatunvisual/noatunvisual-configure.in.in create mode 100644 languages/cpp/app_templates/noatunvisual/noatunvisual.kdevtemplate create mode 100644 languages/cpp/app_templates/noatunvisual/noatunvisual.png create mode 100644 languages/cpp/app_templates/noatunvisual/plugin.kdevelop create mode 100644 languages/cpp/app_templates/noatunvisual/plugin.plugin create mode 100644 languages/cpp/app_templates/noatunvisual/plugin_app.cpp create mode 100644 languages/cpp/app_templates/noatunvisual/plugin_app.h create mode 100644 languages/cpp/app_templates/noatunvisual/plugin_impl.cpp create mode 100644 languages/cpp/app_templates/noatunvisual/plugin_impl.h create mode 100644 languages/cpp/app_templates/noatunvisual/src-Makefile.am create mode 100644 languages/cpp/app_templates/noatunvisual/subdirs create mode 100644 languages/cpp/app_templates/opieapp/.kdev_ignore create mode 100644 languages/cpp/app_templates/opieapp/Example.png create mode 100644 languages/cpp/app_templates/opieapp/Makefile.am create mode 100644 languages/cpp/app_templates/opieapp/app.kdevelop create mode 100644 languages/cpp/app_templates/opieapp/app.pro create mode 100644 languages/cpp/app_templates/opieapp/example.cpp create mode 100644 languages/cpp/app_templates/opieapp/example.desktop create mode 100644 languages/cpp/app_templates/opieapp/example.h create mode 100644 languages/cpp/app_templates/opieapp/examplebase.ui create mode 100644 languages/cpp/app_templates/opieapp/opieapp.kdevtemplate create mode 100644 languages/cpp/app_templates/opieapp/opieapp.png create mode 100644 languages/cpp/app_templates/opieapplet/.kdev_ignore create mode 100644 languages/cpp/app_templates/opieapplet/Example.png create mode 100644 languages/cpp/app_templates/opieapplet/Makefile.am create mode 100644 languages/cpp/app_templates/opieapplet/app.kdevelop create mode 100644 languages/cpp/app_templates/opieapplet/app.pro create mode 100644 languages/cpp/app_templates/opieapplet/opieapplet.kdevtemplate create mode 100644 languages/cpp/app_templates/opieapplet/opieapplet.png create mode 100644 languages/cpp/app_templates/opieapplet/simpleimpl.cpp create mode 100644 languages/cpp/app_templates/opieapplet/simpleimpl.h create mode 100644 languages/cpp/app_templates/opieinput/.kdev_ignore create mode 100644 languages/cpp/app_templates/opieinput/Example.png create mode 100644 languages/cpp/app_templates/opieinput/Makefile.am create mode 100644 languages/cpp/app_templates/opieinput/app.kdevelop create mode 100644 languages/cpp/app_templates/opieinput/app.pro create mode 100644 languages/cpp/app_templates/opieinput/opieinput.kdevtemplate create mode 100644 languages/cpp/app_templates/opieinput/opieinput.png create mode 100644 languages/cpp/app_templates/opieinput/simpleimpl.cpp create mode 100644 languages/cpp/app_templates/opieinput/simpleimpl.h create mode 100644 languages/cpp/app_templates/opiemenu/.kdev_ignore create mode 100644 languages/cpp/app_templates/opiemenu/Example.png create mode 100644 languages/cpp/app_templates/opiemenu/Makefile.am create mode 100644 languages/cpp/app_templates/opiemenu/app.kdevelop create mode 100644 languages/cpp/app_templates/opiemenu/app.pro create mode 100644 languages/cpp/app_templates/opiemenu/opiemenu.kdevtemplate create mode 100644 languages/cpp/app_templates/opiemenu/opiemenu.png create mode 100644 languages/cpp/app_templates/opiemenu/simpleimpl.cpp create mode 100644 languages/cpp/app_templates/opiemenu/simpleimpl.h create mode 100644 languages/cpp/app_templates/opienet/.kdev_ignore create mode 100644 languages/cpp/app_templates/opienet/Example.png create mode 100644 languages/cpp/app_templates/opienet/Makefile.am create mode 100644 languages/cpp/app_templates/opienet/app.kdevelop create mode 100644 languages/cpp/app_templates/opienet/app.pro create mode 100644 languages/cpp/app_templates/opienet/opienet.kdevtemplate create mode 100644 languages/cpp/app_templates/opienet/opienet.png create mode 100644 languages/cpp/app_templates/opienet/simmplemodule.h create mode 100644 languages/cpp/app_templates/opienet/simpleiface.cpp create mode 100644 languages/cpp/app_templates/opienet/simpleiface.h create mode 100644 languages/cpp/app_templates/opienet/simplemodule.cpp create mode 100644 languages/cpp/app_templates/opienet/simplemodule.h create mode 100644 languages/cpp/app_templates/opietoday/.kdev_ignore create mode 100644 languages/cpp/app_templates/opietoday/Example.png create mode 100644 languages/cpp/app_templates/opietoday/Makefile.am create mode 100644 languages/cpp/app_templates/opietoday/app.kdevelop create mode 100644 languages/cpp/app_templates/opietoday/app.pro create mode 100644 languages/cpp/app_templates/opietoday/exampleplugin.cpp create mode 100644 languages/cpp/app_templates/opietoday/exampleplugin.h create mode 100644 languages/cpp/app_templates/opietoday/examplepluginimpl.cpp create mode 100644 languages/cpp/app_templates/opietoday/examplepluginimpl.h create mode 100644 languages/cpp/app_templates/opietoday/examplepluginwidget.cpp create mode 100644 languages/cpp/app_templates/opietoday/examplepluginwidget.h create mode 100644 languages/cpp/app_templates/opietoday/opietoday.kdevtemplate create mode 100644 languages/cpp/app_templates/opietoday/opietoday.png create mode 100644 languages/cpp/app_templates/prc-tool/.kdev_ignore create mode 100644 languages/cpp/app_templates/prc-tool/Makefile.am create mode 100644 languages/cpp/app_templates/prc-tool/callback.h create mode 100644 languages/cpp/app_templates/prc-tool/palmhello.c create mode 100644 languages/cpp/app_templates/prc-tool/palmhello.pbitm create mode 100644 languages/cpp/app_templates/prc-tool/palmhello.rcp create mode 100644 languages/cpp/app_templates/prc-tool/palmhelloRsc.h create mode 100644 languages/cpp/app_templates/prc-tool/prc-tool create mode 100644 languages/cpp/app_templates/prc-tool/prc-tool.kdevelop create mode 100644 languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate create mode 100644 languages/cpp/app_templates/prc-tool/src-Makefile create mode 100644 languages/cpp/app_templates/qmakeapp/.kdev_ignore create mode 100644 languages/cpp/app_templates/qmakeapp/Makefile.am create mode 100644 languages/cpp/app_templates/qmakeapp/fileopen.xpm create mode 100644 languages/cpp/app_templates/qmakeapp/fileprint.xpm create mode 100644 languages/cpp/app_templates/qmakeapp/filesave.xpm create mode 100644 languages/cpp/app_templates/qmakeapp/main.cpp create mode 100644 languages/cpp/app_templates/qmakeapp/qmakeapp create mode 100644 languages/cpp/app_templates/qmakeapp/qmakeapp.cpp create mode 100644 languages/cpp/app_templates/qmakeapp/qmakeapp.h create mode 100644 languages/cpp/app_templates/qmakeapp/qmakeapp.kdevelop create mode 100644 languages/cpp/app_templates/qmakeapp/qmakeapp.kdevtemplate create mode 100644 languages/cpp/app_templates/qmakeapp/qmakeapp.png create mode 100644 languages/cpp/app_templates/qmakeapp/qmakeapp.pro create mode 100644 languages/cpp/app_templates/qmakeapp/src.pro create mode 100644 languages/cpp/app_templates/qmakeempty/Makefile.am create mode 100644 languages/cpp/app_templates/qmakeempty/qmakeempty.kdevelop create mode 100644 languages/cpp/app_templates/qmakeempty/qmakeempty.kdevtemplate create mode 100644 languages/cpp/app_templates/qmakeempty/qmakeempty.png create mode 100644 languages/cpp/app_templates/qmakeempty/qmakeempty.pro create mode 100644 languages/cpp/app_templates/qmakesimple/.kdev_ignore create mode 100644 languages/cpp/app_templates/qmakesimple/Makefile.am create mode 100644 languages/cpp/app_templates/qmakesimple/app.kdevelop create mode 100644 languages/cpp/app_templates/qmakesimple/app.pro create mode 100644 languages/cpp/app_templates/qmakesimple/main.cpp create mode 100644 languages/cpp/app_templates/qmakesimple/qmakesimple create mode 100644 languages/cpp/app_templates/qmakesimple/qmakesimple.kdevtemplate create mode 100644 languages/cpp/app_templates/qmakesimple/qmakesimple.png create mode 100644 languages/cpp/app_templates/qmakesimple/src.pro create mode 100644 languages/cpp/app_templates/qt4hello/Makefile.am create mode 100644 languages/cpp/app_templates/qt4hello/ReadMe create mode 100644 languages/cpp/app_templates/qt4hello/main.cpp create mode 100644 languages/cpp/app_templates/qt4hello/qt4hello.kdevelop create mode 100644 languages/cpp/app_templates/qt4hello/qt4hello.kdevtemplate create mode 100644 languages/cpp/app_templates/qt4hello/qt4hello.png create mode 100644 languages/cpp/app_templates/qt4hello/qt4hello.pro create mode 100644 languages/cpp/app_templates/qt4hello/src.pro create mode 100644 languages/cpp/app_templates/qt4makeapp/Makefile.am create mode 100644 languages/cpp/app_templates/qt4makeapp/ReadMe create mode 100644 languages/cpp/app_templates/qt4makeapp/application.qrc create mode 100644 languages/cpp/app_templates/qt4makeapp/editcopy.xpm create mode 100644 languages/cpp/app_templates/qt4makeapp/editcut.xpm create mode 100644 languages/cpp/app_templates/qt4makeapp/editpaste.xpm create mode 100644 languages/cpp/app_templates/qt4makeapp/filenew.xpm create mode 100644 languages/cpp/app_templates/qt4makeapp/fileopen.xpm create mode 100644 languages/cpp/app_templates/qt4makeapp/filesave.xpm create mode 100644 languages/cpp/app_templates/qt4makeapp/main.cpp create mode 100644 languages/cpp/app_templates/qt4makeapp/qt4makeapp create mode 100644 languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp create mode 100644 languages/cpp/app_templates/qt4makeapp/qt4makeapp.h create mode 100644 languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevelop create mode 100644 languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevtemplate create mode 100644 languages/cpp/app_templates/qt4makeapp/qt4makeapp.png create mode 100644 languages/cpp/app_templates/qt4makeapp/qt4makeapp.pro create mode 100644 languages/cpp/app_templates/qt4makeapp/src.pro create mode 100644 languages/cpp/app_templates/qtopia4app/Example.png create mode 100644 languages/cpp/app_templates/qtopia4app/Makefile.am create mode 100644 languages/cpp/app_templates/qtopia4app/app.kdevelop create mode 100644 languages/cpp/app_templates/qtopia4app/app.pro create mode 100644 languages/cpp/app_templates/qtopia4app/example.cpp create mode 100644 languages/cpp/app_templates/qtopia4app/example.desktop create mode 100644 languages/cpp/app_templates/qtopia4app/example.h create mode 100644 languages/cpp/app_templates/qtopia4app/example.html create mode 100644 languages/cpp/app_templates/qtopia4app/examplebase.ui create mode 100644 languages/cpp/app_templates/qtopia4app/main.cpp create mode 100644 languages/cpp/app_templates/qtopia4app/qtopia4app.kdevtemplate create mode 100644 languages/cpp/app_templates/qtopia4app/qtopia4app.png create mode 100644 languages/cpp/app_templates/qtopiaapp/.kdev_ignore create mode 100644 languages/cpp/app_templates/qtopiaapp/Example.png create mode 100644 languages/cpp/app_templates/qtopiaapp/Makefile.am create mode 100644 languages/cpp/app_templates/qtopiaapp/app.kdevelop create mode 100644 languages/cpp/app_templates/qtopiaapp/app.pro create mode 100644 languages/cpp/app_templates/qtopiaapp/example.control create mode 100644 languages/cpp/app_templates/qtopiaapp/example.cpp create mode 100644 languages/cpp/app_templates/qtopiaapp/example.desktop create mode 100644 languages/cpp/app_templates/qtopiaapp/example.h create mode 100644 languages/cpp/app_templates/qtopiaapp/example.html create mode 100644 languages/cpp/app_templates/qtopiaapp/examplebase.ui create mode 100644 languages/cpp/app_templates/qtopiaapp/main.cpp create mode 100644 languages/cpp/app_templates/qtopiaapp/qtopiaapp create mode 100644 languages/cpp/app_templates/qtopiaapp/qtopiaapp.kdevtemplate create mode 100644 languages/cpp/app_templates/qtopiaapp/qtopiaapp.png create mode 100644 languages/cpp/app_templates/win32gui/.kdev_ignore create mode 100644 languages/cpp/app_templates/win32gui/Makefile.am create mode 100644 languages/cpp/app_templates/win32gui/app.cpp create mode 100644 languages/cpp/app_templates/win32gui/app.kdevelop create mode 100644 languages/cpp/app_templates/win32gui/src-Makefile.am create mode 100644 languages/cpp/app_templates/win32gui/win32gui-Makefile.am create mode 100644 languages/cpp/app_templates/win32gui/win32gui-Makefile.cvs create mode 100644 languages/cpp/app_templates/win32gui/win32gui-configure.in create mode 100644 languages/cpp/app_templates/win32gui/win32gui.kdevtemplate create mode 100644 languages/cpp/app_templates/win32gui/win32gui.png create mode 100644 languages/cpp/app_templates/win32hello/.kdev_ignore create mode 100644 languages/cpp/app_templates/win32hello/Makefile.am create mode 100644 languages/cpp/app_templates/win32hello/app.cpp create mode 100644 languages/cpp/app_templates/win32hello/app.kdevelop create mode 100644 languages/cpp/app_templates/win32hello/src-Makefile.am create mode 100644 languages/cpp/app_templates/win32hello/win32-Makefile.am create mode 100644 languages/cpp/app_templates/win32hello/win32-Makefile.cvs create mode 100644 languages/cpp/app_templates/win32hello/win32-configure.in create mode 100644 languages/cpp/app_templates/win32hello/win32hello.kdevtemplate create mode 100644 languages/cpp/app_templates/win32hello/win32hello.png create mode 100644 languages/cpp/app_templates/wxhello/.kdev_ignore create mode 100644 languages/cpp/app_templates/wxhello/Makefile.am create mode 100644 languages/cpp/app_templates/wxhello/app.cpp create mode 100644 languages/cpp/app_templates/wxhello/app.desktop create mode 100644 languages/cpp/app_templates/wxhello/app.h create mode 100644 languages/cpp/app_templates/wxhello/app.kdevelop create mode 100644 languages/cpp/app_templates/wxhello/src-Makefile.am create mode 100644 languages/cpp/app_templates/wxhello/subdirs create mode 100644 languages/cpp/app_templates/wxhello/wxhello create mode 100644 languages/cpp/app_templates/wxhello/wxhello.kdevtemplate create mode 100644 languages/cpp/app_templates/wxhello/wxhello.png create mode 100644 languages/cpp/ast_utils.cpp create mode 100644 languages/cpp/ast_utils.h create mode 100644 languages/cpp/backgroundparser.cpp create mode 100644 languages/cpp/backgroundparser.h create mode 100644 languages/cpp/bithelpers.h create mode 100644 languages/cpp/ccconfigwidget.cpp create mode 100644 languages/cpp/ccconfigwidget.h create mode 100644 languages/cpp/ccconfigwidgetbase.ui create mode 100644 languages/cpp/classgeneratorconfig.cpp create mode 100644 languages/cpp/classgeneratorconfig.h create mode 100644 languages/cpp/classgeneratorconfigbase.ui create mode 100644 languages/cpp/codecompletionentry.h create mode 100644 languages/cpp/codeinformationrepository.cpp create mode 100644 languages/cpp/codeinformationrepository.h create mode 100644 languages/cpp/compiler/Makefile.am create mode 100644 languages/cpp/compiler/gccoptions/Makefile.am create mode 100644 languages/cpp/compiler/gccoptions/gccoptionsplugin.cpp create mode 100644 languages/cpp/compiler/gccoptions/gccoptionsplugin.h create mode 100644 languages/cpp/compiler/gccoptions/kdevg77options.desktop create mode 100644 languages/cpp/compiler/gccoptions/kdevgccoptions.desktop create mode 100644 languages/cpp/compiler/gccoptions/kdevgppoptions.desktop create mode 100644 languages/cpp/completiondebug.cpp create mode 100644 languages/cpp/completiondebug.h create mode 100644 languages/cpp/computerecoverypoints.h create mode 100644 languages/cpp/configproblemreporter.ui create mode 100644 languages/cpp/configproblemreporter.ui.h create mode 100644 languages/cpp/configuration create mode 100644 languages/cpp/cpp_tags.h create mode 100644 languages/cpp/cppcodecompletion.cpp create mode 100644 languages/cpp/cppcodecompletion.h create mode 100644 languages/cpp/cppcodecompletionconfig.cpp create mode 100644 languages/cpp/cppcodecompletionconfig.h create mode 100644 languages/cpp/cppevaluation.cpp create mode 100644 languages/cpp/cppevaluation.h create mode 100644 languages/cpp/cppimplementationwidget.cpp create mode 100644 languages/cpp/cppimplementationwidget.h create mode 100644 languages/cpp/cppnewclassdlg.cpp create mode 100644 languages/cpp/cppnewclassdlg.h create mode 100644 languages/cpp/cppnewclassdlgbase.ui create mode 100644 languages/cpp/cppsplitheadersourceconfig.cpp create mode 100644 languages/cpp/cppsplitheadersourceconfig.h create mode 100644 languages/cpp/cppsupport_events.h create mode 100644 languages/cpp/cppsupport_utils.cpp create mode 100644 languages/cpp/cppsupport_utils.h create mode 100644 languages/cpp/cppsupportfactory.cpp create mode 100644 languages/cpp/cppsupportfactory.h create mode 100644 languages/cpp/cppsupportpart.cpp create mode 100644 languages/cpp/cppsupportpart.h create mode 100644 languages/cpp/cpptemplates create mode 100644 languages/cpp/creategettersetter.ui create mode 100644 languages/cpp/creategettersetterconfiguration.cpp create mode 100644 languages/cpp/creategettersetterconfiguration.h create mode 100644 languages/cpp/creategettersetterdialog.cpp create mode 100644 languages/cpp/creategettersetterdialog.h create mode 100644 languages/cpp/createpcsdialog.cpp create mode 100644 languages/cpp/createpcsdialog.h create mode 100644 languages/cpp/createpcsdialogbase.ui create mode 100644 languages/cpp/debugger/DESIGN.txt create mode 100644 languages/cpp/debugger/Makefile.am create mode 100644 languages/cpp/debugger/TODO.txt create mode 100644 languages/cpp/debugger/breakpoint.cpp create mode 100644 languages/cpp/debugger/breakpoint.h create mode 100644 languages/cpp/debugger/dbgcontroller.cpp create mode 100644 languages/cpp/debugger/dbgcontroller.h create mode 100644 languages/cpp/debugger/dbgpsdlg.cpp create mode 100644 languages/cpp/debugger/dbgpsdlg.h create mode 100644 languages/cpp/debugger/dbgtoolbar.cpp create mode 100644 languages/cpp/debugger/dbgtoolbar.h create mode 100644 languages/cpp/debugger/debuggerconfigwidget.cpp create mode 100644 languages/cpp/debugger/debuggerconfigwidget.h create mode 100644 languages/cpp/debugger/debuggerconfigwidgetbase.ui create mode 100644 languages/cpp/debugger/debuggerdcopinterface.h create mode 100644 languages/cpp/debugger/debuggerpart.cpp create mode 100644 languages/cpp/debugger/debuggerpart.h create mode 100644 languages/cpp/debugger/debuggertracingdialog.cpp create mode 100644 languages/cpp/debugger/debuggertracingdialog.h create mode 100644 languages/cpp/debugger/debuggertracingdialogbase.ui create mode 100644 languages/cpp/debugger/disassemblewidget.cpp create mode 100644 languages/cpp/debugger/disassemblewidget.h create mode 100644 languages/cpp/debugger/framestackwidget.cpp create mode 100644 languages/cpp/debugger/framestackwidget.h create mode 100644 languages/cpp/debugger/gdbbreakpointwidget.cpp create mode 100644 languages/cpp/debugger/gdbbreakpointwidget.h create mode 100644 languages/cpp/debugger/gdbcommand.cpp create mode 100644 languages/cpp/debugger/gdbcommand.h create mode 100644 languages/cpp/debugger/gdbcontroller.cpp create mode 100644 languages/cpp/debugger/gdbcontroller.h create mode 100644 languages/cpp/debugger/gdboutputwidget.cpp create mode 100644 languages/cpp/debugger/gdboutputwidget.h create mode 100644 languages/cpp/debugger/gdbparser.cpp create mode 100644 languages/cpp/debugger/gdbparser.h create mode 100644 languages/cpp/debugger/gdbtable.cpp create mode 100644 languages/cpp/debugger/gdbtable.h create mode 100644 languages/cpp/debugger/hi16-action-breakpoint_add.png create mode 100644 languages/cpp/debugger/hi16-action-breakpoint_delete.png create mode 100644 languages/cpp/debugger/hi16-action-breakpoint_delete_all.png create mode 100644 languages/cpp/debugger/hi16-action-breakpoint_edit.png create mode 100644 languages/cpp/debugger/kdevdebugger.desktop create mode 100644 languages/cpp/debugger/kdevdebugger.rc create mode 100644 languages/cpp/debugger/label_with_double_click.cpp create mode 100644 languages/cpp/debugger/label_with_double_click.h create mode 100644 languages/cpp/debugger/memviewdlg.cpp create mode 100644 languages/cpp/debugger/memviewdlg.h create mode 100644 languages/cpp/debugger/mi/Makefile.am create mode 100644 languages/cpp/debugger/mi/gdbmi.cpp create mode 100644 languages/cpp/debugger/mi/gdbmi.h create mode 100644 languages/cpp/debugger/mi/milexer.cpp create mode 100644 languages/cpp/debugger/mi/milexer.h create mode 100644 languages/cpp/debugger/mi/miparser.cpp create mode 100644 languages/cpp/debugger/mi/miparser.h create mode 100644 languages/cpp/debugger/mi/tokens.h create mode 100644 languages/cpp/debugger/stty.cpp create mode 100644 languages/cpp/debugger/stty.h create mode 100644 languages/cpp/debugger/tests/README.txt create mode 100644 languages/cpp/debugger/tests/breakpoints/Makefile create mode 100644 languages/cpp/debugger/tests/breakpoints/README.txt create mode 100644 languages/cpp/debugger/tests/breakpoints/breakpoints.kdevelop create mode 100644 languages/cpp/debugger/tests/breakpoints/foo.cpp create mode 100644 languages/cpp/debugger/tests/breakpoints/main.cpp create mode 100644 languages/cpp/debugger/tests/dll/Makefile create mode 100644 languages/cpp/debugger/tests/dll/README.txt create mode 100644 languages/cpp/debugger/tests/dll/dll.kdevelop create mode 100644 languages/cpp/debugger/tests/dll/helper.cpp create mode 100644 languages/cpp/debugger/tests/dll/main.cpp create mode 100644 languages/cpp/debugger/tests/infinite_loop/Makefile create mode 100644 languages/cpp/debugger/tests/infinite_loop/README.txt create mode 100644 languages/cpp/debugger/tests/infinite_loop/infinite_loop.cpp create mode 100644 languages/cpp/debugger/tests/infinite_loop/infinite_loop.kdevelop create mode 100644 languages/cpp/debugger/tests/print_pointers/Makefile create mode 100644 languages/cpp/debugger/tests/print_pointers/print_pointers.cpp create mode 100644 languages/cpp/debugger/tests/print_pointers/print_pointers.kdevelop create mode 100644 languages/cpp/debugger/tests/segfault/Makefile create mode 100644 languages/cpp/debugger/tests/segfault/README.txt create mode 100644 languages/cpp/debugger/tests/segfault/segfault.cpp create mode 100644 languages/cpp/debugger/tests/segfault/segfault.kdevelop create mode 100644 languages/cpp/debugger/tests/threads/Makefile create mode 100644 languages/cpp/debugger/tests/threads/README.txt create mode 100644 languages/cpp/debugger/tests/threads/threads.cpp create mode 100644 languages/cpp/debugger/tests/threads/threads.kdevelop create mode 100644 languages/cpp/debugger/tests/tracing/Makefile create mode 100644 languages/cpp/debugger/tests/tracing/main.cpp create mode 100644 languages/cpp/debugger/tests/tracing/tracing.kdevelop create mode 100644 languages/cpp/debugger/tests/two_module/Makefile create mode 100644 languages/cpp/debugger/tests/two_module/README.txt create mode 100644 languages/cpp/debugger/tests/two_module/main.cpp create mode 100644 languages/cpp/debugger/tests/two_module/src/foo.cpp create mode 100644 languages/cpp/debugger/tests/two_module/two_module.kdevelop create mode 100644 languages/cpp/debugger/variablewidget.cpp create mode 100644 languages/cpp/debugger/variablewidget.h create mode 100644 languages/cpp/declarationinfo.h create mode 100644 languages/cpp/doc/Makefile.am create mode 100644 languages/cpp/doc/c++_bugs_gcc.toc create mode 100644 languages/cpp/doc/clanlib.toc create mode 100644 languages/cpp/doc/cppannotations.toc create mode 100644 languages/cpp/doc/gnome1.toc create mode 100644 languages/cpp/doc/gnustep.toc create mode 100644 languages/cpp/doc/gtk_bugs.toc create mode 100644 languages/cpp/doc/kde2book.toc create mode 100644 languages/cpp/doc/kdetemplates.toc create mode 100644 languages/cpp/doc/libc.toc create mode 100644 languages/cpp/doc/libstdc++.toc create mode 100644 languages/cpp/doc/qt-kdev3.toc create mode 100644 languages/cpp/doc/stl.toc create mode 100644 languages/cpp/doc/wxwidgets_bugs.toc create mode 100644 languages/cpp/doxydoc.cpp create mode 100644 languages/cpp/doxydoc.h create mode 100644 languages/cpp/expressioninfo.h create mode 100644 languages/cpp/file_templates/Makefile.am create mode 100644 languages/cpp/file_templates/c create mode 100644 languages/cpp/file_templates/cpp create mode 100644 languages/cpp/file_templates/h create mode 100644 languages/cpp/file_templates/l create mode 100644 languages/cpp/file_templates/ll create mode 100644 languages/cpp/file_templates/y create mode 100644 languages/cpp/file_templates/yy create mode 100644 languages/cpp/includefiles.cpp create mode 100644 languages/cpp/includefiles.h create mode 100644 languages/cpp/includepathresolver.cpp create mode 100644 languages/cpp/includepathresolver.h create mode 100644 languages/cpp/kdevcppsupport.desktop create mode 100644 languages/cpp/kdevcppsupport.rc create mode 100644 languages/cpp/kdevcsupport.desktop create mode 100644 languages/cpp/kdevdeepcopy.h create mode 100644 languages/cpp/kdevdriver.cpp create mode 100644 languages/cpp/kdevdriver.h create mode 100644 languages/cpp/main.cpp create mode 100644 languages/cpp/newclass_templates/Makefile.am create mode 100644 languages/cpp/newclass_templates/cpp_header create mode 100644 languages/cpp/newclass_templates/cpp_source create mode 100644 languages/cpp/newclass_templates/gtk_header create mode 100644 languages/cpp/newclass_templates/gtk_source create mode 100644 languages/cpp/newclass_templates/objc_header create mode 100644 languages/cpp/newclass_templates/objc_source create mode 100644 languages/cpp/pcsimporter/Makefile.am create mode 100644 languages/cpp/pcsimporter/customimporter/Makefile.am create mode 100644 languages/cpp/pcsimporter/customimporter/kdevcustomimporter.cpp create mode 100644 languages/cpp/pcsimporter/customimporter/kdevcustomimporter.h create mode 100644 languages/cpp/pcsimporter/customimporter/kdevpcscustomimporter.desktop create mode 100644 languages/cpp/pcsimporter/customimporter/settingsdialog.cpp create mode 100644 languages/cpp/pcsimporter/customimporter/settingsdialog.h create mode 100644 languages/cpp/pcsimporter/customimporter/settingsdialogbase.ui create mode 100644 languages/cpp/pcsimporter/kdelibsimporter/Makefile.am create mode 100644 languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.cpp create mode 100644 languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.desktop create mode 100644 languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.h create mode 100644 languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.cpp create mode 100644 languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.h create mode 100644 languages/cpp/pcsimporter/kdelibsimporter/settingsdialogbase.ui create mode 100644 languages/cpp/pcsimporter/qt4importer/Makefile.am create mode 100644 languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp create mode 100644 languages/cpp/pcsimporter/qt4importer/kdevqt4importer.desktop create mode 100644 languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h create mode 100644 languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp create mode 100644 languages/cpp/pcsimporter/qt4importer/settingsdialog.h create mode 100644 languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui create mode 100644 languages/cpp/pcsimporter/qtimporter/Makefile.am create mode 100644 languages/cpp/pcsimporter/qtimporter/kdevqtimporter.cpp create mode 100644 languages/cpp/pcsimporter/qtimporter/kdevqtimporter.desktop create mode 100644 languages/cpp/pcsimporter/qtimporter/kdevqtimporter.h create mode 100644 languages/cpp/pcsimporter/qtimporter/settingsdialog.cpp create mode 100644 languages/cpp/pcsimporter/qtimporter/settingsdialog.h create mode 100644 languages/cpp/pcsimporter/qtimporter/settingsdialogbase.ui create mode 100644 languages/cpp/problemreporter.cpp create mode 100644 languages/cpp/problemreporter.h create mode 100644 languages/cpp/qtbuildconfig.cpp create mode 100644 languages/cpp/qtbuildconfig.h create mode 100644 languages/cpp/qtdesignercppintegration.cpp create mode 100644 languages/cpp/qtdesignercppintegration.h create mode 100644 languages/cpp/safetycounter.h create mode 100644 languages/cpp/setuphelper.cpp create mode 100644 languages/cpp/setuphelper.h create mode 100644 languages/cpp/simplecontext.cpp create mode 100644 languages/cpp/simplecontext.h create mode 100644 languages/cpp/simpletype.cpp create mode 100644 languages/cpp/simpletype.h create mode 100644 languages/cpp/simpletypecachebinder.h create mode 100644 languages/cpp/simpletypecatalog.cpp create mode 100644 languages/cpp/simpletypecatalog.h create mode 100644 languages/cpp/simpletypefunction.cpp create mode 100644 languages/cpp/simpletypefunction.h create mode 100644 languages/cpp/simpletypenamespace.cpp create mode 100644 languages/cpp/simpletypenamespace.h create mode 100644 languages/cpp/store_walker.cpp create mode 100644 languages/cpp/store_walker.h create mode 100644 languages/cpp/storeconverter.cpp create mode 100644 languages/cpp/storeconverter.h create mode 100644 languages/cpp/stringhelpers.cpp create mode 100644 languages/cpp/stringhelpers.h create mode 100644 languages/cpp/subclassing_template/.kdev_ignore create mode 100644 languages/cpp/subclassing_template/Makefile.am create mode 100644 languages/cpp/subclassing_template/subclass_qt4_template.cpp create mode 100644 languages/cpp/subclassing_template/subclass_qt4_template.h create mode 100644 languages/cpp/subclassing_template/subclass_template.cpp create mode 100644 languages/cpp/subclassing_template/subclass_template.h create mode 100644 languages/cpp/subclassingdlg.cpp create mode 100644 languages/cpp/subclassingdlg.h create mode 100644 languages/cpp/subclassingdlgbase.ui create mode 100644 languages/cpp/tag_creator.cpp create mode 100644 languages/cpp/tag_creator.h create mode 100644 languages/cpp/templates/Makefile.am create mode 100644 languages/cpp/templates/default.cpp create mode 100644 languages/cpp/templates/default.h create mode 100644 languages/cpp/typedecoration.h create mode 100644 languages/cpp/typedesc.cpp create mode 100644 languages/cpp/typedesc.h create mode 100644 languages/csharp/Makefile.am create mode 100644 languages/csharp/README.dox create mode 100644 languages/csharp/app_templates/Makefile.am create mode 100644 languages/csharp/app_templates/csharp.appwizard create mode 100644 languages/csharp/csharpconfigwidget.cpp create mode 100644 languages/csharp/csharpconfigwidget.h create mode 100644 languages/csharp/csharpconfigwidgetbase.ui create mode 100644 languages/csharp/csharpdoc.cpp create mode 100644 languages/csharp/csharpdoc.h create mode 100644 languages/csharp/csharpdoc.protocol create mode 100644 languages/csharp/csharpsupportpart.cpp create mode 100644 languages/csharp/csharpsupportpart.h create mode 100644 languages/csharp/doc/Makefile.am create mode 100644 languages/csharp/file_templates/Makefile.am create mode 100644 languages/csharp/kdevcsharpsupport.desktop create mode 100644 languages/csharp/kdevcsharpsupport.rc create mode 100644 languages/fortran/Makefile.am create mode 100644 languages/fortran/README.dox create mode 100644 languages/fortran/app_templates/Makefile.am create mode 100644 languages/fortran/app_templates/fortran.appwizard create mode 100644 languages/fortran/app_templates/fortranhello/.kdev_ignore create mode 100644 languages/fortran/app_templates/fortranhello/Makefile.am create mode 100644 languages/fortran/app_templates/fortranhello/app.kdevelop create mode 100644 languages/fortran/app_templates/fortranhello/configure.in create mode 100644 languages/fortran/app_templates/fortranhello/fortran-Makefile.am create mode 100644 languages/fortran/app_templates/fortranhello/fortran-Makefile.cvs create mode 100644 languages/fortran/app_templates/fortranhello/fortranhello create mode 100644 languages/fortran/app_templates/fortranhello/fortranhello.kdevtemplate create mode 100644 languages/fortran/app_templates/fortranhello/fortranhello.png create mode 100644 languages/fortran/app_templates/fortranhello/main.f create mode 100644 languages/fortran/app_templates/fortranhello/src-Makefile.am create mode 100644 languages/fortran/compiler/Makefile.am create mode 100644 languages/fortran/compiler/pgioptions/Makefile.am create mode 100644 languages/fortran/compiler/pgioptions/kdevpgf77options.desktop create mode 100644 languages/fortran/compiler/pgioptions/kdevpghpfoptions.desktop create mode 100644 languages/fortran/compiler/pgioptions/pgioptionsfactory.cpp create mode 100644 languages/fortran/compiler/pgioptions/pgioptionsfactory.h create mode 100644 languages/fortran/compiler/pgioptions/pgioptionsplugin.cpp create mode 100644 languages/fortran/compiler/pgioptions/pgioptionsplugin.h create mode 100644 languages/fortran/doc/Makefile.am create mode 100644 languages/fortran/doc/fortran_bugs_gcc.toc create mode 100644 languages/fortran/file_templates/Makefile.am create mode 100644 languages/fortran/file_templates/f create mode 100644 languages/fortran/file_templates/f77 create mode 100644 languages/fortran/file_templates/f90 create mode 100644 languages/fortran/file_templates/f95 create mode 100644 languages/fortran/file_templates/for create mode 100644 languages/fortran/file_templates/fpp create mode 100644 languages/fortran/file_templates/ftn create mode 100644 languages/fortran/fixedformparser.cpp create mode 100644 languages/fortran/fixedformparser.h create mode 100644 languages/fortran/fortransupportpart.cpp create mode 100644 languages/fortran/fortransupportpart.h create mode 100644 languages/fortran/ftnchekconfigwidget.cpp create mode 100644 languages/fortran/ftnchekconfigwidget.h create mode 100644 languages/fortran/ftnchekconfigwidgetbase.ui create mode 100644 languages/fortran/kdevfortransupport.desktop create mode 100644 languages/fortran/kdevfortransupport.rc create mode 100644 languages/java/JavaAST.hpp create mode 100644 languages/java/JavaLexer.cpp create mode 100644 languages/java/JavaLexer.hpp create mode 100644 languages/java/JavaRecognizer.cpp create mode 100644 languages/java/JavaRecognizer.hpp create mode 100644 languages/java/JavaStoreWalker.cpp create mode 100644 languages/java/JavaStoreWalker.hpp create mode 100644 languages/java/JavaStoreWalkerTokenTypes.hpp create mode 100644 languages/java/JavaStoreWalkerTokenTypes.txt create mode 100644 languages/java/JavaTokenTypes.hpp create mode 100644 languages/java/JavaTokenTypes.txt create mode 100644 languages/java/KDevJavaSupportIface.cpp create mode 100644 languages/java/KDevJavaSupportIface.h create mode 100644 languages/java/Makefile.am create mode 100644 languages/java/README.dox create mode 100644 languages/java/app_templates/Makefile.am create mode 100644 languages/java/app_templates/java.appwizard create mode 100644 languages/java/app_templates/javahello/.kdev_ignore create mode 100644 languages/java/app_templates/javahello/Main.java create mode 100644 languages/java/app_templates/javahello/Makefile.am create mode 100644 languages/java/app_templates/javahello/build.xml create mode 100644 languages/java/app_templates/javahello/javahello create mode 100644 languages/java/app_templates/javahello/javahello.filelist create mode 100644 languages/java/app_templates/javahello/javahello.kdevelop create mode 100644 languages/java/app_templates/javahello/javahello.kdevtemplate create mode 100644 languages/java/app_templates/javahello/javahello.png create mode 100644 languages/java/app_templates/kappjava/.kdev_ignore create mode 100644 languages/java/app_templates/kappjava/Makefile.am create mode 100644 languages/java/app_templates/kappjava/app.desktop create mode 100644 languages/java/app_templates/kappjava/app.java create mode 100644 languages/java/app_templates/kappjava/app.kdevelop create mode 100644 languages/java/app_templates/kappjava/app_client.java create mode 100644 languages/java/app_templates/kappjava/appui.rc create mode 100644 languages/java/app_templates/kappjava/appview.java create mode 100644 languages/java/app_templates/kappjava/kappjava create mode 100644 languages/java/app_templates/kappjava/kappjava.kdevtemplate create mode 100644 languages/java/app_templates/kappjava/kappjava.png create mode 100644 languages/java/app_templates/kappjava/pref.java create mode 100644 languages/java/app_templates/kappjava/src-Makefile.am create mode 100644 languages/java/app_templates/kappjava/subdirs create mode 100644 languages/java/app_templates/superwaba/.kdev_ignore create mode 100644 languages/java/app_templates/superwaba/Makefile.am create mode 100644 languages/java/app_templates/superwaba/src-Makefile create mode 100644 languages/java/app_templates/superwaba/superwaba create mode 100644 languages/java/app_templates/superwaba/superwaba.kdevtemplate create mode 100644 languages/java/app_templates/superwaba/superwaba.png create mode 100644 languages/java/app_templates/superwaba/sw.filelist create mode 100644 languages/java/app_templates/superwaba/sw.java create mode 100644 languages/java/app_templates/superwaba/sw.kdevelop create mode 100644 languages/java/backgroundparser.cpp create mode 100644 languages/java/backgroundparser.h create mode 100644 languages/java/configproblemreporter.ui create mode 100644 languages/java/configproblemreporter.ui.h create mode 100644 languages/java/doc/Makefile.am create mode 100644 languages/java/doc/java_bugs_gcc.toc create mode 100644 languages/java/doc/java_bugs_sun.toc create mode 100644 languages/java/doc/sw.toc create mode 100644 languages/java/driver.cpp create mode 100644 languages/java/driver.h create mode 100644 languages/java/file_templates/Makefile.am create mode 100644 languages/java/file_templates/java create mode 100644 languages/java/java.g create mode 100644 languages/java/java.store.g create mode 100644 languages/java/java.tree.g create mode 100644 languages/java/javasupport_events.h create mode 100644 languages/java/javasupport_utils.cpp create mode 100644 languages/java/javasupport_utils.h create mode 100644 languages/java/javasupportfactory.cpp create mode 100644 languages/java/javasupportfactory.h create mode 100644 languages/java/javasupportpart.cpp create mode 100644 languages/java/javasupportpart.h create mode 100644 languages/java/javatemplates create mode 100644 languages/java/kdevdeepcopy.h create mode 100644 languages/java/kdevdriver.cpp create mode 100644 languages/java/kdevdriver.h create mode 100644 languages/java/kdevjavasupport.desktop create mode 100644 languages/java/kdevjavasupport.rc create mode 100644 languages/java/newclass_templates/Makefile.am create mode 100644 languages/java/newclass_templates/java_source create mode 100644 languages/java/problemreporter.cpp create mode 100644 languages/java/problemreporter.h create mode 100644 languages/kjssupport/Makefile.am create mode 100644 languages/kjssupport/jscodecompletion.cpp create mode 100644 languages/kjssupport/jscodecompletion.h create mode 100644 languages/kjssupport/kdevkjssupport.desktop create mode 100644 languages/kjssupport/kdevkjssupport.rc create mode 100644 languages/kjssupport/kjsproblems.cpp create mode 100644 languages/kjssupport/kjsproblems.h create mode 100644 languages/kjssupport/kjssupport_part.cpp create mode 100644 languages/kjssupport/kjssupport_part.h create mode 100644 languages/kjssupport/subclassing_template/Makefile.am create mode 100644 languages/kjssupport/subclassing_template/subclass_template.js create mode 100644 languages/kjssupport/subclassingdlg.cpp create mode 100644 languages/kjssupport/subclassingdlg.h create mode 100644 languages/kjssupport/subclassingdlgbase.ui create mode 100644 languages/kjssupport/template/Makefile.am create mode 100644 languages/kjssupport/template/app.js create mode 100644 languages/kjssupport/template/app.kdevelop create mode 100644 languages/kjssupport/template/jshello create mode 100644 languages/kjssupport/template/script create mode 100644 languages/kjssupport/x-javascript-source.desktop create mode 100644 languages/lib/Makefile.am create mode 100644 languages/lib/debugger/Mainpage.dox create mode 100644 languages/lib/debugger/Makefile.am create mode 100644 languages/lib/debugger/debugger.cpp create mode 100644 languages/lib/debugger/debugger.h create mode 100644 languages/lib/debugger/kdevdebugger.cpp create mode 100644 languages/lib/debugger/kdevdebugger.h create mode 100644 languages/lib/designer_integration/Mainpage.dox create mode 100644 languages/lib/designer_integration/Makefile.am create mode 100644 languages/lib/designer_integration/implementationwidget.cpp create mode 100644 languages/lib/designer_integration/implementationwidget.h create mode 100644 languages/lib/designer_integration/implementationwidgetbase.ui create mode 100644 languages/lib/designer_integration/qtdesignerintegration.cpp create mode 100644 languages/lib/designer_integration/qtdesignerintegration.h create mode 100644 languages/lib/interfaces/Mainpage.dox create mode 100644 languages/lib/interfaces/Makefile.am create mode 100644 languages/lib/interfaces/kdeveloppcsimporter.desktop create mode 100644 languages/lib/interfaces/kdevpcsimporter.cpp create mode 100644 languages/lib/interfaces/kdevpcsimporter.h create mode 100644 languages/pascal/Makefile.am create mode 100644 languages/pascal/PascalAST.hpp create mode 100644 languages/pascal/PascalLexer.cpp create mode 100644 languages/pascal/PascalLexer.hpp create mode 100644 languages/pascal/PascalParser.cpp create mode 100644 languages/pascal/PascalParser.hpp create mode 100644 languages/pascal/PascalStoreWalker.cpp create mode 100644 languages/pascal/PascalStoreWalker.hpp create mode 100644 languages/pascal/PascalStoreWalkerTokenTypes.hpp create mode 100644 languages/pascal/PascalStoreWalkerTokenTypes.txt create mode 100644 languages/pascal/PascalTokenTypes.hpp create mode 100644 languages/pascal/PascalTokenTypes.txt create mode 100644 languages/pascal/README.dox create mode 100644 languages/pascal/app_templates/Makefile.am create mode 100644 languages/pascal/app_templates/fpcgtk/.kdev_ignore create mode 100644 languages/pascal/app_templates/fpcgtk/Makefile.am create mode 100644 languages/pascal/app_templates/fpcgtk/app.kdevelop create mode 100644 languages/pascal/app_templates/fpcgtk/fpcgtk create mode 100644 languages/pascal/app_templates/fpcgtk/fpcgtk.kdevtemplate create mode 100644 languages/pascal/app_templates/fpcgtk/fpcgtk.png create mode 100644 languages/pascal/app_templates/fpcgtk/main.pp create mode 100644 languages/pascal/app_templates/fpchello/.kdev_ignore create mode 100644 languages/pascal/app_templates/fpchello/Makefile.am create mode 100644 languages/pascal/app_templates/fpchello/app.kdevelop create mode 100644 languages/pascal/app_templates/fpchello/fpchello create mode 100644 languages/pascal/app_templates/fpchello/fpchello.kdevtemplate create mode 100644 languages/pascal/app_templates/fpchello/fpchello.png create mode 100644 languages/pascal/app_templates/fpchello/main.pp create mode 100644 languages/pascal/app_templates/fpcsharedlib/.kdev_ignore create mode 100644 languages/pascal/app_templates/fpcsharedlib/Makefile.am create mode 100644 languages/pascal/app_templates/fpcsharedlib/app.kdevelop create mode 100644 languages/pascal/app_templates/fpcsharedlib/fpcsharedlib create mode 100644 languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.kdevtemplate create mode 100644 languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.png create mode 100644 languages/pascal/app_templates/fpcsharedlib/main.pp create mode 100644 languages/pascal/app_templates/pascal.appwizard create mode 100644 languages/pascal/app_templates/pascalhello/.kdev_ignore create mode 100644 languages/pascal/app_templates/pascalhello/Makefile.am create mode 100644 languages/pascal/app_templates/pascalhello/app.kdevelop create mode 100644 languages/pascal/app_templates/pascalhello/main.pp create mode 100644 languages/pascal/app_templates/pascalhello/pascalhello create mode 100644 languages/pascal/app_templates/pascalhello/pascalhello.kdevtemplate create mode 100644 languages/pascal/app_templates/pascalhello/pascalhello.png create mode 100644 languages/pascal/backgroundparser.cpp create mode 100644 languages/pascal/backgroundparser.h create mode 100644 languages/pascal/compiler/Makefile.am create mode 100644 languages/pascal/compiler/dccoptions/Makefile.am create mode 100644 languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp create mode 100644 languages/pascal/compiler/dccoptions/dccoptionsplugin.h create mode 100644 languages/pascal/compiler/dccoptions/kdevdccoptions.desktop create mode 100644 languages/pascal/compiler/dccoptions/optiontabs.cpp create mode 100644 languages/pascal/compiler/dccoptions/optiontabs.h create mode 100644 languages/pascal/compiler/fpcoptions/Makefile.am create mode 100644 languages/pascal/compiler/fpcoptions/fpcoptionsplugin.cpp create mode 100644 languages/pascal/compiler/fpcoptions/fpcoptionsplugin.h create mode 100644 languages/pascal/compiler/fpcoptions/kdevfpcoptions.desktop create mode 100644 languages/pascal/compiler/fpcoptions/optiontabs.cpp create mode 100644 languages/pascal/compiler/fpcoptions/optiontabs.h create mode 100644 languages/pascal/configproblemreporter.ui create mode 100644 languages/pascal/doc/Makefile.am create mode 100644 languages/pascal/doc/pascal_bugs_fp.toc create mode 100644 languages/pascal/file_templates/Makefile.am create mode 100644 languages/pascal/file_templates/dpr create mode 100644 languages/pascal/file_templates/pas-program create mode 100644 languages/pascal/file_templates/pas-unit create mode 100644 languages/pascal/file_templates/pp-program create mode 100644 languages/pascal/file_templates/pp-unit create mode 100644 languages/pascal/kdevpascalsupport.desktop create mode 100644 languages/pascal/kdevpascalsupport.rc create mode 100644 languages/pascal/pascal.g create mode 100644 languages/pascal/pascal.tree.g create mode 100644 languages/pascal/pascalsupport_part.cpp create mode 100644 languages/pascal/pascalsupport_part.h create mode 100644 languages/pascal/pascaltemplates create mode 100644 languages/pascal/problemreporter.cpp create mode 100644 languages/pascal/problemreporter.h create mode 100644 languages/perl/Makefile.am create mode 100644 languages/perl/README.dox create mode 100644 languages/perl/app_templates/Makefile.am create mode 100644 languages/perl/app_templates/perl.appwizard create mode 100644 languages/perl/app_templates/perlhello/.kdev_ignore create mode 100644 languages/perl/app_templates/perlhello/Makefile.am create mode 100644 languages/perl/app_templates/perlhello/app.kdevelop create mode 100755 languages/perl/app_templates/perlhello/app.pl create mode 100644 languages/perl/app_templates/perlhello/perlhello create mode 100644 languages/perl/app_templates/perlhello/perlhello.kdevtemplate create mode 100644 languages/perl/app_templates/perlhello/perlhello.png create mode 100644 languages/perl/doc/Makefile.am create mode 100644 languages/perl/doc/perl.toc create mode 100644 languages/perl/doc/perl_bugs.toc create mode 100644 languages/perl/file_templates/Makefile.am create mode 100644 languages/perl/file_templates/pl create mode 100644 languages/perl/file_templates/pm create mode 100644 languages/perl/kdevperlsupport.desktop create mode 100644 languages/perl/kdevperlsupport.rc create mode 100644 languages/perl/perlconfigwidget.cpp create mode 100644 languages/perl/perlconfigwidget.h create mode 100644 languages/perl/perlconfigwidgetbase.ui create mode 100644 languages/perl/perldoc.cpp create mode 100644 languages/perl/perldoc.h create mode 100644 languages/perl/perldoc.protocol create mode 100644 languages/perl/perlparser.cpp create mode 100644 languages/perl/perlparser.h create mode 100644 languages/perl/perlsupportpart.cpp create mode 100644 languages/perl/perlsupportpart.h create mode 100644 languages/php/Makefile.am create mode 100644 languages/php/README.dox create mode 100644 languages/php/app_templates/Makefile.am create mode 100644 languages/php/app_templates/php.appwizard create mode 100644 languages/php/app_templates/phphello/.kdev_ignore create mode 100644 languages/php/app_templates/phphello/Makefile.am create mode 100644 languages/php/app_templates/phphello/app.kdevelop create mode 100644 languages/php/app_templates/phphello/app.php create mode 100644 languages/php/app_templates/phphello/phphello create mode 100644 languages/php/app_templates/phphello/phphello.kdevtemplate create mode 100644 languages/php/app_templates/phphello/phphello.png create mode 100644 languages/php/data/Makefile.am create mode 100644 languages/php/data/phpfunctions create mode 100644 languages/php/doc/Makefile.am create mode 100644 languages/php/doc/php.toc create mode 100644 languages/php/doc/php_bugs.toc create mode 100644 languages/php/file_templates/Makefile.am create mode 100644 languages/php/file_templates/php create mode 100644 languages/php/kdevphpsupport.desktop create mode 100644 languages/php/kdevphpsupport.rc create mode 100644 languages/php/phpcodecompletion.cpp create mode 100644 languages/php/phpcodecompletion.h create mode 100644 languages/php/phpconfigdata.cpp create mode 100644 languages/php/phpconfigdata.h create mode 100644 languages/php/phpconfigwidget.cpp create mode 100644 languages/php/phpconfigwidget.h create mode 100644 languages/php/phpconfigwidgetbase.ui create mode 100644 languages/php/phperrorview.cpp create mode 100644 languages/php/phperrorview.h create mode 100644 languages/php/phpfile.cpp create mode 100644 languages/php/phpfile.h create mode 100644 languages/php/phphtmlview.cpp create mode 100644 languages/php/phphtmlview.h create mode 100644 languages/php/phpinfodlg.ui create mode 100644 languages/php/phpnewclassdlg.cpp create mode 100644 languages/php/phpnewclassdlg.h create mode 100644 languages/php/phpnewclassdlgbase.ui create mode 100644 languages/php/phpparser.cpp create mode 100644 languages/php/phpparser.h create mode 100644 languages/php/phpsupport_event.h create mode 100644 languages/php/phpsupportpart.cpp create mode 100644 languages/php/phpsupportpart.h create mode 100644 languages/php/phptemplates create mode 100644 languages/python/Makefile.am create mode 100644 languages/python/README.dox create mode 100644 languages/python/app_templates/Makefile.am create mode 100644 languages/python/app_templates/pyqt/.kdev_ignore create mode 100644 languages/python/app_templates/pyqt/Makefile.am create mode 100644 languages/python/app_templates/pyqt/app-Makefile.am create mode 100644 languages/python/app_templates/pyqt/app-autogen.sh create mode 100644 languages/python/app_templates/pyqt/app-configure.ac create mode 100644 languages/python/app_templates/pyqt/app.kdevelop create mode 100644 languages/python/app_templates/pyqt/app.py create mode 100644 languages/python/app_templates/pyqt/documentdetails.ui create mode 100644 languages/python/app_templates/pyqt/fileopen.pyxpm create mode 100644 languages/python/app_templates/pyqt/fileprint.pyxpm create mode 100644 languages/python/app_templates/pyqt/filesave.pyxpm create mode 100644 languages/python/app_templates/pyqt/install-sh create mode 100644 languages/python/app_templates/pyqt/missing create mode 100644 languages/python/app_templates/pyqt/mkinstalldirs create mode 100644 languages/python/app_templates/pyqt/pyqt create mode 100644 languages/python/app_templates/pyqt/pyqt-am-preproc.py create mode 100644 languages/python/app_templates/pyqt/pyqt.kdevtemplate create mode 100644 languages/python/app_templates/pyqt/pyqt.png create mode 100644 languages/python/app_templates/pyqt/templates-ui-dialog create mode 100644 languages/python/app_templates/pyqt/templates-ui-mainwin create mode 100644 languages/python/app_templates/python.appwizard create mode 100644 languages/python/app_templates/pythonhello/.kdev_ignore create mode 100644 languages/python/app_templates/pythonhello/Makefile.am create mode 100644 languages/python/app_templates/pythonhello/app.kdevelop create mode 100644 languages/python/app_templates/pythonhello/app.py create mode 100644 languages/python/app_templates/pythonhello/pythonhello create mode 100644 languages/python/app_templates/pythonhello/pythonhello.kdevtemplate create mode 100644 languages/python/app_templates/pythonhello/pythonhello.png create mode 100644 languages/python/app_templates/pytk/.kdev_ignore create mode 100644 languages/python/app_templates/pytk/Makefile.am create mode 100644 languages/python/app_templates/pytk/app.kdevelop create mode 100644 languages/python/app_templates/pytk/app.py create mode 100644 languages/python/app_templates/pytk/pytk create mode 100644 languages/python/app_templates/pytk/pytk.kdevtemplate create mode 100644 languages/python/app_templates/pytk/pytk.png create mode 100644 languages/python/doc/Makefile.am create mode 100644 languages/python/doc/python.toc create mode 100644 languages/python/doc/python_bugs.toc create mode 100644 languages/python/file_templates/Makefile.am create mode 100644 languages/python/file_templates/py create mode 100755 languages/python/kde_pydoc.py create mode 100644 languages/python/kdevpythonsupport.desktop create mode 100644 languages/python/kdevpythonsupport.rc create mode 100644 languages/python/pydoc.cpp create mode 100644 languages/python/pydoc.h create mode 100644 languages/python/pydoc.protocol create mode 100644 languages/python/pythonconfigwidget.cpp create mode 100644 languages/python/pythonconfigwidget.h create mode 100644 languages/python/pythonconfigwidgetbase.ui create mode 100644 languages/python/pythonimplementationwidget.cpp create mode 100644 languages/python/pythonimplementationwidget.h create mode 100644 languages/python/pythonsupportpart.cpp create mode 100644 languages/python/pythonsupportpart.h create mode 100644 languages/python/qtdesignerpythonintegration.cpp create mode 100644 languages/python/qtdesignerpythonintegration.h create mode 100644 languages/ruby/Makefile.am create mode 100644 languages/ruby/README create mode 100644 languages/ruby/README.dox create mode 100644 languages/ruby/app_templates/Makefile.am create mode 100644 languages/ruby/app_templates/dcopservice/Makefile.am create mode 100644 languages/ruby/app_templates/dcopservice/app-configure.in.in create mode 100644 languages/ruby/app_templates/dcopservice/app.cpp create mode 100644 languages/ruby/app_templates/dcopservice/dcopservice.desktop create mode 100644 languages/ruby/app_templates/dcopservice/dcopservice.kdevelop create mode 100644 languages/ruby/app_templates/dcopservice/dcopservice.rb create mode 100644 languages/ruby/app_templates/dcopservice/dcopserviceruby.kdevtemplate create mode 100644 languages/ruby/app_templates/dcopservice/dcopserviceruby.png create mode 100644 languages/ruby/app_templates/dcopservice/main.rb create mode 100644 languages/ruby/app_templates/dcopservice/src-Makefile.am create mode 100644 languages/ruby/app_templates/dcopservice/subdirs create mode 100644 languages/ruby/app_templates/kapp/Makefile.am create mode 100644 languages/ruby/app_templates/kapp/README create mode 100644 languages/ruby/app_templates/kapp/app-Makefile.am create mode 100644 languages/ruby/app_templates/kapp/app-configure.in.in create mode 100644 languages/ruby/app_templates/kapp/app.cpp create mode 100644 languages/ruby/app_templates/kapp/app.desktop create mode 100644 languages/ruby/app_templates/kapp/app.kdevelop create mode 100644 languages/ruby/app_templates/kapp/app.rb create mode 100644 languages/ruby/app_templates/kapp/app_client.rb create mode 100644 languages/ruby/app_templates/kapp/appiface.rb create mode 100644 languages/ruby/app_templates/kapp/appui.rc create mode 100644 languages/ruby/app_templates/kapp/appview.rb create mode 100644 languages/ruby/app_templates/kapp/kappruby.kdevtemplate create mode 100644 languages/ruby/app_templates/kapp/kappruby.png create mode 100644 languages/ruby/app_templates/kapp/main.rb create mode 100644 languages/ruby/app_templates/kapp/pref.rb create mode 100644 languages/ruby/app_templates/kapp/src-Makefile.am create mode 100644 languages/ruby/app_templates/kapp/subdirs create mode 100644 languages/ruby/app_templates/kxt/Makefile.am create mode 100644 languages/ruby/app_templates/kxt/README create mode 100644 languages/ruby/app_templates/kxt/app-Makefile.am create mode 100644 languages/ruby/app_templates/kxt/app-configure.in.in create mode 100644 languages/ruby/app_templates/kxt/app.cpp create mode 100644 languages/ruby/app_templates/kxt/app.desktop create mode 100644 languages/ruby/app_templates/kxt/app.kcfg create mode 100644 languages/ruby/app_templates/kxt/app.kdevelop create mode 100644 languages/ruby/app_templates/kxt/app.rb create mode 100644 languages/ruby/app_templates/kxt/appui.rc create mode 100644 languages/ruby/app_templates/kxt/appview.rb create mode 100644 languages/ruby/app_templates/kxt/appview_base.ui create mode 100644 languages/ruby/app_templates/kxt/kxtruby.kdevtemplate create mode 100644 languages/ruby/app_templates/kxt/kxtruby.png create mode 100644 languages/ruby/app_templates/kxt/main.rb create mode 100644 languages/ruby/app_templates/kxt/prefs-base.ui create mode 100644 languages/ruby/app_templates/kxt/prefs.rb create mode 100644 languages/ruby/app_templates/kxt/previewruby.png create mode 100644 languages/ruby/app_templates/kxt/settings.kcfgc create mode 100644 languages/ruby/app_templates/kxt/src-Makefile.am create mode 100644 languages/ruby/app_templates/kxt/subdirs create mode 100644 languages/ruby/app_templates/qtruby/.kdev_ignore create mode 100644 languages/ruby/app_templates/qtruby/Makefile.am create mode 100644 languages/ruby/app_templates/qtruby/README create mode 100644 languages/ruby/app_templates/qtruby/app-Makefile create mode 100644 languages/ruby/app_templates/qtruby/app.filelist create mode 100644 languages/ruby/app_templates/qtruby/app.kdevelop create mode 100755 languages/ruby/app_templates/qtruby/app.rb create mode 100644 languages/ruby/app_templates/qtruby/qtruby.kdevtemplate create mode 100644 languages/ruby/app_templates/qtruby/qtruby.png create mode 100644 languages/ruby/app_templates/qtruby4app/Makefile.am create mode 100644 languages/ruby/app_templates/qtruby4app/ReadMe create mode 100644 languages/ruby/app_templates/qtruby4app/app-Makefile create mode 100644 languages/ruby/app_templates/qtruby4app/app.filelist create mode 100644 languages/ruby/app_templates/qtruby4app/application.qrc create mode 100644 languages/ruby/app_templates/qtruby4app/editcopy.xpm create mode 100644 languages/ruby/app_templates/qtruby4app/editcut.xpm create mode 100644 languages/ruby/app_templates/qtruby4app/editpaste.xpm create mode 100644 languages/ruby/app_templates/qtruby4app/filenew.xpm create mode 100644 languages/ruby/app_templates/qtruby4app/fileopen.xpm create mode 100644 languages/ruby/app_templates/qtruby4app/filesave.xpm create mode 100644 languages/ruby/app_templates/qtruby4app/main.rb create mode 100644 languages/ruby/app_templates/qtruby4app/qrc_application.rb create mode 100644 languages/ruby/app_templates/qtruby4app/qtruby4app.kdevelop create mode 100644 languages/ruby/app_templates/qtruby4app/qtruby4app.kdevtemplate create mode 100644 languages/ruby/app_templates/qtruby4app/qtruby4app.png create mode 100644 languages/ruby/app_templates/qtruby4app/qtruby4app.rb create mode 100644 languages/ruby/app_templates/qtrubyapp/Makefile.am create mode 100644 languages/ruby/app_templates/qtrubyapp/README create mode 100644 languages/ruby/app_templates/qtrubyapp/app-Makefile create mode 100644 languages/ruby/app_templates/qtrubyapp/app.filelist create mode 100644 languages/ruby/app_templates/qtrubyapp/fileopen.xpm create mode 100644 languages/ruby/app_templates/qtrubyapp/fileprint.xpm create mode 100644 languages/ruby/app_templates/qtrubyapp/filesave.xpm create mode 100644 languages/ruby/app_templates/qtrubyapp/main.rb create mode 100644 languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevelop create mode 100644 languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevtemplate create mode 100644 languages/ruby/app_templates/qtrubyapp/qtrubyapp.png create mode 100644 languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb create mode 100644 languages/ruby/app_templates/rails/CMakeLists.txt create mode 100644 languages/ruby/app_templates/rails/Makefile.am create mode 100644 languages/ruby/app_templates/rails/app.kdevelop create mode 100644 languages/ruby/app_templates/rails/rails.kdevtemplate create mode 100644 languages/ruby/app_templates/rails/rails.png create mode 100644 languages/ruby/app_templates/ruby.appwizard create mode 100644 languages/ruby/app_templates/rubyhello/.kdev_ignore create mode 100644 languages/ruby/app_templates/rubyhello/Makefile.am create mode 100644 languages/ruby/app_templates/rubyhello/app.kdevelop create mode 100644 languages/ruby/app_templates/rubyhello/app.rb create mode 100644 languages/ruby/app_templates/rubyhello/rubyhello create mode 100644 languages/ruby/app_templates/rubyhello/rubyhello.kdevtemplate create mode 100644 languages/ruby/app_templates/rubyhello/rubyhello.png create mode 100644 languages/ruby/debugger/Makefile.am create mode 100644 languages/ruby/debugger/breakpoint.cpp create mode 100644 languages/ruby/debugger/breakpoint.h create mode 100644 languages/ruby/debugger/dbgcommand.cpp create mode 100644 languages/ruby/debugger/dbgcommand.h create mode 100644 languages/ruby/debugger/dbgcontroller.cpp create mode 100644 languages/ruby/debugger/dbgcontroller.h create mode 100644 languages/ruby/debugger/dbgpsdlg.cpp create mode 100644 languages/ruby/debugger/dbgpsdlg.h create mode 100644 languages/ruby/debugger/dbgtoolbar.cpp create mode 100644 languages/ruby/debugger/dbgtoolbar.h create mode 100644 languages/ruby/debugger/debuggee.rb create mode 100644 languages/ruby/debugger/debuggerpart.cpp create mode 100644 languages/ruby/debugger/debuggerpart.h create mode 100644 languages/ruby/debugger/framestackwidget.cpp create mode 100644 languages/ruby/debugger/framestackwidget.h create mode 100644 languages/ruby/debugger/hi16-action-breakpoint_add.png create mode 100644 languages/ruby/debugger/hi16-action-breakpoint_delete.png create mode 100644 languages/ruby/debugger/hi16-action-breakpoint_delete_all.png create mode 100644 languages/ruby/debugger/hi16-action-breakpoint_edit.png create mode 100644 languages/ruby/debugger/kdevrbdebugger.desktop create mode 100644 languages/ruby/debugger/kdevrbdebugger.rc create mode 100644 languages/ruby/debugger/rdbbreakpointwidget.cpp create mode 100644 languages/ruby/debugger/rdbbreakpointwidget.h create mode 100644 languages/ruby/debugger/rdbcommand.cpp create mode 100644 languages/ruby/debugger/rdbcommand.h create mode 100644 languages/ruby/debugger/rdbcontroller.cpp create mode 100644 languages/ruby/debugger/rdbcontroller.h create mode 100644 languages/ruby/debugger/rdboutputwidget.cpp create mode 100644 languages/ruby/debugger/rdboutputwidget.h create mode 100644 languages/ruby/debugger/rdbparser.cpp create mode 100644 languages/ruby/debugger/rdbparser.h create mode 100644 languages/ruby/debugger/rdbtable.cpp create mode 100644 languages/ruby/debugger/rdbtable.h create mode 100644 languages/ruby/debugger/stty.cpp create mode 100644 languages/ruby/debugger/stty.h create mode 100644 languages/ruby/debugger/variablewidget.cpp create mode 100644 languages/ruby/debugger/variablewidget.h create mode 100644 languages/ruby/doc/Makefile.am create mode 100644 languages/ruby/doc/qtruby.toc create mode 100644 languages/ruby/doc/rails.toc create mode 100644 languages/ruby/doc/ruby.toc create mode 100644 languages/ruby/doc/ruby_bugs.toc create mode 100644 languages/ruby/file_templates/Makefile.am create mode 100644 languages/ruby/file_templates/css create mode 100644 languages/ruby/file_templates/html.erb create mode 100644 languages/ruby/file_templates/js create mode 100644 languages/ruby/file_templates/js.rjs create mode 100644 languages/ruby/file_templates/rb create mode 100644 languages/ruby/file_templates/rhtml create mode 100644 languages/ruby/file_templates/rjs create mode 100644 languages/ruby/file_templates/rxml create mode 100644 languages/ruby/file_templates/xml.builder create mode 100644 languages/ruby/kdevrubysupport.desktop create mode 100644 languages/ruby/kdevrubysupport.rc create mode 100644 languages/ruby/play_run.psd create mode 100644 languages/ruby/qtdesignerrubyintegration.cpp create mode 100644 languages/ruby/qtdesignerrubyintegration.h create mode 100644 languages/ruby/ruby_config.png create mode 100644 languages/ruby/ruby_config.psd create mode 100644 languages/ruby/ruby_run.png create mode 100644 languages/ruby/rubyconfigwidget.cpp create mode 100644 languages/ruby/rubyconfigwidget.h create mode 100644 languages/ruby/rubyconfigwidgetbase.ui create mode 100644 languages/ruby/rubyimplementationwidget.cpp create mode 100644 languages/ruby/rubyimplementationwidget.h create mode 100644 languages/ruby/rubysupport_part.cpp create mode 100644 languages/ruby/rubysupport_part.h create mode 100644 languages/ruby/rubytemplates create mode 100644 languages/sql/Makefile.am create mode 100644 languages/sql/README.dox create mode 100644 languages/sql/app_templates/Makefile.am create mode 100644 languages/sql/app_templates/sql.appwizard create mode 100644 languages/sql/app_templates/sqlsimple/.kdev_ignore create mode 100644 languages/sql/app_templates/sqlsimple/Makefile.am create mode 100644 languages/sql/app_templates/sqlsimple/app.kdevelop create mode 100644 languages/sql/app_templates/sqlsimple/app.sql create mode 100644 languages/sql/app_templates/sqlsimple/sqlsimple create mode 100644 languages/sql/app_templates/sqlsimple/sqlsimple.kdevtemplate create mode 100644 languages/sql/app_templates/sqlsimple/sqlsimple.png create mode 100644 languages/sql/doc/Makefile.am create mode 100644 languages/sql/kdevsqlsupport.desktop create mode 100644 languages/sql/kdevsqlsupport.rc create mode 100644 languages/sql/sqlactions.cpp create mode 100644 languages/sql/sqlactions.h create mode 100644 languages/sql/sqlconfigwidget.ui create mode 100644 languages/sql/sqlconfigwidget.ui.h create mode 100644 languages/sql/sqloutputwidget.cpp create mode 100644 languages/sql/sqloutputwidget.h create mode 100644 languages/sql/sqlsupport_part.cpp create mode 100644 languages/sql/sqlsupport_part.h (limited to 'languages') diff --git a/languages/Makefile.am b/languages/Makefile.am new file mode 100644 index 00000000..1172b71c --- /dev/null +++ b/languages/Makefile.am @@ -0,0 +1,74 @@ +## +## Do NOT remove the comments that start with "kdevelop:" +## They are actually directives to the kdevelop plugin system +## +## The include_xxxx variables are controlled by configure.in.in +## + +if include_ada +ADA_LANGUAGE = ada +endif + +if include_bash +BASH_LANGUAGE = bash +endif + +if include_cpp +CPP_LANGUAGE = cpp +endif + +if include_fortran +FORTRAN_LANGUAGE = fortran +endif + +if include_java +JAVA_LANGUAGE = java +endif + +if include_csharp +CSHARP_LANGUAGE = csharp +endif + +if include_pascal +PASCAL_LANGUAGE = pascal +endif + +if include_perl +PERL_LANGUAGE = perl +endif + +if include_php +PHP_LANGUAGE = php +endif + +if include_python +PYTHON_LANGUAGE = python +endif + +if include_ruby +RUBY_LANGUAGE = ruby +endif + +if include_sql +SQL_LANGUAGE = sql +endif + +#kdevelop: ADA_LANGUAGE = ada +#kdevelop: BASH_LANGUAGE = bash +#kdevelop: CPP_LANGUAGE = cpp +#kdevelop: FORTRAN_LANGUAGE = fortran +#kdevelop: JAVA_LANGUAGE = java +#kdevelop: CSHARP_LANGUAGE = csharp +#kdevelop: PASCAL_LANGUAGE = pascal +#kdevelop: PERL_LANGUAGE = perl +#kdevelop: PHP_LANGUAGE = php +#kdevelop: PYTHON_LANGUAGE = python +#kdevelop: RUBY_LANGUAGE = ruby +#kdevelop: SQL_LANGUAGE = sql + +SUBDIRS = lib $(ADA_LANGUAGE) $(BASH_LANGUAGE) $(CPP_LANGUAGE) $(CSHARP_LANGUAGE) \ + $(FORTRAN_LANGUAGE) $(JAVA_LANGUAGE) $(PASCAL_LANGUAGE) \ + $(PERL_LANGUAGE) $(PHP_LANGUAGE) $(PYTHON_LANGUAGE) $(RUBY_LANGUAGE) $(SQL_LANGUAGE) + +DOXYGEN_EMPTY = YES +include ../Doxyfile.am diff --git a/languages/ada/AdaAST.hpp b/languages/ada/AdaAST.hpp new file mode 100644 index 00000000..1bb2bd07 --- /dev/null +++ b/languages/ada/AdaAST.hpp @@ -0,0 +1,77 @@ +#ifndef ADAAST_HPP +#define ADAAST_HPP + +#include + +class AdaAST; +typedef antlr::ASTRefCount RefAdaAST; + +class AdaAST : public antlr::CommonAST { +public: + AdaAST() : m_line (0), m_column (0) {} + + ~AdaAST() {} + + int getLine () const { return m_line; } + void setLine (int line) { m_line = line; } + + int getColumn () const { return m_column; } + void setColumn (int column) { m_column = column; } + + void initialize (antlr::RefToken t) { + antlr::CommonAST::initialize (t); + m_line = t->getLine () - 1; + m_column = t->getColumn () - 1; + } + + void initialize (int t, const std::string& txt) { + setType (t); + setText (txt); + m_line = 0; + m_column = 0; + } + + RefAdaAST duplicate (void) const { + AdaAST *ast = new AdaAST (*this); + return RefAdaAST (ast); + } + + void set (int t, const std::string& txt) { + setType (t); + setText (txt); + } + + void addChild (RefAdaAST c) { + antlr::RefAST n( c.get() ); + antlr::BaseAST::addChild (n); + } + + RefAdaAST down () const { + return RefAdaAST (antlr::BaseAST::getFirstChild ()); + } + + RefAdaAST right () const { + return RefAdaAST (antlr::BaseAST::getNextSibling ()); + } + + /* bool equals(RefAdaAST t) const { + return ((antlr::BaseAST*)this)->equals (t); + } */ + + static antlr::RefAST factory (void) { + RefAdaAST n( new AdaAST ); + return n.get(); + } + + static const RefAdaAST nullAdaAST; + +private: + int m_line; + int m_column; +}; + +#define Set(n, t) (n)->set(t, #t) +// for Java compatibility: +#define boolean bool + +#endif diff --git a/languages/ada/AdaLexer.cpp b/languages/ada/AdaLexer.cpp new file mode 100644 index 00000000..2ac19416 --- /dev/null +++ b/languages/ada/AdaLexer.cpp @@ -0,0 +1,1507 @@ +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaLexer.cpp"$ */ +#include "AdaLexer.hpp" +#include +#include +#include +#include +#include +#include +#include + +#line 1531 "ada.g" + +#include "preambles.h" + +#line 16 "AdaLexer.cpp" +AdaLexer::AdaLexer(ANTLR_USE_NAMESPACE(std)istream& in) + : ANTLR_USE_NAMESPACE(antlr)CharScanner(new ANTLR_USE_NAMESPACE(antlr)CharBuffer(in),false) +{ + initLiterals(); +} + +AdaLexer::AdaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib) + : ANTLR_USE_NAMESPACE(antlr)CharScanner(ib,false) +{ + initLiterals(); +} + +AdaLexer::AdaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state) + : ANTLR_USE_NAMESPACE(antlr)CharScanner(state,false) +{ + initLiterals(); +} + +void AdaLexer::initLiterals() +{ + literals["until"] = 78; + literals["xor"] = 86; + literals["abstract"] = 40; + literals["reverse"] = 71; + literals["use"] = 13; + literals["requeue"] = 84; + literals["with"] = 11; + literals["task"] = 42; + literals["at"] = 49; + literals["for"] = 47; + literals["else"] = 68; + literals["is"] = 23; + literals["of"] = 55; + literals["range"] = 16; + literals["and"] = 85; + literals["begin"] = 62; + literals["procedure"] = 24; + literals["separate"] = 39; + literals["private"] = 20; + literals["pragma"] = 4; + literals["delay"] = 77; + literals["abort"] = 80; + literals["function"] = 25; + literals["digits"] = 17; + literals["declare"] = 72; + literals["raise"] = 83; + literals["not"] = 87; + literals["record"] = 38; + literals["all"] = 30; + literals["in"] = 32; + literals["generic"] = 61; + literals["terminate"] = 82; + literals["subtype"] = 51; + literals["delta"] = 18; + literals["when"] = 58; + literals["null"] = 37; + literals["entry"] = 46; + literals["elsif"] = 67; + literals["case"] = 57; + literals["others"] = 27; + literals["do"] = 76; + literals["abs"] = 100; + literals["constant"] = 53; + literals["renames"] = 34; + literals["then"] = 66; + literals["exception"] = 52; + literals["protected"] = 43; + literals["accept"] = 75; + literals["or"] = 81; + literals["if"] = 65; + literals["aliased"] = 56; + literals["loop"] = 69; + literals["return"] = 41; + literals["limited"] = 60; + literals["new"] = 26; + literals["array"] = 54; + literals["rem"] = 99; + literals["end"] = 48; + literals["body"] = 22; + literals["mod"] = 50; + literals["goto"] = 74; + literals["tagged"] = 59; + literals["select"] = 79; + literals["while"] = 70; + literals["package"] = 21; + literals["type"] = 14; + literals["access"] = 19; + literals["out"] = 33; + literals["exit"] = 73; +} + +ANTLR_USE_NAMESPACE(antlr)RefToken AdaLexer::nextToken() +{ + ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken; + for (;;) { + ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken; + int _ttype = ANTLR_USE_NAMESPACE(antlr)Token::INVALID_TYPE; + resetText(); + try { // for lexical and char stream error handling + switch ( LA(1)) { + case 0x7c /* '|' */ : + { + mPIPE(true); + theRetToken=_returnToken; + break; + } + case 0x26 /* '&' */ : + { + mCONCAT(true); + theRetToken=_returnToken; + break; + } + case 0x2b /* '+' */ : + { + mPLUS(true); + theRetToken=_returnToken; + break; + } + case 0x28 /* '(' */ : + { + mLPAREN(true); + theRetToken=_returnToken; + break; + } + case 0x29 /* ')' */ : + { + mRPAREN(true); + theRetToken=_returnToken; + break; + } + case 0x2c /* ',' */ : + { + mCOMMA(true); + theRetToken=_returnToken; + break; + } + case 0x3b /* ';' */ : + { + mSEMI(true); + theRetToken=_returnToken; + break; + } + case 0x61 /* 'a' */ : + case 0x62 /* 'b' */ : + case 0x63 /* 'c' */ : + case 0x64 /* 'd' */ : + case 0x65 /* 'e' */ : + case 0x66 /* 'f' */ : + case 0x67 /* 'g' */ : + case 0x68 /* 'h' */ : + case 0x69 /* 'i' */ : + case 0x6a /* 'j' */ : + case 0x6b /* 'k' */ : + case 0x6c /* 'l' */ : + case 0x6d /* 'm' */ : + case 0x6e /* 'n' */ : + case 0x6f /* 'o' */ : + case 0x70 /* 'p' */ : + case 0x71 /* 'q' */ : + case 0x72 /* 'r' */ : + case 0x73 /* 's' */ : + case 0x74 /* 't' */ : + case 0x75 /* 'u' */ : + case 0x76 /* 'v' */ : + case 0x77 /* 'w' */ : + case 0x78 /* 'x' */ : + case 0x79 /* 'y' */ : + case 0x7a /* 'z' */ : + { + mIDENTIFIER(true); + theRetToken=_returnToken; + break; + } + case 0x27 /* '\'' */ : + { + mTIC_OR_CHARACTER_LITERAL(true); + theRetToken=_returnToken; + break; + } + case 0x22 /* '\"' */ : + { + mCHAR_STRING(true); + theRetToken=_returnToken; + break; + } + case 0x30 /* '0' */ : + case 0x31 /* '1' */ : + case 0x32 /* '2' */ : + case 0x33 /* '3' */ : + case 0x34 /* '4' */ : + case 0x35 /* '5' */ : + case 0x36 /* '6' */ : + case 0x37 /* '7' */ : + case 0x38 /* '8' */ : + case 0x39 /* '9' */ : + { + mNUMERIC_LIT(true); + theRetToken=_returnToken; + break; + } + case 0x9 /* '\t' */ : + case 0xa /* '\n' */ : + case 0xc /* '\14' */ : + case 0xd /* '\r' */ : + case 0x20 /* ' ' */ : + { + mWS_(true); + theRetToken=_returnToken; + break; + } + default: + if ((LA(1) == 0x2d /* '-' */ ) && (LA(2) == 0x2d /* '-' */ ) && ((LA(3) >= 0x3 /* '\3' */ && LA(3) <= 0xff))) { + mCOMMENT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2d /* '-' */ ) && (LA(2) == 0x2d /* '-' */ ) && (true)) { + mCOMMENT_INTRO(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2e /* '.' */ ) && (LA(2) == 0x2e /* '.' */ )) { + mDOT_DOT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3c /* '<' */ )) { + mLT_LT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3e /* '>' */ )) { + mOX(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3e /* '>' */ )) { + mGT_GT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3a /* ':' */ ) && (LA(2) == 0x3d /* '=' */ )) { + mASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3e /* '>' */ )) { + mRIGHT_SHAFT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x3d /* '=' */ )) { + mNE(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3d /* '=' */ )) { + mLE(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3d /* '=' */ )) { + mGE(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2a /* '*' */ ) && (LA(2) == 0x2a /* '*' */ )) { + mEXPON(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2e /* '.' */ ) && (true)) { + mDOT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3d /* '=' */ ) && (true)) { + mEQ(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3c /* '<' */ ) && (true)) { + mLT_(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3e /* '>' */ ) && (true)) { + mGT(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2d /* '-' */ ) && (true)) { + mMINUS(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2a /* '*' */ ) && (true)) { + mSTAR(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x2f /* '/' */ ) && (true)) { + mDIV(true); + theRetToken=_returnToken; + } + else if ((LA(1) == 0x3a /* ':' */ ) && (true)) { + mCOLON(true); + theRetToken=_returnToken; + } + else { + if (LA(1)==EOF_CHAR) + { + uponEOF(); + _returnToken = makeToken(ANTLR_USE_NAMESPACE(antlr)Token::EOF_TYPE); + } + else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + } + if ( !_returnToken ) + goto tryAgain; // found SKIP token + + _ttype = _returnToken->getType(); + _returnToken->setType(_ttype); + return _returnToken; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& e) { + throw ANTLR_USE_NAMESPACE(antlr)TokenStreamRecognitionException(e); + } + catch (ANTLR_USE_NAMESPACE(antlr)CharStreamIOException& csie) { + throw ANTLR_USE_NAMESPACE(antlr)TokenStreamIOException(csie.io); + } + catch (ANTLR_USE_NAMESPACE(antlr)CharStreamException& cse) { + throw ANTLR_USE_NAMESPACE(antlr)TokenStreamException(cse.getMessage()); + } +tryAgain:; + } +} + +void AdaLexer::mCOMMENT_INTRO(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = COMMENT_INTRO; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("--"); +#line 1888 "ada.g" + lastTokenWasTicCompatible=false; +#line 345 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mDOT_DOT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = DOT_DOT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(".."); +#line 1889 "ada.g" + lastTokenWasTicCompatible=false; +#line 362 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mLT_LT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = LT_LT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("<<"); +#line 1890 "ada.g" + lastTokenWasTicCompatible=false; +#line 379 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mOX(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = OX; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("<>"); +#line 1891 "ada.g" + lastTokenWasTicCompatible=false; +#line 396 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mGT_GT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = GT_GT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(">>"); +#line 1892 "ada.g" + lastTokenWasTicCompatible=false; +#line 413 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mASSIGN(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = ASSIGN; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(":="); +#line 1893 "ada.g" + lastTokenWasTicCompatible=false; +#line 430 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mRIGHT_SHAFT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = RIGHT_SHAFT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("=>"); +#line 1894 "ada.g" + lastTokenWasTicCompatible=false; +#line 447 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mNE(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = NE; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("/="); +#line 1895 "ada.g" + lastTokenWasTicCompatible=false; +#line 464 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mLE(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = LE; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("<="); +#line 1896 "ada.g" + lastTokenWasTicCompatible=false; +#line 481 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mGE(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = GE; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(">="); +#line 1897 "ada.g" + lastTokenWasTicCompatible=false; +#line 498 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mEXPON(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = EXPON; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match("**"); +#line 1898 "ada.g" + lastTokenWasTicCompatible=false; +#line 515 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mPIPE(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = PIPE; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('|' /* charlit */ ); +#line 1899 "ada.g" + lastTokenWasTicCompatible=false; +#line 532 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mCONCAT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = CONCAT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('&' /* charlit */ ); +#line 1900 "ada.g" + lastTokenWasTicCompatible=false; +#line 549 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mDOT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = DOT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('.' /* charlit */ ); +#line 1901 "ada.g" + lastTokenWasTicCompatible=false; +#line 566 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mEQ(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = EQ; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('=' /* charlit */ ); +#line 1902 "ada.g" + lastTokenWasTicCompatible=false; +#line 583 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mLT_(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = LT_; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('<' /* charlit */ ); +#line 1903 "ada.g" + lastTokenWasTicCompatible=false; +#line 600 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mGT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = GT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('>' /* charlit */ ); +#line 1904 "ada.g" + lastTokenWasTicCompatible=false; +#line 617 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mPLUS(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = PLUS; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('+' /* charlit */ ); +#line 1905 "ada.g" + lastTokenWasTicCompatible=false; +#line 634 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mMINUS(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = MINUS; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('-' /* charlit */ ); +#line 1906 "ada.g" + lastTokenWasTicCompatible=false; +#line 651 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mSTAR(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = STAR; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('*' /* charlit */ ); +#line 1907 "ada.g" + lastTokenWasTicCompatible=false; +#line 668 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mDIV(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = DIV; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('/' /* charlit */ ); +#line 1908 "ada.g" + lastTokenWasTicCompatible=false; +#line 685 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mLPAREN(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = LPAREN; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match('(' /* charlit */ ); +#line 1909 "ada.g" + lastTokenWasTicCompatible=false; +#line 702 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mRPAREN(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = RPAREN; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(')' /* charlit */ ); +#line 1910 "ada.g" + lastTokenWasTicCompatible=true; +#line 719 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mCOLON(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = COLON; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(':' /* charlit */ ); +#line 1911 "ada.g" + lastTokenWasTicCompatible=false; +#line 736 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mCOMMA(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = COMMA; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(',' /* charlit */ ); +#line 1912 "ada.g" + lastTokenWasTicCompatible=false; +#line 753 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mSEMI(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = SEMI; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + match(';' /* charlit */ ); +#line 1913 "ada.g" + lastTokenWasTicCompatible=false; +#line 770 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mIDENTIFIER(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = IDENTIFIER; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { + matchRange('a','z'); + } + { // ( ... )* + for (;;) { + if ((_tokenSet_0.member(LA(1)))) { + { + switch ( LA(1)) { + case 0x5f /* '_' */ : + { + match('_' /* charlit */ ); + break; + } + case 0x30 /* '0' */ : + case 0x31 /* '1' */ : + case 0x32 /* '2' */ : + case 0x33 /* '3' */ : + case 0x34 /* '4' */ : + case 0x35 /* '5' */ : + case 0x36 /* '6' */ : + case 0x37 /* '7' */ : + case 0x38 /* '8' */ : + case 0x39 /* '9' */ : + case 0x61 /* 'a' */ : + case 0x62 /* 'b' */ : + case 0x63 /* 'c' */ : + case 0x64 /* 'd' */ : + case 0x65 /* 'e' */ : + case 0x66 /* 'f' */ : + case 0x67 /* 'g' */ : + case 0x68 /* 'h' */ : + case 0x69 /* 'i' */ : + case 0x6a /* 'j' */ : + case 0x6b /* 'k' */ : + case 0x6c /* 'l' */ : + case 0x6d /* 'm' */ : + case 0x6e /* 'n' */ : + case 0x6f /* 'o' */ : + case 0x70 /* 'p' */ : + case 0x71 /* 'q' */ : + case 0x72 /* 'r' */ : + case 0x73 /* 's' */ : + case 0x74 /* 't' */ : + case 0x75 /* 'u' */ : + case 0x76 /* 'v' */ : + case 0x77 /* 'w' */ : + case 0x78 /* 'x' */ : + case 0x79 /* 'y' */ : + case 0x7a /* 'z' */ : + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + switch ( LA(1)) { + case 0x61 /* 'a' */ : + case 0x62 /* 'b' */ : + case 0x63 /* 'c' */ : + case 0x64 /* 'd' */ : + case 0x65 /* 'e' */ : + case 0x66 /* 'f' */ : + case 0x67 /* 'g' */ : + case 0x68 /* 'h' */ : + case 0x69 /* 'i' */ : + case 0x6a /* 'j' */ : + case 0x6b /* 'k' */ : + case 0x6c /* 'l' */ : + case 0x6d /* 'm' */ : + case 0x6e /* 'n' */ : + case 0x6f /* 'o' */ : + case 0x70 /* 'p' */ : + case 0x71 /* 'q' */ : + case 0x72 /* 'r' */ : + case 0x73 /* 's' */ : + case 0x74 /* 't' */ : + case 0x75 /* 'u' */ : + case 0x76 /* 'v' */ : + case 0x77 /* 'w' */ : + case 0x78 /* 'x' */ : + case 0x79 /* 'y' */ : + case 0x7a /* 'z' */ : + { + matchRange('a','z'); + break; + } + case 0x30 /* '0' */ : + case 0x31 /* '1' */ : + case 0x32 /* '2' */ : + case 0x33 /* '3' */ : + case 0x34 /* '4' */ : + case 0x35 /* '5' */ : + case 0x36 /* '6' */ : + case 0x37 /* '7' */ : + case 0x38 /* '8' */ : + case 0x39 /* '9' */ : + { + matchRange('0','9'); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + else { + goto _loop512; + } + + } + _loop512:; + } // ( ... )* + _ttype = testLiteralsTable(_ttype); + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mTIC_OR_CHARACTER_LITERAL(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = TIC_OR_CHARACTER_LITERAL; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + _saveIndex = text.length(); + match("\'"); + text.erase(_saveIndex); +#line 1927 "ada.g" + _ttype = TIC; +#line 921 "AdaLexer.cpp" + { + if ((((LA(1) >= 0x3 /* '\3' */ && LA(1) <= 0xff)))&&( ! lastTokenWasTicCompatible )) { + matchNot(EOF/*_CHAR*/); + _saveIndex = text.length(); + match("\'"); + text.erase(_saveIndex); +#line 1929 "ada.g" + _ttype = CHARACTER_LITERAL; +#line 930 "AdaLexer.cpp" + } + else { + } + + } +#line 1931 "ada.g" + lastTokenWasTicCompatible=false; +#line 938 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mCHAR_STRING(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = CHAR_STRING; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + _saveIndex = text.length(); + match('\"' /* charlit */ ); + text.erase(_saveIndex); + { // ( ... )* + for (;;) { + if ((LA(1) == 0x22 /* '\"' */ ) && (LA(2) == 0x22 /* '\"' */ )) { + match("\"\""); + } + else if ((_tokenSet_1.member(LA(1)))) { + { + match(_tokenSet_1); + } + } + else { + goto _loop518; + } + + } + _loop518:; + } // ( ... )* + _saveIndex = text.length(); + match('\"' /* charlit */ ); + text.erase(_saveIndex); +#line 1934 "ada.g" + lastTokenWasTicCompatible=true; +#line 977 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mNUMERIC_LIT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = NUMERIC_LIT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { // ( ... )+ + int _cnt521=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt521>=1 ) { goto _loop521; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt521++; + } + _loop521:; + } // ( ... )+ + { + switch ( LA(1)) { + case 0x23 /* '#' */ : + { + match('#' /* charlit */ ); + mBASED_INTEGER(false); + { + switch ( LA(1)) { + case 0x2e /* '.' */ : + { + match('.' /* charlit */ ); + mBASED_INTEGER(false); + break; + } + case 0x23 /* '#' */ : + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + match('#' /* charlit */ ); + break; + } + case 0x5f /* '_' */ : + { + { // ( ... )+ + int _cnt527=0; + for (;;) { + if ((LA(1) == 0x5f /* '_' */ )) { + match('_' /* charlit */ ); + { // ( ... )+ + int _cnt526=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt526>=1 ) { goto _loop526; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt526++; + } + _loop526:; + } // ( ... )+ + } + else { + if ( _cnt527>=1 ) { goto _loop527; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt527++; + } + _loop527:; + } // ( ... )+ + break; + } + default: + { + } + } + } + { + if (((LA(1) == 0x2e /* '.' */ || LA(1) == 0x65 /* 'e' */ ))&&( LA(2)!='.' )) { + { + switch ( LA(1)) { + case 0x2e /* '.' */ : + { + match('.' /* charlit */ ); + { // ( ... )+ + int _cnt531=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt531>=1 ) { goto _loop531; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt531++; + } + _loop531:; + } // ( ... )+ + { // ( ... )* + for (;;) { + if ((LA(1) == 0x5f /* '_' */ )) { + match('_' /* charlit */ ); + { // ( ... )+ + int _cnt534=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt534>=1 ) { goto _loop534; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt534++; + } + _loop534:; + } // ( ... )+ + } + else { + goto _loop535; + } + + } + _loop535:; + } // ( ... )* + { + if ((LA(1) == 0x65 /* 'e' */ )) { + mEXPONENT(false); + } + else { + } + + } + break; + } + case 0x65 /* 'e' */ : + { + mEXPONENT(false); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + else { + } + + } +#line 1945 "ada.g" + lastTokenWasTicCompatible=false; +#line 1144 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mDIGIT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = DIGIT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { + matchRange('0','9'); + } +#line 1950 "ada.g" + lastTokenWasTicCompatible=false; +#line 1163 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mBASED_INTEGER(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = BASED_INTEGER; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { + mEXTENDED_DIGIT(false); + } + { // ( ... )* + for (;;) { + if ((_tokenSet_2.member(LA(1)))) { + { + switch ( LA(1)) { + case 0x5f /* '_' */ : + { + match('_' /* charlit */ ); + break; + } + case 0x30 /* '0' */ : + case 0x31 /* '1' */ : + case 0x32 /* '2' */ : + case 0x33 /* '3' */ : + case 0x34 /* '4' */ : + case 0x35 /* '5' */ : + case 0x36 /* '6' */ : + case 0x37 /* '7' */ : + case 0x38 /* '8' */ : + case 0x39 /* '9' */ : + case 0x61 /* 'a' */ : + case 0x62 /* 'b' */ : + case 0x63 /* 'c' */ : + case 0x64 /* 'd' */ : + case 0x65 /* 'e' */ : + case 0x66 /* 'f' */ : + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + mEXTENDED_DIGIT(false); + } + else { + goto _loop550; + } + + } + _loop550:; + } // ( ... )* +#line 1959 "ada.g" + lastTokenWasTicCompatible=false; +#line 1226 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mEXPONENT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = EXPONENT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { + match('e' /* charlit */ ); + } + { + switch ( LA(1)) { + case 0x2b /* '+' */ : + { + match('+' /* charlit */ ); + break; + } + case 0x2d /* '-' */ : + { + match('-' /* charlit */ ); + break; + } + case 0x30 /* '0' */ : + case 0x31 /* '1' */ : + case 0x32 /* '2' */ : + case 0x33 /* '3' */ : + case 0x34 /* '4' */ : + case 0x35 /* '5' */ : + case 0x36 /* '6' */ : + case 0x37 /* '7' */ : + case 0x38 /* '8' */ : + case 0x39 /* '9' */ : + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { // ( ... )+ + int _cnt543=0; + for (;;) { + if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) { + mDIGIT(false); + } + else { + if ( _cnt543>=1 ) { goto _loop543; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt543++; + } + _loop543:; + } // ( ... )+ +#line 1953 "ada.g" + lastTokenWasTicCompatible=false; +#line 1290 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mEXTENDED_DIGIT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = EXTENDED_DIGIT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { + switch ( LA(1)) { + case 0x30 /* '0' */ : + case 0x31 /* '1' */ : + case 0x32 /* '2' */ : + case 0x33 /* '3' */ : + case 0x34 /* '4' */ : + case 0x35 /* '5' */ : + case 0x36 /* '6' */ : + case 0x37 /* '7' */ : + case 0x38 /* '8' */ : + case 0x39 /* '9' */ : + { + mDIGIT(false); + break; + } + case 0x61 /* 'a' */ : + case 0x62 /* 'b' */ : + case 0x63 /* 'c' */ : + case 0x64 /* 'd' */ : + case 0x65 /* 'e' */ : + case 0x66 /* 'f' */ : + { + matchRange('a','f'); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } +#line 1956 "ada.g" + lastTokenWasTicCompatible=false; +#line 1338 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mWS_(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = WS_; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + { + switch ( LA(1)) { + case 0x20 /* ' ' */ : + { + match(' ' /* charlit */ ); + break; + } + case 0x9 /* '\t' */ : + { + match('\t' /* charlit */ ); + break; + } + case 0xc /* '\14' */ : + { + match('\14' /* charlit */ ); + break; + } + case 0xa /* '\n' */ : + case 0xd /* '\r' */ : + { + { + if ((LA(1) == 0xd /* '\r' */ ) && (LA(2) == 0xa /* '\n' */ )) { + match("\r\n"); + } + else if ((LA(1) == 0xd /* '\r' */ ) && (true)) { + match('\r' /* charlit */ ); + } + else if ((LA(1) == 0xa /* '\n' */ )) { + match('\n' /* charlit */ ); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + + } +#line 1971 "ada.g" + newline(); +#line 1389 "AdaLexer.cpp" + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } +#line 1973 "ada.g" + _ttype = antlr::Token::SKIP; +#line 1400 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + +void AdaLexer::mCOMMENT(bool _createToken) { + int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length(); + _ttype = COMMENT; + ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex; + + mCOMMENT_INTRO(false); + { // ( ... )* + for (;;) { + if ((_tokenSet_3.member(LA(1)))) { + { + match(_tokenSet_3); + } + } + else { + goto _loop557; + } + + } + _loop557:; + } // ( ... )* + { + switch ( LA(1)) { + case 0xa /* '\n' */ : + { + match('\n' /* charlit */ ); + break; + } + case 0xd /* '\r' */ : + { + match('\r' /* charlit */ ); + { + if ((LA(1) == 0xa /* '\n' */ )) { + match('\n' /* charlit */ ); + } + else { + } + + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn()); + } + } + } +#line 1978 "ada.g" + _ttype = antlr::Token::SKIP; + newline(); + lastTokenWasTicCompatible=false; +#line 1459 "AdaLexer.cpp" + if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) { + _token = makeToken(_ttype); + _token->setText(text.substr(_begin, text.length()-_begin)); + } + _returnToken = _token; + _saveIndex=0; +} + + +const unsigned long AdaLexer::_tokenSet_0_data_[] = { 0UL, 67043328UL, 2147483648UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// 0 1 2 3 4 5 6 7 8 9 _ a b c d e f g h i j k l m n o p q r s t u v w +// x y z +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_0(_tokenSet_0_data_,10); +const unsigned long AdaLexer::_tokenSet_1_data_[] = { 4294967288UL, 4294967291UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13 +// 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f ! # $ +// % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F +// G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g +// h i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83 +// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 +// 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f +// 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad +// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb +// 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9 +// 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 +// 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5 +// 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf3 +// 0xf4 0xf5 0xf6 0xf7 0xf8 0xf9 0xfa 0xfb 0xfc 0xfd 0xfe 0xff +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_1(_tokenSet_1_data_,16); +const unsigned long AdaLexer::_tokenSet_2_data_[] = { 0UL, 67043328UL, 2147483648UL, 126UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// 0 1 2 3 4 5 6 7 8 9 _ a b c d e f +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_2(_tokenSet_2_data_,10); +const unsigned long AdaLexer::_tokenSet_3_data_[] = { 4294958072UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14 +// 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f ! \" # $ % +// & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G +// H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g h +// i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83 +// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 +// 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f +// 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad +// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb +// 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9 +// 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7 +// 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5 +// 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf3 +// 0xf4 0xf5 0xf6 0xf7 0xf8 0xf9 0xfa 0xfb 0xfc 0xfd 0xfe 0xff +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_3(_tokenSet_3_data_,16); + diff --git a/languages/ada/AdaLexer.hpp b/languages/ada/AdaLexer.hpp new file mode 100644 index 00000000..795c7bba --- /dev/null +++ b/languages/ada/AdaLexer.hpp @@ -0,0 +1,86 @@ +#ifndef INC_AdaLexer_hpp_ +#define INC_AdaLexer_hpp_ + +#line 29 "ada.g" + +#include // antlr wants this +#include "AdaAST.hpp" +#include "preambles.h" + +#line 11 "AdaLexer.hpp" +#include +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaLexer.hpp"$ */ +#include +#include +#include +#include "AdaTokenTypes.hpp" +#include +class CUSTOM_API AdaLexer : public ANTLR_USE_NAMESPACE(antlr)CharScanner, public AdaTokenTypes +{ +#line 1879 "ada.g" + + ANTLR_LEXER_PREAMBLE + private: + bool lastTokenWasTicCompatible; +#line 22 "AdaLexer.hpp" +private: + void initLiterals(); +public: + bool getCaseSensitiveLiterals() const + { + return false; + } +public: + AdaLexer(ANTLR_USE_NAMESPACE(std)istream& in); + AdaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib); + AdaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state); + ANTLR_USE_NAMESPACE(antlr)RefToken nextToken(); + public: void mCOMMENT_INTRO(bool _createToken); + public: void mDOT_DOT(bool _createToken); + public: void mLT_LT(bool _createToken); + public: void mOX(bool _createToken); + public: void mGT_GT(bool _createToken); + public: void mASSIGN(bool _createToken); + public: void mRIGHT_SHAFT(bool _createToken); + public: void mNE(bool _createToken); + public: void mLE(bool _createToken); + public: void mGE(bool _createToken); + public: void mEXPON(bool _createToken); + public: void mPIPE(bool _createToken); + public: void mCONCAT(bool _createToken); + public: void mDOT(bool _createToken); + public: void mEQ(bool _createToken); + public: void mLT_(bool _createToken); + public: void mGT(bool _createToken); + public: void mPLUS(bool _createToken); + public: void mMINUS(bool _createToken); + public: void mSTAR(bool _createToken); + public: void mDIV(bool _createToken); + public: void mLPAREN(bool _createToken); + public: void mRPAREN(bool _createToken); + public: void mCOLON(bool _createToken); + public: void mCOMMA(bool _createToken); + public: void mSEMI(bool _createToken); + public: void mIDENTIFIER(bool _createToken); + public: void mTIC_OR_CHARACTER_LITERAL(bool _createToken); + public: void mCHAR_STRING(bool _createToken); + public: void mNUMERIC_LIT(bool _createToken); + protected: void mDIGIT(bool _createToken); + protected: void mBASED_INTEGER(bool _createToken); + protected: void mEXPONENT(bool _createToken); + protected: void mEXTENDED_DIGIT(bool _createToken); + public: void mWS_(bool _createToken); + public: void mCOMMENT(bool _createToken); +private: + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; +}; + +#endif /*INC_AdaLexer_hpp_*/ diff --git a/languages/ada/AdaParser.cpp b/languages/ada/AdaParser.cpp new file mode 100644 index 00000000..e783595e --- /dev/null +++ b/languages/ada/AdaParser.cpp @@ -0,0 +1,12283 @@ +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaParser.cpp"$ */ +#include "AdaParser.hpp" +#include +#include +#include +#line 1 "ada.g" +#line 8 "AdaParser.cpp" +AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,k) +{ +} + +AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,2) +{ +} + +AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,k) +{ +} + +AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,2) +{ +} + +AdaParser::AdaParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state) +: ANTLR_USE_NAMESPACE(antlr)LLkParser(state,2) +{ +} + +void AdaParser::compilation_unit() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST compilation_unit_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + context_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PRIVATE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case GENERIC: + { + library_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEPARATE: + { + subunit(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + { // ( ... )* + for (;;) { + if ((LA(1) == PRAGMA)) { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop4; + } + + } + _loop4:; + } // ( ... )* + compilation_unit_AST = RefAdaAST(currentAST.root); + returnAST = compilation_unit_AST; +} + +void AdaParser::context_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST context_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case WITH: + { + with_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case USE: + { + use_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop14; + } + } + } + _loop14:; + } // ( ... )* + if ( inputState->guessing==0 ) { + context_items_opt_AST = RefAdaAST(currentAST.root); +#line 86 "ada.g" + context_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CONTEXT_CLAUSE,"CONTEXT_CLAUSE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(context_items_opt_AST)))); +#line 135 "AdaParser.cpp" + currentAST.root = context_items_opt_AST; + if ( context_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + context_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = context_items_opt_AST->getFirstChild(); + else + currentAST.child = context_items_opt_AST; + currentAST.advanceChildToEnd(); + } + context_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = context_items_opt_AST; +} + +void AdaParser::library_item() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST library_item_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + private_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PACKAGE: + { + lib_pkg_spec_or_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PROCEDURE: + case FUNCTION: + { + subprog_decl_or_rename_or_inst_or_body(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case GENERIC: + { + generic_decl(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + library_item_AST = RefAdaAST(currentAST.root); +#line 133 "ada.g" + library_item_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(LIBRARY_ITEM,"LIBRARY_ITEM")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(library_item_AST)))); +#line 194 "AdaParser.cpp" + currentAST.root = library_item_AST; + if ( library_item_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + library_item_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = library_item_AST->getFirstChild(); + else + currentAST.child = library_item_AST; + currentAST.advanceChildToEnd(); + } + library_item_AST = RefAdaAST(currentAST.root); + returnAST = library_item_AST; +} + +void AdaParser::subunit() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subunit_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken sep = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST sep_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + sep = LT(1); + if ( inputState->guessing == 0 ) { + sep_AST = astFactory->create(sep); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(sep_AST)); + } + match(SEPARATE); + match(LPAREN); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 1497 "ada.g" + Set(sep_AST, SUBUNIT); +#line 229 "AdaParser.cpp" + } + { + switch ( LA(1)) { + case PROCEDURE: + case FUNCTION: + { + subprogram_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PACKAGE: + { + package_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case TASK: + { + task_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PROTECTED: + { + protected_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subunit_AST = RefAdaAST(currentAST.root); + returnAST = subunit_AST; +} + +void AdaParser::pragma() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pragma_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp3_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp3_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp3_AST)); + } + match(PRAGMA); + RefAdaAST tmp4_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp4_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp4_AST)); + } + match(IDENTIFIER); + pragma_args_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + pragma_AST = RefAdaAST(currentAST.root); + returnAST = pragma_AST; +} + +void AdaParser::pragma_args_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pragma_args_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + pragma_arg(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + pragma_arg(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop9; + } + + } + _loop9:; + } // ( ... )* + match(RPAREN); + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + pragma_args_opt_AST = RefAdaAST(currentAST.root); + returnAST = pragma_args_opt_AST; +} + +void AdaParser::pragma_arg() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pragma_arg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + if ((LA(1) == IDENTIFIER) && (LA(2) == RIGHT_SHAFT)) { + RefAdaAST tmp9_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp9_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp9_AST)); + } + match(IDENTIFIER); + RefAdaAST tmp10_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp10_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp10_AST)); + } + match(RIGHT_SHAFT); + } + else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + pragma_arg_AST = RefAdaAST(currentAST.root); + returnAST = pragma_arg_AST; +} + +void AdaParser::expression() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST expression_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken a = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST a_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken o = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST o_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + relation(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case AND: + { + a = LT(1); + if ( inputState->guessing == 0 ) { + a_AST = astFactory->create(a); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(a_AST)); + } + match(AND); + { + switch ( LA(1)) { + case THEN: + { + match(THEN); + if ( inputState->guessing==0 ) { +#line 1417 "ada.g" + Set (a_AST, AND_THEN); +#line 416 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + relation(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case OR: + { + o = LT(1); + if ( inputState->guessing == 0 ) { + o_AST = astFactory->create(o); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(o_AST)); + } + match(OR); + { + switch ( LA(1)) { + case ELSE: + { + match(ELSE); + if ( inputState->guessing==0 ) { +#line 1418 "ada.g" + Set (o_AST, OR_ELSE); +#line 462 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + relation(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case XOR: + { + RefAdaAST tmp13_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp13_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp13_AST)); + } + match(XOR); + relation(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop450; + } + } + } + _loop450:; + } // ( ... )* + expression_AST = RefAdaAST(currentAST.root); + returnAST = expression_AST; +} + +void AdaParser::with_clause() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST with_clause_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WITH); + c_name_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 94 "ada.g" + Set(w_AST, WITH_CLAUSE); +#line 539 "AdaParser.cpp" + } + with_clause_AST = RefAdaAST(currentAST.root); + returnAST = with_clause_AST; +} + +void AdaParser::use_clause() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST use_clause_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken u = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST u_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + u = LT(1); + if ( inputState->guessing == 0 ) { + u_AST = astFactory->create(u); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(u_AST)); + } + match(USE); + { + switch ( LA(1)) { + case TYPE: + { + match(TYPE); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop25; + } + + } + _loop25:; + } // ( ... )* + if ( inputState->guessing==0 ) { +#line 108 "ada.g" + Set(u_AST, USE_TYPE_CLAUSE); +#line 586 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + { + c_name_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 109 "ada.g" + Set(u_AST, USE_CLAUSE); +#line 599 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + use_clause_AST = RefAdaAST(currentAST.root); + returnAST = use_clause_AST; +} + +void AdaParser::c_name_list() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST c_name_list_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop18; + } + + } + _loop18:; + } // ( ... )* + c_name_list_AST = RefAdaAST(currentAST.root); + returnAST = c_name_list_AST; +} + +void AdaParser::compound_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST compound_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp19_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp19_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp19_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + if ((LA(1) == DOT)) { + RefAdaAST tmp20_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp20_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp20_AST)); + } + match(DOT); + RefAdaAST tmp21_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp21_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp21_AST)); + } + match(IDENTIFIER); + } + else { + goto _loop21; + } + + } + _loop21:; + } // ( ... )* + compound_name_AST = RefAdaAST(currentAST.root); + returnAST = compound_name_AST; +} + +void AdaParser::subtype_mark() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subtype_mark_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case TIC: + { + RefAdaAST tmp22_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp22_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp22_AST)); + } + match(TIC); + attribute_id(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case LPAREN: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case USE: + case RANGE: + case DIGITS: + case DELTA: + case IS: + case PIPE: + case DOT_DOT: + case RENAMES: + case ASSIGN: + case AT: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subtype_mark_AST = RefAdaAST(currentAST.root); + returnAST = subtype_mark_AST; +} + +void AdaParser::attribute_id() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST attribute_id_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case RANGE: + { + RefAdaAST tmp23_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp23_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp23_AST)); + } + match(RANGE); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + case DIGITS: + { + RefAdaAST tmp24_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp24_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp24_AST)); + } + match(DIGITS); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + case DELTA: + { + RefAdaAST tmp25_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp25_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp25_AST)); + } + match(DELTA); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + case ACCESS: + { + RefAdaAST tmp26_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp26_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp26_AST)); + } + match(ACCESS); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp27_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp27_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp27_AST)); + } + match(IDENTIFIER); + attribute_id_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = attribute_id_AST; +} + +void AdaParser::private_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST private_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRIVATE: + { + RefAdaAST tmp28_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp28_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp28_AST)); + } + match(PRIVATE); + break; + } + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case GENERIC: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + private_opt_AST = RefAdaAST(currentAST.root); +#line 137 "ada.g" + private_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(private_opt_AST)))); +#line 843 "AdaParser.cpp" + currentAST.root = private_opt_AST; + if ( private_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + private_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = private_opt_AST->getFirstChild(); + else + currentAST.child = private_opt_AST; + currentAST.advanceChildToEnd(); + } + private_opt_AST = RefAdaAST(currentAST.root); + returnAST = private_opt_AST; +} + +void AdaParser::lib_pkg_spec_or_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST lib_pkg_spec_or_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pkg = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pkg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + pkg = LT(1); + if ( inputState->guessing == 0 ) { + pkg_AST = astFactory->create(pkg); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pkg_AST)); + } + match(PACKAGE); + { + switch ( LA(1)) { + case BODY: + { + match(BODY); + def_id(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + pkg_body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 143 "ada.g" + Set(pkg_AST, PACKAGE_BODY); +#line 887 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + { + def_id(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + spec_decl_part(pkg_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + lib_pkg_spec_or_body_AST = RefAdaAST(currentAST.root); + returnAST = lib_pkg_spec_or_body_AST; +} + +void AdaParser::subprog_decl_or_rename_or_inst_or_body( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprog_decl_or_rename_or_inst_or_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 944 "ada.g" + RefAdaAST t; +#line 925 "AdaParser.cpp" + + switch ( LA(1)) { + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + if ((LA(1) == IS) && (LA(2) == NEW)) { + generic_subp_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 948 "ada.g" + Set(p_AST, GENERIC_PROCEDURE_INSTANTIATION); +#line 949 "AdaParser.cpp" + } + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2)))) { + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 950 "ada.g" + Set(p_AST, PROCEDURE_RENAMING_DECLARATION); +#line 968 "AdaParser.cpp" + } + break; + } + case IS: + { + match(IS); + { + switch ( LA(1)) { + case SEPARATE: + case ABSTRACT: + { + separate_or_abstract(p_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + case BEGIN: + { + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 952 "ada.g" + Set(p_AST, PROCEDURE_BODY); +#line 1007 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 954 "ada.g" + pop_def_id(); + Set(p_AST, PROCEDURE_DECLARATION); +#line 1025 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + subprog_decl_or_rename_or_inst_or_body_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + generic_subp_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 961 "ada.g" + Set(f_AST, GENERIC_FUNCTION_INSTANTIATION); +#line 1068 "AdaParser.cpp" + } + break; + } + case LPAREN: + case RETURN: + { + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 963 "ada.g" + Set(f_AST, FUNCTION_RENAMING_DECLARATION); +#line 1090 "AdaParser.cpp" + } + break; + } + case IS: + { + match(IS); + { + switch ( LA(1)) { + case SEPARATE: + case ABSTRACT: + { + separate_or_abstract(f_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + case BEGIN: + { + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 965 "ada.g" + Set(f_AST, FUNCTION_BODY); +#line 1129 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 967 "ada.g" + pop_def_id(); + Set(f_AST, FUNCTION_DECLARATION); +#line 1147 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subprog_decl_or_rename_or_inst_or_body_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = subprog_decl_or_rename_or_inst_or_body_AST; +} + +void AdaParser::generic_decl( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken g = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST g_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + g = LT(1); + if ( inputState->guessing == 0 ) { + g_AST = astFactory->create(g); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(g_AST)); + } + match(GENERIC); + generic_formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PACKAGE: + { + match(PACKAGE); + def_id(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 865 "ada.g" + Set(g_AST, GENERIC_PACKAGE_RENAMING); +#line 1216 "AdaParser.cpp" + } + break; + } + case IS: + { + match(IS); + pkg_spec_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 866 "ada.g" + Set(g_AST, GENERIC_PACKAGE_DECLARATION); +#line 1230 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case PROCEDURE: + { + match(PROCEDURE); + def_id(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 869 "ada.g" + Set(g_AST, GENERIC_PROCEDURE_RENAMING); +#line 1264 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 872 "ada.g" + Set(g_AST, GENERIC_PROCEDURE_DECLARATION); pop_def_id(); +#line 1273 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case FUNCTION: + { + match(FUNCTION); + def_designator(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 875 "ada.g" + Set(g_AST, GENERIC_FUNCTION_RENAMING); +#line 1307 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 878 "ada.g" + Set(g_AST, GENERIC_FUNCTION_DECLARATION); pop_def_id(); +#line 1316 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + generic_decl_AST = RefAdaAST(currentAST.root); + returnAST = generic_decl_AST; +} + +void AdaParser::def_id( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST def_id_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST cn_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if (((LA(1) == IDENTIFIER) && (_tokenSet_4.member(LA(2))))&&( lib_level )) { + compound_name(); + if (inputState->guessing==0) { + cn_AST = returnAST; + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 171 "ada.g" + push_def_id(cn_AST); +#line 1358 "AdaParser.cpp" + } + def_id_AST = RefAdaAST(currentAST.root); + } + else if (((LA(1) == IDENTIFIER) && (_tokenSet_5.member(LA(2))))&&( !lib_level )) { + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST)); + } + match(IDENTIFIER); + if ( inputState->guessing==0 ) { +#line 172 "ada.g" + push_def_id(n_AST); +#line 1372 "AdaParser.cpp" + } + def_id_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = def_id_AST; +} + +void AdaParser::pkg_body_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pkg_body_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + declarative_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + block_body_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + pkg_body_part_AST = RefAdaAST(currentAST.root); + returnAST = pkg_body_part_AST; +} + +void AdaParser::spec_decl_part( + RefAdaAST pkg +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST spec_decl_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IS: + { + match(IS); + { + switch ( LA(1)) { + case NEW: + { + generic_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 364 "ada.g" + Set(pkg, GENERIC_PACKAGE_INSTANTIATION); +#line 1427 "AdaParser.cpp" + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PRIVATE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case END: + case SUBTYPE: + case GENERIC: + { + pkg_spec_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 365 "ada.g" + Set(pkg, PACKAGE_SPECIFICATION); +#line 1453 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 367 "ada.g" + Set(pkg, PACKAGE_RENAMING_DECLARATION); +#line 1474 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + spec_decl_part_AST = RefAdaAST(currentAST.root); + returnAST = spec_decl_part_AST; +} + +void AdaParser::subprog_decl( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprog_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 148 "ada.g" + RefAdaAST t; +#line 1501 "AdaParser.cpp" + + switch ( LA(1)) { + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + if ((LA(1) == IS) && (LA(2) == NEW)) { + generic_subp_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 152 "ada.g" + Set(p_AST, GENERIC_PROCEDURE_INSTANTIATION); +#line 1525 "AdaParser.cpp" + } + } + else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_6.member(LA(2)))) { + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 154 "ada.g" + Set(p_AST, PROCEDURE_RENAMING_DECLARATION); +#line 1544 "AdaParser.cpp" + } + break; + } + case SEMI: + case IS: + { + is_separate_or_abstract_or_decl(p_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + subprog_decl_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(lib_level); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + generic_subp_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 161 "ada.g" + Set(f_AST, GENERIC_FUNCTION_INSTANTIATION); +#line 1596 "AdaParser.cpp" + } + break; + } + case LPAREN: + case RETURN: + { + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RENAMES: + { + renames(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 163 "ada.g" + Set(f_AST, FUNCTION_RENAMING_DECLARATION); +#line 1618 "AdaParser.cpp" + } + break; + } + case SEMI: + case IS: + { + is_separate_or_abstract_or_decl(f_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subprog_decl_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = subprog_decl_AST; +} + +void AdaParser::generic_subp_inst() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_subp_inst_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(IS); + generic_inst(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + generic_subp_inst_AST = RefAdaAST(currentAST.root); + returnAST = generic_subp_inst_AST; +} + +void AdaParser::formal_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST formal_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + parameter_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == SEMI)) { + match(SEMI); + parameter_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop70; + } + + } + _loop70:; + } // ( ... )* + match(RPAREN); + break; + } + case SEMI: + case IS: + case RENAMES: + case WHEN: + case DO: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + formal_part_opt_AST = RefAdaAST(currentAST.root); +#line 235 "ada.g" + formal_part_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(FORMAL_PART_OPT,"FORMAL_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(formal_part_opt_AST)))); +#line 1723 "AdaParser.cpp" + currentAST.root = formal_part_opt_AST; + if ( formal_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + formal_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = formal_part_opt_AST->getFirstChild(); + else + currentAST.child = formal_part_opt_AST; + currentAST.advanceChildToEnd(); + } + formal_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = formal_part_opt_AST; +} + +void AdaParser::renames() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST renames_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 258 "ada.g" + RefAdaAST dummy; +#line 1742 "AdaParser.cpp" + + match(RENAMES); + { + switch ( LA(1)) { + case IDENTIFIER: + { + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case CHAR_STRING: + { + dummy=definable_operator_symbol(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 262 "ada.g" + pop_def_id(); +#line 1772 "AdaParser.cpp" + } + renames_AST = RefAdaAST(currentAST.root); + returnAST = renames_AST; +} + +void AdaParser::is_separate_or_abstract_or_decl( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST is_separate_or_abstract_or_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case IS: + { + match(IS); + separate_or_abstract(t); + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 305 "ada.g" + pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, PROCEDURE_DECLARATION); + else + Set(t, FUNCTION_DECLARATION); + +#line 1802 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = is_separate_or_abstract_or_decl_AST; +} + +void AdaParser::def_designator( + boolean lib_level +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST def_designator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 330 "ada.g" + RefAdaAST d; +#line 1823 "AdaParser.cpp" + + if (((LA(1) == IDENTIFIER) && (_tokenSet_7.member(LA(2))))&&( lib_level )) { + compound_name(); + if (inputState->guessing==0) { + n_AST = returnAST; + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 332 "ada.g" + push_def_id(n_AST); +#line 1834 "AdaParser.cpp" + } + def_designator_AST = RefAdaAST(currentAST.root); + } + else if (((LA(1) == IDENTIFIER || LA(1) == CHAR_STRING) && (LA(2) == LPAREN || LA(2) == IS || LA(2) == RETURN))&&( !lib_level )) { + d=designator(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 333 "ada.g" + push_def_id(d); +#line 1846 "AdaParser.cpp" + } + def_designator_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = def_designator_AST; +} + +void AdaParser::function_tail() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST function_tail_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + func_formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RETURN); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail_AST = RefAdaAST(currentAST.root); + returnAST = function_tail_AST; +} + +void AdaParser::generic_inst() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_inst_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(NEW); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 179 "ada.g" + pop_def_id(); +#line 1910 "AdaParser.cpp" + } + generic_inst_AST = RefAdaAST(currentAST.root); + returnAST = generic_inst_AST; +} + +void AdaParser::value_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST value_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + value(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + value(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop445; + } + + } + _loop445:; + } // ( ... )* + if ( inputState->guessing==0 ) { + value_s_AST = RefAdaAST(currentAST.root); +#line 1405 "ada.g" + value_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(VALUES,"VALUES")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(value_s_AST)))); +#line 1945 "AdaParser.cpp" + currentAST.root = value_s_AST; + if ( value_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + value_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = value_s_AST->getFirstChild(); + else + currentAST.child = value_s_AST; + currentAST.advanceChildToEnd(); + } + value_s_AST = RefAdaAST(currentAST.root); + returnAST = value_s_AST; +} + +void AdaParser::parenth_values() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST parenth_values_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(LPAREN); + value(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + value(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop46; + } + + } + _loop46:; + } // ( ... )* + match(RPAREN); + parenth_values_AST = RefAdaAST(currentAST.root); + returnAST = parenth_values_AST; +} + +void AdaParser::value() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST value_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case OTHERS: + { + RefAdaAST tmp60_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp60_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp60_AST)); + } + match(OTHERS); + match(RIGHT_SHAFT); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + ranged_expr_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RIGHT_SHAFT: + { + RefAdaAST tmp62_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp62_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp62_AST)); + } + match(RIGHT_SHAFT); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case COMMA: + case RPAREN: + case WITH: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + value_AST = RefAdaAST(currentAST.root); + returnAST = value_AST; +} + +void AdaParser::ranged_expr_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST ranged_expr_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + ranged_expr(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == PIPE)) { + RefAdaAST tmp63_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp63_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp63_AST)); + } + match(PIPE); + ranged_expr(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop52; + } + + } + _loop52:; + } // ( ... )* + ranged_expr_s_AST = RefAdaAST(currentAST.root); + returnAST = ranged_expr_s_AST; +} + +void AdaParser::ranged_expr() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST ranged_expr_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case DOT_DOT: + { + RefAdaAST tmp64_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp64_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp64_AST)); + } + match(DOT_DOT); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case RANGE: + { + RefAdaAST tmp65_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp65_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp65_AST)); + } + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case PIPE: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + ranged_expr_AST = RefAdaAST(currentAST.root); + returnAST = ranged_expr_AST; +} + +void AdaParser::simple_expression() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST simple_expression_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + signed_term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PLUS: + { + RefAdaAST tmp66_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp66_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp66_AST)); + } + match(PLUS); + signed_term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case MINUS: + { + RefAdaAST tmp67_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp67_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp67_AST)); + } + match(MINUS); + signed_term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case CONCAT: + { + RefAdaAST tmp68_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp68_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp68_AST)); + } + match(CONCAT); + signed_term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop458; + } + } + } + _loop458:; + } // ( ... )* + simple_expression_AST = RefAdaAST(currentAST.root); + returnAST = simple_expression_AST; +} + +void AdaParser::range() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched59 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) { + int _m59 = mark(); + synPredMatched59 = true; + inputState->guessing++; + try { + { + range_dots(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched59 = false; + } + rewind(_m59); + inputState->guessing--; + } + if ( synPredMatched59 ) { + range_dots(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else if ((LA(1) == IDENTIFIER) && (LA(2) == LPAREN || LA(2) == DOT || LA(2) == TIC)) { + range_attrib_ref(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + range_AST = RefAdaAST(currentAST.root); + returnAST = range_AST; +} + +void AdaParser::range_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 203 "ada.g" + Set(r_AST, RANGE_CONSTRAINT); +#line 2287 "AdaParser.cpp" + } + range_constraint_AST = RefAdaAST(currentAST.root); + returnAST = range_constraint_AST; +} + +void AdaParser::range_dots() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_dots_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + RefAdaAST tmp69_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp69_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp69_AST)); + } + match(DOT_DOT); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_dots_AST = RefAdaAST(currentAST.root); + returnAST = range_dots_AST; +} + +void AdaParser::range_attrib_ref() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_attrib_ref_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + prefix(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(TIC); + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(RANGE); + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + break; + } + case SEMI: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case RANGE: + case DIGITS: + case IS: + case PIPE: + case DOT_DOT: + case ASSIGN: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 219 "ada.g" + Set(r_AST, RANGE_ATTRIBUTE_REFERENCE); +#line 2374 "AdaParser.cpp" + } + range_attrib_ref_AST = RefAdaAST(currentAST.root); + returnAST = range_attrib_ref_AST; +} + +void AdaParser::prefix() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prefix_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp73_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp73_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp73_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case DOT: + { + RefAdaAST tmp74_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp74_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp74_AST)); + } + match(DOT); + { + switch ( LA(1)) { + case ALL: + { + RefAdaAST tmp75_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp75_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp75_AST)); + } + match(ALL); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp76_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp76_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp76_AST)); + } + match(IDENTIFIER); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case LPAREN: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 228 "ada.g" + Set(p_AST, INDEXED_COMPONENT); +#line 2450 "AdaParser.cpp" + } + break; + } + default: + { + goto _loop66; + } + } + } + _loop66:; + } // ( ... )* + prefix_AST = RefAdaAST(currentAST.root); + returnAST = prefix_AST; +} + +void AdaParser::parameter_specification() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST parameter_specification_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_ids_colon(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + mode_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + parameter_specification_AST = RefAdaAST(currentAST.root); +#line 240 "ada.g" + parameter_specification_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PARAMETER_SPECIFICATION,"PARAMETER_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(parameter_specification_AST)))); +#line 2492 "AdaParser.cpp" + currentAST.root = parameter_specification_AST; + if ( parameter_specification_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + parameter_specification_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = parameter_specification_AST->getFirstChild(); + else + currentAST.child = parameter_specification_AST; + currentAST.advanceChildToEnd(); + } + parameter_specification_AST = RefAdaAST(currentAST.root); + returnAST = parameter_specification_AST; +} + +void AdaParser::def_ids_colon() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST def_ids_colon_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + defining_identifier_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(COLON); + def_ids_colon_AST = RefAdaAST(currentAST.root); + returnAST = def_ids_colon_AST; +} + +void AdaParser::mode_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST mode_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IN: + { + RefAdaAST tmp79_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp79_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp79_AST)); + } + match(IN); + { + switch ( LA(1)) { + case OUT: + { + RefAdaAST tmp80_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp80_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp80_AST)); + } + match(OUT); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case OUT: + { + RefAdaAST tmp81_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp81_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp81_AST)); + } + match(OUT); + break; + } + case ACCESS: + { + RefAdaAST tmp82_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp82_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp82_AST)); + } + match(ACCESS); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + mode_opt_AST = RefAdaAST(currentAST.root); +#line 255 "ada.g" + mode_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(mode_opt_AST)))); +#line 2592 "AdaParser.cpp" + currentAST.root = mode_opt_AST; + if ( mode_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + mode_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = mode_opt_AST->getFirstChild(); + else + currentAST.child = mode_opt_AST; + currentAST.advanceChildToEnd(); + } + mode_opt_AST = RefAdaAST(currentAST.root); + returnAST = mode_opt_AST; +} + +void AdaParser::init_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST init_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ASSIGN: + { + match(ASSIGN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case RPAREN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + init_opt_AST = RefAdaAST(currentAST.root); +#line 468 "ada.g" + init_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(INIT_OPT,"INIT_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(init_opt_AST)))); +#line 2636 "AdaParser.cpp" + currentAST.root = init_opt_AST; + if ( init_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + init_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = init_opt_AST->getFirstChild(); + else + currentAST.child = init_opt_AST; + currentAST.advanceChildToEnd(); + } + init_opt_AST = RefAdaAST(currentAST.root); + returnAST = init_opt_AST; +} + +void AdaParser::defining_identifier_list() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST defining_identifier_list_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp84_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp84_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp84_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + RefAdaAST tmp86_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp86_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp86_AST)); + } + match(IDENTIFIER); + } + else { + goto _loop75; + } + + } + _loop75:; + } // ( ... )* + if ( inputState->guessing==0 ) { + defining_identifier_list_AST = RefAdaAST(currentAST.root); +#line 249 "ada.g" + defining_identifier_list_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DEFINING_IDENTIFIER_LIST,"DEFINING_IDENTIFIER_LIST")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(defining_identifier_list_AST)))); +#line 2683 "AdaParser.cpp" + currentAST.root = defining_identifier_list_AST; + if ( defining_identifier_list_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + defining_identifier_list_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = defining_identifier_list_AST->getFirstChild(); + else + currentAST.child = defining_identifier_list_AST; + currentAST.advanceChildToEnd(); + } + defining_identifier_list_AST = RefAdaAST(currentAST.root); + returnAST = defining_identifier_list_AST; +} + +void AdaParser::name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 265 "ada.g" + RefAdaAST dummy; +#line 2704 "AdaParser.cpp" + + RefAdaAST tmp87_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp87_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp87_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case DOT: + { + RefAdaAST tmp88_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp88_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp88_AST)); + } + match(DOT); + { + switch ( LA(1)) { + case ALL: + { + RefAdaAST tmp89_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp89_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp89_AST)); + } + match(ALL); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp90_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp90_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp90_AST)); + } + match(IDENTIFIER); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp91_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp91_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp91_AST)); + } + match(CHARACTER_LITERAL); + break; + } + case CHAR_STRING: + { + dummy=is_operator(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case LPAREN: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 273 "ada.g" + Set(p_AST, INDEXED_COMPONENT); +#line 2787 "AdaParser.cpp" + } + break; + } + case TIC: + { + RefAdaAST tmp93_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp93_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp93_AST)); + } + match(TIC); + attribute_id(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop84; + } + } + } + _loop84:; + } // ( ... )* + name_AST = RefAdaAST(currentAST.root); + returnAST = name_AST; +} + +RefAdaAST AdaParser::definable_operator_symbol() { +#line 285 "ada.g" + RefAdaAST d; +#line 2820 "AdaParser.cpp" + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST definable_operator_symbol_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken op = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST op_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if (!( definable_operator(LT(1)->getText().c_str()) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" definable_operator(LT(1)->getText().c_str()) "); + op = LT(1); + if ( inputState->guessing == 0 ) { + op_AST = astFactory->create(op); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(op_AST)); + } + match(CHAR_STRING); + if ( inputState->guessing==0 ) { +#line 287 "ada.g" + op_AST->setType(OPERATOR_SYMBOL); d=op_AST; +#line 2838 "AdaParser.cpp" + } + definable_operator_symbol_AST = RefAdaAST(currentAST.root); + returnAST = definable_operator_symbol_AST; + return d; +} + +RefAdaAST AdaParser::is_operator() { +#line 280 "ada.g" + RefAdaAST d; +#line 2848 "AdaParser.cpp" + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST is_operator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken op = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST op_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if (!( is_operator_symbol(LT(1)->getText().c_str()) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" is_operator_symbol(LT(1)->getText().c_str()) "); + op = LT(1); + if ( inputState->guessing == 0 ) { + op_AST = astFactory->create(op); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(op_AST)); + } + match(CHAR_STRING); + if ( inputState->guessing==0 ) { +#line 282 "ada.g" + op_AST->setType(OPERATOR_SYMBOL); d=op_AST; +#line 2866 "AdaParser.cpp" + } + is_operator_AST = RefAdaAST(currentAST.root); + returnAST = is_operator_AST; + return d; +} + +void AdaParser::parenthesized_primary() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST parenthesized_primary_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pp = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pp_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + pp = LT(1); + if ( inputState->guessing == 0 ) { + pp_AST = astFactory->create(pp); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pp_AST)); + } + match(LPAREN); + { + if ((LA(1) == NuLL) && (LA(2) == RECORD)) { + RefAdaAST tmp94_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp94_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp94_AST)); + } + match(NuLL); + match(RECORD); + } + else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2)))) { + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + extension_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 295 "ada.g" + Set(pp_AST, PARENTHESIZED_PRIMARY); +#line 2915 "AdaParser.cpp" + } + parenthesized_primary_AST = RefAdaAST(currentAST.root); + returnAST = parenthesized_primary_AST; +} + +void AdaParser::extension_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST extension_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case WITH: + { + match(WITH); + { + if ((LA(1) == NuLL) && (LA(2) == RECORD)) { + RefAdaAST tmp98_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp98_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp98_AST)); + } + match(NuLL); + match(RECORD); + } + else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_11.member(LA(2)))) { + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + break; + } + case RPAREN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + extension_opt_AST = RefAdaAST(currentAST.root); +#line 299 "ada.g" + extension_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(EXTENSION_OPT,"EXTENSION_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(extension_opt_AST)))); +#line 2969 "AdaParser.cpp" + currentAST.root = extension_opt_AST; + if ( extension_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + extension_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = extension_opt_AST->getFirstChild(); + else + currentAST.child = extension_opt_AST; + currentAST.advanceChildToEnd(); + } + extension_opt_AST = RefAdaAST(currentAST.root); + returnAST = extension_opt_AST; +} + +void AdaParser::separate_or_abstract( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST separate_or_abstract_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case SEPARATE: + { + match(SEPARATE); + if ( inputState->guessing==0 ) { +#line 315 "ada.g" + pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, PROCEDURE_BODY_STUB); + else + Set(t, FUNCTION_BODY_STUB); + +#line 3001 "AdaParser.cpp" + } + break; + } + case ABSTRACT: + { + match(ABSTRACT); + if ( inputState->guessing==0 ) { +#line 322 "ada.g" + pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, ABSTRACT_PROCEDURE_DECLARATION); + else + Set(t, ABSTRACT_FUNCTION_DECLARATION); + +#line 3016 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = separate_or_abstract_AST; +} + +RefAdaAST AdaParser::designator() { +#line 336 "ada.g" + RefAdaAST d; +#line 3031 "AdaParser.cpp" + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST designator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 336 "ada.g" + RefAdaAST op; +#line 3039 "AdaParser.cpp" + + switch ( LA(1)) { + case CHAR_STRING: + { + op=definable_operator_symbol(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 338 "ada.g" + d = op; +#line 3051 "AdaParser.cpp" + } + designator_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST)); + } + match(IDENTIFIER); + if ( inputState->guessing==0 ) { +#line 339 "ada.g" + d = n_AST; +#line 3067 "AdaParser.cpp" + } + designator_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = designator_AST; + return d; +} + +void AdaParser::func_formal_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST func_formal_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + func_param(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == SEMI)) { + match(SEMI); + func_param(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop100; + } + + } + _loop100:; + } // ( ... )* + match(RPAREN); + break; + } + case RETURN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + func_formal_part_opt_AST = RefAdaAST(currentAST.root); +#line 348 "ada.g" + func_formal_part_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(FORMAL_PART_OPT,"FORMAL_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(func_formal_part_opt_AST)))); +#line 3129 "AdaParser.cpp" + currentAST.root = func_formal_part_opt_AST; + if ( func_formal_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + func_formal_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = func_formal_part_opt_AST->getFirstChild(); + else + currentAST.child = func_formal_part_opt_AST; + currentAST.advanceChildToEnd(); + } + func_formal_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = func_formal_part_opt_AST; +} + +void AdaParser::func_param() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST func_param_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_ids_colon(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + in_access_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + func_param_AST = RefAdaAST(currentAST.root); +#line 354 "ada.g" + func_param_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PARAMETER_SPECIFICATION,"PARAMETER_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(func_param_AST)))); +#line 3168 "AdaParser.cpp" + currentAST.root = func_param_AST; + if ( func_param_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + func_param_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = func_param_AST->getFirstChild(); + else + currentAST.child = func_param_AST; + currentAST.advanceChildToEnd(); + } + func_param_AST = RefAdaAST(currentAST.root); + returnAST = func_param_AST; +} + +void AdaParser::in_access_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST in_access_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IN: + { + RefAdaAST tmp105_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp105_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp105_AST)); + } + match(IN); + break; + } + case ACCESS: + { + RefAdaAST tmp106_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp106_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp106_AST)); + } + match(ACCESS); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + in_access_opt_AST = RefAdaAST(currentAST.root); +#line 360 "ada.g" + in_access_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(in_access_opt_AST)))); +#line 3222 "AdaParser.cpp" + currentAST.root = in_access_opt_AST; + if ( in_access_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + in_access_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = in_access_opt_AST->getFirstChild(); + else + currentAST.child = in_access_opt_AST; + currentAST.advanceChildToEnd(); + } + in_access_opt_AST = RefAdaAST(currentAST.root); + returnAST = in_access_opt_AST; +} + +void AdaParser::pkg_spec_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST pkg_spec_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + basic_declarative_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + private_declarative_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + pkg_spec_part_AST = RefAdaAST(currentAST.root); + returnAST = pkg_spec_part_AST; +} + +void AdaParser::basic_declarative_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST basic_declarative_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + { + basic_decl_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop114; + } + } + } + _loop114:; + } // ( ... )* + if ( inputState->guessing==0 ) { + basic_declarative_items_opt_AST = RefAdaAST(currentAST.root); +#line 385 "ada.g" + basic_declarative_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BASIC_DECLARATIVE_ITEMS_OPT,"BASIC_DECLARATIVE_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(basic_declarative_items_opt_AST)))); +#line 3303 "AdaParser.cpp" + currentAST.root = basic_declarative_items_opt_AST; + if ( basic_declarative_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + basic_declarative_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = basic_declarative_items_opt_AST->getFirstChild(); + else + currentAST.child = basic_declarative_items_opt_AST; + currentAST.advanceChildToEnd(); + } + basic_declarative_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = basic_declarative_items_opt_AST; +} + +void AdaParser::private_declarative_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST private_declarative_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + { + basic_decl_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop111; + } + } + } + _loop111:; + } // ( ... )* + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + private_declarative_items_opt_AST = RefAdaAST(currentAST.root); +#line 378 "ada.g" + private_declarative_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PRIVATE_DECLARATIVE_ITEMS_OPT,"PRIVATE_DECLARATIVE_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(private_declarative_items_opt_AST)))); +#line 3380 "AdaParser.cpp" + currentAST.root = private_declarative_items_opt_AST; + if ( private_declarative_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + private_declarative_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = private_declarative_items_opt_AST->getFirstChild(); + else + currentAST.child = private_declarative_items_opt_AST; + currentAST.advanceChildToEnd(); + } + private_declarative_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = private_declarative_items_opt_AST; +} + +void AdaParser::end_id_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST end_id_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST e_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + e = LT(1); + if ( inputState->guessing == 0 ) { + e_AST = astFactory->create(e); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(e_AST)); + } + match(END); + id_opt_aux(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1176 "ada.g" + Set(e_AST, END_ID_OPT); +#line 3413 "AdaParser.cpp" + } + end_id_opt_AST = RefAdaAST(currentAST.root); + returnAST = end_id_opt_AST; +} + +void AdaParser::basic_decl_item() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST basic_decl_item_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pkg = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pkg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken tsk = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST tsk_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pro = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pro_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case PACKAGE: + { + pkg = LT(1); + if ( inputState->guessing == 0 ) { + pkg_AST = astFactory->create(pkg); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pkg_AST)); + } + match(PACKAGE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + spec_decl_part(pkg_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + case TASK: + { + tsk = LT(1); + if ( inputState->guessing == 0 ) { + tsk_AST = astFactory->create(tsk); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tsk_AST)); + } + match(TASK); + task_type_or_single_decl(tsk_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + case PROTECTED: + { + pro = LT(1); + if ( inputState->guessing == 0 ) { + pro_AST = astFactory->create(pro); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pro_AST)); + } + match(PROTECTED); + prot_type_or_single_decl(pro_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + case PROCEDURE: + case FUNCTION: + { + subprog_decl(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + case USE: + case TYPE: + case FOR: + case SUBTYPE: + case GENERIC: + { + decl_common(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + basic_decl_item_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = basic_decl_item_AST; +} + +void AdaParser::basic_declarative_items() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST basic_declarative_items_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt117=0; + for (;;) { + switch ( LA(1)) { + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + { + basic_decl_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + if ( _cnt117>=1 ) { goto _loop117; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + } + _cnt117++; + } + _loop117:; + } // ( ... )+ + if ( inputState->guessing==0 ) { + basic_declarative_items_AST = RefAdaAST(currentAST.root); +#line 392 "ada.g" + basic_declarative_items_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BASIC_DECLARATIVE_ITEMS_OPT,"BASIC_DECLARATIVE_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(basic_declarative_items_AST)))); +#line 3562 "AdaParser.cpp" + currentAST.root = basic_declarative_items_AST; + if ( basic_declarative_items_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + basic_declarative_items_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = basic_declarative_items_AST->getFirstChild(); + else + currentAST.child = basic_declarative_items_AST; + currentAST.advanceChildToEnd(); + } + basic_declarative_items_AST = RefAdaAST(currentAST.root); + returnAST = basic_declarative_items_AST; +} + +void AdaParser::task_type_or_single_decl( + RefAdaAST tsk +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST task_type_or_single_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case TYPE: + { + match(TYPE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrim_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + task_definition_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 408 "ada.g" + Set(tsk, TASK_TYPE_DECLARATION); +#line 3601 "AdaParser.cpp" + } + task_type_or_single_decl_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + task_definition_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 410 "ada.g" + Set(tsk, SINGLE_TASK_DECLARATION); +#line 3619 "AdaParser.cpp" + } + task_type_or_single_decl_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = task_type_or_single_decl_AST; +} + +void AdaParser::prot_type_or_single_decl( + RefAdaAST pro +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_type_or_single_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case TYPE: + { + match(TYPE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrim_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + protected_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 539 "ada.g" + Set(pro, PROTECTED_TYPE_DECLARATION); +#line 3658 "AdaParser.cpp" + } + prot_type_or_single_decl_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + protected_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 541 "ada.g" + Set(pro, SINGLE_PROTECTED_DECLARATION); +#line 3676 "AdaParser.cpp" + } + prot_type_or_single_decl_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = prot_type_or_single_decl_AST; +} + +void AdaParser::decl_common() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST decl_common_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken erd = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST erd_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken ord = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST ord_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken od = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST od_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case TYPE: + { + t = LT(1); + if ( inputState->guessing == 0 ) { + t_AST = astFactory->create(t); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST)); + } + match(TYPE); + RefAdaAST tmp111_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp111_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp111_AST)); + } + match(IDENTIFIER); + { + switch ( LA(1)) { + case IS: + { + match(IS); + type_def(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case LPAREN: + { + { + switch ( LA(1)) { + case LPAREN: + { + discrim_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + match(IS); + derived_or_private_or_record(t_AST, true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 587 "ada.g" + Set(t_AST, INCOMPLETE_TYPE_DECLARATION); +#line 3759 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case SEMI: + { + empty_discrim_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 590 "ada.g" + Set(t_AST, INCOMPLETE_TYPE_DECLARATION); +#line 3780 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + case SUBTYPE: + { + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(SUBTYPE); + RefAdaAST tmp115_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp115_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp115_AST)); + } + match(IDENTIFIER); + match(IS); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 604 "ada.g" + Set(s_AST, SUBTYPE_DECLARATION); +#line 3825 "AdaParser.cpp" + } + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + case GENERIC: + { + generic_decl(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + case USE: + { + use_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + case FOR: + { + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(FOR); + { + bool synPredMatched184 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == USE))) { + int _m184 = mark(); + synPredMatched184 = true; + inputState->guessing++; + try { + { + local_enum_name(); + match(USE); + match(LPAREN); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched184 = false; + } + rewind(_m184); + inputState->guessing--; + } + if ( synPredMatched184 ) { + local_enum_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(USE); + enumeration_aggregate(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 609 "ada.g" + Set(r_AST, ENUMERATION_REPESENTATION_CLAUSE); +#line 3888 "AdaParser.cpp" + } + } + else if ((LA(1) == IDENTIFIER) && (LA(2) == DOT || LA(2) == USE || LA(2) == TIC)) { + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(USE); + rep_spec_part(r_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + match(SEMI); + decl_common_AST = RefAdaAST(currentAST.root); + break; + } + default: + bool synPredMatched186 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == COLON))) { + int _m186 = mark(); + synPredMatched186 = true; + inputState->guessing++; + try { + { + match(IDENTIFIER); + match(COLON); + match(EXCEPTION); + match(RENAMES); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched186 = false; + } + rewind(_m186); + inputState->guessing--; + } + if ( synPredMatched186 ) { + RefAdaAST tmp121_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp121_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp121_AST)); + } + match(IDENTIFIER); + erd = LT(1); + if ( inputState->guessing == 0 ) { + erd_AST = astFactory->create(erd); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(erd_AST)); + } + match(COLON); + match(EXCEPTION); + match(RENAMES); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 615 "ada.g" + Set(erd_AST, EXCEPTION_RENAMING_DECLARATION); +#line 3954 "AdaParser.cpp" + } + decl_common_AST = RefAdaAST(currentAST.root); + } + else { + bool synPredMatched188 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == COLON))) { + int _m188 = mark(); + synPredMatched188 = true; + inputState->guessing++; + try { + { + match(IDENTIFIER); + match(COLON); + subtype_mark(); + match(RENAMES); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched188 = false; + } + rewind(_m188); + inputState->guessing--; + } + if ( synPredMatched188 ) { + RefAdaAST tmp125_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp125_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp125_AST)); + } + match(IDENTIFIER); + ord = LT(1); + if ( inputState->guessing == 0 ) { + ord_AST = astFactory->create(ord); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(ord_AST)); + } + match(COLON); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RENAMES); + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 618 "ada.g" + Set(ord_AST, OBJECT_RENAMING_DECLARATION); +#line 4004 "AdaParser.cpp" + } + decl_common_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == IDENTIFIER) && (LA(2) == COMMA || LA(2) == COLON)) { + defining_identifier_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + od = LT(1); + if ( inputState->guessing == 0 ) { + od_AST = astFactory->create(od); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(od_AST)); + } + match(COLON); + { + if ((LA(1) == EXCEPTION)) { + match(EXCEPTION); + if ( inputState->guessing==0 ) { +#line 621 "ada.g" + Set(od_AST, EXCEPTION_DECLARATION); +#line 4025 "AdaParser.cpp" + } + } + else { + bool synPredMatched191 = false; + if (((LA(1) == CONSTANT) && (LA(2) == ASSIGN))) { + int _m191 = mark(); + synPredMatched191 = true; + inputState->guessing++; + try { + { + match(CONSTANT); + match(ASSIGN); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched191 = false; + } + rewind(_m191); + inputState->guessing--; + } + if ( synPredMatched191 ) { + match(CONSTANT); + match(ASSIGN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 623 "ada.g" + Set(od_AST, NUMBER_DECLARATION); +#line 4056 "AdaParser.cpp" + } + } + else if ((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2)))) { + aliased_constant_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case ARRAY: + { + array_type_definition(od_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 626 "ada.g" + Set(od_AST, ARRAY_OBJECT_DECLARATION); +#line 4079 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + { + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 630 "ada.g" + Set(od_AST, OBJECT_DECLARATION); +#line 4096 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + decl_common_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + }} + returnAST = decl_common_AST; +} + +void AdaParser::discrim_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrim_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + discrim_part_text(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case IS: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + discrim_part_opt_AST = RefAdaAST(currentAST.root); +#line 420 "ada.g" + discrim_part_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discrim_part_opt_AST)))); +#line 4153 "AdaParser.cpp" + currentAST.root = discrim_part_opt_AST; + if ( discrim_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discrim_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discrim_part_opt_AST->getFirstChild(); + else + currentAST.child = discrim_part_opt_AST; + currentAST.advanceChildToEnd(); + } + discrim_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = discrim_part_opt_AST; +} + +void AdaParser::task_definition_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST task_definition_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case IS: + { + match(IS); + task_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + private_task_items_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + task_definition_opt_AST = RefAdaAST(currentAST.root); + break; + } + case SEMI: + { + match(SEMI); + if ( inputState->guessing==0 ) { +#line 415 "ada.g" + pop_def_id(); +#line 4197 "AdaParser.cpp" + } + task_definition_opt_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = task_definition_opt_AST; +} + +void AdaParser::task_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST task_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((LA(1) == PRAGMA)) { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop138; + } + + } + _loop138:; + } // ( ... )* + entrydecls_repspecs_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + task_items_opt_AST = RefAdaAST(currentAST.root); +#line 473 "ada.g" + task_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TASK_ITEMS_OPT,"TASK_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(task_items_opt_AST)))); +#line 4239 "AdaParser.cpp" + currentAST.root = task_items_opt_AST; + if ( task_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + task_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = task_items_opt_AST->getFirstChild(); + else + currentAST.child = task_items_opt_AST; + currentAST.advanceChildToEnd(); + } + task_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = task_items_opt_AST; +} + +void AdaParser::private_task_items_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST private_task_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + { // ( ... )* + for (;;) { + if ((LA(1) == PRAGMA)) { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop163; + } + + } + _loop163:; + } // ( ... )* + entrydecls_repspecs_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + private_task_items_opt_AST = RefAdaAST(currentAST.root); +#line 530 "ada.g" + private_task_items_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PRIVATE_TASK_ITEMS_OPT,"PRIVATE_TASK_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(private_task_items_opt_AST)))); +#line 4298 "AdaParser.cpp" + currentAST.root = private_task_items_opt_AST; + if ( private_task_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + private_task_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = private_task_items_opt_AST->getFirstChild(); + else + currentAST.child = private_task_items_opt_AST; + currentAST.advanceChildToEnd(); + } + private_task_items_opt_AST = RefAdaAST(currentAST.root); + returnAST = private_task_items_opt_AST; +} + +void AdaParser::discrim_part_text() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrim_part_text_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(LPAREN); + { + switch ( LA(1)) { + case BOX: + { + RefAdaAST tmp137_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp137_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp137_AST)); + } + match(BOX); + break; + } + case IDENTIFIER: + { + discriminant_specifications(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(RPAREN); + discrim_part_text_AST = RefAdaAST(currentAST.root); + returnAST = discrim_part_text_AST; +} + +void AdaParser::discriminant_specifications() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_specifications_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + discriminant_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == SEMI)) { + match(SEMI); + discriminant_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop130; + } + + } + _loop130:; + } // ( ... )* + if ( inputState->guessing==0 ) { + discriminant_specifications_AST = RefAdaAST(currentAST.root); +#line 450 "ada.g" + discriminant_specifications_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIMINANT_SPECIFICATIONS,"DISCRIMINANT_SPECIFICATIONS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discriminant_specifications_AST)))); +#line 4378 "AdaParser.cpp" + currentAST.root = discriminant_specifications_AST; + if ( discriminant_specifications_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discriminant_specifications_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discriminant_specifications_AST->getFirstChild(); + else + currentAST.child = discriminant_specifications_AST; + currentAST.advanceChildToEnd(); + } + discriminant_specifications_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_specifications_AST; +} + +void AdaParser::known_discrim_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST known_discrim_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(LPAREN); + discriminant_specifications(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { + known_discrim_part_AST = RefAdaAST(currentAST.root); +#line 430 "ada.g" + known_discrim_part_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(known_discrim_part_AST)))); +#line 4407 "AdaParser.cpp" + currentAST.root = known_discrim_part_AST; + if ( known_discrim_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + known_discrim_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = known_discrim_part_AST->getFirstChild(); + else + currentAST.child = known_discrim_part_AST; + currentAST.advanceChildToEnd(); + } + known_discrim_part_AST = RefAdaAST(currentAST.root); + returnAST = known_discrim_part_AST; +} + +void AdaParser::empty_discrim_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST empty_discrim_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if ( inputState->guessing==0 ) { + empty_discrim_opt_AST = RefAdaAST(currentAST.root); +#line 436 "ada.g" + empty_discrim_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(empty_discrim_opt_AST)))); +#line 4430 "AdaParser.cpp" + currentAST.root = empty_discrim_opt_AST; + if ( empty_discrim_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + empty_discrim_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = empty_discrim_opt_AST->getFirstChild(); + else + currentAST.child = empty_discrim_opt_AST; + currentAST.advanceChildToEnd(); + } + empty_discrim_opt_AST = RefAdaAST(currentAST.root); + returnAST = empty_discrim_opt_AST; +} + +void AdaParser::discrim_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrim_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + discrim_part_text(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + discrim_part_AST = RefAdaAST(currentAST.root); +#line 443 "ada.g" + discrim_part_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discrim_part_AST)))); +#line 4457 "AdaParser.cpp" + currentAST.root = discrim_part_AST; + if ( discrim_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discrim_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discrim_part_AST->getFirstChild(); + else + currentAST.child = discrim_part_AST; + currentAST.advanceChildToEnd(); + } + discrim_part_AST = RefAdaAST(currentAST.root); + returnAST = discrim_part_AST; +} + +void AdaParser::discriminant_specification() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_specification_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_ids_colon(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + access_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + discriminant_specification_AST = RefAdaAST(currentAST.root); +#line 457 "ada.g" + discriminant_specification_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIMINANT_SPECIFICATION,"DISCRIMINANT_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discriminant_specification_AST)))); +#line 4496 "AdaParser.cpp" + currentAST.root = discriminant_specification_AST; + if ( discriminant_specification_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discriminant_specification_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discriminant_specification_AST->getFirstChild(); + else + currentAST.child = discriminant_specification_AST; + currentAST.advanceChildToEnd(); + } + discriminant_specification_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_specification_AST; +} + +void AdaParser::access_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST access_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ACCESS: + { + RefAdaAST tmp142_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp142_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp142_AST)); + } + match(ACCESS); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + access_opt_AST = RefAdaAST(currentAST.root); +#line 464 "ada.g" + access_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(access_opt_AST)))); +#line 4540 "AdaParser.cpp" + currentAST.root = access_opt_AST; + if ( access_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + access_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = access_opt_AST->getFirstChild(); + else + currentAST.child = access_opt_AST; + currentAST.advanceChildToEnd(); + } + access_opt_AST = RefAdaAST(currentAST.root); + returnAST = access_opt_AST; +} + +void AdaParser::entrydecls_repspecs_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entrydecls_repspecs_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((LA(1) == ENTRY)) { + entry_declaration(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case FOR: + { + rep_spec(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop142; + } + } + } + _loop142:; + } // ( ... )* + } + else { + goto _loop143; + } + + } + _loop143:; + } // ( ... )* + entrydecls_repspecs_opt_AST = RefAdaAST(currentAST.root); + returnAST = entrydecls_repspecs_opt_AST; +} + +void AdaParser::entry_declaration() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_declaration_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST e_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + e = LT(1); + if ( inputState->guessing == 0 ) { + e_AST = astFactory->create(e); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(e_AST)); + } + match(ENTRY); + RefAdaAST tmp143_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp143_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp143_AST)); + } + match(IDENTIFIER); + discrete_subtype_def_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 482 "ada.g" + Set (e_AST, ENTRY_DECLARATION); +#line 4635 "AdaParser.cpp" + } + entry_declaration_AST = RefAdaAST(currentAST.root); + returnAST = entry_declaration_AST; +} + +void AdaParser::rep_spec() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST rep_spec_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(FOR); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(USE); + rep_spec_part(r_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + rep_spec_AST = RefAdaAST(currentAST.root); + returnAST = rep_spec_AST; +} + +void AdaParser::discrete_subtype_def_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrete_subtype_def_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched148 = false; + if (((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2))))) { + int _m148 = mark(); + synPredMatched148 = true; + inputState->guessing++; + try { + { + match(LPAREN); + discrete_subtype_definition(); + match(RPAREN); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched148 = false; + } + rewind(_m148); + inputState->guessing--; + } + if ( synPredMatched148 ) { + match(LPAREN); + discrete_subtype_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + } + else if ((LA(1) == SEMI || LA(1) == LPAREN) && (_tokenSet_14.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + discrete_subtype_def_opt_AST = RefAdaAST(currentAST.root); +#line 489 "ada.g" + discrete_subtype_def_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRETE_SUBTYPE_DEF_OPT,"DISCRETE_SUBTYPE_DEF_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discrete_subtype_def_opt_AST)))); +#line 4712 "AdaParser.cpp" + currentAST.root = discrete_subtype_def_opt_AST; + if ( discrete_subtype_def_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discrete_subtype_def_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discrete_subtype_def_opt_AST->getFirstChild(); + else + currentAST.child = discrete_subtype_def_opt_AST; + currentAST.advanceChildToEnd(); + } + discrete_subtype_def_opt_AST = RefAdaAST(currentAST.root); + returnAST = discrete_subtype_def_opt_AST; +} + +void AdaParser::discrete_subtype_definition() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrete_subtype_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched152 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) { + int _m152 = mark(); + synPredMatched152 = true; + inputState->guessing++; + try { + { + range(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched152 = false; + } + rewind(_m152); + inputState->guessing--; + } + if ( synPredMatched152 ) { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_15.member(LA(2)))) { + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + discrete_subtype_definition_AST = RefAdaAST(currentAST.root); + returnAST = discrete_subtype_definition_AST; +} + +void AdaParser::subtype_ind() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subtype_ind_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + subtype_ind_AST = RefAdaAST(currentAST.root); +#line 693 "ada.g" + subtype_ind_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SUBTYPE_INDICATION,"SUBTYPE_INDICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(subtype_ind_AST)))); +#line 4785 "AdaParser.cpp" + currentAST.root = subtype_ind_AST; + if ( subtype_ind_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + subtype_ind_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = subtype_ind_AST->getFirstChild(); + else + currentAST.child = subtype_ind_AST; + currentAST.advanceChildToEnd(); + } + subtype_ind_AST = RefAdaAST(currentAST.root); + returnAST = subtype_ind_AST; +} + +void AdaParser::rep_spec_part( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST rep_spec_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case RECORD: + { + match(RECORD); + align_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + comp_loc_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(RECORD); + if ( inputState->guessing==0 ) { +#line 512 "ada.g" + Set(t, RECORD_REPRESENTATION_CLAUSE); +#line 4822 "AdaParser.cpp" + } + rep_spec_part_AST = RefAdaAST(currentAST.root); + break; + } + case AT: + { + match(AT); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 514 "ada.g" + Set(t, AT_CLAUSE); +#line 4837 "AdaParser.cpp" + } + rep_spec_part_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 517 "ada.g" + Set(t, ATTRIBUTE_DEFINITION_CLAUSE); +#line 4861 "AdaParser.cpp" + } + rep_spec_part_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = rep_spec_part_AST; +} + +void AdaParser::align_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST align_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case AT: + { + match(AT); + match(MOD); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + case PRAGMA: + case IDENTIFIER: + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + align_opt_AST = RefAdaAST(currentAST.root); +#line 521 "ada.g" + align_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MOD_CLAUSE_OPT,"MOD_CLAUSE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(align_opt_AST)))); +#line 4908 "AdaParser.cpp" + currentAST.root = align_opt_AST; + if ( align_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + align_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = align_opt_AST->getFirstChild(); + else + currentAST.child = align_opt_AST; + currentAST.advanceChildToEnd(); + } + align_opt_AST = RefAdaAST(currentAST.root); + returnAST = align_opt_AST; +} + +void AdaParser::comp_loc_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST comp_loc_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(AT); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + default: + { + goto _loop159; + } + } + } + _loop159:; + } // ( ... )* + if ( inputState->guessing==0 ) { + comp_loc_s_AST = RefAdaAST(currentAST.root); +#line 525 "ada.g" + comp_loc_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_CLAUSES_OPT,"COMPONENT_CLAUSES_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(comp_loc_s_AST)))); +#line 4968 "AdaParser.cpp" + currentAST.root = comp_loc_s_AST; + if ( comp_loc_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + comp_loc_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = comp_loc_s_AST->getFirstChild(); + else + currentAST.child = comp_loc_s_AST; + currentAST.advanceChildToEnd(); + } + comp_loc_s_AST = RefAdaAST(currentAST.root); + returnAST = comp_loc_s_AST; +} + +void AdaParser::protected_definition() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST protected_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(IS); + prot_op_decl_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_private_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + protected_definition_AST = RefAdaAST(currentAST.root); + returnAST = protected_definition_AST; +} + +void AdaParser::prot_private_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_private_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + case PROCEDURE: + case FUNCTION: + case ENTRY: + case FOR: + { + prot_op_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + comp_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop168; + } + } + } + _loop168:; + } // ( ... )* + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + prot_private_opt_AST = RefAdaAST(currentAST.root); +#line 545 "ada.g" + prot_private_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_PRIVATE_OPT,"PROT_PRIVATE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_private_opt_AST)))); +#line 5061 "AdaParser.cpp" + currentAST.root = prot_private_opt_AST; + if ( prot_private_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + prot_private_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = prot_private_opt_AST->getFirstChild(); + else + currentAST.child = prot_private_opt_AST; + currentAST.advanceChildToEnd(); + } + prot_private_opt_AST = RefAdaAST(currentAST.root); + returnAST = prot_private_opt_AST; +} + +void AdaParser::prot_op_decl() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_op_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case ENTRY: + { + entry_declaration(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 561 "ada.g" + pop_def_id(); Set(p_AST, PROCEDURE_DECLARATION); +#line 5113 "AdaParser.cpp" + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 563 "ada.g" + pop_def_id(); Set(f_AST, FUNCTION_DECLARATION); +#line 5138 "AdaParser.cpp" + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + case FOR: + { + rep_spec(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_op_decl_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = prot_op_decl_AST; +} + +void AdaParser::comp_decl() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST comp_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_ids_colon(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + component_subtype_def(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + init_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { + comp_decl_AST = RefAdaAST(currentAST.root); +#line 575 "ada.g" + comp_decl_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_DECLARATION,"COMPONENT_DECLARATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(comp_decl_AST)))); +#line 5192 "AdaParser.cpp" + currentAST.root = comp_decl_AST; + if ( comp_decl_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + comp_decl_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = comp_decl_AST->getFirstChild(); + else + currentAST.child = comp_decl_AST; + currentAST.advanceChildToEnd(); + } + comp_decl_AST = RefAdaAST(currentAST.root); + returnAST = comp_decl_AST; +} + +void AdaParser::prot_op_decl_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_op_decl_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((_tokenSet_16.member(LA(1)))) { + prot_op_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop172; + } + + } + _loop172:; + } // ( ... )* + if ( inputState->guessing==0 ) { + prot_op_decl_s_AST = RefAdaAST(currentAST.root); +#line 555 "ada.g" + prot_op_decl_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_OP_DECLARATIONS,"PROT_OP_DECLARATIONS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_op_decl_s_AST)))); +#line 5229 "AdaParser.cpp" + currentAST.root = prot_op_decl_s_AST; + if ( prot_op_decl_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + prot_op_decl_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = prot_op_decl_s_AST->getFirstChild(); + else + currentAST.child = prot_op_decl_s_AST; + currentAST.advanceChildToEnd(); + } + prot_op_decl_s_AST = RefAdaAST(currentAST.root); + returnAST = prot_op_decl_s_AST; +} + +void AdaParser::prot_member_decl_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_member_decl_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + case PROCEDURE: + case FUNCTION: + case ENTRY: + case FOR: + { + prot_op_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + comp_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop176; + } + } + } + _loop176:; + } // ( ... )* + if ( inputState->guessing==0 ) { + prot_member_decl_s_AST = RefAdaAST(currentAST.root); +#line 569 "ada.g" + prot_member_decl_s_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_MEMBER_DECLARATIONS,"PROT_MEMBER_DECLARATIONS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_member_decl_s_AST)))); +#line 5283 "AdaParser.cpp" + currentAST.root = prot_member_decl_s_AST; + if ( prot_member_decl_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + prot_member_decl_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = prot_member_decl_s_AST->getFirstChild(); + else + currentAST.child = prot_member_decl_s_AST; + currentAST.advanceChildToEnd(); + } + prot_member_decl_s_AST = RefAdaAST(currentAST.root); + returnAST = prot_member_decl_s_AST; +} + +void AdaParser::component_subtype_def() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST component_subtype_def_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + aliased_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + component_subtype_def_AST = RefAdaAST(currentAST.root); + returnAST = component_subtype_def_AST; +} + +void AdaParser::type_def( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST type_def_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + enum_id_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 638 "ada.g" + Set(t, ENUMERATION_TYPE_DECLARATION); +#line 5332 "AdaParser.cpp" + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case RANGE: + { + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 640 "ada.g" + Set(t, SIGNED_INTEGER_TYPE_DECLARATION); +#line 5347 "AdaParser.cpp" + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case MOD: + { + match(MOD); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 642 "ada.g" + Set(t, MODULAR_TYPE_DECLARATION); +#line 5362 "AdaParser.cpp" + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case DIGITS: + { + match(DIGITS); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 644 "ada.g" + Set(t, FLOATING_POINT_DECLARATION); +#line 5381 "AdaParser.cpp" + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case DELTA: + { + match(DELTA); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case RANGE: + { + match(RANGE); + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 647 "ada.g" + Set(t, ORDINARY_FIXED_POINT_DECLARATION); +#line 5405 "AdaParser.cpp" + } + break; + } + case DIGITS: + { + match(DIGITS); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 649 "ada.g" + Set(t, DECIMAL_FIXED_POINT_DECLARATION); +#line 5423 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case ARRAY: + { + array_type_definition(t); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case ACCESS: + { + access_type_definition(t); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + case PRIVATE: + case NEW: + case NuLL: + case RECORD: + case ABSTRACT: + case TAGGED: + case LIMITED: + { + empty_discrim_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + derived_or_private_or_record(t, false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + type_def_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = type_def_AST; +} + +void AdaParser::derived_or_private_or_record( + RefAdaAST t, boolean has_discrim +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST derived_or_private_or_record_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched246 = false; + if (((LA(1) == NEW || LA(1) == ABSTRACT) && (LA(2) == IDENTIFIER || LA(2) == NEW))) { + int _m246 = mark(); + synPredMatched246 = true; + inputState->guessing++; + try { + { + { + switch ( LA(1)) { + case ABSTRACT: + { + match(ABSTRACT); + break; + } + case NEW: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(NEW); + subtype_ind(); + match(WITH); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched246 = false; + } + rewind(_m246); + inputState->guessing--; + } + if ( synPredMatched246 ) { + abstract_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(NEW); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(WITH); + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + if ( inputState->guessing==0 ) { +#line 772 "ada.g" + Set(t, PRIVATE_EXTENSION_DECLARATION); +#line 5542 "AdaParser.cpp" + } + break; + } + case NuLL: + case RECORD: + { + record_definition(has_discrim); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 774 "ada.g" + Set(t, DERIVED_RECORD_EXTENSION); +#line 5556 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + derived_or_private_or_record_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == NEW) && (LA(2) == IDENTIFIER)) { + match(NEW); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 776 "ada.g" + Set(t, ORDINARY_DERIVED_TYPE_DECLARATION); +#line 5577 "AdaParser.cpp" + } + derived_or_private_or_record_AST = RefAdaAST(currentAST.root); + } + else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_18.member(LA(2)))) { + abstract_tagged_limited_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PRIVATE: + { + match(PRIVATE); + if ( inputState->guessing==0 ) { +#line 778 "ada.g" + Set(t, PRIVATE_TYPE_DECLARATION); +#line 5594 "AdaParser.cpp" + } + break; + } + case NuLL: + case RECORD: + { + record_definition(has_discrim); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 780 "ada.g" + Set(t, RECORD_TYPE_DECLARATION); +#line 5608 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + derived_or_private_or_record_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = derived_or_private_or_record_AST; +} + +void AdaParser::local_enum_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST local_enum_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp177_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp177_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp177_AST)); + } + match(IDENTIFIER); + local_enum_name_AST = RefAdaAST(currentAST.root); + returnAST = local_enum_name_AST; +} + +void AdaParser::enumeration_aggregate() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST enumeration_aggregate_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + parenth_values(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + enumeration_aggregate_AST = RefAdaAST(currentAST.root); + returnAST = enumeration_aggregate_AST; +} + +void AdaParser::aliased_constant_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST aliased_constant_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ALIASED: + { + RefAdaAST tmp178_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp178_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp178_AST)); + } + match(ALIASED); + break; + } + case IDENTIFIER: + case CONSTANT: + case ARRAY: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case CONSTANT: + { + RefAdaAST tmp179_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp179_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp179_AST)); + } + match(CONSTANT); + break; + } + case IDENTIFIER: + case ARRAY: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + aliased_constant_opt_AST = RefAdaAST(currentAST.root); +#line 858 "ada.g" + aliased_constant_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(aliased_constant_opt_AST)))); +#line 5712 "AdaParser.cpp" + currentAST.root = aliased_constant_opt_AST; + if ( aliased_constant_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + aliased_constant_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = aliased_constant_opt_AST->getFirstChild(); + else + currentAST.child = aliased_constant_opt_AST; + currentAST.advanceChildToEnd(); + } + aliased_constant_opt_AST = RefAdaAST(currentAST.root); + returnAST = aliased_constant_opt_AST; +} + +void AdaParser::array_type_definition( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST array_type_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(ARRAY); + match(LPAREN); + index_or_discrete_range_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + match(OF); + component_subtype_def(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 669 "ada.g" + Set(t, ARRAY_TYPE_DECLARATION); +#line 5747 "AdaParser.cpp" + } + array_type_definition_AST = RefAdaAST(currentAST.root); + returnAST = array_type_definition_AST; +} + +void AdaParser::enum_id_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST enum_id_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + enumeration_literal_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + enumeration_literal_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop197; + } + + } + _loop197:; + } // ( ... )* + enum_id_s_AST = RefAdaAST(currentAST.root); + returnAST = enum_id_s_AST; +} + +void AdaParser::range_constraint_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_constraint_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case RANGE: + { + range_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case WITH: + case ASSIGN: + case LOOP: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + range_constraint_opt_AST = RefAdaAST(currentAST.root); + returnAST = range_constraint_opt_AST; +} + +void AdaParser::access_type_definition( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST access_type_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(ACCESS); + { + switch ( LA(1)) { + case PROCEDURE: + case FUNCTION: + case PROTECTED: + { + protected_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case PROCEDURE: + { + match(PROCEDURE); + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 751 "ada.g" + Set(t, ACCESS_TO_PROCEDURE_DECLARATION); +#line 5846 "AdaParser.cpp" + } + break; + } + case FUNCTION: + { + match(FUNCTION); + func_formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RETURN); + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 753 "ada.g" + Set(t, ACCESS_TO_FUNCTION_DECLARATION); +#line 5865 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case IDENTIFIER: + case ALL: + case CONSTANT: + { + constant_all_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 756 "ada.g" + Set(t, ACCESS_TO_OBJECT_DECLARATION); +#line 5892 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + access_type_definition_AST = RefAdaAST(currentAST.root); + returnAST = access_type_definition_AST; +} + +void AdaParser::enumeration_literal_specification() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST enumeration_literal_specification_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case IDENTIFIER: + { + RefAdaAST tmp189_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp189_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp189_AST)); + } + match(IDENTIFIER); + enumeration_literal_specification_AST = RefAdaAST(currentAST.root); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp190_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp190_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp190_AST)); + } + match(CHARACTER_LITERAL); + enumeration_literal_specification_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = enumeration_literal_specification_AST; +} + +void AdaParser::index_or_discrete_range_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST index_or_discrete_range_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + index_or_discrete_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + RefAdaAST tmp191_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp191_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp191_AST)); + } + match(COMMA); + index_or_discrete_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop204; + } + + } + _loop204:; + } // ( ... )* + index_or_discrete_range_s_AST = RefAdaAST(currentAST.root); + returnAST = index_or_discrete_range_s_AST; +} + +void AdaParser::index_or_discrete_range() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST index_or_discrete_range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case DOT_DOT: + { + RefAdaAST tmp192_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp192_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp192_AST)); + } + match(DOT_DOT); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case RANGE: + { + RefAdaAST tmp193_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp193_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp193_AST)); + } + match(RANGE); + { + switch ( LA(1)) { + case BOX: + { + RefAdaAST tmp194_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp194_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp194_AST)); + } + match(BOX); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case COMMA: + case RPAREN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + index_or_discrete_range_AST = RefAdaAST(currentAST.root); + returnAST = index_or_discrete_range_AST; +} + +void AdaParser::aliased_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST aliased_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ALIASED: + { + RefAdaAST tmp195_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp195_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp195_AST)); + } + match(ALIASED); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + aliased_opt_AST = RefAdaAST(currentAST.root); +#line 689 "ada.g" + aliased_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(aliased_opt_AST)))); +#line 6093 "AdaParser.cpp" + currentAST.root = aliased_opt_AST; + if ( aliased_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + aliased_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = aliased_opt_AST->getFirstChild(); + else + currentAST.child = aliased_opt_AST; + currentAST.advanceChildToEnd(); + } + aliased_opt_AST = RefAdaAST(currentAST.root); + returnAST = aliased_opt_AST; +} + +void AdaParser::constraint_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST constraint_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case RANGE: + { + range_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case DIGITS: + { + digits_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case DELTA: + { + delta_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case WITH: + case ASSIGN: + case LOOP: + { + break; + } + default: + bool synPredMatched215 = false; + if (((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2))))) { + int _m215 = mark(); + synPredMatched215 = true; + inputState->guessing++; + try { + { + index_constraint(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched215 = false; + } + rewind(_m215); + inputState->guessing--; + } + if ( synPredMatched215 ) { + index_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else if ((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2)))) { + discriminant_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + constraint_opt_AST = RefAdaAST(currentAST.root); + returnAST = constraint_opt_AST; +} + +void AdaParser::digits_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST digits_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken d = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST d_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + d = LT(1); + if ( inputState->guessing == 0 ) { + d_AST = astFactory->create(d); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST)); + } + match(DIGITS); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 706 "ada.g" + Set(d_AST, DIGITS_CONSTRAINT); +#line 6208 "AdaParser.cpp" + } + digits_constraint_AST = RefAdaAST(currentAST.root); + returnAST = digits_constraint_AST; +} + +void AdaParser::delta_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST delta_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken d = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST d_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + d = LT(1); + if ( inputState->guessing == 0 ) { + d_AST = astFactory->create(d); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST)); + } + match(DELTA); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 710 "ada.g" + Set(d_AST, DELTA_CONSTRAINT); +#line 6238 "AdaParser.cpp" + } + delta_constraint_AST = RefAdaAST(currentAST.root); + returnAST = delta_constraint_AST; +} + +void AdaParser::index_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST index_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + discrete_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + discrete_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop220; + } + + } + _loop220:; + } // ( ... )* + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 714 "ada.g" + Set(p_AST, INDEX_CONSTRAINT); +#line 6281 "AdaParser.cpp" + } + index_constraint_AST = RefAdaAST(currentAST.root); + returnAST = index_constraint_AST; +} + +void AdaParser::discriminant_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + discriminant_association(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + discriminant_association(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop226; + } + + } + _loop226:; + } // ( ... )* + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 724 "ada.g" + Set(p_AST, DISCRIMINANT_CONSTRAINT); +#line 6324 "AdaParser.cpp" + } + discriminant_constraint_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_constraint_AST; +} + +void AdaParser::discrete_range() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrete_range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched223 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) { + int _m223 = mark(); + synPredMatched223 = true; + inputState->guessing++; + try { + { + range(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched223 = false; + } + rewind(_m223); + inputState->guessing--; + } + if ( synPredMatched223 ) { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_range_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_19.member(LA(2)))) { + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_range_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = discrete_range_AST; +} + +void AdaParser::discriminant_association() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_association_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + selector_names_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + discriminant_association_AST = RefAdaAST(currentAST.root); +#line 728 "ada.g" + discriminant_association_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIMINANT_ASSOCIATION,"DISCRIMINANT_ASSOCIATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discriminant_association_AST)))); +#line 6390 "AdaParser.cpp" + currentAST.root = discriminant_association_AST; + if ( discriminant_association_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + discriminant_association_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = discriminant_association_AST->getFirstChild(); + else + currentAST.child = discriminant_association_AST; + currentAST.advanceChildToEnd(); + } + discriminant_association_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_association_AST; +} + +void AdaParser::selector_names_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST selector_names_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched231 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == RIGHT_SHAFT || LA(2) == PIPE))) { + int _m231 = mark(); + synPredMatched231 = true; + inputState->guessing++; + try { + { + association_head(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched231 = false; + } + rewind(_m231); + inputState->guessing--; + } + if ( synPredMatched231 ) { + association_head(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + selector_names_opt_AST = RefAdaAST(currentAST.root); +#line 736 "ada.g" + selector_names_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SELECTOR_NAMES_OPT,"SELECTOR_NAMES_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(selector_names_opt_AST)))); +#line 6443 "AdaParser.cpp" + currentAST.root = selector_names_opt_AST; + if ( selector_names_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + selector_names_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = selector_names_opt_AST->getFirstChild(); + else + currentAST.child = selector_names_opt_AST; + currentAST.advanceChildToEnd(); + } + selector_names_opt_AST = RefAdaAST(currentAST.root); + returnAST = selector_names_opt_AST; +} + +void AdaParser::association_head() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST association_head_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + selector_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == PIPE)) { + match(PIPE); + selector_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop234; + } + + } + _loop234:; + } // ( ... )* + match(RIGHT_SHAFT); + association_head_AST = RefAdaAST(currentAST.root); + returnAST = association_head_AST; +} + +void AdaParser::selector_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST selector_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp202_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp202_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp202_AST)); + } + match(IDENTIFIER); + selector_name_AST = RefAdaAST(currentAST.root); + returnAST = selector_name_AST; +} + +void AdaParser::protected_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST protected_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PROTECTED: + { + RefAdaAST tmp203_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp203_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp203_AST)); + } + match(PROTECTED); + break; + } + case PROCEDURE: + case FUNCTION: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + protected_opt_AST = RefAdaAST(currentAST.root); +#line 761 "ada.g" + protected_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(protected_opt_AST)))); +#line 6533 "AdaParser.cpp" + currentAST.root = protected_opt_AST; + if ( protected_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + protected_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = protected_opt_AST->getFirstChild(); + else + currentAST.child = protected_opt_AST; + currentAST.advanceChildToEnd(); + } + protected_opt_AST = RefAdaAST(currentAST.root); + returnAST = protected_opt_AST; +} + +void AdaParser::constant_all_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST constant_all_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case CONSTANT: + { + RefAdaAST tmp204_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp204_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp204_AST)); + } + match(CONSTANT); + break; + } + case ALL: + { + RefAdaAST tmp205_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp205_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp205_AST)); + } + match(ALL); + break; + } + case IDENTIFIER: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + constant_all_opt_AST = RefAdaAST(currentAST.root); +#line 765 "ada.g" + constant_all_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(constant_all_opt_AST)))); +#line 6588 "AdaParser.cpp" + currentAST.root = constant_all_opt_AST; + if ( constant_all_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + constant_all_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = constant_all_opt_AST->getFirstChild(); + else + currentAST.child = constant_all_opt_AST; + currentAST.advanceChildToEnd(); + } + constant_all_opt_AST = RefAdaAST(currentAST.root); + returnAST = constant_all_opt_AST; +} + +void AdaParser::abstract_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST abstract_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ABSTRACT: + { + RefAdaAST tmp206_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp206_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp206_AST)); + } + match(ABSTRACT); + break; + } + case NEW: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + abstract_opt_AST = RefAdaAST(currentAST.root); +#line 785 "ada.g" + abstract_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(abstract_opt_AST)))); +#line 6632 "AdaParser.cpp" + currentAST.root = abstract_opt_AST; + if ( abstract_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + abstract_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = abstract_opt_AST->getFirstChild(); + else + currentAST.child = abstract_opt_AST; + currentAST.advanceChildToEnd(); + } + abstract_opt_AST = RefAdaAST(currentAST.root); + returnAST = abstract_opt_AST; +} + +void AdaParser::record_definition( + boolean has_discrim +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST record_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case RECORD: + { + match(RECORD); + component_list(has_discrim); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(RECORD); + record_definition_AST = RefAdaAST(currentAST.root); + break; + } + case NuLL: + { + match(NuLL); + match(RECORD); + record_definition_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = record_definition_AST; +} + +void AdaParser::abstract_tagged_limited_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST abstract_tagged_limited_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ABSTRACT: + { + RefAdaAST tmp212_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp212_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp212_AST)); + } + match(ABSTRACT); + match(TAGGED); + break; + } + case TAGGED: + { + RefAdaAST tmp214_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp214_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp214_AST)); + } + match(TAGGED); + break; + } + case PRIVATE: + case NuLL: + case RECORD: + case LIMITED: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case LIMITED: + { + RefAdaAST tmp215_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp215_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp215_AST)); + } + match(LIMITED); + break; + } + case PRIVATE: + case NuLL: + case RECORD: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + abstract_tagged_limited_opt_AST = RefAdaAST(currentAST.root); +#line 847 "ada.g" + abstract_tagged_limited_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(abstract_tagged_limited_opt_AST)))); +#line 6750 "AdaParser.cpp" + currentAST.root = abstract_tagged_limited_opt_AST; + if ( abstract_tagged_limited_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + abstract_tagged_limited_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = abstract_tagged_limited_opt_AST->getFirstChild(); + else + currentAST.child = abstract_tagged_limited_opt_AST; + currentAST.advanceChildToEnd(); + } + abstract_tagged_limited_opt_AST = RefAdaAST(currentAST.root); + returnAST = abstract_tagged_limited_opt_AST; +} + +void AdaParser::component_list( + boolean has_discrim +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST component_list_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case NuLL: + { + match(NuLL); + match(SEMI); + component_list_AST = RefAdaAST(currentAST.root); + break; + } + case PRAGMA: + case IDENTIFIER: + { + component_items(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case CASE: + { + variant_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if (!( has_discrim )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" has_discrim "); + break; + } + case END: + case WHEN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + component_list_AST = RefAdaAST(currentAST.root); + break; + } + case CASE: + { + empty_component_items(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + variant_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if (!( has_discrim )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" has_discrim "); + component_list_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = component_list_AST; +} + +void AdaParser::component_items() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST component_items_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt256=0; + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + comp_decl(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + if ( _cnt256>=1 ) { goto _loop256; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + } + _cnt256++; + } + _loop256:; + } // ( ... )+ + if ( inputState->guessing==0 ) { + component_items_AST = RefAdaAST(currentAST.root); +#line 800 "ada.g" + component_items_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_ITEMS,"COMPONENT_ITEMS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(component_items_AST)))); +#line 6873 "AdaParser.cpp" + currentAST.root = component_items_AST; + if ( component_items_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + component_items_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = component_items_AST->getFirstChild(); + else + currentAST.child = component_items_AST; + currentAST.advanceChildToEnd(); + } + component_items_AST = RefAdaAST(currentAST.root); + returnAST = component_items_AST; +} + +void AdaParser::variant_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST variant_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken c = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST c_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + c = LT(1); + if ( inputState->guessing == 0 ) { + c_AST = astFactory->create(c); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(c_AST)); + } + match(CASE); + discriminant_direct_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + variant_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(CASE); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 812 "ada.g" + Set (c_AST, VARIANT_PART); +#line 6914 "AdaParser.cpp" + } + variant_part_AST = RefAdaAST(currentAST.root); + returnAST = variant_part_AST; +} + +void AdaParser::empty_component_items() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST empty_component_items_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if ( inputState->guessing==0 ) { + empty_component_items_AST = RefAdaAST(currentAST.root); +#line 806 "ada.g" + empty_component_items_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_ITEMS,"COMPONENT_ITEMS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(empty_component_items_AST)))); +#line 6930 "AdaParser.cpp" + currentAST.root = empty_component_items_AST; + if ( empty_component_items_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + empty_component_items_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = empty_component_items_AST->getFirstChild(); + else + currentAST.child = empty_component_items_AST; + currentAST.advanceChildToEnd(); + } + empty_component_items_AST = RefAdaAST(currentAST.root); + returnAST = empty_component_items_AST; +} + +void AdaParser::discriminant_direct_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminant_direct_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp222_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp222_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp222_AST)); + } + match(IDENTIFIER); + discriminant_direct_name_AST = RefAdaAST(currentAST.root); + returnAST = discriminant_direct_name_AST; +} + +void AdaParser::variant_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST variant_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt262=0; + for (;;) { + if ((LA(1) == WHEN)) { + variant(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + if ( _cnt262>=1 ) { goto _loop262; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + + _cnt262++; + } + _loop262:; + } // ( ... )+ + if ( inputState->guessing==0 ) { + variant_s_AST = RefAdaAST(currentAST.root); +#line 819 "ada.g" + variant_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(VARIANTS,"VARIANTS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(variant_s_AST)))); +#line 6984 "AdaParser.cpp" + currentAST.root = variant_s_AST; + if ( variant_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + variant_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = variant_s_AST->getFirstChild(); + else + currentAST.child = variant_s_AST; + currentAST.advanceChildToEnd(); + } + variant_s_AST = RefAdaAST(currentAST.root); + returnAST = variant_s_AST; +} + +void AdaParser::variant() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST variant_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WHEN); + choice_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RIGHT_SHAFT); + component_list(true); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 823 "ada.g" + Set (w_AST, VARIANT); +#line 7022 "AdaParser.cpp" + } + variant_AST = RefAdaAST(currentAST.root); + returnAST = variant_AST; +} + +void AdaParser::choice_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST choice_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + choice(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == PIPE)) { + RefAdaAST tmp224_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp224_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp224_AST)); + } + match(PIPE); + choice(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop266; + } + + } + _loop266:; + } // ( ... )* + choice_s_AST = RefAdaAST(currentAST.root); + returnAST = choice_s_AST; +} + +void AdaParser::choice() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST choice_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + if ((LA(1) == OTHERS)) { + RefAdaAST tmp225_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp225_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp225_AST)); + } + match(OTHERS); + choice_AST = RefAdaAST(currentAST.root); + } + else { + bool synPredMatched269 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_20.member(LA(2))))) { + int _m269 = mark(); + synPredMatched269 = true; + inputState->guessing++; + try { + { + discrete_with_range(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched269 = false; + } + rewind(_m269); + inputState->guessing--; + } + if ( synPredMatched269 ) { + discrete_with_range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + choice_AST = RefAdaAST(currentAST.root); + } + else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_21.member(LA(2)))) { + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + choice_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = choice_AST; +} + +void AdaParser::discrete_with_range() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discrete_with_range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched272 = false; + if (((LA(1) == IDENTIFIER) && (LA(2) == DOT || LA(2) == TIC || LA(2) == RANGE))) { + int _m272 = mark(); + synPredMatched272 = true; + inputState->guessing++; + try { + { + mark_with_constraint(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched272 = false; + } + rewind(_m272); + inputState->guessing--; + } + if ( synPredMatched272 ) { + mark_with_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_with_range_AST = RefAdaAST(currentAST.root); + } + else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2)))) { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_with_range_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = discrete_with_range_AST; +} + +void AdaParser::mark_with_constraint() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST mark_with_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_constraint(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + mark_with_constraint_AST = RefAdaAST(currentAST.root); +#line 839 "ada.g" + mark_with_constraint_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MARK_WITH_CONSTRAINT,"MARK_WITH_CONSTRAINT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(mark_with_constraint_AST)))); +#line 7174 "AdaParser.cpp" + currentAST.root = mark_with_constraint_AST; + if ( mark_with_constraint_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + mark_with_constraint_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = mark_with_constraint_AST->getFirstChild(); + else + currentAST.child = mark_with_constraint_AST; + currentAST.advanceChildToEnd(); + } + mark_with_constraint_AST = RefAdaAST(currentAST.root); + returnAST = mark_with_constraint_AST; +} + +void AdaParser::generic_formal_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_formal_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case USE: + { + use_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case WITH: + case TYPE: + { + generic_formal_parameter(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop289; + } + } + } + _loop289:; + } // ( ... )* + if ( inputState->guessing==0 ) { + generic_formal_part_opt_AST = RefAdaAST(currentAST.root); +#line 885 "ada.g" + generic_formal_part_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(GENERIC_FORMAL_PART,"GENERIC_FORMAL_PART")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(generic_formal_part_opt_AST)))); +#line 7234 "AdaParser.cpp" + currentAST.root = generic_formal_part_opt_AST; + if ( generic_formal_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + generic_formal_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = generic_formal_part_opt_AST->getFirstChild(); + else + currentAST.child = generic_formal_part_opt_AST; + currentAST.advanceChildToEnd(); + } + generic_formal_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = generic_formal_part_opt_AST; +} + +void AdaParser::generic_formal_parameter() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST generic_formal_parameter_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case TYPE: + { + t = LT(1); + if ( inputState->guessing == 0 ) { + t_AST = astFactory->create(t); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST)); + } + match(TYPE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + match(IS); + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + match(BOX); + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 895 "ada.g" + Set (t_AST, FORMAL_DISCRETE_TYPE_DECLARATION); +#line 7285 "AdaParser.cpp" + } + break; + } + case RANGE: + { + match(RANGE); + match(BOX); + if ( inputState->guessing==0 ) { +#line 897 "ada.g" + Set (t_AST, FORMAL_SIGNED_INTEGER_TYPE_DECLARATION); +#line 7296 "AdaParser.cpp" + } + break; + } + case MOD: + { + match(MOD); + match(BOX); + if ( inputState->guessing==0 ) { +#line 899 "ada.g" + Set (t_AST, FORMAL_MODULAR_TYPE_DECLARATION); +#line 7307 "AdaParser.cpp" + } + break; + } + case DELTA: + { + match(DELTA); + match(BOX); + { + switch ( LA(1)) { + case DIGITS: + { + match(DIGITS); + match(BOX); + if ( inputState->guessing==0 ) { +#line 902 "ada.g" + Set (t_AST, FORMAL_DECIMAL_FIXED_POINT_DECLARATION); +#line 7324 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 903 "ada.g" + Set (t_AST, FORMAL_ORDINARY_FIXED_POINT_DECLARATION); +#line 7333 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case DIGITS: + { + match(DIGITS); + match(BOX); + if ( inputState->guessing==0 ) { +#line 906 "ada.g" + Set (t_AST, FORMAL_FLOATING_POINT_DECLARATION); +#line 7352 "AdaParser.cpp" + } + break; + } + case ARRAY: + { + array_type_definition(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case ACCESS: + { + access_type_definition(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRIVATE: + case NEW: + case ABSTRACT: + case TAGGED: + case LIMITED: + { + empty_discrim_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discriminable_type_definition(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case LPAREN: + { + discrim_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + discriminable_type_definition(t_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 913 "ada.g" + pop_def_id(); +#line 7418 "AdaParser.cpp" + } + break; + } + case WITH: + { + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WITH); + { + switch ( LA(1)) { + case PROCEDURE: + { + match(PROCEDURE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subprogram_default_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 915 "ada.g" + Set(w_AST, FORMAL_PROCEDURE_DECLARATION); +#line 7450 "AdaParser.cpp" + } + break; + } + case FUNCTION: + { + match(FUNCTION); + def_designator(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + subprogram_default_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 917 "ada.g" + Set(w_AST, FORMAL_FUNCTION_DECLARATION); +#line 7472 "AdaParser.cpp" + } + break; + } + case PACKAGE: + { + match(PACKAGE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + match(NEW); + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_package_actual_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 919 "ada.g" + Set(w_AST, FORMAL_PACKAGE_DECLARATION); +#line 7496 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 921 "ada.g" + pop_def_id(); +#line 7509 "AdaParser.cpp" + } + break; + } + case IDENTIFIER: + { + parameter_specification(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + generic_formal_parameter_AST = RefAdaAST(currentAST.root); + returnAST = generic_formal_parameter_AST; +} + +void AdaParser::discriminable_type_definition( + RefAdaAST t +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST discriminable_type_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched299 = false; + if (((LA(1) == NEW || LA(1) == ABSTRACT) && (LA(2) == IDENTIFIER || LA(2) == NEW))) { + int _m299 = mark(); + synPredMatched299 = true; + inputState->guessing++; + try { + { + { + switch ( LA(1)) { + case ABSTRACT: + { + match(ABSTRACT); + break; + } + case NEW: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(NEW); + subtype_ind(); + match(WITH); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched299 = false; + } + rewind(_m299); + inputState->guessing--; + } + if ( synPredMatched299 ) { + abstract_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(NEW); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(WITH); + match(PRIVATE); + if ( inputState->guessing==0 ) { +#line 930 "ada.g" + Set (t, FORMAL_PRIVATE_EXTENSION_DECLARATION); +#line 7589 "AdaParser.cpp" + } + discriminable_type_definition_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == NEW) && (LA(2) == IDENTIFIER)) { + match(NEW); + subtype_ind(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 932 "ada.g" + Set (t, FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION); +#line 7602 "AdaParser.cpp" + } + discriminable_type_definition_AST = RefAdaAST(currentAST.root); + } + else if ((_tokenSet_22.member(LA(1))) && (_tokenSet_23.member(LA(2)))) { + abstract_tagged_limited_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(PRIVATE); + if ( inputState->guessing==0 ) { +#line 934 "ada.g" + Set (t, FORMAL_PRIVATE_TYPE_DECLARATION); +#line 7615 "AdaParser.cpp" + } + discriminable_type_definition_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = discriminable_type_definition_AST; +} + +void AdaParser::subprogram_default_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprogram_default_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IS: + { + match(IS); + { + switch ( LA(1)) { + case BOX: + { + RefAdaAST tmp253_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp253_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp253_AST)); + } + match(BOX); + break; + } + case IDENTIFIER: + { + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + subprogram_default_opt_AST = RefAdaAST(currentAST.root); + returnAST = subprogram_default_opt_AST; +} + +void AdaParser::formal_package_actual_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST formal_package_actual_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LPAREN: + { + match(LPAREN); + { + switch ( LA(1)) { + case BOX: + { + RefAdaAST tmp255_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp255_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp255_AST)); + } + match(BOX); + break; + } + case IDENTIFIER: + { + defining_identifier_list(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(RPAREN); + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + formal_package_actual_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = formal_package_actual_part_opt_AST; +} + +void AdaParser::body_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST body_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + declarative_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + block_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + body_part_AST = RefAdaAST(currentAST.root); + returnAST = body_part_AST; +} + +void AdaParser::declarative_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST declarative_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + { + declarative_item(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop316; + } + } + } + _loop316:; + } // ( ... )* + if ( inputState->guessing==0 ) { + declarative_part_AST = RefAdaAST(currentAST.root); +#line 978 "ada.g" + declarative_part_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DECLARATIVE_PART,"DECLARATIVE_PART")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(declarative_part_AST)))); +#line 7799 "AdaParser.cpp" + currentAST.root = declarative_part_AST; + if ( declarative_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + declarative_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = declarative_part_AST->getFirstChild(); + else + currentAST.child = declarative_part_AST; + currentAST.advanceChildToEnd(); + } + declarative_part_AST = RefAdaAST(currentAST.root); + returnAST = declarative_part_AST; +} + +void AdaParser::block_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST block_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken b = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST b_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + b = LT(1); + if ( inputState->guessing == 0 ) { + b_AST = astFactory->create(b); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(b_AST)); + } + match(BEGIN); + handled_stmt_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1058 "ada.g" + Set(b_AST, BLOCK_BODY); +#line 7832 "AdaParser.cpp" + } + block_body_AST = RefAdaAST(currentAST.root); + returnAST = block_body_AST; +} + +void AdaParser::declarative_item() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST declarative_item_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pkg = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pkg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken tsk = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST tsk_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken pro = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST pro_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PACKAGE: + { + pkg = LT(1); + if ( inputState->guessing == 0 ) { + pkg_AST = astFactory->create(pkg); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pkg_AST)); + } + match(PACKAGE); + { + switch ( LA(1)) { + case BODY: + { + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case SEPARATE: + { + separate(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 986 "ada.g" + Set(pkg_AST, PACKAGE_BODY_STUB); +#line 7878 "AdaParser.cpp" + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case END: + case SUBTYPE: + case GENERIC: + case BEGIN: + { + pkg_body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 988 "ada.g" + Set(pkg_AST, PACKAGE_BODY); +#line 7904 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + case IDENTIFIER: + { + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + spec_decl_part(pkg_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case TASK: + { + tsk = LT(1); + if ( inputState->guessing == 0 ) { + tsk_AST = astFactory->create(tsk); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tsk_AST)); + } + match(TASK); + { + switch ( LA(1)) { + case BODY: + { + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case SEPARATE: + { + separate(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 994 "ada.g" + Set(tsk_AST, TASK_BODY_STUB); +#line 7964 "AdaParser.cpp" + } + break; + } + case PRAGMA: + case IDENTIFIER: + case USE: + case TYPE: + case PACKAGE: + case PROCEDURE: + case FUNCTION: + case TASK: + case PROTECTED: + case FOR: + case SUBTYPE: + case GENERIC: + case BEGIN: + { + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 995 "ada.g" + Set(tsk_AST, TASK_BODY); +#line 7989 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + case IDENTIFIER: + case TYPE: + { + task_type_or_single_decl(tsk_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case PROTECTED: + { + pro = LT(1); + if ( inputState->guessing == 0 ) { + pro_AST = astFactory->create(pro); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pro_AST)); + } + match(PROTECTED); + { + switch ( LA(1)) { + case BODY: + { + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case SEPARATE: + { + separate(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1002 "ada.g" + Set(pro_AST, PROTECTED_BODY_STUB); +#line 8046 "AdaParser.cpp" + } + break; + } + case PRAGMA: + case PROCEDURE: + case FUNCTION: + case ENTRY: + case END: + { + prot_op_bodies_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1004 "ada.g" + Set(pro_AST, PROTECTED_BODY); +#line 8067 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case IDENTIFIER: + case TYPE: + { + prot_type_or_single_decl(pro_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + break; + } + case PROCEDURE: + case FUNCTION: + { + subprog_decl_or_rename_or_inst_or_body(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case USE: + case TYPE: + case FOR: + case SUBTYPE: + case GENERIC: + { + decl_common(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + declarative_item_AST = RefAdaAST(currentAST.root); + returnAST = declarative_item_AST; +} + +void AdaParser::body_is() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST body_is_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(BODY); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + body_is_AST = RefAdaAST(currentAST.root); + returnAST = body_is_AST; +} + +void AdaParser::separate() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST separate_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(SEPARATE); + if ( inputState->guessing==0 ) { +#line 1023 "ada.g" + pop_def_id(); +#line 8153 "AdaParser.cpp" + } + separate_AST = RefAdaAST(currentAST.root); + returnAST = separate_AST; +} + +void AdaParser::prot_op_bodies_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST prot_op_bodies_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case ENTRY: + { + entry_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PROCEDURE: + case FUNCTION: + { + subprog_decl_or_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop332; + } + } + } + _loop332:; + } // ( ... )* + if ( inputState->guessing==0 ) { + prot_op_bodies_opt_AST = RefAdaAST(currentAST.root); +#line 1039 "ada.g" + prot_op_bodies_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_OP_BODIES_OPT,"PROT_OP_BODIES_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_op_bodies_opt_AST)))); +#line 8205 "AdaParser.cpp" + currentAST.root = prot_op_bodies_opt_AST; + if ( prot_op_bodies_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + prot_op_bodies_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = prot_op_bodies_opt_AST->getFirstChild(); + else + currentAST.child = prot_op_bodies_opt_AST; + currentAST.advanceChildToEnd(); + } + prot_op_bodies_opt_AST = RefAdaAST(currentAST.root); + returnAST = prot_op_bodies_opt_AST; +} + +void AdaParser::block_body_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST block_body_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case BEGIN: + { + match(BEGIN); + handled_stmt_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + block_body_opt_AST = RefAdaAST(currentAST.root); +#line 1030 "ada.g" + block_body_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BLOCK_BODY_OPT,"BLOCK_BODY_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(block_body_opt_AST)))); +#line 8249 "AdaParser.cpp" + currentAST.root = block_body_opt_AST; + if ( block_body_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + block_body_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = block_body_opt_AST->getFirstChild(); + else + currentAST.child = block_body_opt_AST; + currentAST.advanceChildToEnd(); + } + block_body_opt_AST = RefAdaAST(currentAST.root); + returnAST = block_body_opt_AST; +} + +void AdaParser::handled_stmt_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST handled_stmt_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + except_handler_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + handled_stmt_s_AST = RefAdaAST(currentAST.root); +#line 1062 "ada.g" + handled_stmt_s_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(HANDLED_SEQUENCE_OF_STATEMENTS,"HANDLED_SEQUENCE_OF_STATEMENTS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(handled_stmt_s_AST)))); +#line 8280 "AdaParser.cpp" + currentAST.root = handled_stmt_s_AST; + if ( handled_stmt_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + handled_stmt_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = handled_stmt_s_AST->getFirstChild(); + else + currentAST.child = handled_stmt_s_AST; + currentAST.advanceChildToEnd(); + } + handled_stmt_s_AST = RefAdaAST(currentAST.root); + returnAST = handled_stmt_s_AST; +} + +void AdaParser::entry_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST e_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + e = LT(1); + if ( inputState->guessing == 0 ) { + e_AST = astFactory->create(e); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(e_AST)); + } + match(ENTRY); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_body_formal_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_barrier(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1236 "ada.g" + Set (e_AST, ENTRY_BODY); +#line 8327 "AdaParser.cpp" + } + entry_body_AST = RefAdaAST(currentAST.root); + returnAST = entry_body_AST; +} + +void AdaParser::subprog_decl_or_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprog_decl_or_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1046 "ada.g" + Set(p_AST, PROCEDURE_BODY); +#line 8371 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 1047 "ada.g" + pop_def_id(); Set(p_AST, PROCEDURE_DECLARATION); +#line 8380 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + subprog_decl_or_body_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IS: + { + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1051 "ada.g" + Set(f_AST, FUNCTION_BODY); +#line 8422 "AdaParser.cpp" + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 1052 "ada.g" + pop_def_id(); Set(f_AST, FUNCTION_DECLARATION); +#line 8431 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + subprog_decl_or_body_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = subprog_decl_or_body_AST; +} + +void AdaParser::statements() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST statements_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt342=0; + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case NuLL: + case RETURN: + case FOR: + case CASE: + case BEGIN: + case LT_LT: + case IF: + case LOOP: + case WHILE: + case DECLARE: + case EXIT: + case GOTO: + case ACCEPT: + case DELAY: + case SELECT: + case ABORT: + case RAISE: + case REQUEUE: + { + statement(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + if ( _cnt342>=1 ) { goto _loop342; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + } + _cnt342++; + } + _loop342:; + } // ( ... )+ + if ( inputState->guessing==0 ) { + statements_AST = RefAdaAST(currentAST.root); +#line 1074 "ada.g" + statements_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SEQUENCE_OF_STATEMENTS,"SEQUENCE_OF_STATEMENTS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(statements_AST)))); +#line 8509 "AdaParser.cpp" + currentAST.root = statements_AST; + if ( statements_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + statements_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = statements_AST->getFirstChild(); + else + currentAST.child = statements_AST; + currentAST.advanceChildToEnd(); + } + statements_AST = RefAdaAST(currentAST.root); + returnAST = statements_AST; +} + +void AdaParser::except_handler_part_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST except_handler_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case EXCEPTION: + { + match(EXCEPTION); + { // ( ... )+ + int _cnt429=0; + for (;;) { + if ((LA(1) == WHEN)) { + exception_handler(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + if ( _cnt429>=1 ) { goto _loop429; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + + _cnt429++; + } + _loop429:; + } // ( ... )+ + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + except_handler_part_opt_AST = RefAdaAST(currentAST.root); +#line 1365 "ada.g" + except_handler_part_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(EXCEPT_HANDLER_PART_OPT,"EXCEPT_HANDLER_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(except_handler_part_opt_AST)))); +#line 8566 "AdaParser.cpp" + currentAST.root = except_handler_part_opt_AST; + if ( except_handler_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + except_handler_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = except_handler_part_opt_AST->getFirstChild(); + else + currentAST.child = except_handler_part_opt_AST; + currentAST.advanceChildToEnd(); + } + except_handler_part_opt_AST = RefAdaAST(currentAST.root); + returnAST = except_handler_part_opt_AST; +} + +void AdaParser::handled_stmts_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST handled_stmts_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case PRAGMA: + case IDENTIFIER: + case NuLL: + case RETURN: + case FOR: + case CASE: + case BEGIN: + case LT_LT: + case IF: + case LOOP: + case WHILE: + case DECLARE: + case EXIT: + case GOTO: + case ACCEPT: + case DELAY: + case SELECT: + case ABORT: + case RAISE: + case REQUEUE: + { + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + except_handler_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + handled_stmts_opt_AST = RefAdaAST(currentAST.root); +#line 1068 "ada.g" + handled_stmts_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(HANDLED_STMTS_OPT,"HANDLED_STMTS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(handled_stmts_opt_AST)))); +#line 8632 "AdaParser.cpp" + currentAST.root = handled_stmts_opt_AST; + if ( handled_stmts_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + handled_stmts_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = handled_stmts_opt_AST->getFirstChild(); + else + currentAST.child = handled_stmts_opt_AST; + currentAST.advanceChildToEnd(); + } + handled_stmts_opt_AST = RefAdaAST(currentAST.root); + returnAST = handled_stmts_opt_AST; +} + +void AdaParser::statement() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST statement_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + def_label_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case NuLL: + { + null_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case EXIT: + { + exit_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case RETURN: + { + return_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case GOTO: + { + goto_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case DELAY: + { + delay_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case ABORT: + { + abort_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case RAISE: + { + raise_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case REQUEUE: + { + requeue_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case ACCEPT: + { + accept_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SELECT: + { + select_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IF: + { + if_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case CASE: + { + case_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case FOR: + case LOOP: + case WHILE: + { + loop_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + case BEGIN: + case DECLARE: + { + block(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(SEMI); + break; + } + default: + if ((LA(1) == IDENTIFIER) && (LA(2) == COLON)) { + statement_identifier(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case FOR: + case LOOP: + case WHILE: + { + loop_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + case BEGIN: + case DECLARE: + { + block(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_24.member(LA(2)))) { + call_or_assignment(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + statement_AST = RefAdaAST(currentAST.root); +#line 1100 "ada.g" + statement_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(STATEMENT,"STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(statement_AST)))); +#line 8833 "AdaParser.cpp" + currentAST.root = statement_AST; + if ( statement_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + statement_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = statement_AST->getFirstChild(); + else + currentAST.child = statement_AST; + currentAST.advanceChildToEnd(); + } + statement_AST = RefAdaAST(currentAST.root); + returnAST = statement_AST; +} + +void AdaParser::def_label_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST def_label_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case LT_LT: + { + match(LT_LT); + RefAdaAST tmp277_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp277_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp277_AST)); + } + match(IDENTIFIER); + match(GT_GT); + break; + } + case IDENTIFIER: + case NuLL: + case RETURN: + case FOR: + case CASE: + case BEGIN: + case IF: + case LOOP: + case WHILE: + case DECLARE: + case EXIT: + case GOTO: + case ACCEPT: + case DELAY: + case SELECT: + case ABORT: + case RAISE: + case REQUEUE: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + def_label_opt_AST = RefAdaAST(currentAST.root); +#line 1104 "ada.g" + def_label_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(LABEL_OPT,"LABEL_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(def_label_opt_AST)))); +#line 8896 "AdaParser.cpp" + currentAST.root = def_label_opt_AST; + if ( def_label_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + def_label_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = def_label_opt_AST->getFirstChild(); + else + currentAST.child = def_label_opt_AST; + currentAST.advanceChildToEnd(); + } + def_label_opt_AST = RefAdaAST(currentAST.root); + returnAST = def_label_opt_AST; +} + +void AdaParser::null_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST null_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(NuLL); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1108 "ada.g" + Set(s_AST, NULL_STATEMENT); +#line 8926 "AdaParser.cpp" + } + null_stmt_AST = RefAdaAST(currentAST.root); + returnAST = null_stmt_AST; +} + +void AdaParser::exit_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST exit_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(EXIT); + { + switch ( LA(1)) { + case IDENTIFIER: + { + label_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case WHEN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + { + switch ( LA(1)) { + case WHEN: + { + RefAdaAST tmp280_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp280_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp280_AST)); + } + match(WHEN); + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1206 "ada.g" + Set(s_AST, EXIT_STATEMENT); +#line 8996 "AdaParser.cpp" + } + exit_stmt_AST = RefAdaAST(currentAST.root); + returnAST = exit_stmt_AST; +} + +void AdaParser::return_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST return_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(RETURN); + { + switch ( LA(1)) { + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1213 "ada.g" + Set(s_AST, RETURN_STATEMENT); +#line 9049 "AdaParser.cpp" + } + return_stmt_AST = RefAdaAST(currentAST.root); + returnAST = return_stmt_AST; +} + +void AdaParser::goto_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST goto_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(GOTO); + label_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1217 "ada.g" + Set(s_AST, GOTO_STATEMENT); +#line 9076 "AdaParser.cpp" + } + goto_stmt_AST = RefAdaAST(currentAST.root); + returnAST = goto_stmt_AST; +} + +void AdaParser::delay_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST delay_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken d = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST d_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + d = LT(1); + if ( inputState->guessing == 0 ) { + d_AST = astFactory->create(d); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST)); + } + match(DELAY); + until_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1282 "ada.g" + Set (d_AST, DELAY_STATEMENT); +#line 9107 "AdaParser.cpp" + } + delay_stmt_AST = RefAdaAST(currentAST.root); + returnAST = delay_stmt_AST; +} + +void AdaParser::abort_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST abort_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken a = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST a_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + a = LT(1); + if ( inputState->guessing == 0 ) { + a_AST = astFactory->create(a); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(a_AST)); + } + match(ABORT); + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == COMMA)) { + match(COMMA); + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop425; + } + + } + _loop425:; + } // ( ... )* + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1361 "ada.g" + Set (a_AST, ABORT_STATEMENT); +#line 9150 "AdaParser.cpp" + } + abort_stmt_AST = RefAdaAST(currentAST.root); + returnAST = abort_stmt_AST; +} + +void AdaParser::raise_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST raise_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(RAISE); + { + switch ( LA(1)) { + case IDENTIFIER: + { + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1389 "ada.g" + Set (r_AST, RAISE_STATEMENT); +#line 9193 "AdaParser.cpp" + } + raise_stmt_AST = RefAdaAST(currentAST.root); + returnAST = raise_stmt_AST; +} + +void AdaParser::requeue_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST requeue_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + r = LT(1); + if ( inputState->guessing == 0 ) { + r_AST = astFactory->create(r); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST)); + } + match(REQUEUE); + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case WITH: + { + match(WITH); + RefAdaAST tmp289_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp289_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp289_AST)); + } + match(ABORT); + break; + } + case SEMI: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1393 "ada.g" + Set (r_AST, REQUEUE_STATEMENT); +#line 9243 "AdaParser.cpp" + } + requeue_stmt_AST = RefAdaAST(currentAST.root); + returnAST = requeue_stmt_AST; +} + +void AdaParser::accept_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST accept_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken a = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST a_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + a = LT(1); + if ( inputState->guessing == 0 ) { + a_AST = astFactory->create(a); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(a_AST)); + } + match(ACCEPT); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_index_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case DO: + { + match(DO); + handled_stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + break; + } + case SEMI: + { + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1264 "ada.g" + pop_def_id(); +#line 9296 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 1266 "ada.g" + Set (a_AST, ACCEPT_STATEMENT); +#line 9309 "AdaParser.cpp" + } + accept_stmt_AST = RefAdaAST(currentAST.root); + returnAST = accept_stmt_AST; +} + +void AdaParser::select_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST select_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(SELECT); + { + bool synPredMatched403 = false; + if (((LA(1) == IDENTIFIER || LA(1) == DELAY) && (_tokenSet_25.member(LA(2))))) { + int _m403 = mark(); + synPredMatched403 = true; + inputState->guessing++; + try { + { + triggering_alternative(); + match(THEN); + match(ABORT); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched403 = false; + } + rewind(_m403); + inputState->guessing--; + } + if ( synPredMatched403 ) { + triggering_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(THEN); + match(ABORT); + abortable_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1297 "ada.g" + Set (s_AST, ASYNCHRONOUS_SELECT); +#line 9361 "AdaParser.cpp" + } + } + else if ((_tokenSet_26.member(LA(1))) && (_tokenSet_27.member(LA(2)))) { + selective_accept(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1299 "ada.g" + Set (s_AST, SELECTIVE_ACCEPT); +#line 9372 "AdaParser.cpp" + } + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_28.member(LA(2)))) { + entry_call_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case OR: + { + match(OR); + delay_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1301 "ada.g" + Set (s_AST, TIMED_ENTRY_CALL); +#line 9392 "AdaParser.cpp" + } + break; + } + case ELSE: + { + match(ELSE); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1302 "ada.g" + Set (s_AST, CONDITIONAL_ENTRY_CALL); +#line 9406 "AdaParser.cpp" + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + match(END); + match(SELECT); + match(SEMI); + select_stmt_AST = RefAdaAST(currentAST.root); + returnAST = select_stmt_AST; +} + +void AdaParser::if_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST if_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(IF); + cond_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + elsifs_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + else_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(IF); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1114 "ada.g" + Set(s_AST, IF_STATEMENT); +#line 9460 "AdaParser.cpp" + } + if_stmt_AST = RefAdaAST(currentAST.root); + returnAST = if_stmt_AST; +} + +void AdaParser::case_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST case_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(CASE); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + alternative_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(CASE); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1134 "ada.g" + Set(s_AST, CASE_STATEMENT); +#line 9494 "AdaParser.cpp" + } + case_stmt_AST = RefAdaAST(currentAST.root); + returnAST = case_stmt_AST; +} + +void AdaParser::loop_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST loop_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken l = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST l_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + iteration_scheme_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + l = LT(1); + if ( inputState->guessing == 0 ) { + l_AST = astFactory->create(l); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(l_AST)); + } + match(LOOP); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(END); + match(LOOP); + if ( inputState->guessing==0 ) { +#line 1146 "ada.g" + Set(l_AST, LOOP_STATEMENT); +#line 9526 "AdaParser.cpp" + } + loop_stmt_AST = RefAdaAST(currentAST.root); + returnAST = loop_stmt_AST; +} + +void AdaParser::block() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST block_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + declare_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + block_body(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + block_AST = RefAdaAST(currentAST.root); +#line 1198 "ada.g" + block_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BLOCK_STATEMENT,"BLOCK_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(block_AST)))); +#line 9549 "AdaParser.cpp" + currentAST.root = block_AST; + if ( block_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + block_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = block_AST->getFirstChild(); + else + currentAST.child = block_AST; + currentAST.advanceChildToEnd(); + } + block_AST = RefAdaAST(currentAST.root); + returnAST = block_AST; +} + +void AdaParser::statement_identifier() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST statement_identifier_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + } + match(IDENTIFIER); + match(COLON); + if ( inputState->guessing==0 ) { +#line 1186 "ada.g" + push_def_id(n_AST); +#line 9578 "AdaParser.cpp" + } + returnAST = statement_identifier_AST; +} + +void AdaParser::id_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST id_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + id_opt_aux(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + id_opt_AST = RefAdaAST(currentAST.root); +#line 1172 "ada.g" + id_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ID_OPT,"ID_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(id_opt_AST)))); +#line 9596 "AdaParser.cpp" + currentAST.root = id_opt_AST; + if ( id_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + id_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = id_opt_AST->getFirstChild(); + else + currentAST.child = id_opt_AST; + currentAST.advanceChildToEnd(); + } + id_opt_AST = RefAdaAST(currentAST.root); + returnAST = id_opt_AST; +} + +void AdaParser::call_or_assignment() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST call_or_assignment_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case ASSIGN: + { + match(ASSIGN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + call_or_assignment_AST = RefAdaAST(currentAST.root); +#line 1222 "ada.g" + call_or_assignment_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ASSIGNMENT_STATEMENT,"ASSIGNMENT_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(call_or_assignment_AST)))); +#line 9632 "AdaParser.cpp" + currentAST.root = call_or_assignment_AST; + if ( call_or_assignment_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + call_or_assignment_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = call_or_assignment_AST->getFirstChild(); + else + currentAST.child = call_or_assignment_AST; + currentAST.advanceChildToEnd(); + } + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { + call_or_assignment_AST = RefAdaAST(currentAST.root); +#line 1225 "ada.g" + call_or_assignment_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CALL_STATEMENT,"CALL_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(call_or_assignment_AST)))); +#line 9650 "AdaParser.cpp" + currentAST.root = call_or_assignment_AST; + if ( call_or_assignment_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + call_or_assignment_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = call_or_assignment_AST->getFirstChild(); + else + currentAST.child = call_or_assignment_AST; + currentAST.advanceChildToEnd(); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + match(SEMI); + call_or_assignment_AST = RefAdaAST(currentAST.root); + returnAST = call_or_assignment_AST; +} + +void AdaParser::cond_clause() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST cond_clause_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken c = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST c_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + c = LT(1); + if ( inputState->guessing == 0 ) { + c_AST = astFactory->create(c); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(c_AST)); + } + match(THEN); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1118 "ada.g" + Set(c_AST, COND_CLAUSE); +#line 9696 "AdaParser.cpp" + } + cond_clause_AST = RefAdaAST(currentAST.root); + returnAST = cond_clause_AST; +} + +void AdaParser::elsifs_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST elsifs_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((LA(1) == ELSIF)) { + match(ELSIF); + cond_clause(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop354; + } + + } + _loop354:; + } // ( ... )* + if ( inputState->guessing==0 ) { + elsifs_opt_AST = RefAdaAST(currentAST.root); +#line 1126 "ada.g" + elsifs_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ELSIFS_OPT,"ELSIFS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(elsifs_opt_AST)))); +#line 9727 "AdaParser.cpp" + currentAST.root = elsifs_opt_AST; + if ( elsifs_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + elsifs_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = elsifs_opt_AST->getFirstChild(); + else + currentAST.child = elsifs_opt_AST; + currentAST.advanceChildToEnd(); + } + elsifs_opt_AST = RefAdaAST(currentAST.root); + returnAST = elsifs_opt_AST; +} + +void AdaParser::else_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST else_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case ELSE: + { + match(ELSE); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + else_opt_AST = RefAdaAST(currentAST.root); +#line 1130 "ada.g" + else_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ELSE_OPT,"ELSE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(else_opt_AST)))); +#line 9770 "AdaParser.cpp" + currentAST.root = else_opt_AST; + if ( else_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + else_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = else_opt_AST->getFirstChild(); + else + currentAST.child = else_opt_AST; + currentAST.advanceChildToEnd(); + } + else_opt_AST = RefAdaAST(currentAST.root); + returnAST = else_opt_AST; +} + +void AdaParser::condition() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST condition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + condition_AST = RefAdaAST(currentAST.root); + returnAST = condition_AST; +} + +void AdaParser::alternative_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST alternative_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )+ + int _cnt360=0; + for (;;) { + if ((LA(1) == WHEN)) { + case_statement_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + if ( _cnt360>=1 ) { goto _loop360; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());} + } + + _cnt360++; + } + _loop360:; + } // ( ... )+ + alternative_s_AST = RefAdaAST(currentAST.root); + returnAST = alternative_s_AST; +} + +void AdaParser::case_statement_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST case_statement_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + s = LT(1); + if ( inputState->guessing == 0 ) { + s_AST = astFactory->create(s); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST)); + } + match(WHEN); + choice_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RIGHT_SHAFT); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1141 "ada.g" + Set(s_AST, CASE_STATEMENT_ALTERNATIVE); +#line 9847 "AdaParser.cpp" + } + case_statement_alternative_AST = RefAdaAST(currentAST.root); + returnAST = case_statement_alternative_AST; +} + +void AdaParser::iteration_scheme_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST iteration_scheme_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case WHILE: + { + RefAdaAST tmp316_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp316_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp316_AST)); + } + match(WHILE); + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case FOR: + { + RefAdaAST tmp317_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp317_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp317_AST)); + } + match(FOR); + RefAdaAST tmp318_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp318_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp318_AST)); + } + match(IDENTIFIER); + match(IN); + reverse_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + discrete_subtype_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case LOOP: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + iteration_scheme_opt_AST = RefAdaAST(currentAST.root); +#line 1152 "ada.g" + iteration_scheme_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ITERATION_SCHEME_OPT,"ITERATION_SCHEME_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(iteration_scheme_opt_AST)))); +#line 9914 "AdaParser.cpp" + currentAST.root = iteration_scheme_opt_AST; + if ( iteration_scheme_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + iteration_scheme_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = iteration_scheme_opt_AST->getFirstChild(); + else + currentAST.child = iteration_scheme_opt_AST; + currentAST.advanceChildToEnd(); + } + iteration_scheme_opt_AST = RefAdaAST(currentAST.root); + returnAST = iteration_scheme_opt_AST; +} + +void AdaParser::reverse_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST reverse_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case REVERSE: + { + RefAdaAST tmp320_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp320_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp320_AST)); + } + match(REVERSE); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + reverse_opt_AST = RefAdaAST(currentAST.root); +#line 1158 "ada.g" + reverse_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(reverse_opt_AST)))); +#line 9968 "AdaParser.cpp" + currentAST.root = reverse_opt_AST; + if ( reverse_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + reverse_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = reverse_opt_AST->getFirstChild(); + else + currentAST.child = reverse_opt_AST; + currentAST.advanceChildToEnd(); + } + reverse_opt_AST = RefAdaAST(currentAST.root); + returnAST = reverse_opt_AST; +} + +void AdaParser::id_opt_aux() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST id_opt_aux_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 1161 "ada.g" + RefAdaAST endid; +#line 9988 "AdaParser.cpp" + + switch ( LA(1)) { + case CHAR_STRING: + { + endid=definable_operator_symbol(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if (!( end_id_matches_def_id (endid) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" end_id_matches_def_id (endid) "); + id_opt_aux_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + { + compound_name(); + if (inputState->guessing==0) { + n_AST = returnAST; + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if (!( end_id_matches_def_id (n_AST) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" end_id_matches_def_id (n_AST) "); + id_opt_aux_AST = RefAdaAST(currentAST.root); + break; + } + case SEMI: + { + if ( inputState->guessing==0 ) { +#line 1168 "ada.g" + pop_def_id(); +#line 10019 "AdaParser.cpp" + } + id_opt_aux_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = id_opt_aux_AST; +} + +void AdaParser::declare_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST declare_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case DECLARE: + { + match(DECLARE); + declarative_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case BEGIN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + declare_opt_AST = RefAdaAST(currentAST.root); +#line 1202 "ada.g" + declare_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DECLARE_OPT,"DECLARE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(declare_opt_AST)))); +#line 10062 "AdaParser.cpp" + currentAST.root = declare_opt_AST; + if ( declare_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + declare_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = declare_opt_AST->getFirstChild(); + else + currentAST.child = declare_opt_AST; + currentAST.advanceChildToEnd(); + } + declare_opt_AST = RefAdaAST(currentAST.root); + returnAST = declare_opt_AST; +} + +void AdaParser::label_name() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST label_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + RefAdaAST tmp322_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp322_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp322_AST)); + } + match(IDENTIFIER); + label_name_AST = RefAdaAST(currentAST.root); + returnAST = label_name_AST; +} + +void AdaParser::entry_body_formal_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_body_formal_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + entry_index_spec_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_body_formal_part_AST = RefAdaAST(currentAST.root); + returnAST = entry_body_formal_part_AST; +} + +void AdaParser::entry_barrier() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_barrier_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(WHEN); + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + entry_barrier_AST = RefAdaAST(currentAST.root); + returnAST = entry_barrier_AST; +} + +void AdaParser::entry_index_spec_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_index_spec_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched388 = false; + if (((LA(1) == LPAREN) && (LA(2) == FOR))) { + int _m388 = mark(); + synPredMatched388 = true; + inputState->guessing++; + try { + { + match(LPAREN); + match(FOR); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched388 = false; + } + rewind(_m388); + inputState->guessing--; + } + if ( synPredMatched388 ) { + match(LPAREN); + match(FOR); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IN); + discrete_subtype_definition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + } + else if ((LA(1) == LPAREN || LA(1) == WHEN) && (_tokenSet_0.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + entry_index_spec_opt_AST = RefAdaAST(currentAST.root); +#line 1247 "ada.g" + entry_index_spec_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_INDEX_SPECIFICATION,"ENTRY_INDEX_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_index_spec_opt_AST)))); +#line 10170 "AdaParser.cpp" + currentAST.root = entry_index_spec_opt_AST; + if ( entry_index_spec_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + entry_index_spec_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = entry_index_spec_opt_AST->getFirstChild(); + else + currentAST.child = entry_index_spec_opt_AST; + currentAST.advanceChildToEnd(); + } + entry_index_spec_opt_AST = RefAdaAST(currentAST.root); + returnAST = entry_index_spec_opt_AST; +} + +void AdaParser::entry_call_stmt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_call_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { + entry_call_stmt_AST = RefAdaAST(currentAST.root); +#line 1257 "ada.g" + entry_call_stmt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_CALL_STATEMENT,"ENTRY_CALL_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_call_stmt_AST)))); +#line 10198 "AdaParser.cpp" + currentAST.root = entry_call_stmt_AST; + if ( entry_call_stmt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + entry_call_stmt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = entry_call_stmt_AST->getFirstChild(); + else + currentAST.child = entry_call_stmt_AST; + currentAST.advanceChildToEnd(); + } + entry_call_stmt_AST = RefAdaAST(currentAST.root); + returnAST = entry_call_stmt_AST; +} + +void AdaParser::entry_index_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_index_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + bool synPredMatched396 = false; + if (((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2))))) { + int _m396 = mark(); + synPredMatched396 = true; + inputState->guessing++; + try { + { + match(LPAREN); + expression(); + match(RPAREN); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched396 = false; + } + rewind(_m396); + inputState->guessing--; + } + if ( synPredMatched396 ) { + match(LPAREN); + expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + } + else if ((LA(1) == SEMI || LA(1) == LPAREN || LA(1) == DO) && (_tokenSet_29.member(LA(2)))) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + entry_index_opt_AST = RefAdaAST(currentAST.root); +#line 1276 "ada.g" + entry_index_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_INDEX_OPT,"ENTRY_INDEX_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_index_opt_AST)))); +#line 10255 "AdaParser.cpp" + currentAST.root = entry_index_opt_AST; + if ( entry_index_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + entry_index_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = entry_index_opt_AST->getFirstChild(); + else + currentAST.child = entry_index_opt_AST; + currentAST.advanceChildToEnd(); + } + entry_index_opt_AST = RefAdaAST(currentAST.root); + returnAST = entry_index_opt_AST; +} + +void AdaParser::until_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST until_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case UNTIL: + { + RefAdaAST tmp331_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp331_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp331_AST)); + } + match(UNTIL); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case PLUS: + case MINUS: + case ABS: + case NUMERIC_LIT: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { + until_opt_AST = RefAdaAST(currentAST.root); +#line 1286 "ada.g" + until_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(until_opt_AST)))); +#line 10309 "AdaParser.cpp" + currentAST.root = until_opt_AST; + if ( until_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + until_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = until_opt_AST->getFirstChild(); + else + currentAST.child = until_opt_AST; + currentAST.advanceChildToEnd(); + } + until_opt_AST = RefAdaAST(currentAST.root); + returnAST = until_opt_AST; +} + +void AdaParser::triggering_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST triggering_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case DELAY: + { + delay_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + { + entry_call_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + triggering_alternative_AST = RefAdaAST(currentAST.root); +#line 1310 "ada.g" + triggering_alternative_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TRIGGERING_ALTERNATIVE,"TRIGGERING_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(triggering_alternative_AST)))); +#line 10360 "AdaParser.cpp" + currentAST.root = triggering_alternative_AST; + if ( triggering_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + triggering_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = triggering_alternative_AST->getFirstChild(); + else + currentAST.child = triggering_alternative_AST; + currentAST.advanceChildToEnd(); + } + triggering_alternative_AST = RefAdaAST(currentAST.root); + returnAST = triggering_alternative_AST; +} + +void AdaParser::abortable_part() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST abortable_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + abortable_part_AST = RefAdaAST(currentAST.root); +#line 1316 "ada.g" + abortable_part_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ABORTABLE_PART,"ABORTABLE_PART")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(abortable_part_AST)))); +#line 10387 "AdaParser.cpp" + currentAST.root = abortable_part_AST; + if ( abortable_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + abortable_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = abortable_part_AST->getFirstChild(); + else + currentAST.child = abortable_part_AST; + currentAST.advanceChildToEnd(); + } + abortable_part_AST = RefAdaAST(currentAST.root); + returnAST = abortable_part_AST; +} + +void AdaParser::selective_accept() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST selective_accept_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + guard_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + select_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + or_select_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + else_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + selective_accept_AST = RefAdaAST(currentAST.root); + returnAST = selective_accept_AST; +} + +void AdaParser::entry_call_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST entry_call_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + entry_call_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + entry_call_alternative_AST = RefAdaAST(currentAST.root); +#line 1322 "ada.g" + entry_call_alternative_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_CALL_ALTERNATIVE,"ENTRY_CALL_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_call_alternative_AST)))); +#line 10443 "AdaParser.cpp" + currentAST.root = entry_call_alternative_AST; + if ( entry_call_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + entry_call_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = entry_call_alternative_AST->getFirstChild(); + else + currentAST.child = entry_call_alternative_AST; + currentAST.advanceChildToEnd(); + } + entry_call_alternative_AST = RefAdaAST(currentAST.root); + returnAST = entry_call_alternative_AST; +} + +void AdaParser::delay_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST delay_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + delay_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + delay_alternative_AST = RefAdaAST(currentAST.root); +#line 1347 "ada.g" + delay_alternative_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DELAY_ALTERNATIVE,"DELAY_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(delay_alternative_AST)))); +#line 10474 "AdaParser.cpp" + currentAST.root = delay_alternative_AST; + if ( delay_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + delay_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = delay_alternative_AST->getFirstChild(); + else + currentAST.child = delay_alternative_AST; + currentAST.advanceChildToEnd(); + } + delay_alternative_AST = RefAdaAST(currentAST.root); + returnAST = delay_alternative_AST; +} + +void AdaParser::stmts_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST stmts_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case PRAGMA: + { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case NuLL: + case RETURN: + case FOR: + case CASE: + case BEGIN: + case LT_LT: + case IF: + case LOOP: + case WHILE: + case DECLARE: + case EXIT: + case GOTO: + case ACCEPT: + case DELAY: + case SELECT: + case ABORT: + case RAISE: + case REQUEUE: + { + statement(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop419; + } + } + } + _loop419:; + } // ( ... )* + stmts_opt_AST = RefAdaAST(currentAST.root); + returnAST = stmts_opt_AST; +} + +void AdaParser::guard_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST guard_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case WHEN: + { + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WHEN); + condition(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RIGHT_SHAFT); + { // ( ... )* + for (;;) { + if ((LA(1) == PRAGMA)) { + pragma(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop413; + } + + } + _loop413:; + } // ( ... )* + break; + } + case ACCEPT: + case DELAY: + case TERMINATE: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + if ( inputState->guessing==0 ) { +#line 1331 "ada.g" + Set(w_AST, GUARD_OPT); +#line 10595 "AdaParser.cpp" + } + guard_opt_AST = RefAdaAST(currentAST.root); + returnAST = guard_opt_AST; +} + +void AdaParser::select_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST select_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case ACCEPT: + { + accept_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + select_alternative_AST = RefAdaAST(currentAST.root); + break; + } + case DELAY: + { + delay_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + select_alternative_AST = RefAdaAST(currentAST.root); + break; + } + case TERMINATE: + { + t = LT(1); + if ( inputState->guessing == 0 ) { + t_AST = astFactory->create(t); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST)); + } + match(TERMINATE); + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1337 "ada.g" + Set(t_AST, TERMINATE_ALTERNATIVE); +#line 10639 "AdaParser.cpp" + } + select_alternative_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = select_alternative_AST; +} + +void AdaParser::or_select_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST or_select_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { // ( ... )* + for (;;) { + if ((LA(1) == OR)) { + match(OR); + guard_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + select_alternative(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop422; + } + + } + _loop422:; + } // ( ... )* + if ( inputState->guessing==0 ) { + or_select_opt_AST = RefAdaAST(currentAST.root); +#line 1356 "ada.g" + or_select_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(OR_SELECT_OPT,"OR_SELECT_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(or_select_opt_AST)))); +#line 10682 "AdaParser.cpp" + currentAST.root = or_select_opt_AST; + if ( or_select_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + or_select_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = or_select_opt_AST->getFirstChild(); + else + currentAST.child = or_select_opt_AST; + currentAST.advanceChildToEnd(); + } + or_select_opt_AST = RefAdaAST(currentAST.root); + returnAST = or_select_opt_AST; +} + +void AdaParser::accept_alternative() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST accept_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + accept_stmt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + stmts_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { + accept_alternative_AST = RefAdaAST(currentAST.root); +#line 1341 "ada.g" + accept_alternative_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ACCEPT_ALTERNATIVE,"ACCEPT_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(accept_alternative_AST)))); +#line 10713 "AdaParser.cpp" + currentAST.root = accept_alternative_AST; + if ( accept_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + accept_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = accept_alternative_AST->getFirstChild(); + else + currentAST.child = accept_alternative_AST; + currentAST.advanceChildToEnd(); + } + accept_alternative_AST = RefAdaAST(currentAST.root); + returnAST = accept_alternative_AST; +} + +void AdaParser::exception_handler() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST exception_handler_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + w = LT(1); + if ( inputState->guessing == 0 ) { + w_AST = astFactory->create(w); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST)); + } + match(WHEN); + identifier_colon_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + except_choice_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RIGHT_SHAFT); + statements(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1372 "ada.g" + Set (w_AST, EXCEPTION_HANDLER); +#line 10755 "AdaParser.cpp" + } + exception_handler_AST = RefAdaAST(currentAST.root); + returnAST = exception_handler_AST; +} + +void AdaParser::identifier_colon_opt() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST identifier_colon_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + if ((LA(1) == IDENTIFIER) && (LA(2) == COLON)) { + RefAdaAST tmp336_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp336_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp336_AST)); + } + match(IDENTIFIER); + match(COLON); + } + else if ((LA(1) == IDENTIFIER || LA(1) == OTHERS) && (LA(2) == RIGHT_SHAFT || LA(2) == DOT || LA(2) == PIPE)) { + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + } + if ( inputState->guessing==0 ) { + identifier_colon_opt_AST = RefAdaAST(currentAST.root); +#line 1376 "ada.g" + identifier_colon_opt_AST = + RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(IDENTIFIER_COLON_OPT,"IDENTIFIER_COLON_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(identifier_colon_opt_AST)))); +#line 10788 "AdaParser.cpp" + currentAST.root = identifier_colon_opt_AST; + if ( identifier_colon_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) && + identifier_colon_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + currentAST.child = identifier_colon_opt_AST->getFirstChild(); + else + currentAST.child = identifier_colon_opt_AST; + currentAST.advanceChildToEnd(); + } + identifier_colon_opt_AST = RefAdaAST(currentAST.root); + returnAST = identifier_colon_opt_AST; +} + +void AdaParser::except_choice_s() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST except_choice_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + exception_choice(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + if ((LA(1) == PIPE)) { + RefAdaAST tmp338_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp338_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp338_AST)); + } + match(PIPE); + exception_choice(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + } + else { + goto _loop435; + } + + } + _loop435:; + } // ( ... )* + except_choice_s_AST = RefAdaAST(currentAST.root); + returnAST = except_choice_s_AST; +} + +void AdaParser::exception_choice() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST exception_choice_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case IDENTIFIER: + { + compound_name(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + exception_choice_AST = RefAdaAST(currentAST.root); + break; + } + case OTHERS: + { + RefAdaAST tmp339_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp339_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp339_AST)); + } + match(OTHERS); + exception_choice_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = exception_choice_AST; +} + +void AdaParser::operator_call() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST operator_call_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken cs = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST cs_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + cs = LT(1); + if ( inputState->guessing == 0 ) { + cs_AST = astFactory->create(cs); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(cs_AST)); + } + match(CHAR_STRING); + operator_call_tail(cs_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + operator_call_AST = RefAdaAST(currentAST.root); + returnAST = operator_call_AST; +} + +void AdaParser::operator_call_tail( + RefAdaAST opstr +) { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST operator_call_tail_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + match(LPAREN); + if (!( is_operator_symbol(opstr->getText().c_str()) )) + throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" is_operator_symbol(opstr->getText().c_str()) "); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 1401 "ada.g" + opstr->setType(OPERATOR_SYMBOL); +#line 10908 "AdaParser.cpp" + } + operator_call_tail_AST = RefAdaAST(currentAST.root); + returnAST = operator_call_tail_AST; +} + +void AdaParser::relation() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST relation_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case IN: + { + RefAdaAST tmp342_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp342_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp342_AST)); + } + match(IN); + range_or_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case NOT: + { + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST)); + } + match(NOT); + match(IN); + range_or_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1425 "ada.g" + Set (n_AST, NOT_IN); +#line 10957 "AdaParser.cpp" + } + break; + } + case EQ: + { + RefAdaAST tmp344_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp344_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp344_AST)); + } + match(EQ); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case NE: + { + RefAdaAST tmp345_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp345_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp345_AST)); + } + match(NE); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case LT_: + { + RefAdaAST tmp346_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp346_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp346_AST)); + } + match(LT_); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case LE: + { + RefAdaAST tmp347_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp347_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp347_AST)); + } + match(LE); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case GT: + { + RefAdaAST tmp348_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp348_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp348_AST)); + } + match(GT); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case GE: + { + RefAdaAST tmp349_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp349_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp349_AST)); + } + match(GE); + simple_expression(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case RANGE: + case DIGITS: + case IS: + case PIPE: + case DOT_DOT: + case ASSIGN: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + relation_AST = RefAdaAST(currentAST.root); + returnAST = relation_AST; +} + +void AdaParser::range_or_mark() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST range_or_mark_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + bool synPredMatched455 = false; + if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) { + int _m455 = mark(); + synPredMatched455 = true; + inputState->guessing++; + try { + { + range(); + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) { + synPredMatched455 = false; + } + rewind(_m455); + inputState->guessing--; + } + if ( synPredMatched455 ) { + range(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_or_mark_AST = RefAdaAST(currentAST.root); + } + else if ((LA(1) == IDENTIFIER) && (_tokenSet_30.member(LA(2)))) { + subtype_mark(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + range_or_mark_AST = RefAdaAST(currentAST.root); + } + else { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + + returnAST = range_or_mark_AST; +} + +void AdaParser::signed_term() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST signed_term_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken m = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST m_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case PLUS: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PLUS); + term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1447 "ada.g" + Set(p_AST, UNARY_PLUS); +#line 11141 "AdaParser.cpp" + } + signed_term_AST = RefAdaAST(currentAST.root); + break; + } + case MINUS: + { + m = LT(1); + if ( inputState->guessing == 0 ) { + m_AST = astFactory->create(m); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(m_AST)); + } + match(MINUS); + term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1448 "ada.g" + Set(m_AST, UNARY_MINUS); +#line 11161 "AdaParser.cpp" + } + signed_term_AST = RefAdaAST(currentAST.root); + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case ABS: + case NUMERIC_LIT: + { + term(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + signed_term_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = signed_term_AST; +} + +void AdaParser::term() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST term_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case STAR: + { + RefAdaAST tmp350_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp350_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp350_AST)); + } + match(STAR); + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case DIV: + { + RefAdaAST tmp351_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp351_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp351_AST)); + } + match(DIV); + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case MOD: + { + RefAdaAST tmp352_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp352_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp352_AST)); + } + match(MOD); + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case REM: + { + RefAdaAST tmp353_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp353_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp353_AST)); + } + match(REM); + factor(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + goto _loop462; + } + } + } + _loop462:; + } // ( ... )* + term_AST = RefAdaAST(currentAST.root); + returnAST = term_AST; +} + +void AdaParser::factor() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST factor_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case NOT: + { + RefAdaAST tmp354_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp354_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp354_AST)); + } + match(NOT); + primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case ABS: + { + RefAdaAST tmp355_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp355_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp355_AST)); + } + match(ABS); + primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case LPAREN: + case NEW: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NUMERIC_LIT: + { + primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + { + switch ( LA(1)) { + case EXPON: + { + RefAdaAST tmp356_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp356_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp356_AST)); + } + match(EXPON); + primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case RANGE: + case DIGITS: + case IS: + case PIPE: + case DOT_DOT: + case IN: + case ASSIGN: + case MOD: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + factor_AST = RefAdaAST(currentAST.root); + returnAST = factor_AST; +} + +void AdaParser::primary() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST primary_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken cs = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST cs_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + { + switch ( LA(1)) { + case IDENTIFIER: + { + name_or_qualified(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case LPAREN: + { + parenthesized_primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case NEW: + { + allocator(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case NuLL: + { + RefAdaAST tmp357_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp357_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp357_AST)); + } + match(NuLL); + break; + } + case NUMERIC_LIT: + { + RefAdaAST tmp358_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp358_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp358_AST)); + } + match(NUMERIC_LIT); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp359_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp359_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp359_AST)); + } + match(CHARACTER_LITERAL); + break; + } + case CHAR_STRING: + { + cs = LT(1); + if ( inputState->guessing == 0 ) { + cs_AST = astFactory->create(cs); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(cs_AST)); + } + match(CHAR_STRING); + { + switch ( LA(1)) { + case LPAREN: + { + operator_call_tail(cs_AST); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case SEMI: + case COMMA: + case RPAREN: + case RIGHT_SHAFT: + case WITH: + case RANGE: + case DIGITS: + case IS: + case PIPE: + case DOT_DOT: + case IN: + case ASSIGN: + case MOD: + case THEN: + case LOOP: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case EXPON: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + primary_AST = RefAdaAST(currentAST.root); + returnAST = primary_AST; +} + +void AdaParser::name_or_qualified() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST name_or_qualified_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); +#line 1479 "ada.g" + RefAdaAST dummy; +#line 11528 "AdaParser.cpp" + + RefAdaAST tmp360_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp360_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp360_AST)); + } + match(IDENTIFIER); + { // ( ... )* + for (;;) { + switch ( LA(1)) { + case DOT: + { + RefAdaAST tmp361_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp361_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp361_AST)); + } + match(DOT); + { + switch ( LA(1)) { + case ALL: + { + RefAdaAST tmp362_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp362_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp362_AST)); + } + match(ALL); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp363_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp363_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp363_AST)); + } + match(IDENTIFIER); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp364_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp364_AST = astFactory->create(LT(1)); + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp364_AST)); + } + match(CHARACTER_LITERAL); + break; + } + case CHAR_STRING: + { + dummy=is_operator(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + case LPAREN: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(LPAREN); + value_s(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(RPAREN); + if ( inputState->guessing==0 ) { +#line 1487 "ada.g" + Set(p_AST, INDEXED_COMPONENT); +#line 11611 "AdaParser.cpp" + } + break; + } + case TIC: + { + RefAdaAST tmp366_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + if ( inputState->guessing == 0 ) { + tmp366_AST = astFactory->create(LT(1)); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp366_AST)); + } + match(TIC); + { + switch ( LA(1)) { + case LPAREN: + { + parenthesized_primary(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + case IDENTIFIER: + case RANGE: + case DIGITS: + case DELTA: + case ACCESS: + { + attribute_id(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + } + break; + } + default: + { + goto _loop473; + } + } + } + _loop473:; + } // ( ... )* + name_or_qualified_AST = RefAdaAST(currentAST.root); + returnAST = name_or_qualified_AST; +} + +void AdaParser::allocator() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST allocator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + n = LT(1); + if ( inputState->guessing == 0 ) { + n_AST = astFactory->create(n); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST)); + } + match(NEW); + name_or_qualified(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + if ( inputState->guessing==0 ) { +#line 1493 "ada.g" + Set(n_AST, ALLOCATOR); +#line 11685 "AdaParser.cpp" + } + allocator_AST = RefAdaAST(currentAST.root); + returnAST = allocator_AST; +} + +void AdaParser::subprogram_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST subprogram_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + switch ( LA(1)) { + case PROCEDURE: + { + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROCEDURE); + def_id(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + formal_part_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1507 "ada.g" + pop_def_id(); Set(p_AST, PROCEDURE_BODY); +#line 11726 "AdaParser.cpp" + } + subprogram_body_AST = RefAdaAST(currentAST.root); + break; + } + case FUNCTION: + { + f = LT(1); + if ( inputState->guessing == 0 ) { + f_AST = astFactory->create(f); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST)); + } + match(FUNCTION); + def_designator(false); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + function_tail(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(IS); + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1509 "ada.g" + pop_def_id(); Set(f_AST, FUNCTION_BODY); +#line 11756 "AdaParser.cpp" + } + subprogram_body_AST = RefAdaAST(currentAST.root); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename()); + } + } + returnAST = subprogram_body_AST; +} + +void AdaParser::package_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST package_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PACKAGE); + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + pkg_body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1513 "ada.g" + Set(p_AST, PACKAGE_BODY); +#line 11794 "AdaParser.cpp" + } + package_body_AST = RefAdaAST(currentAST.root); + returnAST = package_body_AST; +} + +void AdaParser::task_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST task_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + t = LT(1); + if ( inputState->guessing == 0 ) { + t_AST = astFactory->create(t); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST)); + } + match(TASK); + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + body_part(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1517 "ada.g" + Set(t_AST, TASK_BODY); +#line 11825 "AdaParser.cpp" + } + task_body_AST = RefAdaAST(currentAST.root); + returnAST = task_body_AST; +} + +void AdaParser::protected_body() { + returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST; + RefAdaAST protected_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken; + RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + p = LT(1); + if ( inputState->guessing == 0 ) { + p_AST = astFactory->create(p); + astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST)); + } + match(PROTECTED); + body_is(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + prot_op_bodies_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + end_id_opt(); + if (inputState->guessing==0) { + astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST)); + } + match(SEMI); + if ( inputState->guessing==0 ) { +#line 1521 "ada.g" + Set(p_AST, PROTECTED_BODY); +#line 11860 "AdaParser.cpp" + } + protected_body_AST = RefAdaAST(currentAST.root); + returnAST = protected_body_AST; +} + +void AdaParser::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ) +{ + factory.setMaxNodeType(289); +} +const char* AdaParser::tokenNames[] = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"pragma\"", + "IDENTIFIER", + "SEMI", + "LPAREN", + "COMMA", + "RPAREN", + "RIGHT_SHAFT", + "\"with\"", + "DOT", + "\"use\"", + "\"type\"", + "TIC", + "\"range\"", + "\"digits\"", + "\"delta\"", + "\"access\"", + "\"private\"", + "\"package\"", + "\"body\"", + "\"is\"", + "\"procedure\"", + "\"function\"", + "\"new\"", + "\"others\"", + "PIPE", + "DOT_DOT", + "\"all\"", + "COLON", + "\"in\"", + "\"out\"", + "\"renames\"", + "CHARACTER_LITERAL", + "CHAR_STRING", + "\"null\"", + "\"record\"", + "\"separate\"", + "\"abstract\"", + "\"return\"", + "\"task\"", + "\"protected\"", + "BOX", + "ASSIGN", + "\"entry\"", + "\"for\"", + "\"end\"", + "\"at\"", + "\"mod\"", + "\"subtype\"", + "\"exception\"", + "\"constant\"", + "\"array\"", + "\"of\"", + "\"aliased\"", + "\"case\"", + "\"when\"", + "\"tagged\"", + "\"limited\"", + "\"generic\"", + "\"begin\"", + "LT_LT", + "GT_GT", + "\"if\"", + "\"then\"", + "\"elsif\"", + "\"else\"", + "\"loop\"", + "\"while\"", + "\"reverse\"", + "\"declare\"", + "\"exit\"", + "\"goto\"", + "\"accept\"", + "\"do\"", + "\"delay\"", + "\"until\"", + "\"select\"", + "\"abort\"", + "\"or\"", + "\"terminate\"", + "\"raise\"", + "\"requeue\"", + "\"and\"", + "\"xor\"", + "\"not\"", + "EQ", + "NE", + "LT_", + "LE", + "GT", + "GE", + "PLUS", + "MINUS", + "CONCAT", + "STAR", + "DIV", + "\"rem\"", + "\"abs\"", + "EXPON", + "NUMERIC_LIT", + "ABORTABLE_PART", + "ABORT_STATEMENT", + "ACCEPT_ALTERNATIVE", + "ACCEPT_STATEMENT", + "ALLOCATOR", + "ASSIGNMENT_STATEMENT", + "ASYNCHRONOUS_SELECT", + "ATTRIBUTE_DEFINITION_CLAUSE", + "AT_CLAUSE", + "BLOCK_STATEMENT", + "CASE_STATEMENT", + "CASE_STATEMENT_ALTERNATIVE", + "CODE_STATEMENT", + "COMPONENT_DECLARATION", + "CONDITIONAL_ENTRY_CALL", + "CONTEXT_CLAUSE", + "DECLARATIVE_PART", + "DEFINING_IDENTIFIER_LIST", + "DELAY_ALTERNATIVE", + "DELAY_STATEMENT", + "DELTA_CONSTRAINT", + "DIGITS_CONSTRAINT", + "DISCRIMINANT_ASSOCIATION", + "DISCRIMINANT_CONSTRAINT", + "DISCRIMINANT_SPECIFICATION", + "ENTRY_BODY", + "ENTRY_CALL_ALTERNATIVE", + "ENTRY_CALL_STATEMENT", + "ENTRY_DECLARATION", + "ENTRY_INDEX_SPECIFICATION", + "ENUMERATION_REPESENTATION_CLAUSE", + "EXCEPTION_DECLARATION", + "EXCEPTION_HANDLER", + "EXCEPTION_RENAMING_DECLARATION", + "EXIT_STATEMENT", + "FORMAL_PACKAGE_DECLARATION", + "GENERIC_FORMAL_PART", + "GENERIC_PACKAGE_DECLARATION", + "GOTO_STATEMENT", + "HANDLED_SEQUENCE_OF_STATEMENTS", + "HANDLED_STMTS_OPT", + "IF_STATEMENT", + "INCOMPLETE_TYPE_DECLARATION", + "INDEXED_COMPONENT", + "INDEX_CONSTRAINT", + "LIBRARY_ITEM", + "LOOP_STATEMENT", + "NAME", + "NULL_STATEMENT", + "NUMBER_DECLARATION", + "OBJECT_DECLARATION", + "OBJECT_RENAMING_DECLARATION", + "OPERATOR_SYMBOL", + "PACKAGE_BODY", + "PACKAGE_BODY_STUB", + "PACKAGE_RENAMING_DECLARATION", + "PACKAGE_SPECIFICATION", + "PARAMETER_SPECIFICATION", + "PRIVATE_EXTENSION_DECLARATION", + "PRIVATE_TYPE_DECLARATION", + "PROTECTED_BODY", + "PROTECTED_BODY_STUB", + "PROTECTED_TYPE_DECLARATION", + "RAISE_STATEMENT", + "RANGE_ATTRIBUTE_REFERENCE", + "RECORD_REPRESENTATION_CLAUSE", + "REQUEUE_STATEMENT", + "RETURN_STATEMENT", + "SELECTIVE_ACCEPT", + "SEQUENCE_OF_STATEMENTS", + "SINGLE_PROTECTED_DECLARATION", + "SINGLE_TASK_DECLARATION", + "STATEMENT", + "SUBTYPE_DECLARATION", + "SUBTYPE_INDICATION", + "SUBTYPE_MARK", + "SUBUNIT", + "TASK_BODY", + "TASK_BODY_STUB", + "TASK_TYPE_DECLARATION", + "TERMINATE_ALTERNATIVE", + "TIMED_ENTRY_CALL", + "TRIGGERING_ALTERNATIVE", + "USE_CLAUSE", + "USE_TYPE_CLAUSE", + "VARIANT", + "VARIANT_PART", + "WITH_CLAUSE", + "ABSTRACT_FUNCTION_DECLARATION", + "ABSTRACT_PROCEDURE_DECLARATION", + "ACCESS_TO_FUNCTION_DECLARATION", + "ACCESS_TO_OBJECT_DECLARATION", + "ACCESS_TO_PROCEDURE_DECLARATION", + "ARRAY_OBJECT_DECLARATION", + "ARRAY_TYPE_DECLARATION", + "AND_THEN", + "BASIC_DECLARATIVE_ITEMS_OPT", + "BLOCK_BODY", + "BLOCK_BODY_OPT", + "CALL_STATEMENT", + "COMPONENT_CLAUSES_OPT", + "COMPONENT_ITEMS", + "COND_CLAUSE", + "DECIMAL_FIXED_POINT_DECLARATION", + "DECLARE_OPT", + "DERIVED_RECORD_EXTENSION", + "DISCRETE_SUBTYPE_DEF_OPT", + "DISCRIMINANT_SPECIFICATIONS", + "DISCRIM_PART_OPT", + "ELSE_OPT", + "ELSIFS_OPT", + "END_ID_OPT", + "ENTRY_INDEX_OPT", + "ENUMERATION_TYPE_DECLARATION", + "EXCEPT_HANDLER_PART_OPT", + "EXTENSION_OPT", + "FLOATING_POINT_DECLARATION", + "FORMAL_DECIMAL_FIXED_POINT_DECLARATION", + "FORMAL_DISCRETE_TYPE_DECLARATION", + "FORMAL_FLOATING_POINT_DECLARATION", + "FORMAL_FUNCTION_DECLARATION", + "FORMAL_MODULAR_TYPE_DECLARATION", + "FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION", + "FORMAL_ORDINARY_FIXED_POINT_DECLARATION", + "FORMAL_PART_OPT", + "FORMAL_PRIVATE_EXTENSION_DECLARATION", + "FORMAL_PRIVATE_TYPE_DECLARATION", + "FORMAL_PROCEDURE_DECLARATION", + "FORMAL_SIGNED_INTEGER_TYPE_DECLARATION", + "FUNCTION_BODY", + "FUNCTION_BODY_STUB", + "FUNCTION_DECLARATION", + "FUNCTION_RENAMING_DECLARATION", + "GENERIC_FUNCTION_DECLARATION", + "GENERIC_FUNCTION_INSTANTIATION", + "GENERIC_FUNCTION_RENAMING", + "GENERIC_PACKAGE_INSTANTIATION", + "GENERIC_PACKAGE_RENAMING", + "GENERIC_PROCEDURE_DECLARATION", + "GENERIC_PROCEDURE_INSTANTIATION", + "GENERIC_PROCEDURE_RENAMING", + "GUARD_OPT", + "IDENTIFIER_COLON_OPT", + "ID_OPT", + "INIT_OPT", + "ITERATION_SCHEME_OPT", + "LABEL_OPT", + "MARK_WITH_CONSTRAINT", + "MODIFIERS", + "MODULAR_TYPE_DECLARATION", + "MOD_CLAUSE_OPT", + "NOT_IN", + "ORDINARY_DERIVED_TYPE_DECLARATION", + "ORDINARY_FIXED_POINT_DECLARATION", + "OR_ELSE", + "OR_SELECT_OPT", + "PARENTHESIZED_PRIMARY", + "PRIVATE_DECLARATIVE_ITEMS_OPT", + "PRIVATE_TASK_ITEMS_OPT", + "PROCEDURE_BODY", + "PROCEDURE_BODY_STUB", + "PROCEDURE_DECLARATION", + "PROCEDURE_RENAMING_DECLARATION", + "PROT_MEMBER_DECLARATIONS", + "PROT_OP_BODIES_OPT", + "PROT_OP_DECLARATIONS", + "PROT_PRIVATE_OPT", + "RANGED_EXPRS", + "RANGE_CONSTRAINT", + "RECORD_TYPE_DECLARATION", + "SELECTOR_NAMES_OPT", + "SIGNED_INTEGER_TYPE_DECLARATION", + "TASK_ITEMS_OPT", + "UNARY_MINUS", + "UNARY_PLUS", + "VALUE", + "VALUES", + "VARIANTS", + "COMMENT_INTRO", + "OX", + "TIC_OR_CHARACTER_LITERAL", + "DIGIT", + "EXPONENT", + "EXTENDED_DIGIT", + "BASED_INTEGER", + "WS_", + "COMMENT", + 0 +}; + +const unsigned long AdaParser::_tokenSet_0_data_[] = { 67109024UL, 56UL, 3229614080UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN "new" CHARACTER_LITERAL CHAR_STRING "null" "not" PLUS +// MINUS "abs" NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_0(_tokenSet_0_data_,10); +const unsigned long AdaParser::_tokenSet_1_data_[] = { 201364384UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN COMMA RPAREN DOT TIC "new" "others" "in" CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS +// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_1(_tokenSet_1_data_,10); +const unsigned long AdaParser::_tokenSet_2_data_[] = { 8388800UL, 4UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN "is" "renames" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_2(_tokenSet_2_data_,10); +const unsigned long AdaParser::_tokenSet_3_data_[] = { 52453426UL, 1611238800UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// EOF "pragma" IDENTIFIER "use" "type" "package" "procedure" "function" +// CHAR_STRING "separate" "abstract" "task" "protected" "for" "end" "subtype" +// "generic" "begin" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_3(_tokenSet_3_data_,10); +const unsigned long AdaParser::_tokenSet_4_data_[] = { 8392896UL, 67108869UL, 4096UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN DOT "is" "in" "renames" "when" "do" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_4(_tokenSet_4_data_,10); +const unsigned long AdaParser::_tokenSet_5_data_[] = { 8388800UL, 67108869UL, 4096UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN "is" "in" "renames" "when" "do" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_5(_tokenSet_5_data_,10); +const unsigned long AdaParser::_tokenSet_6_data_[] = { 53502002UL, 537496976UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// EOF "pragma" IDENTIFIER "use" "type" "private" "package" "procedure" +// "function" CHAR_STRING "separate" "abstract" "task" "protected" "for" +// "end" "subtype" "generic" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_6(_tokenSet_6_data_,10); +const unsigned long AdaParser::_tokenSet_7_data_[] = { 8392832UL, 512UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// LPAREN DOT "is" "return" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_7(_tokenSet_7_data_,10); +const unsigned long AdaParser::_tokenSet_8_data_[] = { 738234528UL, 262200UL, 3229614080UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN DOT TIC "new" "others" DOT_DOT CHARACTER_LITERAL CHAR_STRING +// "null" "mod" "not" PLUS MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_8(_tokenSet_8_data_,10); +const unsigned long AdaParser::_tokenSet_9_data_[] = { 201326752UL, 56UL, 3229614080UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN "new" "others" CHARACTER_LITERAL CHAR_STRING "null" +// "not" PLUS MINUS "abs" NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_9(_tokenSet_9_data_,10); +const unsigned long AdaParser::_tokenSet_10_data_[] = { 1006739360UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN COMMA RPAREN RIGHT_SHAFT "with" DOT TIC "range" "new" +// "others" PIPE DOT_DOT "in" CHARACTER_LITERAL CHAR_STRING "null" "mod" +// "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR DIV +// "rem" "abs" EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_10(_tokenSet_10_data_,10); +const unsigned long AdaParser::_tokenSet_11_data_[] = { 1006737312UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN COMMA RPAREN RIGHT_SHAFT DOT TIC "range" "new" "others" +// PIPE DOT_DOT "in" CHARACTER_LITERAL CHAR_STRING "null" "mod" "or" "and" +// "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR DIV "rem" "abs" +// EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_11(_tokenSet_11_data_,10); +const unsigned long AdaParser::_tokenSet_12_data_[] = { 32UL, 23068672UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER "constant" "array" "aliased" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_12(_tokenSet_12_data_,10); +const unsigned long AdaParser::_tokenSet_13_data_[] = { 495840UL, 6299648UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER SEMI LPAREN DOT TIC "range" "digits" "delta" ASSIGN "constant" +// "array" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_13(_tokenSet_13_data_,10); +const unsigned long AdaParser::_tokenSet_14_data_[] = { 51380274UL, 114688UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// EOF "pragma" IDENTIFIER "private" "procedure" "function" "entry" "for" +// "end" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_14(_tokenSet_14_data_,10); +const unsigned long AdaParser::_tokenSet_15_data_[] = { 496256UL, 0UL, 32UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// LPAREN RPAREN DOT TIC "range" "digits" "delta" "loop" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_15(_tokenSet_15_data_,10); +const unsigned long AdaParser::_tokenSet_16_data_[] = { 50331664UL, 49152UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" "procedure" "function" "entry" "for" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_16(_tokenSet_16_data_,10); +const unsigned long AdaParser::_tokenSet_17_data_[] = { 1048576UL, 402653536UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "private" "null" "record" "abstract" "tagged" "limited" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_17(_tokenSet_17_data_,10); +const unsigned long AdaParser::_tokenSet_18_data_[] = { 1048688UL, 436207712UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" IDENTIFIER SEMI "private" "null" "record" "case" "tagged" "limited" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_18(_tokenSet_18_data_,10); +const unsigned long AdaParser::_tokenSet_19_data_[] = { 496512UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// LPAREN COMMA RPAREN DOT TIC "range" "digits" "delta" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_19(_tokenSet_19_data_,10); +const unsigned long AdaParser::_tokenSet_20_data_[] = { 738300064UL, 262200UL, 3229614080UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN DOT TIC "range" "new" "others" DOT_DOT CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "not" PLUS MINUS CONCAT STAR DIV "rem" "abs" +// EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_20(_tokenSet_20_data_,10); +const unsigned long AdaParser::_tokenSet_21_data_[] = { 469800096UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER LPAREN RIGHT_SHAFT DOT TIC "new" "others" PIPE "in" CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS +// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_21(_tokenSet_21_data_,10); +const unsigned long AdaParser::_tokenSet_22_data_[] = { 1048576UL, 402653440UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "private" "abstract" "tagged" "limited" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_22(_tokenSet_22_data_,10); +const unsigned long AdaParser::_tokenSet_23_data_[] = { 1048640UL, 402653184UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI "private" "tagged" "limited" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_23(_tokenSet_23_data_,10); +const unsigned long AdaParser::_tokenSet_24_data_[] = { 37056UL, 8192UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN DOT TIC ASSIGN +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_24(_tokenSet_24_data_,10); +const unsigned long AdaParser::_tokenSet_25_data_[] = { 67145952UL, 56UL, 3229630464UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER SEMI LPAREN DOT TIC "new" CHARACTER_LITERAL CHAR_STRING "null" +// "until" "not" PLUS MINUS "abs" NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_25(_tokenSet_25_data_,10); +const unsigned long AdaParser::_tokenSet_26_data_[] = { 0UL, 67108864UL, 272384UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "when" "accept" "delay" "terminate" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_26(_tokenSet_26_data_,10); +const unsigned long AdaParser::_tokenSet_27_data_[] = { 67109088UL, 56UL, 3229630464UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER SEMI LPAREN "new" CHARACTER_LITERAL CHAR_STRING "null" "until" +// "not" PLUS MINUS "abs" NUMERIC_LIT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_27(_tokenSet_27_data_,10); +const unsigned long AdaParser::_tokenSet_28_data_[] = { 37056UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI LPAREN DOT TIC +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_28(_tokenSet_28_data_,10); +const unsigned long AdaParser::_tokenSet_29_data_[] = { 48UL, 3323036192UL, 1814398UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" IDENTIFIER "null" "return" "for" "end" "exception" "case" "when" +// "begin" LT_LT "if" "then" "elsif" "else" "loop" "while" "declare" "exit" +// "goto" "accept" "delay" "select" "abort" "or" "raise" "requeue" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_29(_tokenSet_29_data_,10); +const unsigned long AdaParser::_tokenSet_30_data_[] = { 813932352UL, 8192UL, 6422564UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// SEMI COMMA RPAREN RIGHT_SHAFT "with" DOT TIC "range" "digits" "is" PIPE +// DOT_DOT ASSIGN "then" "loop" "or" "and" "xor" +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_30(_tokenSet_30_data_,10); + + diff --git a/languages/ada/AdaParser.hpp b/languages/ada/AdaParser.hpp new file mode 100644 index 00000000..0074c820 --- /dev/null +++ b/languages/ada/AdaParser.hpp @@ -0,0 +1,389 @@ +#ifndef INC_AdaParser_hpp_ +#define INC_AdaParser_hpp_ + +#line 29 "ada.g" + +#include // antlr wants this +#include "AdaAST.hpp" +#include "preambles.h" + +#line 11 "AdaParser.hpp" +#include +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaParser.hpp"$ */ +#include +#include +#include "AdaTokenTypes.hpp" +#include + +class CUSTOM_API AdaParser : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public AdaTokenTypes +{ +#line 53 "ada.g" + + ANTLR_PARSER_PREAMBLE + +public: + // Ada support stuff + void push_def_id (const RefAdaAST& defid); + const RefAdaAST& pop_def_id (); + bool end_id_matches_def_id (const RefAdaAST& endid); + bool definable_operator (const char *string); // operator_symbol sans "/=" + bool is_operator_symbol (const char *string); +#line 22 "AdaParser.hpp" +public: + void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); +protected: + AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k); +public: + AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf); +protected: + AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k); +public: + AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer); + AdaParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state); + int getNumTokens() const + { + return AdaParser::NUM_TOKENS; + } + const char* getTokenName( int type ) const + { + if( type > getNumTokens() ) return 0; + return AdaParser::tokenNames[type]; + } + const char* const* getTokenNames() const + { + return AdaParser::tokenNames; + } + public: void compilation_unit(); + public: void context_items_opt(); + public: void library_item(); + public: void subunit(); + public: void pragma(); + public: void pragma_args_opt(); + public: void pragma_arg(); + public: void expression(); + public: void with_clause(); + public: void use_clause(); + public: void c_name_list(); + public: void compound_name(); + public: void subtype_mark(); + public: void attribute_id(); + public: void private_opt(); + public: void lib_pkg_spec_or_body(); + public: void subprog_decl_or_rename_or_inst_or_body( + boolean lib_level + ); + public: void generic_decl( + boolean lib_level + ); + public: void def_id( + boolean lib_level + ); + public: void pkg_body_part(); + public: void spec_decl_part( + RefAdaAST pkg + ); + public: void subprog_decl( + boolean lib_level + ); + public: void generic_subp_inst(); + public: void formal_part_opt(); + public: void renames(); + public: void is_separate_or_abstract_or_decl( + RefAdaAST t + ); + public: void def_designator( + boolean lib_level + ); + public: void function_tail(); + public: void generic_inst(); + public: void value_s(); + public: void parenth_values(); + public: void value(); + public: void ranged_expr_s(); + public: void ranged_expr(); + public: void simple_expression(); + public: void range(); + public: void range_constraint(); + public: void range_dots(); + public: void range_attrib_ref(); + public: void prefix(); + public: void parameter_specification(); + public: void def_ids_colon(); + public: void mode_opt(); + public: void init_opt(); + public: void defining_identifier_list(); + public: void name(); + public: RefAdaAST definable_operator_symbol(); + public: RefAdaAST is_operator(); + public: void parenthesized_primary(); + public: void extension_opt(); + public: void separate_or_abstract( + RefAdaAST t + ); + public: RefAdaAST designator(); + public: void func_formal_part_opt(); + public: void func_param(); + public: void in_access_opt(); + public: void pkg_spec_part(); + public: void basic_declarative_items_opt(); + public: void private_declarative_items_opt(); + public: void end_id_opt(); + public: void basic_decl_item(); + public: void basic_declarative_items(); + public: void task_type_or_single_decl( + RefAdaAST tsk + ); + public: void prot_type_or_single_decl( + RefAdaAST pro + ); + public: void decl_common(); + public: void discrim_part_opt(); + public: void task_definition_opt(); + public: void task_items_opt(); + public: void private_task_items_opt(); + public: void discrim_part_text(); + public: void discriminant_specifications(); + public: void known_discrim_part(); + public: void empty_discrim_opt(); + public: void discrim_part(); + public: void discriminant_specification(); + public: void access_opt(); + public: void entrydecls_repspecs_opt(); + public: void entry_declaration(); + public: void rep_spec(); + public: void discrete_subtype_def_opt(); + public: void discrete_subtype_definition(); + public: void subtype_ind(); + public: void rep_spec_part( + RefAdaAST t + ); + public: void align_opt(); + public: void comp_loc_s(); + public: void protected_definition(); + public: void prot_private_opt(); + public: void prot_op_decl(); + public: void comp_decl(); + public: void prot_op_decl_s(); + public: void prot_member_decl_s(); + public: void component_subtype_def(); + public: void type_def( + RefAdaAST t + ); + public: void derived_or_private_or_record( + RefAdaAST t, boolean has_discrim + ); + public: void local_enum_name(); + public: void enumeration_aggregate(); + public: void aliased_constant_opt(); + public: void array_type_definition( + RefAdaAST t + ); + public: void enum_id_s(); + public: void range_constraint_opt(); + public: void access_type_definition( + RefAdaAST t + ); + public: void enumeration_literal_specification(); + public: void index_or_discrete_range_s(); + public: void index_or_discrete_range(); + public: void aliased_opt(); + public: void constraint_opt(); + public: void digits_constraint(); + public: void delta_constraint(); + public: void index_constraint(); + public: void discriminant_constraint(); + public: void discrete_range(); + public: void discriminant_association(); + public: void selector_names_opt(); + public: void association_head(); + public: void selector_name(); + public: void protected_opt(); + public: void constant_all_opt(); + public: void abstract_opt(); + public: void record_definition( + boolean has_discrim + ); + public: void abstract_tagged_limited_opt(); + public: void component_list( + boolean has_discrim + ); + public: void component_items(); + public: void variant_part(); + public: void empty_component_items(); + public: void discriminant_direct_name(); + public: void variant_s(); + public: void variant(); + public: void choice_s(); + public: void choice(); + public: void discrete_with_range(); + public: void mark_with_constraint(); + public: void generic_formal_part_opt(); + public: void generic_formal_parameter(); + public: void discriminable_type_definition( + RefAdaAST t + ); + public: void subprogram_default_opt(); + public: void formal_package_actual_part_opt(); + public: void body_part(); + public: void declarative_part(); + public: void block_body(); + public: void declarative_item(); + public: void body_is(); + public: void separate(); + public: void prot_op_bodies_opt(); + public: void block_body_opt(); + public: void handled_stmt_s(); + public: void entry_body(); + public: void subprog_decl_or_body(); + public: void statements(); + public: void except_handler_part_opt(); + public: void handled_stmts_opt(); + public: void statement(); + public: void def_label_opt(); + public: void null_stmt(); + public: void exit_stmt(); + public: void return_stmt(); + public: void goto_stmt(); + public: void delay_stmt(); + public: void abort_stmt(); + public: void raise_stmt(); + public: void requeue_stmt(); + public: void accept_stmt(); + public: void select_stmt(); + public: void if_stmt(); + public: void case_stmt(); + public: void loop_stmt(); + public: void block(); + public: void statement_identifier(); + public: void id_opt(); + public: void call_or_assignment(); + public: void cond_clause(); + public: void elsifs_opt(); + public: void else_opt(); + public: void condition(); + public: void alternative_s(); + public: void case_statement_alternative(); + public: void iteration_scheme_opt(); + public: void reverse_opt(); + public: void id_opt_aux(); + public: void declare_opt(); + public: void label_name(); + public: void entry_body_formal_part(); + public: void entry_barrier(); + public: void entry_index_spec_opt(); + public: void entry_call_stmt(); + public: void entry_index_opt(); + public: void until_opt(); + public: void triggering_alternative(); + public: void abortable_part(); + public: void selective_accept(); + public: void entry_call_alternative(); + public: void delay_alternative(); + public: void stmts_opt(); + public: void guard_opt(); + public: void select_alternative(); + public: void or_select_opt(); + public: void accept_alternative(); + public: void exception_handler(); + public: void identifier_colon_opt(); + public: void except_choice_s(); + public: void exception_choice(); + public: void operator_call(); + public: void operator_call_tail( + RefAdaAST opstr + ); + public: void relation(); + public: void range_or_mark(); + public: void signed_term(); + public: void term(); + public: void factor(); + public: void primary(); + public: void name_or_qualified(); + public: void allocator(); + public: void subprogram_body(); + public: void package_body(); + public: void task_body(); + public: void protected_body(); +public: + ANTLR_USE_NAMESPACE(antlr)RefAST getAST() + { + return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST); + } + +protected: + RefAdaAST returnAST; +private: + static const char* tokenNames[]; +#ifndef NO_STATIC_CONSTS + static const int NUM_TOKENS = 290; +#else + enum { + NUM_TOKENS = 290 + }; +#endif + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; + static const unsigned long _tokenSet_4_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; + static const unsigned long _tokenSet_5_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5; + static const unsigned long _tokenSet_6_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6; + static const unsigned long _tokenSet_7_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_7; + static const unsigned long _tokenSet_8_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_8; + static const unsigned long _tokenSet_9_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_9; + static const unsigned long _tokenSet_10_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_10; + static const unsigned long _tokenSet_11_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_11; + static const unsigned long _tokenSet_12_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_12; + static const unsigned long _tokenSet_13_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_13; + static const unsigned long _tokenSet_14_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_14; + static const unsigned long _tokenSet_15_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_15; + static const unsigned long _tokenSet_16_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_16; + static const unsigned long _tokenSet_17_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_17; + static const unsigned long _tokenSet_18_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_18; + static const unsigned long _tokenSet_19_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_19; + static const unsigned long _tokenSet_20_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_20; + static const unsigned long _tokenSet_21_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_21; + static const unsigned long _tokenSet_22_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_22; + static const unsigned long _tokenSet_23_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_23; + static const unsigned long _tokenSet_24_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_24; + static const unsigned long _tokenSet_25_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_25; + static const unsigned long _tokenSet_26_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_26; + static const unsigned long _tokenSet_27_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_27; + static const unsigned long _tokenSet_28_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_28; + static const unsigned long _tokenSet_29_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_29; + static const unsigned long _tokenSet_30_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_30; +}; + +#endif /*INC_AdaParser_hpp_*/ diff --git a/languages/ada/AdaStoreWalker.cpp b/languages/ada/AdaStoreWalker.cpp new file mode 100644 index 00000000..167d671c --- /dev/null +++ b/languages/ada/AdaStoreWalker.cpp @@ -0,0 +1,9439 @@ +/* $ANTLR 2.7.7 (20070609): "expandedada.store.g" -> "AdaStoreWalker.cpp"$ */ +#include "AdaStoreWalker.hpp" +#include +#include +#include +#include +#include +#include +#line 1 "expandedada.store.g" +#line 11 "AdaStoreWalker.cpp" +AdaStoreWalker::AdaStoreWalker() + : ANTLR_USE_NAMESPACE(antlr)TreeParser() { +} + +void AdaStoreWalker::compilation_unit(RefAdaAST _t) { + RefAdaAST compilation_unit_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling +#line 116 "expandedada.store.g" + init(); +#line 22 "AdaStoreWalker.cpp" + context_items_opt(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case LIBRARY_ITEM: + { + library_item(_t); + _t = _retTree; + break; + } + case SUBUNIT: + { + subunit(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == PRAGMA)) { + pragma(_t); + _t = _retTree; + } + else { + goto _loop4; + } + + } + _loop4:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::context_items_opt(RefAdaAST _t) { + RefAdaAST context_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t70 = _t; + RefAdaAST tmp1_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONTEXT_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case WITH_CLAUSE: + { + with_clause(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + default: + { + goto _loop72; + } + } + } + _loop72:; + } // ( ... )* + _t = __t70; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::library_item(RefAdaAST _t) { + RefAdaAST library_item_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST pb = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST gpi = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST ps = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + RefAdaAST prd = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + RefAdaAST __t17 = _t; + RefAdaAST tmp2_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LIBRARY_ITEM); + _t = _t->getFirstChild(); + RefAdaAST __t18 = _t; + RefAdaAST tmp3_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODIFIERS); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRIVATE: + { + RefAdaAST tmp4_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE); + _t = _t->getNextSibling(); +#line 132 "expandedada.store.g" + m_currentAccess = CodeModelItem::Protected; +#line 149 "AdaStoreWalker.cpp" + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t18; + _t = _t->getNextSibling(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + lib_subprog_decl_or_rename_or_inst_or_body(_t); + _t = _retTree; + break; + } + case PACKAGE_BODY: + { + RefAdaAST __t21 = _t; + RefAdaAST tmp5_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY); + _t = _t->getFirstChild(); + pb = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t21; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_INSTANTIATION: + { + RefAdaAST __t22 = _t; + RefAdaAST tmp6_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_INSTANTIATION); + _t = _t->getFirstChild(); + gpi = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 136 "expandedada.store.g" + + defineScope( gpi ); + +#line 213 "AdaStoreWalker.cpp" + generic_inst(_t); + _t = _retTree; + _t = __t22; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_SPECIFICATION: + { + RefAdaAST __t23 = _t; + RefAdaAST tmp7_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_SPECIFICATION); + _t = _t->getFirstChild(); + ps = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 142 "expandedada.store.g" + + NamespaceDom psc = defineScope( ps ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + +#line 236 "AdaStoreWalker.cpp" + pkg_spec_part(_t); + _t = _retTree; +#line 149 "expandedada.store.g" + + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) { + kdDebug() << "adastore: m_scopeStack is empty!" << endl; + m_scopeStack.append( m_model->globalNamespace() ); + } + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setEndPosition (endLine, 0); + m_addToStore = false; + +#line 250 "AdaStoreWalker.cpp" + _t = __t23; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + { + RefAdaAST __t24 = _t; + RefAdaAST tmp8_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + prd = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 161 "expandedada.store.g" + + defineScope( prd ); + +#line 268 "AdaStoreWalker.cpp" + renames(_t); + _t = _retTree; + _t = __t24; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + { + generic_decl(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t17; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subunit(RefAdaAST _t) { + RefAdaAST subunit_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t521 = _t; + RefAdaAST tmp9_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SUBUNIT); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case FUNCTION_BODY: + case PROCEDURE_BODY: + { + subprogram_body(_t); + _t = _retTree; + break; + } + case PACKAGE_BODY: + { + package_body(_t); + _t = _retTree; + break; + } + case TASK_BODY: + { + task_body(_t); + _t = _retTree; + break; + } + case PROTECTED_BODY: + { + protected_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t521; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::pragma(RefAdaAST _t) { + RefAdaAST pragma_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t64 = _t; + RefAdaAST tmp10_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRAGMA); + _t = _t->getFirstChild(); + RefAdaAST tmp11_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_0.member(_t->getType()))) { + pragma_arg(_t); + _t = _retTree; + } + else { + goto _loop66; + } + + } + _loop66:; + } // ( ... )* + _t = __t64; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::with_clause(RefAdaAST _t) { + RefAdaAST with_clause_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t6 = _t; + RefAdaAST tmp12_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WITH_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt8=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) { + compound_name(_t); + _t = _retTree; + } + else { + if ( _cnt8>=1 ) { goto _loop8; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt8++; + } + _loop8:; + } // ( ... )+ + _t = __t6; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::compound_name(RefAdaAST _t) { + RefAdaAST compound_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp13_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + RefAdaAST __t74 = _t; + RefAdaAST tmp14_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + RefAdaAST tmp15_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + _t = __t74; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::use_clause(RefAdaAST _t) { + RefAdaAST use_clause_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST c = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case USE_TYPE_CLAUSE: + { + RefAdaAST __t10 = _t; + RefAdaAST tmp16_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),USE_TYPE_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt12=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT || _t->getType() == TIC)) { + subtype_mark(_t); + _t = _retTree; + } + else { + if ( _cnt12>=1 ) { goto _loop12; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt12++; + } + _loop12:; + } // ( ... )+ + _t = __t10; + _t = _t->getNextSibling(); + break; + } + case USE_CLAUSE: + { + RefAdaAST __t13 = _t; + RefAdaAST tmp17_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),USE_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt15=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) { + c = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + compound_name(_t); + _t = _retTree; +#line 127 "expandedada.store.g" + m_imports.back ().push_back (qtext (c)); +#line 527 "AdaStoreWalker.cpp" + } + else { + if ( _cnt15>=1 ) { goto _loop15; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt15++; + } + _loop15:; + } // ( ... )+ + _t = __t13; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subtype_mark(RefAdaAST _t) { + RefAdaAST subtype_mark_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case TIC: + { + RefAdaAST __t76 = _t; + RefAdaAST tmp18_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIC); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + attribute_id(_t); + _t = _retTree; + _t = __t76; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::lib_subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t) { + RefAdaAST lib_subprog_decl_or_rename_or_inst_or_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling +#line 310 "expandedada.store.g" + m_addToStore = true; +#line 603 "AdaStoreWalker.cpp" + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } +#line 315 "expandedada.store.g" + m_addToStore = false; +#line 643 "AdaStoreWalker.cpp" + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::def_id(RefAdaAST _t) { + RefAdaAST def_id_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST cn = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + cn = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + compound_name(_t); + _t = _retTree; +#line 189 "expandedada.store.g" + + // kdDebug() << "cn:compound_name started " << endl; + if (m_addToStore) { + // kdDebug() << "cn:compound_name m_addToStore " << endl; + if (m_isSubprogram) { + // kdDebug() << "cn:compound_name m_isSubprogram " << endl; + FunctionDom method = m_model->create(); + method->setName (qtext (cn)); + method->setFileName(m_fileName); + // kdDebug() << "cn:compound_name method->setStartPosition(" << endl; + method->setStartPosition(cn->getLine(), cn->getColumn()); + + if (m_currentContainer == m_model->globalNamespace()) + m_file->addFunction(method); + else + m_currentContainer->addFunction(method); + //FIXME: adymo: is this valid for CodeModel + /* ParsedMethod *old = m_currentContainer->getMethod (method); + if (old) { + delete (method); + method = old; + } else { + m_currentContainer->addMethod (method); + }*/ + } else { + // TBC: what about other declarations? + } + } + +#line 691 "AdaStoreWalker.cpp" + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::pkg_body_part(RefAdaAST _t) { + RefAdaAST pkg_body_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + declarative_part(_t); + _t = _retTree; + block_body_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::generic_inst(RefAdaAST _t) { + RefAdaAST generic_inst_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + compound_name(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case VALUES: + { + value_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::pkg_spec_part(RefAdaAST _t) { + RefAdaAST pkg_spec_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + basic_declarative_items_opt(_t); + _t = _retTree; + private_declarative_items_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::renames(RefAdaAST _t) { + RefAdaAST renames_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case CHARACTER_STRING: + { + RefAdaAST tmp19_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_STRING); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + RefAdaAST tmp20_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::generic_decl(RefAdaAST _t) { + RefAdaAST generic_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST gpd = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PACKAGE_RENAMING: + { + RefAdaAST __t49 = _t; + RefAdaAST tmp21_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t49; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + { + RefAdaAST __t50 = _t; + RefAdaAST tmp22_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + gpd = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 284 "expandedada.store.g" + + NamespaceDom psc = defineScope( gpd ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + +#line 860 "AdaStoreWalker.cpp" + pkg_spec_part(_t); + _t = _retTree; +#line 291 "expandedada.store.g" + + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) + m_scopeStack.append( m_model->globalNamespace() ); + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setDeclarationEndsOnLine (endLine); + m_addToStore = false; + +#line 872 "AdaStoreWalker.cpp" + _t = __t50; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PROCEDURE_RENAMING: + { + RefAdaAST __t51 = _t; + RefAdaAST tmp23_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PROCEDURE_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t51; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PROCEDURE_DECLARATION: + { + RefAdaAST __t52 = _t; + RefAdaAST tmp24_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t52; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_RENAMING: + { + RefAdaAST __t53 = _t; + RefAdaAST tmp25_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FUNCTION_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t53; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_DECLARATION: + { + RefAdaAST __t54 = _t; + RefAdaAST tmp26_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + subprog_def_id(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t54; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprog_def_id(RefAdaAST _t) { + RefAdaAST subprog_def_id_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling +#line 171 "expandedada.store.g" + m_isSubprogram = true; +#line 965 "AdaStoreWalker.cpp" + def_id(_t); + _t = _retTree; +#line 173 "expandedada.store.g" + m_isSubprogram = false; +#line 970 "AdaStoreWalker.cpp" + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprog_decl(RefAdaAST _t) { + RefAdaAST subprog_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PROCEDURE_INSTANTIATION: + { + RefAdaAST __t27 = _t; + RefAdaAST tmp27_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PROCEDURE_INSTANTIATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t27; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_RENAMING_DECLARATION: + { + RefAdaAST __t28 = _t; + RefAdaAST tmp28_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t28; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_DECLARATION: + { + RefAdaAST __t29 = _t; + RefAdaAST tmp29_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t29; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_BODY_STUB: + { + RefAdaAST __t30 = _t; + RefAdaAST tmp30_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_BODY_STUB); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t30; + _t = _t->getNextSibling(); + break; + } + case ABSTRACT_PROCEDURE_DECLARATION: + { + RefAdaAST __t31 = _t; + RefAdaAST tmp31_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t31; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_INSTANTIATION: + { + RefAdaAST __t32 = _t; + RefAdaAST tmp32_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FUNCTION_INSTANTIATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t32; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_RENAMING_DECLARATION: + { + RefAdaAST __t33 = _t; + RefAdaAST tmp33_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t33; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_DECLARATION: + { + RefAdaAST __t34 = _t; + RefAdaAST tmp34_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t34; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_BODY_STUB: + { + RefAdaAST __t35 = _t; + RefAdaAST tmp35_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_BODY_STUB); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t35; + _t = _t->getNextSibling(); + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + { + RefAdaAST __t36 = _t; + RefAdaAST tmp36_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t36; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::formal_part_opt(RefAdaAST _t) { + RefAdaAST formal_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t112 = _t; + RefAdaAST tmp37_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PART_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == PARAMETER_SPECIFICATION)) { + parameter_specification(_t); + _t = _retTree; + } + else { + goto _loop114; + } + + } + _loop114:; + } // ( ... )* + _t = __t112; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::def_designator(RefAdaAST _t) { + RefAdaAST def_designator_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST cn = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + cn = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + compound_name(_t); + _t = _retTree; +#line 221 "expandedada.store.g" + + // kdDebug() << "def_designator cn:compound_name started" << endl; + if (m_addToStore) { + // kdDebug() << "def_designator cn:compound_name m_addToStore" << endl; + FunctionDom method = m_model->create(); + method->setName (qtext (cn)); + method->setFileName(m_fileName); + // kdDebug() << "def_designator cn:compound_name method->setStartPosition(" << endl; + method->setStartPosition(cn->getLine(), cn->getColumn()); + + if (m_currentContainer == m_model->globalNamespace()) + m_file->addFunction(method); + else + m_currentContainer->addFunction(method); + //FIXME: adymo: is this valid for CodeModel + /* ParsedMethod *old = m_currentContainer->getMethod (method); + if (old) { + delete method; + method = old; + } else { + m_currentContainer->addMethod (method); + }*/ + } + +#line 1218 "AdaStoreWalker.cpp" + break; + } + case OPERATOR_SYMBOL: + { + definable_operator_symbol(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::function_tail(RefAdaAST _t) { + RefAdaAST function_tail_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + formal_part_opt(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::definable_operator_symbol(RefAdaAST _t) { + RefAdaAST definable_operator_symbol_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp38_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::spec_decl_part(RefAdaAST _t) { + RefAdaAST spec_decl_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST ps = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PACKAGE_INSTANTIATION: + { + RefAdaAST __t40 = _t; + RefAdaAST tmp39_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_INSTANTIATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t40; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_SPECIFICATION: + { + RefAdaAST __t41 = _t; + RefAdaAST tmp40_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_SPECIFICATION); + _t = _t->getFirstChild(); + ps = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; +#line 250 "expandedada.store.g" + + NamespaceDom psc = defineScope( ps ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + +#line 1312 "AdaStoreWalker.cpp" + pkg_spec_part(_t); + _t = _retTree; +#line 257 "expandedada.store.g" + + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) { + kdDebug() << "adastore: m_scopeStack is empty!" << endl; + m_scopeStack.append( m_model->globalNamespace() ); + } + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setDeclarationEndsOnLine (endLine); + m_addToStore = false; + +#line 1326 "AdaStoreWalker.cpp" + _t = __t41; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + { + RefAdaAST __t42 = _t; + RefAdaAST tmp41_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t42; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::basic_declarative_items_opt(RefAdaAST _t) { + RefAdaAST basic_declarative_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t136 = _t; + RefAdaAST tmp42_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BASIC_DECLARATIVE_ITEMS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_1.member(_t->getType()))) { + basic_decl_item(_t); + _t = _retTree; + } + else { + goto _loop138; + } + + } + _loop138:; + } // ( ... )* + _t = __t136; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::private_declarative_items_opt(RefAdaAST _t) { + RefAdaAST private_declarative_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case PROTECTED_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SINGLE_PROTECTED_DECLARATION: + case SINGLE_TASK_DECLARATION: + case SUBTYPE_DECLARATION: + case TASK_TYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_INSTANTIATION: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { +#line 276 "expandedada.store.g" + m_currentAccess = CodeModelItem::Protected; +#line 1457 "AdaStoreWalker.cpp" + { // ( ... )+ + int _cnt47=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case PROTECTED_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SINGLE_PROTECTED_DECLARATION: + case SINGLE_TASK_DECLARATION: + case SUBTYPE_DECLARATION: + case TASK_TYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_INSTANTIATION: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + basic_decl_item(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt47>=1 ) { goto _loop47; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + } + _cnt47++; + } + _loop47:; + } // ( ... )+ +#line 278 "expandedada.store.g" + m_currentAccess = CodeModelItem::Public; +#line 1538 "AdaStoreWalker.cpp" + break; + } + case END: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::end_id_opt(RefAdaAST _t) { + RefAdaAST end_id_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t86 = _t; + RefAdaAST tmp43_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),END); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case OPERATOR_SYMBOL: + { + def_designator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t86; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::basic_decl_item(RefAdaAST _t) { + RefAdaAST basic_decl_item_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case GENERIC_PACKAGE_INSTANTIATION: + { + spec_decl_part(_t); + _t = _retTree; + break; + } + case SINGLE_TASK_DECLARATION: + case TASK_TYPE_DECLARATION: + { + task_type_or_single_decl(_t); + _t = _retTree; + break; + } + case PROTECTED_TYPE_DECLARATION: + case SINGLE_PROTECTED_DECLARATION: + { + prot_type_or_single_decl(_t); + _t = _retTree; + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SUBTYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + decl_common(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::generic_formal_part_opt(RefAdaAST _t) { + RefAdaAST generic_formal_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t295 = _t; + RefAdaAST tmp44_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FORMAL_PART); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + case FORMAL_PACKAGE_DECLARATION: + case PARAMETER_SPECIFICATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case FORMAL_DECIMAL_FIXED_POINT_DECLARATION: + case FORMAL_DISCRETE_TYPE_DECLARATION: + case FORMAL_FLOATING_POINT_DECLARATION: + case FORMAL_FUNCTION_DECLARATION: + case FORMAL_MODULAR_TYPE_DECLARATION: + case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION: + case FORMAL_ORDINARY_FIXED_POINT_DECLARATION: + case FORMAL_PRIVATE_EXTENSION_DECLARATION: + case FORMAL_PRIVATE_TYPE_DECLARATION: + case FORMAL_PROCEDURE_DECLARATION: + case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION: + { + generic_formal_parameter(_t); + _t = _retTree; + break; + } + default: + { + goto _loop297; + } + } + } + _loop297:; + } // ( ... )* + _t = __t295; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::procedure_body(RefAdaAST _t) { + RefAdaAST procedure_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t319 = _t; + RefAdaAST tmp45_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t319; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::function_body(RefAdaAST _t) { + RefAdaAST function_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t321 = _t; + RefAdaAST tmp46_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_BODY); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t321; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t) { + RefAdaAST subprog_decl_or_rename_or_inst_or_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprog_decl_or_body(RefAdaAST _t) { + RefAdaAST subprog_decl_or_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case PROCEDURE_DECLARATION: + { + RefAdaAST __t59 = _t; + RefAdaAST tmp47_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + subprog_def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t59; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + case FUNCTION_DECLARATION: + { + RefAdaAST __t60 = _t; + RefAdaAST tmp48_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t60; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::package_body(RefAdaAST _t) { + RefAdaAST package_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + RefAdaAST id = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST); + + try { // for error handling + RefAdaAST __t62 = _t; + RefAdaAST tmp49_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY); + _t = _t->getFirstChild(); + id = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t62; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::pragma_arg(RefAdaAST _t) { + RefAdaAST pragma_arg_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RIGHT_SHAFT: + { + RefAdaAST __t68 = _t; + RefAdaAST tmp50_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RIGHT_SHAFT); + _t = _t->getFirstChild(); + RefAdaAST tmp51_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + _t = __t68; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::expression(RefAdaAST _t) { + RefAdaAST expression_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case AND: + { + RefAdaAST __t479 = _t; + RefAdaAST tmp52_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AND); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t479; + _t = _t->getNextSibling(); + break; + } + case AND_THEN: + { + RefAdaAST __t480 = _t; + RefAdaAST tmp53_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AND_THEN); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t480; + _t = _t->getNextSibling(); + break; + } + case OR: + { + RefAdaAST __t481 = _t; + RefAdaAST tmp54_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t481; + _t = _t->getNextSibling(); + break; + } + case OR_ELSE: + { + RefAdaAST __t482 = _t; + RefAdaAST tmp55_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR_ELSE); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t482; + _t = _t->getNextSibling(); + break; + } + case XOR: + { + RefAdaAST __t483 = _t; + RefAdaAST tmp56_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),XOR); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t483; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case NOT_IN: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + relation(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::attribute_id(RefAdaAST _t) { + RefAdaAST attribute_id_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE: + { + RefAdaAST tmp57_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE); + _t = _t->getNextSibling(); + break; + } + case DIGITS: + { + RefAdaAST tmp58_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIGITS); + _t = _t->getNextSibling(); + break; + } + case DELTA: + { + RefAdaAST tmp59_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELTA); + _t = _t->getNextSibling(); + break; + } + case ACCESS: + { + RefAdaAST tmp60_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp61_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::modifiers(RefAdaAST _t) { + RefAdaAST modifiers_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t79 = _t; + RefAdaAST tmp62_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODIFIERS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT: + { + RefAdaAST tmp63_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT); + _t = _t->getNextSibling(); + break; + } + case ACCESS: + { + RefAdaAST tmp64_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS); + _t = _t->getNextSibling(); + break; + } + case ALIASED: + { + RefAdaAST tmp65_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALIASED); + _t = _t->getNextSibling(); + break; + } + case ALL: + { + RefAdaAST tmp66_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL); + _t = _t->getNextSibling(); + break; + } + case CONSTANT: + { + RefAdaAST tmp67_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONSTANT); + _t = _t->getNextSibling(); + break; + } + case IN: + { + RefAdaAST tmp68_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IN); + _t = _t->getNextSibling(); + break; + } + case LIMITED: + { + RefAdaAST tmp69_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LIMITED); + _t = _t->getNextSibling(); + break; + } + case OUT: + { + RefAdaAST tmp70_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OUT); + _t = _t->getNextSibling(); + break; + } + case PRIVATE: + { + RefAdaAST tmp71_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE); + _t = _t->getNextSibling(); + break; + } + case PROTECTED: + { + RefAdaAST tmp72_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED); + _t = _t->getNextSibling(); + break; + } + case REVERSE: + { + RefAdaAST tmp73_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REVERSE); + _t = _t->getNextSibling(); + break; + } + case TAGGED: + { + RefAdaAST tmp74_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TAGGED); + _t = _t->getNextSibling(); + break; + } + default: + { + goto _loop81; + } + } + } + _loop81:; + } // ( ... )* + _t = __t79; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::id_opt(RefAdaAST _t) { + RefAdaAST id_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t83 = _t; + RefAdaAST tmp75_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ID_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case OPERATOR_SYMBOL: + { + def_designator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t83; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::value_s(RefAdaAST _t) { + RefAdaAST value_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t475 = _t; + RefAdaAST tmp76_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VALUES); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt477=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_2.member(_t->getType()))) { + value(_t); + _t = _retTree; + } + else { + if ( _cnt477>=1 ) { goto _loop477; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt477++; + } + _loop477:; + } // ( ... )+ + _t = __t475; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::value(RefAdaAST _t) { + RefAdaAST value_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case OTHERS: + { + RefAdaAST __t91 = _t; + RefAdaAST tmp77_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OTHERS); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + _t = __t91; + _t = _t->getNextSibling(); + break; + } + case RIGHT_SHAFT: + { + RefAdaAST __t92 = _t; + RefAdaAST tmp78_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RIGHT_SHAFT); + _t = _t->getFirstChild(); + ranged_expr_s(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t92; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case PIPE: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + ranged_expr_s(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::ranged_expr_s(RefAdaAST _t) { + RefAdaAST ranged_expr_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + RefAdaAST __t94 = _t; + RefAdaAST tmp79_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PIPE); + _t = _t->getFirstChild(); + ranged_expr_s(_t); + _t = _retTree; + ranged_expr(_t); + _t = _retTree; + _t = __t94; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + ranged_expr(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::ranged_expr(RefAdaAST _t) { + RefAdaAST ranged_expr_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + RefAdaAST __t96 = _t; + RefAdaAST tmp80_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT_DOT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t96; + _t = _t->getNextSibling(); + break; + } + case RANGE: + { + RefAdaAST __t97 = _t; + RefAdaAST tmp81_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + _t = __t97; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::simple_expression(RefAdaAST _t) { + RefAdaAST simple_expression_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PLUS: + { + RefAdaAST __t495 = _t; + RefAdaAST tmp82_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PLUS); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t495; + _t = _t->getNextSibling(); + break; + } + case MINUS: + { + RefAdaAST __t496 = _t; + RefAdaAST tmp83_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MINUS); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t496; + _t = _t->getNextSibling(); + break; + } + case CONCAT: + { + RefAdaAST __t497 = _t; + RefAdaAST tmp84_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONCAT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t497; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + signed_term(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range(RefAdaAST _t) { + RefAdaAST range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + range_dots(_t); + _t = _retTree; + break; + } + case RANGE_ATTRIBUTE_REFERENCE: + { + range_attrib_ref(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_constraint(RefAdaAST _t) { + RefAdaAST range_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t99 = _t; + RefAdaAST tmp85_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE_CONSTRAINT); + _t = _t->getFirstChild(); + range(_t); + _t = _retTree; + _t = __t99; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_dots(RefAdaAST _t) { + RefAdaAST range_dots_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t103 = _t; + RefAdaAST tmp86_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT_DOT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t103; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_attrib_ref(RefAdaAST _t) { + RefAdaAST range_attrib_ref_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t105 = _t; + RefAdaAST tmp87_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE_ATTRIBUTE_REFERENCE); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t105; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prefix(RefAdaAST _t) { + RefAdaAST prefix_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp88_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + RefAdaAST __t108 = _t; + RefAdaAST tmp89_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + RefAdaAST tmp90_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp91_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t108; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + RefAdaAST __t110 = _t; + RefAdaAST tmp92_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEXED_COMPONENT); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t110; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::parameter_specification(RefAdaAST _t) { + RefAdaAST parameter_specification_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t116 = _t; + RefAdaAST tmp93_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PARAMETER_SPECIFICATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t116; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::defining_identifier_list(RefAdaAST _t) { + RefAdaAST defining_identifier_list_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t118 = _t; + RefAdaAST tmp94_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DEFINING_IDENTIFIER_LIST); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt120=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER)) { + RefAdaAST tmp95_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + else { + if ( _cnt120>=1 ) { goto _loop120; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt120++; + } + _loop120:; + } // ( ... )+ + _t = __t118; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::init_opt(RefAdaAST _t) { + RefAdaAST init_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t154 = _t; + RefAdaAST tmp96_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INIT_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t154; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::name(RefAdaAST _t) { + RefAdaAST name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp97_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + RefAdaAST __t123 = _t; + RefAdaAST tmp98_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + RefAdaAST tmp99_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp100_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp101_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + RefAdaAST tmp102_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t123; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + RefAdaAST __t125 = _t; + RefAdaAST tmp103_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEXED_COMPONENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t125; + _t = _t->getNextSibling(); + break; + } + case TIC: + { + RefAdaAST __t126 = _t; + RefAdaAST tmp104_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIC); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + attribute_id(_t); + _t = _retTree; + _t = __t126; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::parenthesized_primary(RefAdaAST _t) { + RefAdaAST parenthesized_primary_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t129 = _t; + RefAdaAST tmp105_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PARENTHESIZED_PRIMARY); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case NuLL: + { + RefAdaAST tmp106_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NuLL); + _t = _t->getNextSibling(); + break; + } + case VALUES: + { + value_s(_t); + _t = _retTree; + extension_opt(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t129; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::extension_opt(RefAdaAST _t) { + RefAdaAST extension_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t132 = _t; + RefAdaAST tmp107_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXTENSION_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case NuLL: + { + RefAdaAST tmp108_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NuLL); + _t = _t->getNextSibling(); + break; + } + case VALUES: + { + value_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t132; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::task_type_or_single_decl(RefAdaAST _t) { + RefAdaAST task_type_or_single_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case TASK_TYPE_DECLARATION: + { + RefAdaAST __t141 = _t; + RefAdaAST tmp109_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + task_definition_opt(_t); + _t = _retTree; + _t = __t141; + _t = _t->getNextSibling(); + break; + } + case SINGLE_TASK_DECLARATION: + { + RefAdaAST __t142 = _t; + RefAdaAST tmp110_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SINGLE_TASK_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + task_definition_opt(_t); + _t = _retTree; + _t = __t142; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_type_or_single_decl(RefAdaAST _t) { + RefAdaAST prot_type_or_single_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROTECTED_TYPE_DECLARATION: + { + RefAdaAST __t182 = _t; + RefAdaAST tmp111_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + protected_definition(_t); + _t = _retTree; + _t = __t182; + _t = _t->getNextSibling(); + break; + } + case SINGLE_PROTECTED_DECLARATION: + { + RefAdaAST __t183 = _t; + RefAdaAST tmp112_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SINGLE_PROTECTED_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + protected_definition(_t); + _t = _retTree; + _t = __t183; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::decl_common(RefAdaAST _t) { + RefAdaAST decl_common_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENUMERATION_TYPE_DECLARATION: + { + RefAdaAST __t202 = _t; + RefAdaAST tmp113_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENUMERATION_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp114_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + enum_id_s(_t); + _t = _retTree; + _t = __t202; + _t = _t->getNextSibling(); + break; + } + case SIGNED_INTEGER_TYPE_DECLARATION: + { + RefAdaAST __t203 = _t; + RefAdaAST tmp115_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SIGNED_INTEGER_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp116_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + range(_t); + _t = _retTree; + _t = __t203; + _t = _t->getNextSibling(); + break; + } + case MODULAR_TYPE_DECLARATION: + { + RefAdaAST __t204 = _t; + RefAdaAST tmp117_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODULAR_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp118_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + _t = __t204; + _t = _t->getNextSibling(); + break; + } + case FLOATING_POINT_DECLARATION: + { + RefAdaAST __t205 = _t; + RefAdaAST tmp119_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FLOATING_POINT_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp120_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t205; + _t = _t->getNextSibling(); + break; + } + case ORDINARY_FIXED_POINT_DECLARATION: + { + RefAdaAST __t206 = _t; + RefAdaAST tmp121_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ORDINARY_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp122_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + _t = __t206; + _t = _t->getNextSibling(); + break; + } + case DECIMAL_FIXED_POINT_DECLARATION: + { + RefAdaAST __t207 = _t; + RefAdaAST tmp123_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DECIMAL_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp124_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t207; + _t = _t->getNextSibling(); + break; + } + case ARRAY_TYPE_DECLARATION: + { + array_type_declaration(_t); + _t = _retTree; + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + { + access_type_declaration(_t); + _t = _retTree; + break; + } + case INCOMPLETE_TYPE_DECLARATION: + { + RefAdaAST __t208 = _t; + RefAdaAST tmp125_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INCOMPLETE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp126_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + discrim_part_opt(_t); + _t = _retTree; + _t = __t208; + _t = _t->getNextSibling(); + break; + } + case PRIVATE_EXTENSION_DECLARATION: + { + RefAdaAST __t209 = _t; + RefAdaAST tmp127_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE_EXTENSION_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t209; + _t = _t->getNextSibling(); + break; + } + case DERIVED_RECORD_EXTENSION: + { + RefAdaAST __t210 = _t; + RefAdaAST tmp128_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DERIVED_RECORD_EXTENSION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + record_definition(_t); + _t = _retTree; + _t = __t210; + _t = _t->getNextSibling(); + break; + } + case ORDINARY_DERIVED_TYPE_DECLARATION: + { + RefAdaAST __t211 = _t; + RefAdaAST tmp129_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ORDINARY_DERIVED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t211; + _t = _t->getNextSibling(); + break; + } + case PRIVATE_TYPE_DECLARATION: + { + RefAdaAST __t212 = _t; + RefAdaAST tmp130_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + _t = __t212; + _t = _t->getNextSibling(); + break; + } + case RECORD_TYPE_DECLARATION: + { + RefAdaAST __t213 = _t; + RefAdaAST tmp131_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RECORD_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + record_definition(_t); + _t = _retTree; + _t = __t213; + _t = _t->getNextSibling(); + break; + } + case SUBTYPE_DECLARATION: + { + RefAdaAST __t214 = _t; + RefAdaAST tmp132_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SUBTYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp133_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + subtype_ind(_t); + _t = _retTree; + _t = __t214; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + { + generic_decl(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + case EXCEPTION_RENAMING_DECLARATION: + { + RefAdaAST __t215 = _t; + RefAdaAST tmp134_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPTION_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + compound_name(_t); + _t = _retTree; + _t = __t215; + _t = _t->getNextSibling(); + break; + } + case OBJECT_RENAMING_DECLARATION: + { + RefAdaAST __t216 = _t; + RefAdaAST tmp135_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OBJECT_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + name(_t); + _t = _retTree; + _t = __t216; + _t = _t->getNextSibling(); + break; + } + case EXCEPTION_DECLARATION: + { + RefAdaAST __t217 = _t; + RefAdaAST tmp136_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPTION_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + _t = __t217; + _t = _t->getNextSibling(); + break; + } + case NUMBER_DECLARATION: + { + RefAdaAST __t218 = _t; + RefAdaAST tmp137_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUMBER_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t218; + _t = _t->getNextSibling(); + break; + } + case ARRAY_OBJECT_DECLARATION: + { + RefAdaAST __t219 = _t; + RefAdaAST tmp138_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_OBJECT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + array_type_definition(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t219; + _t = _t->getNextSibling(); + break; + } + case OBJECT_DECLARATION: + { + RefAdaAST __t220 = _t; + RefAdaAST tmp139_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OBJECT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t220; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrim_part_opt(RefAdaAST _t) { + RefAdaAST discrim_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t145 = _t; + RefAdaAST tmp140_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIM_PART_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + RefAdaAST tmp141_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX); + _t = _t->getNextSibling(); + break; + } + case DISCRIMINANT_SPECIFICATIONS: + { + discriminant_specifications(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t145; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::task_definition_opt(RefAdaAST _t) { + RefAdaAST task_definition_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + task_items_opt(_t); + _t = _retTree; + private_task_items_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::task_items_opt(RefAdaAST _t) { + RefAdaAST task_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t157 = _t; + RefAdaAST tmp142_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_ITEMS_OPT); + _t = _t->getFirstChild(); + entrydecls_repspecs_opt(_t); + _t = _retTree; + _t = __t157; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::private_task_items_opt(RefAdaAST _t) { + RefAdaAST private_task_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t180 = _t; + RefAdaAST tmp143_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE_TASK_ITEMS_OPT); + _t = _t->getFirstChild(); + entrydecls_repspecs_opt(_t); + _t = _retTree; + _t = __t180; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_specifications(RefAdaAST _t) { + RefAdaAST discriminant_specifications_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t148 = _t; + RefAdaAST tmp144_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_SPECIFICATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == DISCRIMINANT_SPECIFICATION)) { + discriminant_specification(_t); + _t = _retTree; + } + else { + goto _loop150; + } + + } + _loop150:; + } // ( ... )* + _t = __t148; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_specification(RefAdaAST _t) { + RefAdaAST discriminant_specification_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t152 = _t; + RefAdaAST tmp145_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_SPECIFICATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t152; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entrydecls_repspecs_opt(RefAdaAST _t) { + RefAdaAST entrydecls_repspecs_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENTRY_DECLARATION: + { + entry_declaration(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + default: + { + goto _loop160; + } + } + } + _loop160:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_declaration(RefAdaAST _t) { + RefAdaAST entry_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t162 = _t; + RefAdaAST tmp146_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp147_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + discrete_subtype_def_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t162; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::rep_spec(RefAdaAST _t) { + RefAdaAST rep_spec_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RECORD_REPRESENTATION_CLAUSE: + { + RefAdaAST __t168 = _t; + RefAdaAST tmp148_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RECORD_REPRESENTATION_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + align_opt(_t); + _t = _retTree; + comp_loc_s(_t); + _t = _retTree; + _t = __t168; + _t = _t->getNextSibling(); + break; + } + case AT_CLAUSE: + { + RefAdaAST __t169 = _t; + RefAdaAST tmp149_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AT_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t169; + _t = _t->getNextSibling(); + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + { + RefAdaAST __t170 = _t; + RefAdaAST tmp150_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ATTRIBUTE_DEFINITION_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t170; + _t = _t->getNextSibling(); + break; + } + case ENUMERATION_REPESENTATION_CLAUSE: + { + RefAdaAST __t171 = _t; + RefAdaAST tmp151_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENUMERATION_REPESENTATION_CLAUSE); + _t = _t->getFirstChild(); + local_enum_name(_t); + _t = _retTree; + enumeration_aggregate(_t); + _t = _retTree; + _t = __t171; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrete_subtype_def_opt(RefAdaAST _t) { + RefAdaAST discrete_subtype_def_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t164 = _t; + RefAdaAST tmp152_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRETE_SUBTYPE_DEF_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + case SUBTYPE_INDICATION: + { + discrete_subtype_definition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t164; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrete_subtype_definition(RefAdaAST _t) { + RefAdaAST discrete_subtype_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case SUBTYPE_INDICATION: + { + subtype_ind(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subtype_ind(RefAdaAST _t) { + RefAdaAST subtype_ind_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t239 = _t; + RefAdaAST tmp153_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SUBTYPE_INDICATION); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + constraint_opt(_t); + _t = _retTree; + _t = __t239; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::align_opt(RefAdaAST _t) { + RefAdaAST align_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t173 = _t; + RefAdaAST tmp154_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MOD_CLAUSE_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t173; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::comp_loc_s(RefAdaAST _t) { + RefAdaAST comp_loc_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t176 = _t; + RefAdaAST tmp155_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMPONENT_CLAUSES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + { + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + break; + } + default: + { + goto _loop178; + } + } + } + _loop178:; + } // ( ... )* + _t = __t176; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::local_enum_name(RefAdaAST _t) { + RefAdaAST local_enum_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp156_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::enumeration_aggregate(RefAdaAST _t) { + RefAdaAST enumeration_aggregate_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_2.member(_t->getType()))) { + value(_t); + _t = _retTree; + } + else { + goto _loop293; + } + + } + _loop293:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::protected_definition(RefAdaAST _t) { + RefAdaAST protected_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + prot_op_decl_s(_t); + _t = _retTree; + prot_private_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_private_opt(RefAdaAST _t) { + RefAdaAST prot_private_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t185 = _t; + RefAdaAST tmp157_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_PRIVATE_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROT_MEMBER_DECLARATIONS: + { + prot_member_decl_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t185; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_member_decl_s(RefAdaAST _t) { + RefAdaAST prot_member_decl_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t196 = _t; + RefAdaAST tmp158_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_MEMBER_DECLARATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENTRY_DECLARATION: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + case FUNCTION_DECLARATION: + case PROCEDURE_DECLARATION: + { + prot_op_decl(_t); + _t = _retTree; + break; + } + case COMPONENT_DECLARATION: + { + comp_decl(_t); + _t = _retTree; + break; + } + default: + { + goto _loop198; + } + } + } + _loop198:; + } // ( ... )* + _t = __t196; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_op_decl_s(RefAdaAST _t) { + RefAdaAST prot_op_decl_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t189 = _t; + RefAdaAST tmp159_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_OP_DECLARATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_3.member(_t->getType()))) { + prot_op_decl(_t); + _t = _retTree; + } + else { + goto _loop191; + } + + } + _loop191:; + } // ( ... )* + _t = __t189; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_op_decl(RefAdaAST _t) { + RefAdaAST prot_op_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENTRY_DECLARATION: + { + entry_declaration(_t); + _t = _retTree; + break; + } + case PROCEDURE_DECLARATION: + { + RefAdaAST __t193 = _t; + RefAdaAST tmp160_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t193; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_DECLARATION: + { + RefAdaAST __t194 = _t; + RefAdaAST tmp161_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t194; + _t = _t->getNextSibling(); + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::comp_decl(RefAdaAST _t) { + RefAdaAST comp_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t200 = _t; + RefAdaAST tmp162_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMPONENT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + component_subtype_def(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t200; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::component_subtype_def(RefAdaAST _t) { + RefAdaAST component_subtype_def_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::enum_id_s(RefAdaAST _t) { + RefAdaAST enum_id_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )+ + int _cnt224=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == CHARACTER_LITERAL)) { + enumeration_literal_specification(_t); + _t = _retTree; + } + else { + if ( _cnt224>=1 ) { goto _loop224; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt224++; + } + _loop224:; + } // ( ... )+ + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_constraint_opt(RefAdaAST _t) { + RefAdaAST range_constraint_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE_CONSTRAINT: + { + range_constraint(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::array_type_declaration(RefAdaAST _t) { + RefAdaAST array_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t230 = _t; + RefAdaAST tmp163_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_TYPE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp164_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + array_type_definition(_t); + _t = _retTree; + _t = __t230; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::access_type_declaration(RefAdaAST _t) { + RefAdaAST access_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ACCESS_TO_PROCEDURE_DECLARATION: + { + RefAdaAST __t263 = _t; + RefAdaAST tmp165_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS_TO_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp166_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t263; + _t = _t->getNextSibling(); + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + { + RefAdaAST __t264 = _t; + RefAdaAST tmp167_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS_TO_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp168_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t264; + _t = _t->getNextSibling(); + break; + } + case ACCESS_TO_OBJECT_DECLARATION: + { + RefAdaAST __t265 = _t; + RefAdaAST tmp169_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS_TO_OBJECT_DECLARATION); + _t = _t->getFirstChild(); + RefAdaAST tmp170_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t265; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::id_and_discrim(RefAdaAST _t) { + RefAdaAST id_and_discrim_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp171_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + discrim_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::record_definition(RefAdaAST _t) { + RefAdaAST record_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case COMPONENT_ITEMS: + { + component_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::array_type_definition(RefAdaAST _t) { + RefAdaAST array_type_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + index_or_discrete_range_s(_t); + _t = _retTree; + component_subtype_def(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::enumeration_literal_specification(RefAdaAST _t) { + RefAdaAST enumeration_literal_specification_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp172_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp173_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::index_or_discrete_range_s(RefAdaAST _t) { + RefAdaAST index_or_discrete_range_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case DOT_DOT: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + index_or_discrete_range(_t); + _t = _retTree; + break; + } + case COMMA: + { + RefAdaAST __t232 = _t; + RefAdaAST tmp174_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMMA); + _t = _t->getFirstChild(); + index_or_discrete_range_s(_t); + _t = _retTree; + index_or_discrete_range(_t); + _t = _retTree; + _t = __t232; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::index_or_discrete_range(RefAdaAST _t) { + RefAdaAST index_or_discrete_range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + RefAdaAST __t234 = _t; + RefAdaAST tmp175_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT_DOT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t234; + _t = _t->getNextSibling(); + break; + } + case RANGE: + { + RefAdaAST __t235 = _t; + RefAdaAST tmp176_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + RefAdaAST tmp177_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX); + _t = _t->getNextSibling(); + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t235; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + simple_expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::constraint_opt(RefAdaAST _t) { + RefAdaAST constraint_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE_CONSTRAINT: + { + range_constraint(_t); + _t = _retTree; + break; + } + case DIGITS_CONSTRAINT: + { + digits_constraint(_t); + _t = _retTree; + break; + } + case DELTA_CONSTRAINT: + { + delta_constraint(_t); + _t = _retTree; + break; + } + case INDEX_CONSTRAINT: + { + index_constraint(_t); + _t = _retTree; + break; + } + case DISCRIMINANT_CONSTRAINT: + { + discriminant_constraint(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::digits_constraint(RefAdaAST _t) { + RefAdaAST digits_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t243 = _t; + RefAdaAST tmp178_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIGITS_CONSTRAINT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t243; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::delta_constraint(RefAdaAST _t) { + RefAdaAST delta_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t245 = _t; + RefAdaAST tmp179_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELTA_CONSTRAINT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t245; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::index_constraint(RefAdaAST _t) { + RefAdaAST index_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t247 = _t; + RefAdaAST tmp180_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEX_CONSTRAINT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt249=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == DOT_DOT || _t->getType() == RANGE_ATTRIBUTE_REFERENCE || _t->getType() == SUBTYPE_INDICATION)) { + discrete_range(_t); + _t = _retTree; + } + else { + if ( _cnt249>=1 ) { goto _loop249; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt249++; + } + _loop249:; + } // ( ... )+ + _t = __t247; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_constraint(RefAdaAST _t) { + RefAdaAST discriminant_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t252 = _t; + RefAdaAST tmp181_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_CONSTRAINT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt254=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == DISCRIMINANT_ASSOCIATION)) { + discriminant_association(_t); + _t = _retTree; + } + else { + if ( _cnt254>=1 ) { goto _loop254; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt254++; + } + _loop254:; + } // ( ... )+ + _t = __t252; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrete_range(RefAdaAST _t) { + RefAdaAST discrete_range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case SUBTYPE_INDICATION: + { + subtype_ind(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_association(RefAdaAST _t) { + RefAdaAST discriminant_association_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t256 = _t; + RefAdaAST tmp182_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_ASSOCIATION); + _t = _t->getFirstChild(); + selector_names_opt(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t256; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::selector_names_opt(RefAdaAST _t) { + RefAdaAST selector_names_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t258 = _t; + RefAdaAST tmp183_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SELECTOR_NAMES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER)) { + selector_name(_t); + _t = _retTree; + } + else { + goto _loop260; + } + + } + _loop260:; + } // ( ... )* + _t = __t258; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::selector_name(RefAdaAST _t) { + RefAdaAST selector_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp184_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::component_list(RefAdaAST _t) { + RefAdaAST component_list_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + component_items(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case VARIANT_PART: + { + variant_part(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::component_items(RefAdaAST _t) { + RefAdaAST component_items_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t271 = _t; + RefAdaAST tmp185_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMPONENT_ITEMS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case COMPONENT_DECLARATION: + { + comp_decl(_t); + _t = _retTree; + break; + } + default: + { + goto _loop273; + } + } + } + _loop273:; + } // ( ... )* + _t = __t271; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::variant_part(RefAdaAST _t) { + RefAdaAST variant_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t275 = _t; + RefAdaAST tmp186_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANT_PART); + _t = _t->getFirstChild(); + discriminant_direct_name(_t); + _t = _retTree; + variant_s(_t); + _t = _retTree; + _t = __t275; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discriminant_direct_name(RefAdaAST _t) { + RefAdaAST discriminant_direct_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp187_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::variant_s(RefAdaAST _t) { + RefAdaAST variant_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t278 = _t; + RefAdaAST tmp188_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANTS); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt280=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == VARIANT)) { + variant(_t); + _t = _retTree; + } + else { + if ( _cnt280>=1 ) { goto _loop280; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt280++; + } + _loop280:; + } // ( ... )+ + _t = __t278; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::variant(RefAdaAST _t) { + RefAdaAST variant_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t282 = _t; + RefAdaAST tmp189_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANT); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case COMPONENT_ITEMS: + { + component_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t282; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::choice_s(RefAdaAST _t) { + RefAdaAST choice_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + RefAdaAST __t285 = _t; + RefAdaAST tmp190_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PIPE); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + choice(_t); + _t = _retTree; + _t = __t285; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case OTHERS: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case RANGE_ATTRIBUTE_REFERENCE: + case AND_THEN: + case MARK_WITH_CONSTRAINT: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + choice(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::choice(RefAdaAST _t) { + RefAdaAST choice_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case OTHERS: + { + RefAdaAST tmp191_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OTHERS); + _t = _t->getNextSibling(); + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + case MARK_WITH_CONSTRAINT: + { + discrete_with_range(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::discrete_with_range(RefAdaAST _t) { + RefAdaAST discrete_with_range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case MARK_WITH_CONSTRAINT: + { + mark_with_constraint(_t); + _t = _retTree; + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::mark_with_constraint(RefAdaAST _t) { + RefAdaAST mark_with_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t289 = _t; + RefAdaAST tmp192_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MARK_WITH_CONSTRAINT); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + range_constraint(_t); + _t = _retTree; + _t = __t289; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::generic_formal_parameter(RefAdaAST _t) { + RefAdaAST generic_formal_parameter_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case FORMAL_DISCRETE_TYPE_DECLARATION: + { + RefAdaAST __t299 = _t; + RefAdaAST tmp193_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_DISCRETE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t299; + _t = _t->getNextSibling(); + break; + } + case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION: + { + RefAdaAST __t300 = _t; + RefAdaAST tmp194_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_SIGNED_INTEGER_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t300; + _t = _t->getNextSibling(); + break; + } + case FORMAL_MODULAR_TYPE_DECLARATION: + { + RefAdaAST __t301 = _t; + RefAdaAST tmp195_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_MODULAR_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t301; + _t = _t->getNextSibling(); + break; + } + case FORMAL_DECIMAL_FIXED_POINT_DECLARATION: + { + RefAdaAST __t302 = _t; + RefAdaAST tmp196_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_DECIMAL_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t302; + _t = _t->getNextSibling(); + break; + } + case FORMAL_ORDINARY_FIXED_POINT_DECLARATION: + { + RefAdaAST __t303 = _t; + RefAdaAST tmp197_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_ORDINARY_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t303; + _t = _t->getNextSibling(); + break; + } + case FORMAL_FLOATING_POINT_DECLARATION: + { + RefAdaAST __t304 = _t; + RefAdaAST tmp198_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_FLOATING_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t304; + _t = _t->getNextSibling(); + break; + } + case ARRAY_TYPE_DECLARATION: + { + formal_array_type_declaration(_t); + _t = _retTree; + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + { + formal_access_type_declaration(_t); + _t = _retTree; + break; + } + case FORMAL_PRIVATE_TYPE_DECLARATION: + { + RefAdaAST __t305 = _t; + RefAdaAST tmp199_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PRIVATE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + _t = __t305; + _t = _t->getNextSibling(); + break; + } + case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION: + { + RefAdaAST __t306 = _t; + RefAdaAST tmp200_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t306; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PRIVATE_EXTENSION_DECLARATION: + { + RefAdaAST __t307 = _t; + RefAdaAST tmp201_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PRIVATE_EXTENSION_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t307; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PROCEDURE_DECLARATION: + { + RefAdaAST __t308 = _t; + RefAdaAST tmp202_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + subprogram_default_opt(_t); + _t = _retTree; + _t = __t308; + _t = _t->getNextSibling(); + break; + } + case FORMAL_FUNCTION_DECLARATION: + { + RefAdaAST __t309 = _t; + RefAdaAST tmp203_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + subprogram_default_opt(_t); + _t = _retTree; + _t = __t309; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PACKAGE_DECLARATION: + { + RefAdaAST __t310 = _t; + RefAdaAST tmp204_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PACKAGE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + compound_name(_t); + _t = _retTree; + formal_package_actual_part_opt(_t); + _t = _retTree; + _t = __t310; + _t = _t->getNextSibling(); + break; + } + case PARAMETER_SPECIFICATION: + { + parameter_specification(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::formal_array_type_declaration(RefAdaAST _t) { + RefAdaAST formal_array_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + array_type_declaration(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::formal_access_type_declaration(RefAdaAST _t) { + RefAdaAST formal_access_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + access_type_declaration(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::id_part(RefAdaAST _t) { + RefAdaAST id_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprogram_default_opt(RefAdaAST _t) { + RefAdaAST subprogram_default_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + RefAdaAST tmp205_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::formal_package_actual_part_opt(RefAdaAST _t) { + RefAdaAST formal_package_actual_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + RefAdaAST tmp206_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX); + _t = _t->getNextSibling(); + break; + } + case DEFINING_IDENTIFIER_LIST: + { + defining_identifier_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::body_part(RefAdaAST _t) { + RefAdaAST body_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + declarative_part(_t); + _t = _retTree; + block_body(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::declarative_part(RefAdaAST _t) { + RefAdaAST declarative_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t324 = _t; + RefAdaAST tmp207_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DECLARATIVE_PART); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PACKAGE_BODY: + case PACKAGE_BODY_STUB: + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case PROTECTED_BODY: + case PROTECTED_BODY_STUB: + case PROTECTED_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SINGLE_PROTECTED_DECLARATION: + case SINGLE_TASK_DECLARATION: + case SUBTYPE_DECLARATION: + case TASK_BODY: + case TASK_BODY_STUB: + case TASK_TYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_INSTANTIATION: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + declarative_item(_t); + _t = _retTree; + break; + } + default: + { + goto _loop326; + } + } + } + _loop326:; + } // ( ... )* + _t = __t324; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::block_body(RefAdaAST _t) { + RefAdaAST block_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t343 = _t; + RefAdaAST tmp208_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK_BODY); + _t = _t->getFirstChild(); + handled_stmt_s(_t); + _t = _retTree; + _t = __t343; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::declarative_item(RefAdaAST _t) { + RefAdaAST declarative_item_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PACKAGE_BODY_STUB: + { + RefAdaAST __t328 = _t; + RefAdaAST tmp209_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t328; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_BODY: + { + RefAdaAST __t329 = _t; + RefAdaAST tmp210_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t329; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case GENERIC_PACKAGE_INSTANTIATION: + { + spec_decl_part(_t); + _t = _retTree; + break; + } + case TASK_BODY_STUB: + { + RefAdaAST __t330 = _t; + RefAdaAST tmp211_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t330; + _t = _t->getNextSibling(); + break; + } + case TASK_BODY: + { + RefAdaAST __t331 = _t; + RefAdaAST tmp212_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t331; + _t = _t->getNextSibling(); + break; + } + case SINGLE_TASK_DECLARATION: + case TASK_TYPE_DECLARATION: + { + task_type_or_single_decl(_t); + _t = _retTree; + break; + } + case PROTECTED_BODY_STUB: + { + RefAdaAST __t332 = _t; + RefAdaAST tmp213_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t332; + _t = _t->getNextSibling(); + break; + } + case PROTECTED_BODY: + { + RefAdaAST __t333 = _t; + RefAdaAST tmp214_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + prot_op_bodies_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t333; + _t = _t->getNextSibling(); + break; + } + case PROTECTED_TYPE_DECLARATION: + case SINGLE_PROTECTED_DECLARATION: + { + prot_type_or_single_decl(_t); + _t = _retTree; + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl_or_rename_or_inst_or_body(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SUBTYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + decl_common(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::prot_op_bodies_opt(RefAdaAST _t) { + RefAdaAST prot_op_bodies_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t339 = _t; + RefAdaAST tmp215_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_OP_BODIES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ENTRY_BODY: + { + entry_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + case FUNCTION_DECLARATION: + case PROCEDURE_BODY: + case PROCEDURE_DECLARATION: + { + subprog_decl_or_body(_t); + _t = _retTree; + break; + } + default: + { + goto _loop341; + } + } + } + _loop341:; + } // ( ... )* + _t = __t339; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::block_body_opt(RefAdaAST _t) { + RefAdaAST block_body_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t336 = _t; + RefAdaAST tmp216_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK_BODY_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case HANDLED_SEQUENCE_OF_STATEMENTS: + { + handled_stmt_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t336; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::handled_stmt_s(RefAdaAST _t) { + RefAdaAST handled_stmt_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t345 = _t; + RefAdaAST tmp217_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),HANDLED_SEQUENCE_OF_STATEMENTS); + _t = _t->getFirstChild(); + statements(_t); + _t = _retTree; + except_handler_part_opt(_t); + _t = _retTree; + _t = __t345; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_body(RefAdaAST _t) { + RefAdaAST entry_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t405 = _t; + RefAdaAST tmp218_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + entry_body_formal_part(_t); + _t = _retTree; + entry_barrier(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t405; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::statements(RefAdaAST _t) { + RefAdaAST statements_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t350 = _t; + RefAdaAST tmp219_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SEQUENCE_OF_STATEMENTS); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt352=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case STATEMENT: + { + statement(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt352>=1 ) { goto _loop352; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + } + _cnt352++; + } + _loop352:; + } // ( ... )+ + _t = __t350; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::except_handler_part_opt(RefAdaAST _t) { + RefAdaAST except_handler_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t455 = _t; + RefAdaAST tmp220_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPT_HANDLER_PART_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == EXCEPTION_HANDLER)) { + exception_handler(_t); + _t = _retTree; + } + else { + goto _loop457; + } + + } + _loop457:; + } // ( ... )* + _t = __t455; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::handled_stmts_opt(RefAdaAST _t) { + RefAdaAST handled_stmts_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t347 = _t; + RefAdaAST tmp221_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),HANDLED_STMTS_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case SEQUENCE_OF_STATEMENTS: + { + statements(_t); + _t = _retTree; + except_handler_part_opt(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t347; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::statement(RefAdaAST _t) { + RefAdaAST statement_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t354 = _t; + RefAdaAST tmp222_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STATEMENT); + _t = _t->getFirstChild(); + def_label_opt(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case NULL_STATEMENT: + { + null_stmt(_t); + _t = _retTree; + break; + } + case EXIT_STATEMENT: + { + exit_stmt(_t); + _t = _retTree; + break; + } + case RETURN_STATEMENT: + { + return_stmt(_t); + _t = _retTree; + break; + } + case GOTO_STATEMENT: + { + goto_stmt(_t); + _t = _retTree; + break; + } + case DELAY_STATEMENT: + { + delay_stmt(_t); + _t = _retTree; + break; + } + case ABORT_STATEMENT: + { + abort_stmt(_t); + _t = _retTree; + break; + } + case RAISE_STATEMENT: + { + raise_stmt(_t); + _t = _retTree; + break; + } + case REQUEUE_STATEMENT: + { + requeue_stmt(_t); + _t = _retTree; + break; + } + case ACCEPT_STATEMENT: + { + accept_stmt(_t); + _t = _retTree; + break; + } + case ASYNCHRONOUS_SELECT: + case CONDITIONAL_ENTRY_CALL: + case SELECTIVE_ACCEPT: + case TIMED_ENTRY_CALL: + { + select_stmt(_t); + _t = _retTree; + break; + } + case IF_STATEMENT: + { + if_stmt(_t); + _t = _retTree; + break; + } + case CASE_STATEMENT: + { + case_stmt(_t); + _t = _retTree; + break; + } + case LOOP_STATEMENT: + { + loop_stmt(_t); + _t = _retTree; + id_opt(_t); + _t = _retTree; + break; + } + case BLOCK_STATEMENT: + { + block(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + break; + } + case ASSIGNMENT_STATEMENT: + case CALL_STATEMENT: + { + call_or_assignment(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t354; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::def_label_opt(RefAdaAST _t) { + RefAdaAST def_label_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t357 = _t; + RefAdaAST tmp223_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LABEL_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp224_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t357; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::null_stmt(RefAdaAST _t) { + RefAdaAST null_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp225_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NULL_STATEMENT); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::exit_stmt(RefAdaAST _t) { + RefAdaAST exit_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t392 = _t; + RefAdaAST tmp226_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXIT_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + label_name(_t); + _t = _retTree; + break; + } + case 3: + case WHEN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case WHEN: + { + RefAdaAST tmp227_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WHEN); + _t = _t->getNextSibling(); + condition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t392; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::return_stmt(RefAdaAST _t) { + RefAdaAST return_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t397 = _t; + RefAdaAST tmp228_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RETURN_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t397; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::goto_stmt(RefAdaAST _t) { + RefAdaAST goto_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t400 = _t; + RefAdaAST tmp229_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GOTO_STATEMENT); + _t = _t->getFirstChild(); + label_name(_t); + _t = _retTree; + _t = __t400; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::delay_stmt(RefAdaAST _t) { + RefAdaAST delay_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t419 = _t; + RefAdaAST tmp230_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELAY_STATEMENT); + _t = _t->getFirstChild(); + modifiers(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t419; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::abort_stmt(RefAdaAST _t) { + RefAdaAST abort_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t451 = _t; + RefAdaAST tmp231_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABORT_STATEMENT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt453=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_tokenSet_4.member(_t->getType()))) { + name(_t); + _t = _retTree; + } + else { + if ( _cnt453>=1 ) { goto _loop453; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt453++; + } + _loop453:; + } // ( ... )+ + _t = __t451; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::raise_stmt(RefAdaAST _t) { + RefAdaAST raise_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t467 = _t; + RefAdaAST tmp232_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RAISE_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t467; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::requeue_stmt(RefAdaAST _t) { + RefAdaAST requeue_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t470 = _t; + RefAdaAST tmp233_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REQUEUE_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABORT: + { + RefAdaAST tmp234_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABORT); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t470; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::accept_stmt(RefAdaAST _t) { + RefAdaAST accept_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t414 = _t; + RefAdaAST tmp235_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCEPT_STATEMENT); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + entry_index_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + handled_stmts_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t414; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::select_stmt(RefAdaAST _t) { + RefAdaAST select_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ASYNCHRONOUS_SELECT: + { + RefAdaAST __t421 = _t; + RefAdaAST tmp236_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ASYNCHRONOUS_SELECT); + _t = _t->getFirstChild(); + triggering_alternative(_t); + _t = _retTree; + abortable_part(_t); + _t = _retTree; + _t = __t421; + _t = _t->getNextSibling(); + break; + } + case SELECTIVE_ACCEPT: + { + RefAdaAST __t422 = _t; + RefAdaAST tmp237_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SELECTIVE_ACCEPT); + _t = _t->getFirstChild(); + selective_accept(_t); + _t = _retTree; + _t = __t422; + _t = _t->getNextSibling(); + break; + } + case TIMED_ENTRY_CALL: + { + RefAdaAST __t423 = _t; + RefAdaAST tmp238_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIMED_ENTRY_CALL); + _t = _t->getFirstChild(); + entry_call_alternative(_t); + _t = _retTree; + delay_alternative(_t); + _t = _retTree; + _t = __t423; + _t = _t->getNextSibling(); + break; + } + case CONDITIONAL_ENTRY_CALL: + { + RefAdaAST __t424 = _t; + RefAdaAST tmp239_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONDITIONAL_ENTRY_CALL); + _t = _t->getFirstChild(); + entry_call_alternative(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t424; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::if_stmt(RefAdaAST _t) { + RefAdaAST if_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t361 = _t; + RefAdaAST tmp240_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IF_STATEMENT); + _t = _t->getFirstChild(); + cond_clause(_t); + _t = _retTree; + elsifs_opt(_t); + _t = _retTree; + else_opt(_t); + _t = _retTree; + _t = __t361; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::case_stmt(RefAdaAST _t) { + RefAdaAST case_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t373 = _t; + RefAdaAST tmp241_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CASE_STATEMENT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + alternative_s(_t); + _t = _retTree; + _t = __t373; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::loop_stmt(RefAdaAST _t) { + RefAdaAST loop_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t380 = _t; + RefAdaAST tmp242_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LOOP_STATEMENT); + _t = _t->getFirstChild(); + iteration_scheme_opt(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t380; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::block(RefAdaAST _t) { + RefAdaAST block_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t387 = _t; + RefAdaAST tmp243_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK_STATEMENT); + _t = _t->getFirstChild(); + declare_opt(_t); + _t = _retTree; + block_body(_t); + _t = _retTree; + _t = __t387; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::call_or_assignment(RefAdaAST _t) { + RefAdaAST call_or_assignment_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ASSIGNMENT_STATEMENT: + { + RefAdaAST __t402 = _t; + RefAdaAST tmp244_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ASSIGNMENT_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t402; + _t = _t->getNextSibling(); + break; + } + case CALL_STATEMENT: + { + RefAdaAST __t403 = _t; + RefAdaAST tmp245_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CALL_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + _t = __t403; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::cond_clause(RefAdaAST _t) { + RefAdaAST cond_clause_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t363 = _t; + RefAdaAST tmp246_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COND_CLAUSE); + _t = _t->getFirstChild(); + condition(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t363; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::elsifs_opt(RefAdaAST _t) { + RefAdaAST elsifs_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t366 = _t; + RefAdaAST tmp247_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ELSIFS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == COND_CLAUSE)) { + cond_clause(_t); + _t = _retTree; + } + else { + goto _loop368; + } + + } + _loop368:; + } // ( ... )* + _t = __t366; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::else_opt(RefAdaAST _t) { + RefAdaAST else_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t370 = _t; + RefAdaAST tmp248_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ELSE_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case SEQUENCE_OF_STATEMENTS: + { + statements(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t370; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::condition(RefAdaAST _t) { + RefAdaAST condition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + expression(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::alternative_s(RefAdaAST _t) { + RefAdaAST alternative_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )+ + int _cnt376=0; + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == CASE_STATEMENT_ALTERNATIVE)) { + case_statement_alternative(_t); + _t = _retTree; + } + else { + if ( _cnt376>=1 ) { goto _loop376; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));} + } + + _cnt376++; + } + _loop376:; + } // ( ... )+ + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::case_statement_alternative(RefAdaAST _t) { + RefAdaAST case_statement_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t378 = _t; + RefAdaAST tmp249_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CASE_STATEMENT_ALTERNATIVE); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t378; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::iteration_scheme_opt(RefAdaAST _t) { + RefAdaAST iteration_scheme_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t382 = _t; + RefAdaAST tmp250_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ITERATION_SCHEME_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case WHILE: + { + RefAdaAST __t384 = _t; + RefAdaAST tmp251_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WHILE); + _t = _t->getFirstChild(); + condition(_t); + _t = _retTree; + _t = __t384; + _t = _t->getNextSibling(); + break; + } + case FOR: + { + RefAdaAST __t385 = _t; + RefAdaAST tmp252_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FOR); + _t = _t->getFirstChild(); + RefAdaAST tmp253_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + discrete_subtype_definition(_t); + _t = _retTree; + _t = __t385; + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t382; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::declare_opt(RefAdaAST _t) { + RefAdaAST declare_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t389 = _t; + RefAdaAST tmp254_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DECLARE_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DECLARATIVE_PART: + { + declarative_part(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t389; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::label_name(RefAdaAST _t) { + RefAdaAST label_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST tmp255_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_body_formal_part(RefAdaAST _t) { + RefAdaAST entry_body_formal_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + entry_index_spec_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_barrier(RefAdaAST _t) { + RefAdaAST entry_barrier_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + condition(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_index_spec_opt(RefAdaAST _t) { + RefAdaAST entry_index_spec_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t408 = _t; + RefAdaAST tmp256_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_INDEX_SPECIFICATION); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + def_id(_t); + _t = _retTree; + discrete_subtype_definition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t408; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_call_stmt(RefAdaAST _t) { + RefAdaAST entry_call_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t412 = _t; + RefAdaAST tmp257_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_CALL_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + _t = __t412; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_index_opt(RefAdaAST _t) { + RefAdaAST entry_index_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t416 = _t; + RefAdaAST tmp258_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_INDEX_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t416; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::triggering_alternative(RefAdaAST _t) { + RefAdaAST triggering_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t426 = _t; + RefAdaAST tmp259_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TRIGGERING_ALTERNATIVE); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DELAY_STATEMENT: + { + delay_stmt(_t); + _t = _retTree; + break; + } + case ENTRY_CALL_STATEMENT: + { + entry_call_stmt(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + stmts_opt(_t); + _t = _retTree; + _t = __t426; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::abortable_part(RefAdaAST _t) { + RefAdaAST abortable_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t429 = _t; + RefAdaAST tmp260_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABORTABLE_PART); + _t = _t->getFirstChild(); + stmts_opt(_t); + _t = _retTree; + _t = __t429; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::selective_accept(RefAdaAST _t) { + RefAdaAST selective_accept_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + guard_opt(_t); + _t = _retTree; + select_alternative(_t); + _t = _retTree; + or_select_opt(_t); + _t = _retTree; + else_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::entry_call_alternative(RefAdaAST _t) { + RefAdaAST entry_call_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t431 = _t; + RefAdaAST tmp261_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_CALL_ALTERNATIVE); + _t = _t->getFirstChild(); + entry_call_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t431; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::delay_alternative(RefAdaAST _t) { + RefAdaAST delay_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t442 = _t; + RefAdaAST tmp262_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELAY_ALTERNATIVE); + _t = _t->getFirstChild(); + delay_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t442; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::stmts_opt(RefAdaAST _t) { + RefAdaAST stmts_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case STATEMENT: + { + statement(_t); + _t = _retTree; + break; + } + default: + { + goto _loop445; + } + } + } + _loop445:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::guard_opt(RefAdaAST _t) { + RefAdaAST guard_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t434 = _t; + RefAdaAST tmp263_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GUARD_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + condition(_t); + _t = _retTree; + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == PRAGMA)) { + pragma(_t); + _t = _retTree; + } + else { + goto _loop437; + } + + } + _loop437:; + } // ( ... )* + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t434; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::select_alternative(RefAdaAST _t) { + RefAdaAST select_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ACCEPT_ALTERNATIVE: + { + accept_alternative(_t); + _t = _retTree; + break; + } + case DELAY_ALTERNATIVE: + { + delay_alternative(_t); + _t = _retTree; + break; + } + case TERMINATE_ALTERNATIVE: + { + RefAdaAST tmp264_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TERMINATE_ALTERNATIVE); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::or_select_opt(RefAdaAST _t) { + RefAdaAST or_select_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t447 = _t; + RefAdaAST tmp265_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR_SELECT_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + if ((_t->getType() == GUARD_OPT)) { + guard_opt(_t); + _t = _retTree; + select_alternative(_t); + _t = _retTree; + } + else { + goto _loop449; + } + + } + _loop449:; + } // ( ... )* + _t = __t447; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::accept_alternative(RefAdaAST _t) { + RefAdaAST accept_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t440 = _t; + RefAdaAST tmp266_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCEPT_ALTERNATIVE); + _t = _t->getFirstChild(); + accept_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t440; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::exception_handler(RefAdaAST _t) { + RefAdaAST exception_handler_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t459 = _t; + RefAdaAST tmp267_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPTION_HANDLER); + _t = _t->getFirstChild(); + identifier_colon_opt(_t); + _t = _retTree; + except_choice_s(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t459; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::identifier_colon_opt(RefAdaAST _t) { + RefAdaAST identifier_colon_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t461 = _t; + RefAdaAST tmp268_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER_COLON_OPT); + _t = _t->getFirstChild(); + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp269_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t461; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::except_choice_s(RefAdaAST _t) { + RefAdaAST except_choice_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + RefAdaAST __t464 = _t; + RefAdaAST tmp270_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PIPE); + _t = _t->getFirstChild(); + except_choice_s(_t); + _t = _retTree; + exception_choice(_t); + _t = _retTree; + _t = __t464; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case OTHERS: + { + exception_choice(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::exception_choice(RefAdaAST _t) { + RefAdaAST exception_choice_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case OTHERS: + { + RefAdaAST tmp271_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OTHERS); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::operator_call(RefAdaAST _t) { + RefAdaAST operator_call_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t473 = _t; + RefAdaAST tmp272_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getFirstChild(); + value_s(_t); + _t = _retTree; + _t = __t473; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::relation(RefAdaAST _t) { + RefAdaAST relation_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IN: + { + RefAdaAST __t485 = _t; + RefAdaAST tmp273_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IN); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + range_or_mark(_t); + _t = _retTree; + _t = __t485; + _t = _t->getNextSibling(); + break; + } + case NOT_IN: + { + RefAdaAST __t486 = _t; + RefAdaAST tmp274_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NOT_IN); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + range_or_mark(_t); + _t = _retTree; + _t = __t486; + _t = _t->getNextSibling(); + break; + } + case EQ: + { + RefAdaAST __t487 = _t; + RefAdaAST tmp275_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EQ); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t487; + _t = _t->getNextSibling(); + break; + } + case NE: + { + RefAdaAST __t488 = _t; + RefAdaAST tmp276_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t488; + _t = _t->getNextSibling(); + break; + } + case LT_: + { + RefAdaAST __t489 = _t; + RefAdaAST tmp277_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LT_); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t489; + _t = _t->getNextSibling(); + break; + } + case LE: + { + RefAdaAST __t490 = _t; + RefAdaAST tmp278_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t490; + _t = _t->getNextSibling(); + break; + } + case GT: + { + RefAdaAST __t491 = _t; + RefAdaAST tmp279_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t491; + _t = _t->getNextSibling(); + break; + } + case GE: + { + RefAdaAST __t492 = _t; + RefAdaAST tmp280_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t492; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + simple_expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::range_or_mark(RefAdaAST _t) { + RefAdaAST range_or_mark_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + { + subtype_mark(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::signed_term(RefAdaAST _t) { + RefAdaAST signed_term_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case UNARY_PLUS: + { + RefAdaAST __t499 = _t; + RefAdaAST tmp281_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),UNARY_PLUS); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + _t = __t499; + _t = _t->getNextSibling(); + break; + } + case UNARY_MINUS: + { + RefAdaAST __t500 = _t; + RefAdaAST tmp282_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),UNARY_MINUS); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + _t = __t500; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + term(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::term(RefAdaAST _t) { + RefAdaAST term_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case STAR: + { + RefAdaAST __t502 = _t; + RefAdaAST tmp283_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STAR); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t502; + _t = _t->getNextSibling(); + break; + } + case DIV: + { + RefAdaAST __t503 = _t; + RefAdaAST tmp284_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIV); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t503; + _t = _t->getNextSibling(); + break; + } + case MOD: + { + RefAdaAST __t504 = _t; + RefAdaAST tmp285_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MOD); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t504; + _t = _t->getNextSibling(); + break; + } + case REM: + { + RefAdaAST __t505 = _t; + RefAdaAST tmp286_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REM); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t505; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + factor(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::factor(RefAdaAST _t) { + RefAdaAST factor_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case NOT: + { + RefAdaAST __t507 = _t; + RefAdaAST tmp287_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NOT); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + _t = __t507; + _t = _t->getNextSibling(); + break; + } + case ABS: + { + RefAdaAST __t508 = _t; + RefAdaAST tmp288_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABS); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + _t = __t508; + _t = _t->getNextSibling(); + break; + } + case EXPON: + { + RefAdaAST __t509 = _t; + RefAdaAST tmp289_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXPON); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + primary(_t); + _t = _retTree; + _t = __t509; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + primary(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::primary(RefAdaAST _t) { + RefAdaAST primary_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name_or_qualified(_t); + _t = _retTree; + break; + } + case PARENTHESIZED_PRIMARY: + { + parenthesized_primary(_t); + _t = _retTree; + break; + } + case ALLOCATOR: + { + allocator(_t); + _t = _retTree; + break; + } + case NuLL: + { + RefAdaAST tmp290_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NuLL); + _t = _t->getNextSibling(); + break; + } + case NUMERIC_LIT: + { + RefAdaAST tmp291_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUMERIC_LIT); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp292_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case CHAR_STRING: + { + RefAdaAST tmp293_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHAR_STRING); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + operator_call(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::name_or_qualified(RefAdaAST _t) { + RefAdaAST name_or_qualified_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + RefAdaAST tmp294_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + RefAdaAST __t513 = _t; + RefAdaAST tmp295_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + RefAdaAST tmp296_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + RefAdaAST tmp297_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + RefAdaAST tmp298_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + RefAdaAST tmp299_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t513; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + RefAdaAST __t515 = _t; + RefAdaAST tmp300_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEXED_COMPONENT); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t515; + _t = _t->getNextSibling(); + break; + } + case TIC: + { + RefAdaAST __t516 = _t; + RefAdaAST tmp301_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIC); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + { + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PARENTHESIZED_PRIMARY: + { + parenthesized_primary(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case RANGE: + case DIGITS: + case DELTA: + case ACCESS: + { + attribute_id(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + _t = __t516; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::allocator(RefAdaAST _t) { + RefAdaAST allocator_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t519 = _t; + RefAdaAST tmp302_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALLOCATOR); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + _t = __t519; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::subprogram_body(RefAdaAST _t) { + RefAdaAST subprogram_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t)); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::task_body(RefAdaAST _t) { + RefAdaAST task_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t525 = _t; + RefAdaAST tmp303_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t525; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::protected_body(RefAdaAST _t) { + RefAdaAST protected_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t; + + try { // for error handling + RefAdaAST __t527 = _t; + RefAdaAST tmp304_AST_in = _t; + match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + prot_op_bodies_opt(_t); + _t = _retTree; + _t = __t527; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaStoreWalker::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& ) +{ +} +const char* AdaStoreWalker::tokenNames[] = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"pragma\"", + "IDENTIFIER", + "SEMI", + "LPAREN", + "COMMA", + "RPAREN", + "RIGHT_SHAFT", + "\"with\"", + "DOT", + "\"use\"", + "\"type\"", + "TIC", + "\"range\"", + "\"digits\"", + "\"delta\"", + "\"access\"", + "\"private\"", + "\"package\"", + "\"body\"", + "\"is\"", + "\"procedure\"", + "\"function\"", + "\"new\"", + "\"others\"", + "PIPE", + "DOT_DOT", + "\"all\"", + "COLON", + "\"in\"", + "\"out\"", + "\"renames\"", + "CHARACTER_LITERAL", + "CHAR_STRING", + "\"null\"", + "\"record\"", + "\"separate\"", + "\"abstract\"", + "\"return\"", + "\"task\"", + "\"protected\"", + "BOX", + "ASSIGN", + "\"entry\"", + "\"for\"", + "\"end\"", + "\"at\"", + "\"mod\"", + "\"subtype\"", + "\"exception\"", + "\"constant\"", + "\"array\"", + "\"of\"", + "\"aliased\"", + "\"case\"", + "\"when\"", + "\"tagged\"", + "\"limited\"", + "\"generic\"", + "\"begin\"", + "LT_LT", + "GT_GT", + "\"if\"", + "\"then\"", + "\"elsif\"", + "\"else\"", + "\"loop\"", + "\"while\"", + "\"reverse\"", + "\"declare\"", + "\"exit\"", + "\"goto\"", + "\"accept\"", + "\"do\"", + "\"delay\"", + "\"until\"", + "\"select\"", + "\"abort\"", + "\"or\"", + "\"terminate\"", + "\"raise\"", + "\"requeue\"", + "\"and\"", + "\"xor\"", + "\"not\"", + "EQ", + "NE", + "LT_", + "LE", + "GT", + "GE", + "PLUS", + "MINUS", + "CONCAT", + "STAR", + "DIV", + "\"rem\"", + "\"abs\"", + "EXPON", + "NUMERIC_LIT", + "ABORTABLE_PART", + "ABORT_STATEMENT", + "ACCEPT_ALTERNATIVE", + "ACCEPT_STATEMENT", + "ALLOCATOR", + "ASSIGNMENT_STATEMENT", + "ASYNCHRONOUS_SELECT", + "ATTRIBUTE_DEFINITION_CLAUSE", + "AT_CLAUSE", + "BLOCK_STATEMENT", + "CASE_STATEMENT", + "CASE_STATEMENT_ALTERNATIVE", + "CODE_STATEMENT", + "COMPONENT_DECLARATION", + "CONDITIONAL_ENTRY_CALL", + "CONTEXT_CLAUSE", + "DECLARATIVE_PART", + "DEFINING_IDENTIFIER_LIST", + "DELAY_ALTERNATIVE", + "DELAY_STATEMENT", + "DELTA_CONSTRAINT", + "DIGITS_CONSTRAINT", + "DISCRIMINANT_ASSOCIATION", + "DISCRIMINANT_CONSTRAINT", + "DISCRIMINANT_SPECIFICATION", + "ENTRY_BODY", + "ENTRY_CALL_ALTERNATIVE", + "ENTRY_CALL_STATEMENT", + "ENTRY_DECLARATION", + "ENTRY_INDEX_SPECIFICATION", + "ENUMERATION_REPESENTATION_CLAUSE", + "EXCEPTION_DECLARATION", + "EXCEPTION_HANDLER", + "EXCEPTION_RENAMING_DECLARATION", + "EXIT_STATEMENT", + "FORMAL_PACKAGE_DECLARATION", + "GENERIC_FORMAL_PART", + "GENERIC_PACKAGE_DECLARATION", + "GOTO_STATEMENT", + "HANDLED_SEQUENCE_OF_STATEMENTS", + "HANDLED_STMTS_OPT", + "IF_STATEMENT", + "INCOMPLETE_TYPE_DECLARATION", + "INDEXED_COMPONENT", + "INDEX_CONSTRAINT", + "LIBRARY_ITEM", + "LOOP_STATEMENT", + "NAME", + "NULL_STATEMENT", + "NUMBER_DECLARATION", + "OBJECT_DECLARATION", + "OBJECT_RENAMING_DECLARATION", + "OPERATOR_SYMBOL", + "PACKAGE_BODY", + "PACKAGE_BODY_STUB", + "PACKAGE_RENAMING_DECLARATION", + "PACKAGE_SPECIFICATION", + "PARAMETER_SPECIFICATION", + "PRIVATE_EXTENSION_DECLARATION", + "PRIVATE_TYPE_DECLARATION", + "PROTECTED_BODY", + "PROTECTED_BODY_STUB", + "PROTECTED_TYPE_DECLARATION", + "RAISE_STATEMENT", + "RANGE_ATTRIBUTE_REFERENCE", + "RECORD_REPRESENTATION_CLAUSE", + "REQUEUE_STATEMENT", + "RETURN_STATEMENT", + "SELECTIVE_ACCEPT", + "SEQUENCE_OF_STATEMENTS", + "SINGLE_PROTECTED_DECLARATION", + "SINGLE_TASK_DECLARATION", + "STATEMENT", + "SUBTYPE_DECLARATION", + "SUBTYPE_INDICATION", + "SUBTYPE_MARK", + "SUBUNIT", + "TASK_BODY", + "TASK_BODY_STUB", + "TASK_TYPE_DECLARATION", + "TERMINATE_ALTERNATIVE", + "TIMED_ENTRY_CALL", + "TRIGGERING_ALTERNATIVE", + "USE_CLAUSE", + "USE_TYPE_CLAUSE", + "VARIANT", + "VARIANT_PART", + "WITH_CLAUSE", + "ABSTRACT_FUNCTION_DECLARATION", + "ABSTRACT_PROCEDURE_DECLARATION", + "ACCESS_TO_FUNCTION_DECLARATION", + "ACCESS_TO_OBJECT_DECLARATION", + "ACCESS_TO_PROCEDURE_DECLARATION", + "ARRAY_OBJECT_DECLARATION", + "ARRAY_TYPE_DECLARATION", + "AND_THEN", + "BASIC_DECLARATIVE_ITEMS_OPT", + "BLOCK_BODY", + "BLOCK_BODY_OPT", + "CALL_STATEMENT", + "COMPONENT_CLAUSES_OPT", + "COMPONENT_ITEMS", + "COND_CLAUSE", + "DECIMAL_FIXED_POINT_DECLARATION", + "DECLARE_OPT", + "DERIVED_RECORD_EXTENSION", + "DISCRETE_SUBTYPE_DEF_OPT", + "DISCRIMINANT_SPECIFICATIONS", + "DISCRIM_PART_OPT", + "ELSE_OPT", + "ELSIFS_OPT", + "END_ID_OPT", + "ENTRY_INDEX_OPT", + "ENUMERATION_TYPE_DECLARATION", + "EXCEPT_HANDLER_PART_OPT", + "EXTENSION_OPT", + "FLOATING_POINT_DECLARATION", + "FORMAL_DECIMAL_FIXED_POINT_DECLARATION", + "FORMAL_DISCRETE_TYPE_DECLARATION", + "FORMAL_FLOATING_POINT_DECLARATION", + "FORMAL_FUNCTION_DECLARATION", + "FORMAL_MODULAR_TYPE_DECLARATION", + "FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION", + "FORMAL_ORDINARY_FIXED_POINT_DECLARATION", + "FORMAL_PART_OPT", + "FORMAL_PRIVATE_EXTENSION_DECLARATION", + "FORMAL_PRIVATE_TYPE_DECLARATION", + "FORMAL_PROCEDURE_DECLARATION", + "FORMAL_SIGNED_INTEGER_TYPE_DECLARATION", + "FUNCTION_BODY", + "FUNCTION_BODY_STUB", + "FUNCTION_DECLARATION", + "FUNCTION_RENAMING_DECLARATION", + "GENERIC_FUNCTION_DECLARATION", + "GENERIC_FUNCTION_INSTANTIATION", + "GENERIC_FUNCTION_RENAMING", + "GENERIC_PACKAGE_INSTANTIATION", + "GENERIC_PACKAGE_RENAMING", + "GENERIC_PROCEDURE_DECLARATION", + "GENERIC_PROCEDURE_INSTANTIATION", + "GENERIC_PROCEDURE_RENAMING", + "GUARD_OPT", + "IDENTIFIER_COLON_OPT", + "ID_OPT", + "INIT_OPT", + "ITERATION_SCHEME_OPT", + "LABEL_OPT", + "MARK_WITH_CONSTRAINT", + "MODIFIERS", + "MODULAR_TYPE_DECLARATION", + "MOD_CLAUSE_OPT", + "NOT_IN", + "ORDINARY_DERIVED_TYPE_DECLARATION", + "ORDINARY_FIXED_POINT_DECLARATION", + "OR_ELSE", + "OR_SELECT_OPT", + "PARENTHESIZED_PRIMARY", + "PRIVATE_DECLARATIVE_ITEMS_OPT", + "PRIVATE_TASK_ITEMS_OPT", + "PROCEDURE_BODY", + "PROCEDURE_BODY_STUB", + "PROCEDURE_DECLARATION", + "PROCEDURE_RENAMING_DECLARATION", + "PROT_MEMBER_DECLARATIONS", + "PROT_OP_BODIES_OPT", + "PROT_OP_DECLARATIONS", + "PROT_PRIVATE_OPT", + "RANGED_EXPRS", + "RANGE_CONSTRAINT", + "RECORD_TYPE_DECLARATION", + "SELECTOR_NAMES_OPT", + "SIGNED_INTEGER_TYPE_DECLARATION", + "TASK_ITEMS_OPT", + "UNARY_MINUS", + "UNARY_PLUS", + "VALUE", + "VALUES", + "VARIANTS", + "COMMENT_INTRO", + "OX", + "TIC_OR_CHARACTER_LITERAL", + "DIGIT", + "EXPONENT", + "EXTENDED_DIGIT", + "BASED_INTEGER", + "WS_", + "COMMENT", + "CHARACTER_STRING", + 0 +}; + +const unsigned long AdaStoreWalker::_tokenSet_0_data_[] = { 37920UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER RIGHT_SHAFT DOT TIC "in" CHARACTER_LITERAL CHAR_STRING "null" +// "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR +// DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT OPERATOR_SYMBOL +// AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS UNARY_PLUS +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_0(_tokenSet_0_data_,20); +const unsigned long AdaStoreWalker::_tokenSet_1_data_[] = { 0UL, 0UL, 0UL, 49152UL, 3338801504UL, 2353094950UL, 151076927UL, 2416967168UL, 328577UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENUMERATION_REPESENTATION_CLAUSE +// EXCEPTION_DECLARATION EXCEPTION_RENAMING_DECLARATION GENERIC_PACKAGE_DECLARATION +// INCOMPLETE_TYPE_DECLARATION NUMBER_DECLARATION OBJECT_DECLARATION OBJECT_RENAMING_DECLARATION +// PACKAGE_RENAMING_DECLARATION PACKAGE_SPECIFICATION PRIVATE_EXTENSION_DECLARATION +// PRIVATE_TYPE_DECLARATION PROTECTED_TYPE_DECLARATION RECORD_REPRESENTATION_CLAUSE +// SINGLE_PROTECTED_DECLARATION SINGLE_TASK_DECLARATION SUBTYPE_DECLARATION +// TASK_TYPE_DECLARATION USE_CLAUSE USE_TYPE_CLAUSE ABSTRACT_FUNCTION_DECLARATION +// ABSTRACT_PROCEDURE_DECLARATION ACCESS_TO_FUNCTION_DECLARATION ACCESS_TO_OBJECT_DECLARATION +// ACCESS_TO_PROCEDURE_DECLARATION ARRAY_OBJECT_DECLARATION ARRAY_TYPE_DECLARATION +// DECIMAL_FIXED_POINT_DECLARATION DERIVED_RECORD_EXTENSION ENUMERATION_TYPE_DECLARATION +// FLOATING_POINT_DECLARATION FUNCTION_BODY_STUB FUNCTION_DECLARATION FUNCTION_RENAMING_DECLARATION +// GENERIC_FUNCTION_DECLARATION GENERIC_FUNCTION_INSTANTIATION GENERIC_FUNCTION_RENAMING +// GENERIC_PACKAGE_INSTANTIATION GENERIC_PACKAGE_RENAMING GENERIC_PROCEDURE_DECLARATION +// GENERIC_PROCEDURE_INSTANTIATION GENERIC_PROCEDURE_RENAMING MODULAR_TYPE_DECLARATION +// ORDINARY_DERIVED_TYPE_DECLARATION ORDINARY_FIXED_POINT_DECLARATION PROCEDURE_BODY_STUB +// PROCEDURE_DECLARATION PROCEDURE_RENAMING_DECLARATION RECORD_TYPE_DECLARATION +// SIGNED_INTEGER_TYPE_DECLARATION +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_1(_tokenSet_1_data_,20); +const unsigned long AdaStoreWalker::_tokenSet_2_data_[] = { 939627552UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER RIGHT_SHAFT DOT TIC "range" "others" PIPE DOT_DOT "in" CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS +// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT +// OPERATOR_SYMBOL AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS +// UNARY_PLUS +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_2(_tokenSet_2_data_,20); +const unsigned long AdaStoreWalker::_tokenSet_3_data_[] = { 16UL, 0UL, 0UL, 49152UL, 40UL, 256UL, 0UL, 1024UL, 256UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENTRY_DECLARATION ENUMERATION_REPESENTATION_CLAUSE +// RECORD_REPRESENTATION_CLAUSE FUNCTION_DECLARATION PROCEDURE_DECLARATION +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_3(_tokenSet_3_data_,20); +const unsigned long AdaStoreWalker::_tokenSet_4_data_[] = { 36896UL, 0UL, 0UL, 0UL, 262144UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER DOT TIC INDEXED_COMPONENT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_4(_tokenSet_4_data_,12); + + diff --git a/languages/ada/AdaStoreWalker.hpp b/languages/ada/AdaStoreWalker.hpp new file mode 100644 index 00000000..6f108ff6 --- /dev/null +++ b/languages/ada/AdaStoreWalker.hpp @@ -0,0 +1,350 @@ +#ifndef INC_AdaStoreWalker_hpp_ +#define INC_AdaStoreWalker_hpp_ + +#line 1 "expandedada.store.g" + +#include +#include +#include + +#include +#include "AdaAST.hpp" +#include "ada_utils.hpp" + +#line 15 "AdaStoreWalker.hpp" +#include +#include "AdaStoreWalkerTokenTypes.hpp" +/* $ANTLR 2.7.7 (20070609): "expandedada.store.g" -> "AdaStoreWalker.hpp"$ */ +#include + +#line 10 "expandedada.store.g" + +#include +#include + +#line 26 "AdaStoreWalker.hpp" +class CUSTOM_API AdaStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public AdaStoreWalkerTokenTypes +{ +#line 25 "expandedada.store.g" + +private: + QString m_fileName; + QValueList m_scopeStack; + CodeModel* m_model; + QValueList m_imports; + NamespaceDom m_currentContainer; + int m_currentAccess; + bool m_addToStore; /* auxiliary variable: for the moment, this is `true' + only when we are in specs, not bodies. */ + bool m_isSubprogram; // auxiliary to def_id() + FileDom m_file; + +public: + void setCodeModel (CodeModel* model) { m_model = model; } + CodeModel* codeModel () { return m_model; } + const CodeModel* codeModel () const { return m_model; } + + QString fileName () const { return m_fileName; } + void setFileName (const QString& fileName) { m_fileName = fileName; } + + void init () { + m_scopeStack.clear (); + m_imports.clear (); + m_currentContainer = m_model->globalNamespace (); + m_scopeStack.append (m_currentContainer); + m_currentAccess = CodeModelItem::Public; + m_addToStore = false; + m_isSubprogram = false; + if (m_model->hasFile(m_fileName)) + m_model->removeFile (m_model->fileByName(m_fileName)); + m_file = m_model->create(); + m_file->setName(m_fileName); + m_model->addFile(m_file); + } + + void wipeout () { m_model->wipeout (); } +// void out () { m_store->out (); } + void removeWithReferences (const QString& fileName) { + m_model->removeFile (m_model->fileByName(fileName)); + } + NamespaceDom insertScopeContainer + (NamespaceDom scope, const QStringList & scopes ) { + QStringList::ConstIterator it = scopes.begin(); + QString prefix( *it ); + NamespaceDom ns = scope->namespaceByName( prefix ); +// kdDebug() << "insertScopeContainer begin with prefix " << prefix << endl; + if (!ns.data()) { +// kdDebug() << "insertScopeContainer: ns is empty" << endl; + ns = m_model->create(); +// kdDebug() << "insertScopeContainer: ns created" << endl; + ns->setName( prefix ); +// kdDebug() << "insertScopeContainer: ns name set" << endl; + scope->addNamespace( ns ); +// kdDebug() << "insertScopeContainer: ns added to a scope" << endl; + + if (scope == m_model->globalNamespace()) + m_file->addNamespace( ns ); + } +// kdDebug() << "insertScopeContainer: while" << endl; + while ( ++it != scopes.end() ) { + QString nameSegment( *it ); + prefix += "." + nameSegment; +// kdDebug() << "insertScopeContainer: while prefix = " << prefix << endl; + NamespaceDom inner = scope->namespaceByName( prefix ); + if (!inner.data() ) { +// kdDebug() << "insertScopeContainer: inner is empty " << endl; + inner = m_model->create(); +// kdDebug() << "insertScopeContainer: inner created " << endl; + inner->setName( nameSegment ); + ns->addNamespace( inner ); +// kdDebug() << "insertScopeContainer: inner added " << endl; + } + ns = inner; + } + return ns; + } + NamespaceDom defineScope( RefAdaAST namenode ) { + QStringList scopes( qnamelist( namenode ) ); +// kdDebug() << "defineScope: " << scopes.join(" ") << endl; + NamespaceDom psc = insertScopeContainer( m_currentContainer, scopes ); +// kdDebug() << "defineScope psc created" << endl; + psc->setStartPosition(namenode->getLine(), namenode->getColumn()); +// kdDebug() << "defineScope start position set" << endl; + psc->setFileName(m_fileName); +// kdDebug() << "defineScope file name set" << endl; + // psc->setEndPosition (endLine, 0); +// kdDebug() << "defineScope return" << endl; + return psc; + } +#line 30 "AdaStoreWalker.hpp" +public: + AdaStoreWalker(); + static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); + int getNumTokens() const + { + return AdaStoreWalker::NUM_TOKENS; + } + const char* getTokenName( int type ) const + { + if( type > getNumTokens() ) return 0; + return AdaStoreWalker::tokenNames[type]; + } + const char* const* getTokenNames() const + { + return AdaStoreWalker::tokenNames; + } + public: void compilation_unit(RefAdaAST _t); + public: void context_items_opt(RefAdaAST _t); + public: void library_item(RefAdaAST _t); + public: void subunit(RefAdaAST _t); + public: void pragma(RefAdaAST _t); + public: void with_clause(RefAdaAST _t); + public: void compound_name(RefAdaAST _t); + public: void use_clause(RefAdaAST _t); + public: void subtype_mark(RefAdaAST _t); + public: void lib_subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t); + public: void def_id(RefAdaAST _t); + public: void pkg_body_part(RefAdaAST _t); + public: void generic_inst(RefAdaAST _t); + public: void pkg_spec_part(RefAdaAST _t); + public: void renames(RefAdaAST _t); + public: void generic_decl(RefAdaAST _t); + public: void subprog_def_id(RefAdaAST _t); + public: void subprog_decl(RefAdaAST _t); + public: void formal_part_opt(RefAdaAST _t); + public: void def_designator(RefAdaAST _t); + public: void function_tail(RefAdaAST _t); + public: void definable_operator_symbol(RefAdaAST _t); + public: void spec_decl_part(RefAdaAST _t); + public: void basic_declarative_items_opt(RefAdaAST _t); + public: void private_declarative_items_opt(RefAdaAST _t); + public: void end_id_opt(RefAdaAST _t); + public: void basic_decl_item(RefAdaAST _t); + public: void generic_formal_part_opt(RefAdaAST _t); + public: void procedure_body(RefAdaAST _t); + public: void function_body(RefAdaAST _t); + public: void subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t); + public: void subprog_decl_or_body(RefAdaAST _t); + public: void package_body(RefAdaAST _t); + public: void pragma_arg(RefAdaAST _t); + public: void expression(RefAdaAST _t); + public: void attribute_id(RefAdaAST _t); + public: void modifiers(RefAdaAST _t); + public: void id_opt(RefAdaAST _t); + public: void value_s(RefAdaAST _t); + public: void value(RefAdaAST _t); + public: void ranged_expr_s(RefAdaAST _t); + public: void ranged_expr(RefAdaAST _t); + public: void simple_expression(RefAdaAST _t); + public: void range(RefAdaAST _t); + public: void range_constraint(RefAdaAST _t); + public: void range_dots(RefAdaAST _t); + public: void range_attrib_ref(RefAdaAST _t); + public: void prefix(RefAdaAST _t); + public: void parameter_specification(RefAdaAST _t); + public: void defining_identifier_list(RefAdaAST _t); + public: void init_opt(RefAdaAST _t); + public: void name(RefAdaAST _t); + public: void parenthesized_primary(RefAdaAST _t); + public: void extension_opt(RefAdaAST _t); + public: void task_type_or_single_decl(RefAdaAST _t); + public: void prot_type_or_single_decl(RefAdaAST _t); + public: void decl_common(RefAdaAST _t); + public: void discrim_part_opt(RefAdaAST _t); + public: void task_definition_opt(RefAdaAST _t); + public: void task_items_opt(RefAdaAST _t); + public: void private_task_items_opt(RefAdaAST _t); + public: void discriminant_specifications(RefAdaAST _t); + public: void discriminant_specification(RefAdaAST _t); + public: void entrydecls_repspecs_opt(RefAdaAST _t); + public: void entry_declaration(RefAdaAST _t); + public: void rep_spec(RefAdaAST _t); + public: void discrete_subtype_def_opt(RefAdaAST _t); + public: void discrete_subtype_definition(RefAdaAST _t); + public: void subtype_ind(RefAdaAST _t); + public: void align_opt(RefAdaAST _t); + public: void comp_loc_s(RefAdaAST _t); + public: void local_enum_name(RefAdaAST _t); + public: void enumeration_aggregate(RefAdaAST _t); + public: void protected_definition(RefAdaAST _t); + public: void prot_private_opt(RefAdaAST _t); + public: void prot_member_decl_s(RefAdaAST _t); + public: void prot_op_decl_s(RefAdaAST _t); + public: void prot_op_decl(RefAdaAST _t); + public: void comp_decl(RefAdaAST _t); + public: void component_subtype_def(RefAdaAST _t); + public: void enum_id_s(RefAdaAST _t); + public: void range_constraint_opt(RefAdaAST _t); + public: void array_type_declaration(RefAdaAST _t); + public: void access_type_declaration(RefAdaAST _t); + public: void id_and_discrim(RefAdaAST _t); + public: void record_definition(RefAdaAST _t); + public: void array_type_definition(RefAdaAST _t); + public: void enumeration_literal_specification(RefAdaAST _t); + public: void index_or_discrete_range_s(RefAdaAST _t); + public: void index_or_discrete_range(RefAdaAST _t); + public: void constraint_opt(RefAdaAST _t); + public: void digits_constraint(RefAdaAST _t); + public: void delta_constraint(RefAdaAST _t); + public: void index_constraint(RefAdaAST _t); + public: void discriminant_constraint(RefAdaAST _t); + public: void discrete_range(RefAdaAST _t); + public: void discriminant_association(RefAdaAST _t); + public: void selector_names_opt(RefAdaAST _t); + public: void selector_name(RefAdaAST _t); + public: void component_list(RefAdaAST _t); + public: void component_items(RefAdaAST _t); + public: void variant_part(RefAdaAST _t); + public: void discriminant_direct_name(RefAdaAST _t); + public: void variant_s(RefAdaAST _t); + public: void variant(RefAdaAST _t); + public: void choice_s(RefAdaAST _t); + public: void choice(RefAdaAST _t); + public: void discrete_with_range(RefAdaAST _t); + public: void mark_with_constraint(RefAdaAST _t); + public: void generic_formal_parameter(RefAdaAST _t); + public: void formal_array_type_declaration(RefAdaAST _t); + public: void formal_access_type_declaration(RefAdaAST _t); + public: void id_part(RefAdaAST _t); + public: void subprogram_default_opt(RefAdaAST _t); + public: void formal_package_actual_part_opt(RefAdaAST _t); + public: void body_part(RefAdaAST _t); + public: void declarative_part(RefAdaAST _t); + public: void block_body(RefAdaAST _t); + public: void declarative_item(RefAdaAST _t); + public: void prot_op_bodies_opt(RefAdaAST _t); + public: void block_body_opt(RefAdaAST _t); + public: void handled_stmt_s(RefAdaAST _t); + public: void entry_body(RefAdaAST _t); + public: void statements(RefAdaAST _t); + public: void except_handler_part_opt(RefAdaAST _t); + public: void handled_stmts_opt(RefAdaAST _t); + public: void statement(RefAdaAST _t); + public: void def_label_opt(RefAdaAST _t); + public: void null_stmt(RefAdaAST _t); + public: void exit_stmt(RefAdaAST _t); + public: void return_stmt(RefAdaAST _t); + public: void goto_stmt(RefAdaAST _t); + public: void delay_stmt(RefAdaAST _t); + public: void abort_stmt(RefAdaAST _t); + public: void raise_stmt(RefAdaAST _t); + public: void requeue_stmt(RefAdaAST _t); + public: void accept_stmt(RefAdaAST _t); + public: void select_stmt(RefAdaAST _t); + public: void if_stmt(RefAdaAST _t); + public: void case_stmt(RefAdaAST _t); + public: void loop_stmt(RefAdaAST _t); + public: void block(RefAdaAST _t); + public: void call_or_assignment(RefAdaAST _t); + public: void cond_clause(RefAdaAST _t); + public: void elsifs_opt(RefAdaAST _t); + public: void else_opt(RefAdaAST _t); + public: void condition(RefAdaAST _t); + public: void alternative_s(RefAdaAST _t); + public: void case_statement_alternative(RefAdaAST _t); + public: void iteration_scheme_opt(RefAdaAST _t); + public: void declare_opt(RefAdaAST _t); + public: void label_name(RefAdaAST _t); + public: void entry_body_formal_part(RefAdaAST _t); + public: void entry_barrier(RefAdaAST _t); + public: void entry_index_spec_opt(RefAdaAST _t); + public: void entry_call_stmt(RefAdaAST _t); + public: void entry_index_opt(RefAdaAST _t); + public: void triggering_alternative(RefAdaAST _t); + public: void abortable_part(RefAdaAST _t); + public: void selective_accept(RefAdaAST _t); + public: void entry_call_alternative(RefAdaAST _t); + public: void delay_alternative(RefAdaAST _t); + public: void stmts_opt(RefAdaAST _t); + public: void guard_opt(RefAdaAST _t); + public: void select_alternative(RefAdaAST _t); + public: void or_select_opt(RefAdaAST _t); + public: void accept_alternative(RefAdaAST _t); + public: void exception_handler(RefAdaAST _t); + public: void identifier_colon_opt(RefAdaAST _t); + public: void except_choice_s(RefAdaAST _t); + public: void exception_choice(RefAdaAST _t); + public: void operator_call(RefAdaAST _t); + public: void relation(RefAdaAST _t); + public: void range_or_mark(RefAdaAST _t); + public: void signed_term(RefAdaAST _t); + public: void term(RefAdaAST _t); + public: void factor(RefAdaAST _t); + public: void primary(RefAdaAST _t); + public: void name_or_qualified(RefAdaAST _t); + public: void allocator(RefAdaAST _t); + public: void subprogram_body(RefAdaAST _t); + public: void task_body(RefAdaAST _t); + public: void protected_body(RefAdaAST _t); +public: + ANTLR_USE_NAMESPACE(antlr)RefAST getAST() + { + return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST); + } + +protected: + RefAdaAST returnAST; + RefAdaAST _retTree; +private: + static const char* tokenNames[]; +#ifndef NO_STATIC_CONSTS + static const int NUM_TOKENS = 291; +#else + enum { + NUM_TOKENS = 291 + }; +#endif + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; + static const unsigned long _tokenSet_4_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; +}; + +#endif /*INC_AdaStoreWalker_hpp_*/ diff --git a/languages/ada/AdaStoreWalkerTokenTypes.hpp b/languages/ada/AdaStoreWalkerTokenTypes.hpp new file mode 100644 index 00000000..daaa4b21 --- /dev/null +++ b/languages/ada/AdaStoreWalkerTokenTypes.hpp @@ -0,0 +1,307 @@ +#ifndef INC_AdaStoreWalkerTokenTypes_hpp_ +#define INC_AdaStoreWalkerTokenTypes_hpp_ + +/* $ANTLR 2.7.7 (20070609): "expandedada.store.g" -> "AdaStoreWalkerTokenTypes.hpp"$ */ + +#ifndef CUSTOM_API +# define CUSTOM_API +#endif + +#ifdef __cplusplus +struct CUSTOM_API AdaStoreWalkerTokenTypes { +#endif + enum { + EOF_ = 1, + PRAGMA = 4, + IDENTIFIER = 5, + SEMI = 6, + LPAREN = 7, + COMMA = 8, + RPAREN = 9, + RIGHT_SHAFT = 10, + WITH = 11, + DOT = 12, + USE = 13, + TYPE = 14, + TIC = 15, + RANGE = 16, + DIGITS = 17, + DELTA = 18, + ACCESS = 19, + PRIVATE = 20, + PACKAGE = 21, + BODY = 22, + IS = 23, + PROCEDURE = 24, + FUNCTION = 25, + NEW = 26, + OTHERS = 27, + PIPE = 28, + DOT_DOT = 29, + ALL = 30, + COLON = 31, + IN = 32, + OUT = 33, + RENAMES = 34, + CHARACTER_LITERAL = 35, + CHAR_STRING = 36, + NuLL = 37, + RECORD = 38, + SEPARATE = 39, + ABSTRACT = 40, + RETURN = 41, + TASK = 42, + PROTECTED = 43, + BOX = 44, + ASSIGN = 45, + ENTRY = 46, + FOR = 47, + END = 48, + AT = 49, + MOD = 50, + SUBTYPE = 51, + EXCEPTION = 52, + CONSTANT = 53, + ARRAY = 54, + OF = 55, + ALIASED = 56, + CASE = 57, + WHEN = 58, + TAGGED = 59, + LIMITED = 60, + GENERIC = 61, + BEGIN = 62, + LT_LT = 63, + GT_GT = 64, + IF = 65, + THEN = 66, + ELSIF = 67, + ELSE = 68, + LOOP = 69, + WHILE = 70, + REVERSE = 71, + DECLARE = 72, + EXIT = 73, + GOTO = 74, + ACCEPT = 75, + DO = 76, + DELAY = 77, + UNTIL = 78, + SELECT = 79, + ABORT = 80, + OR = 81, + TERMINATE = 82, + RAISE = 83, + REQUEUE = 84, + AND = 85, + XOR = 86, + NOT = 87, + EQ = 88, + NE = 89, + LT_ = 90, + LE = 91, + GT = 92, + GE = 93, + PLUS = 94, + MINUS = 95, + CONCAT = 96, + STAR = 97, + DIV = 98, + REM = 99, + ABS = 100, + EXPON = 101, + NUMERIC_LIT = 102, + ABORTABLE_PART = 103, + ABORT_STATEMENT = 104, + ACCEPT_ALTERNATIVE = 105, + ACCEPT_STATEMENT = 106, + ALLOCATOR = 107, + ASSIGNMENT_STATEMENT = 108, + ASYNCHRONOUS_SELECT = 109, + ATTRIBUTE_DEFINITION_CLAUSE = 110, + AT_CLAUSE = 111, + BLOCK_STATEMENT = 112, + CASE_STATEMENT = 113, + CASE_STATEMENT_ALTERNATIVE = 114, + CODE_STATEMENT = 115, + COMPONENT_DECLARATION = 116, + CONDITIONAL_ENTRY_CALL = 117, + CONTEXT_CLAUSE = 118, + DECLARATIVE_PART = 119, + DEFINING_IDENTIFIER_LIST = 120, + DELAY_ALTERNATIVE = 121, + DELAY_STATEMENT = 122, + DELTA_CONSTRAINT = 123, + DIGITS_CONSTRAINT = 124, + DISCRIMINANT_ASSOCIATION = 125, + DISCRIMINANT_CONSTRAINT = 126, + DISCRIMINANT_SPECIFICATION = 127, + ENTRY_BODY = 128, + ENTRY_CALL_ALTERNATIVE = 129, + ENTRY_CALL_STATEMENT = 130, + ENTRY_DECLARATION = 131, + ENTRY_INDEX_SPECIFICATION = 132, + ENUMERATION_REPESENTATION_CLAUSE = 133, + EXCEPTION_DECLARATION = 134, + EXCEPTION_HANDLER = 135, + EXCEPTION_RENAMING_DECLARATION = 136, + EXIT_STATEMENT = 137, + FORMAL_PACKAGE_DECLARATION = 138, + GENERIC_FORMAL_PART = 139, + GENERIC_PACKAGE_DECLARATION = 140, + GOTO_STATEMENT = 141, + HANDLED_SEQUENCE_OF_STATEMENTS = 142, + HANDLED_STMTS_OPT = 143, + IF_STATEMENT = 144, + INCOMPLETE_TYPE_DECLARATION = 145, + INDEXED_COMPONENT = 146, + INDEX_CONSTRAINT = 147, + LIBRARY_ITEM = 148, + LOOP_STATEMENT = 149, + NAME = 150, + NULL_STATEMENT = 151, + NUMBER_DECLARATION = 152, + OBJECT_DECLARATION = 153, + OBJECT_RENAMING_DECLARATION = 154, + OPERATOR_SYMBOL = 155, + PACKAGE_BODY = 156, + PACKAGE_BODY_STUB = 157, + PACKAGE_RENAMING_DECLARATION = 158, + PACKAGE_SPECIFICATION = 159, + PARAMETER_SPECIFICATION = 160, + PRIVATE_EXTENSION_DECLARATION = 161, + PRIVATE_TYPE_DECLARATION = 162, + PROTECTED_BODY = 163, + PROTECTED_BODY_STUB = 164, + PROTECTED_TYPE_DECLARATION = 165, + RAISE_STATEMENT = 166, + RANGE_ATTRIBUTE_REFERENCE = 167, + RECORD_REPRESENTATION_CLAUSE = 168, + REQUEUE_STATEMENT = 169, + RETURN_STATEMENT = 170, + SELECTIVE_ACCEPT = 171, + SEQUENCE_OF_STATEMENTS = 172, + SINGLE_PROTECTED_DECLARATION = 173, + SINGLE_TASK_DECLARATION = 174, + STATEMENT = 175, + SUBTYPE_DECLARATION = 176, + SUBTYPE_INDICATION = 177, + SUBTYPE_MARK = 178, + SUBUNIT = 179, + TASK_BODY = 180, + TASK_BODY_STUB = 181, + TASK_TYPE_DECLARATION = 182, + TERMINATE_ALTERNATIVE = 183, + TIMED_ENTRY_CALL = 184, + TRIGGERING_ALTERNATIVE = 185, + USE_CLAUSE = 186, + USE_TYPE_CLAUSE = 187, + VARIANT = 188, + VARIANT_PART = 189, + WITH_CLAUSE = 190, + ABSTRACT_FUNCTION_DECLARATION = 191, + ABSTRACT_PROCEDURE_DECLARATION = 192, + ACCESS_TO_FUNCTION_DECLARATION = 193, + ACCESS_TO_OBJECT_DECLARATION = 194, + ACCESS_TO_PROCEDURE_DECLARATION = 195, + ARRAY_OBJECT_DECLARATION = 196, + ARRAY_TYPE_DECLARATION = 197, + AND_THEN = 198, + BASIC_DECLARATIVE_ITEMS_OPT = 199, + BLOCK_BODY = 200, + BLOCK_BODY_OPT = 201, + CALL_STATEMENT = 202, + COMPONENT_CLAUSES_OPT = 203, + COMPONENT_ITEMS = 204, + COND_CLAUSE = 205, + DECIMAL_FIXED_POINT_DECLARATION = 206, + DECLARE_OPT = 207, + DERIVED_RECORD_EXTENSION = 208, + DISCRETE_SUBTYPE_DEF_OPT = 209, + DISCRIMINANT_SPECIFICATIONS = 210, + DISCRIM_PART_OPT = 211, + ELSE_OPT = 212, + ELSIFS_OPT = 213, + END_ID_OPT = 214, + ENTRY_INDEX_OPT = 215, + ENUMERATION_TYPE_DECLARATION = 216, + EXCEPT_HANDLER_PART_OPT = 217, + EXTENSION_OPT = 218, + FLOATING_POINT_DECLARATION = 219, + FORMAL_DECIMAL_FIXED_POINT_DECLARATION = 220, + FORMAL_DISCRETE_TYPE_DECLARATION = 221, + FORMAL_FLOATING_POINT_DECLARATION = 222, + FORMAL_FUNCTION_DECLARATION = 223, + FORMAL_MODULAR_TYPE_DECLARATION = 224, + FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION = 225, + FORMAL_ORDINARY_FIXED_POINT_DECLARATION = 226, + FORMAL_PART_OPT = 227, + FORMAL_PRIVATE_EXTENSION_DECLARATION = 228, + FORMAL_PRIVATE_TYPE_DECLARATION = 229, + FORMAL_PROCEDURE_DECLARATION = 230, + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION = 231, + FUNCTION_BODY = 232, + FUNCTION_BODY_STUB = 233, + FUNCTION_DECLARATION = 234, + FUNCTION_RENAMING_DECLARATION = 235, + GENERIC_FUNCTION_DECLARATION = 236, + GENERIC_FUNCTION_INSTANTIATION = 237, + GENERIC_FUNCTION_RENAMING = 238, + GENERIC_PACKAGE_INSTANTIATION = 239, + GENERIC_PACKAGE_RENAMING = 240, + GENERIC_PROCEDURE_DECLARATION = 241, + GENERIC_PROCEDURE_INSTANTIATION = 242, + GENERIC_PROCEDURE_RENAMING = 243, + GUARD_OPT = 244, + IDENTIFIER_COLON_OPT = 245, + ID_OPT = 246, + INIT_OPT = 247, + ITERATION_SCHEME_OPT = 248, + LABEL_OPT = 249, + MARK_WITH_CONSTRAINT = 250, + MODIFIERS = 251, + MODULAR_TYPE_DECLARATION = 252, + MOD_CLAUSE_OPT = 253, + NOT_IN = 254, + ORDINARY_DERIVED_TYPE_DECLARATION = 255, + ORDINARY_FIXED_POINT_DECLARATION = 256, + OR_ELSE = 257, + OR_SELECT_OPT = 258, + PARENTHESIZED_PRIMARY = 259, + PRIVATE_DECLARATIVE_ITEMS_OPT = 260, + PRIVATE_TASK_ITEMS_OPT = 261, + PROCEDURE_BODY = 262, + PROCEDURE_BODY_STUB = 263, + PROCEDURE_DECLARATION = 264, + PROCEDURE_RENAMING_DECLARATION = 265, + PROT_MEMBER_DECLARATIONS = 266, + PROT_OP_BODIES_OPT = 267, + PROT_OP_DECLARATIONS = 268, + PROT_PRIVATE_OPT = 269, + RANGED_EXPRS = 270, + RANGE_CONSTRAINT = 271, + RECORD_TYPE_DECLARATION = 272, + SELECTOR_NAMES_OPT = 273, + SIGNED_INTEGER_TYPE_DECLARATION = 274, + TASK_ITEMS_OPT = 275, + UNARY_MINUS = 276, + UNARY_PLUS = 277, + VALUE = 278, + VALUES = 279, + VARIANTS = 280, + COMMENT_INTRO = 281, + OX = 282, + TIC_OR_CHARACTER_LITERAL = 283, + DIGIT = 284, + EXPONENT = 285, + EXTENDED_DIGIT = 286, + BASED_INTEGER = 287, + WS_ = 288, + COMMENT = 289, + CHARACTER_STRING = 290, + NULL_TREE_LOOKAHEAD = 3 + }; +#ifdef __cplusplus +}; +#endif +#endif /*INC_AdaStoreWalkerTokenTypes_hpp_*/ diff --git a/languages/ada/AdaStoreWalkerTokenTypes.txt b/languages/ada/AdaStoreWalkerTokenTypes.txt new file mode 100644 index 00000000..e9ba489c --- /dev/null +++ b/languages/ada/AdaStoreWalkerTokenTypes.txt @@ -0,0 +1,289 @@ +// $ANTLR 2.7.7 (20070609): expandedada.store.g -> AdaStoreWalkerTokenTypes.txt$ +AdaStoreWalker // output token vocab name +PRAGMA="pragma"=4 +IDENTIFIER=5 +SEMI=6 +LPAREN=7 +COMMA=8 +RPAREN=9 +RIGHT_SHAFT=10 +WITH="with"=11 +DOT=12 +USE="use"=13 +TYPE="type"=14 +TIC=15 +RANGE="range"=16 +DIGITS="digits"=17 +DELTA="delta"=18 +ACCESS="access"=19 +PRIVATE="private"=20 +PACKAGE="package"=21 +BODY="body"=22 +IS="is"=23 +PROCEDURE="procedure"=24 +FUNCTION="function"=25 +NEW="new"=26 +OTHERS="others"=27 +PIPE=28 +DOT_DOT=29 +ALL="all"=30 +COLON=31 +IN="in"=32 +OUT="out"=33 +RENAMES="renames"=34 +CHARACTER_LITERAL=35 +CHAR_STRING=36 +NuLL="null"=37 +RECORD="record"=38 +SEPARATE="separate"=39 +ABSTRACT="abstract"=40 +RETURN="return"=41 +TASK="task"=42 +PROTECTED="protected"=43 +BOX=44 +ASSIGN=45 +ENTRY="entry"=46 +FOR="for"=47 +END="end"=48 +AT="at"=49 +MOD="mod"=50 +SUBTYPE="subtype"=51 +EXCEPTION="exception"=52 +CONSTANT="constant"=53 +ARRAY="array"=54 +OF="of"=55 +ALIASED="aliased"=56 +CASE="case"=57 +WHEN="when"=58 +TAGGED="tagged"=59 +LIMITED="limited"=60 +GENERIC="generic"=61 +BEGIN="begin"=62 +LT_LT=63 +GT_GT=64 +IF="if"=65 +THEN="then"=66 +ELSIF="elsif"=67 +ELSE="else"=68 +LOOP="loop"=69 +WHILE="while"=70 +REVERSE="reverse"=71 +DECLARE="declare"=72 +EXIT="exit"=73 +GOTO="goto"=74 +ACCEPT="accept"=75 +DO="do"=76 +DELAY="delay"=77 +UNTIL="until"=78 +SELECT="select"=79 +ABORT="abort"=80 +OR="or"=81 +TERMINATE="terminate"=82 +RAISE="raise"=83 +REQUEUE="requeue"=84 +AND="and"=85 +XOR="xor"=86 +NOT="not"=87 +EQ=88 +NE=89 +LT_=90 +LE=91 +GT=92 +GE=93 +PLUS=94 +MINUS=95 +CONCAT=96 +STAR=97 +DIV=98 +REM="rem"=99 +ABS="abs"=100 +EXPON=101 +NUMERIC_LIT=102 +ABORTABLE_PART=103 +ABORT_STATEMENT=104 +ACCEPT_ALTERNATIVE=105 +ACCEPT_STATEMENT=106 +ALLOCATOR=107 +ASSIGNMENT_STATEMENT=108 +ASYNCHRONOUS_SELECT=109 +ATTRIBUTE_DEFINITION_CLAUSE=110 +AT_CLAUSE=111 +BLOCK_STATEMENT=112 +CASE_STATEMENT=113 +CASE_STATEMENT_ALTERNATIVE=114 +CODE_STATEMENT=115 +COMPONENT_DECLARATION=116 +CONDITIONAL_ENTRY_CALL=117 +CONTEXT_CLAUSE=118 +DECLARATIVE_PART=119 +DEFINING_IDENTIFIER_LIST=120 +DELAY_ALTERNATIVE=121 +DELAY_STATEMENT=122 +DELTA_CONSTRAINT=123 +DIGITS_CONSTRAINT=124 +DISCRIMINANT_ASSOCIATION=125 +DISCRIMINANT_CONSTRAINT=126 +DISCRIMINANT_SPECIFICATION=127 +ENTRY_BODY=128 +ENTRY_CALL_ALTERNATIVE=129 +ENTRY_CALL_STATEMENT=130 +ENTRY_DECLARATION=131 +ENTRY_INDEX_SPECIFICATION=132 +ENUMERATION_REPESENTATION_CLAUSE=133 +EXCEPTION_DECLARATION=134 +EXCEPTION_HANDLER=135 +EXCEPTION_RENAMING_DECLARATION=136 +EXIT_STATEMENT=137 +FORMAL_PACKAGE_DECLARATION=138 +GENERIC_FORMAL_PART=139 +GENERIC_PACKAGE_DECLARATION=140 +GOTO_STATEMENT=141 +HANDLED_SEQUENCE_OF_STATEMENTS=142 +HANDLED_STMTS_OPT=143 +IF_STATEMENT=144 +INCOMPLETE_TYPE_DECLARATION=145 +INDEXED_COMPONENT=146 +INDEX_CONSTRAINT=147 +LIBRARY_ITEM=148 +LOOP_STATEMENT=149 +NAME=150 +NULL_STATEMENT=151 +NUMBER_DECLARATION=152 +OBJECT_DECLARATION=153 +OBJECT_RENAMING_DECLARATION=154 +OPERATOR_SYMBOL=155 +PACKAGE_BODY=156 +PACKAGE_BODY_STUB=157 +PACKAGE_RENAMING_DECLARATION=158 +PACKAGE_SPECIFICATION=159 +PARAMETER_SPECIFICATION=160 +PRIVATE_EXTENSION_DECLARATION=161 +PRIVATE_TYPE_DECLARATION=162 +PROTECTED_BODY=163 +PROTECTED_BODY_STUB=164 +PROTECTED_TYPE_DECLARATION=165 +RAISE_STATEMENT=166 +RANGE_ATTRIBUTE_REFERENCE=167 +RECORD_REPRESENTATION_CLAUSE=168 +REQUEUE_STATEMENT=169 +RETURN_STATEMENT=170 +SELECTIVE_ACCEPT=171 +SEQUENCE_OF_STATEMENTS=172 +SINGLE_PROTECTED_DECLARATION=173 +SINGLE_TASK_DECLARATION=174 +STATEMENT=175 +SUBTYPE_DECLARATION=176 +SUBTYPE_INDICATION=177 +SUBTYPE_MARK=178 +SUBUNIT=179 +TASK_BODY=180 +TASK_BODY_STUB=181 +TASK_TYPE_DECLARATION=182 +TERMINATE_ALTERNATIVE=183 +TIMED_ENTRY_CALL=184 +TRIGGERING_ALTERNATIVE=185 +USE_CLAUSE=186 +USE_TYPE_CLAUSE=187 +VARIANT=188 +VARIANT_PART=189 +WITH_CLAUSE=190 +ABSTRACT_FUNCTION_DECLARATION=191 +ABSTRACT_PROCEDURE_DECLARATION=192 +ACCESS_TO_FUNCTION_DECLARATION=193 +ACCESS_TO_OBJECT_DECLARATION=194 +ACCESS_TO_PROCEDURE_DECLARATION=195 +ARRAY_OBJECT_DECLARATION=196 +ARRAY_TYPE_DECLARATION=197 +AND_THEN=198 +BASIC_DECLARATIVE_ITEMS_OPT=199 +BLOCK_BODY=200 +BLOCK_BODY_OPT=201 +CALL_STATEMENT=202 +COMPONENT_CLAUSES_OPT=203 +COMPONENT_ITEMS=204 +COND_CLAUSE=205 +DECIMAL_FIXED_POINT_DECLARATION=206 +DECLARE_OPT=207 +DERIVED_RECORD_EXTENSION=208 +DISCRETE_SUBTYPE_DEF_OPT=209 +DISCRIMINANT_SPECIFICATIONS=210 +DISCRIM_PART_OPT=211 +ELSE_OPT=212 +ELSIFS_OPT=213 +END_ID_OPT=214 +ENTRY_INDEX_OPT=215 +ENUMERATION_TYPE_DECLARATION=216 +EXCEPT_HANDLER_PART_OPT=217 +EXTENSION_OPT=218 +FLOATING_POINT_DECLARATION=219 +FORMAL_DECIMAL_FIXED_POINT_DECLARATION=220 +FORMAL_DISCRETE_TYPE_DECLARATION=221 +FORMAL_FLOATING_POINT_DECLARATION=222 +FORMAL_FUNCTION_DECLARATION=223 +FORMAL_MODULAR_TYPE_DECLARATION=224 +FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION=225 +FORMAL_ORDINARY_FIXED_POINT_DECLARATION=226 +FORMAL_PART_OPT=227 +FORMAL_PRIVATE_EXTENSION_DECLARATION=228 +FORMAL_PRIVATE_TYPE_DECLARATION=229 +FORMAL_PROCEDURE_DECLARATION=230 +FORMAL_SIGNED_INTEGER_TYPE_DECLARATION=231 +FUNCTION_BODY=232 +FUNCTION_BODY_STUB=233 +FUNCTION_DECLARATION=234 +FUNCTION_RENAMING_DECLARATION=235 +GENERIC_FUNCTION_DECLARATION=236 +GENERIC_FUNCTION_INSTANTIATION=237 +GENERIC_FUNCTION_RENAMING=238 +GENERIC_PACKAGE_INSTANTIATION=239 +GENERIC_PACKAGE_RENAMING=240 +GENERIC_PROCEDURE_DECLARATION=241 +GENERIC_PROCEDURE_INSTANTIATION=242 +GENERIC_PROCEDURE_RENAMING=243 +GUARD_OPT=244 +IDENTIFIER_COLON_OPT=245 +ID_OPT=246 +INIT_OPT=247 +ITERATION_SCHEME_OPT=248 +LABEL_OPT=249 +MARK_WITH_CONSTRAINT=250 +MODIFIERS=251 +MODULAR_TYPE_DECLARATION=252 +MOD_CLAUSE_OPT=253 +NOT_IN=254 +ORDINARY_DERIVED_TYPE_DECLARATION=255 +ORDINARY_FIXED_POINT_DECLARATION=256 +OR_ELSE=257 +OR_SELECT_OPT=258 +PARENTHESIZED_PRIMARY=259 +PRIVATE_DECLARATIVE_ITEMS_OPT=260 +PRIVATE_TASK_ITEMS_OPT=261 +PROCEDURE_BODY=262 +PROCEDURE_BODY_STUB=263 +PROCEDURE_DECLARATION=264 +PROCEDURE_RENAMING_DECLARATION=265 +PROT_MEMBER_DECLARATIONS=266 +PROT_OP_BODIES_OPT=267 +PROT_OP_DECLARATIONS=268 +PROT_PRIVATE_OPT=269 +RANGED_EXPRS=270 +RANGE_CONSTRAINT=271 +RECORD_TYPE_DECLARATION=272 +SELECTOR_NAMES_OPT=273 +SIGNED_INTEGER_TYPE_DECLARATION=274 +TASK_ITEMS_OPT=275 +UNARY_MINUS=276 +UNARY_PLUS=277 +VALUE=278 +VALUES=279 +VARIANTS=280 +COMMENT_INTRO=281 +OX=282 +TIC_OR_CHARACTER_LITERAL=283 +DIGIT=284 +EXPONENT=285 +EXTENDED_DIGIT=286 +BASED_INTEGER=287 +WS_=288 +COMMENT=289 +CHARACTER_STRING=290 diff --git a/languages/ada/AdaTokenTypes.hpp b/languages/ada/AdaTokenTypes.hpp new file mode 100644 index 00000000..918b1cfd --- /dev/null +++ b/languages/ada/AdaTokenTypes.hpp @@ -0,0 +1,306 @@ +#ifndef INC_AdaTokenTypes_hpp_ +#define INC_AdaTokenTypes_hpp_ + +/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaTokenTypes.hpp"$ */ + +#ifndef CUSTOM_API +# define CUSTOM_API +#endif + +#ifdef __cplusplus +struct CUSTOM_API AdaTokenTypes { +#endif + enum { + EOF_ = 1, + PRAGMA = 4, + IDENTIFIER = 5, + SEMI = 6, + LPAREN = 7, + COMMA = 8, + RPAREN = 9, + RIGHT_SHAFT = 10, + WITH = 11, + DOT = 12, + USE = 13, + TYPE = 14, + TIC = 15, + RANGE = 16, + DIGITS = 17, + DELTA = 18, + ACCESS = 19, + PRIVATE = 20, + PACKAGE = 21, + BODY = 22, + IS = 23, + PROCEDURE = 24, + FUNCTION = 25, + NEW = 26, + OTHERS = 27, + PIPE = 28, + DOT_DOT = 29, + ALL = 30, + COLON = 31, + IN = 32, + OUT = 33, + RENAMES = 34, + CHARACTER_LITERAL = 35, + CHAR_STRING = 36, + NuLL = 37, + RECORD = 38, + SEPARATE = 39, + ABSTRACT = 40, + RETURN = 41, + TASK = 42, + PROTECTED = 43, + BOX = 44, + ASSIGN = 45, + ENTRY = 46, + FOR = 47, + END = 48, + AT = 49, + MOD = 50, + SUBTYPE = 51, + EXCEPTION = 52, + CONSTANT = 53, + ARRAY = 54, + OF = 55, + ALIASED = 56, + CASE = 57, + WHEN = 58, + TAGGED = 59, + LIMITED = 60, + GENERIC = 61, + BEGIN = 62, + LT_LT = 63, + GT_GT = 64, + IF = 65, + THEN = 66, + ELSIF = 67, + ELSE = 68, + LOOP = 69, + WHILE = 70, + REVERSE = 71, + DECLARE = 72, + EXIT = 73, + GOTO = 74, + ACCEPT = 75, + DO = 76, + DELAY = 77, + UNTIL = 78, + SELECT = 79, + ABORT = 80, + OR = 81, + TERMINATE = 82, + RAISE = 83, + REQUEUE = 84, + AND = 85, + XOR = 86, + NOT = 87, + EQ = 88, + NE = 89, + LT_ = 90, + LE = 91, + GT = 92, + GE = 93, + PLUS = 94, + MINUS = 95, + CONCAT = 96, + STAR = 97, + DIV = 98, + REM = 99, + ABS = 100, + EXPON = 101, + NUMERIC_LIT = 102, + ABORTABLE_PART = 103, + ABORT_STATEMENT = 104, + ACCEPT_ALTERNATIVE = 105, + ACCEPT_STATEMENT = 106, + ALLOCATOR = 107, + ASSIGNMENT_STATEMENT = 108, + ASYNCHRONOUS_SELECT = 109, + ATTRIBUTE_DEFINITION_CLAUSE = 110, + AT_CLAUSE = 111, + BLOCK_STATEMENT = 112, + CASE_STATEMENT = 113, + CASE_STATEMENT_ALTERNATIVE = 114, + CODE_STATEMENT = 115, + COMPONENT_DECLARATION = 116, + CONDITIONAL_ENTRY_CALL = 117, + CONTEXT_CLAUSE = 118, + DECLARATIVE_PART = 119, + DEFINING_IDENTIFIER_LIST = 120, + DELAY_ALTERNATIVE = 121, + DELAY_STATEMENT = 122, + DELTA_CONSTRAINT = 123, + DIGITS_CONSTRAINT = 124, + DISCRIMINANT_ASSOCIATION = 125, + DISCRIMINANT_CONSTRAINT = 126, + DISCRIMINANT_SPECIFICATION = 127, + ENTRY_BODY = 128, + ENTRY_CALL_ALTERNATIVE = 129, + ENTRY_CALL_STATEMENT = 130, + ENTRY_DECLARATION = 131, + ENTRY_INDEX_SPECIFICATION = 132, + ENUMERATION_REPESENTATION_CLAUSE = 133, + EXCEPTION_DECLARATION = 134, + EXCEPTION_HANDLER = 135, + EXCEPTION_RENAMING_DECLARATION = 136, + EXIT_STATEMENT = 137, + FORMAL_PACKAGE_DECLARATION = 138, + GENERIC_FORMAL_PART = 139, + GENERIC_PACKAGE_DECLARATION = 140, + GOTO_STATEMENT = 141, + HANDLED_SEQUENCE_OF_STATEMENTS = 142, + HANDLED_STMTS_OPT = 143, + IF_STATEMENT = 144, + INCOMPLETE_TYPE_DECLARATION = 145, + INDEXED_COMPONENT = 146, + INDEX_CONSTRAINT = 147, + LIBRARY_ITEM = 148, + LOOP_STATEMENT = 149, + NAME = 150, + NULL_STATEMENT = 151, + NUMBER_DECLARATION = 152, + OBJECT_DECLARATION = 153, + OBJECT_RENAMING_DECLARATION = 154, + OPERATOR_SYMBOL = 155, + PACKAGE_BODY = 156, + PACKAGE_BODY_STUB = 157, + PACKAGE_RENAMING_DECLARATION = 158, + PACKAGE_SPECIFICATION = 159, + PARAMETER_SPECIFICATION = 160, + PRIVATE_EXTENSION_DECLARATION = 161, + PRIVATE_TYPE_DECLARATION = 162, + PROTECTED_BODY = 163, + PROTECTED_BODY_STUB = 164, + PROTECTED_TYPE_DECLARATION = 165, + RAISE_STATEMENT = 166, + RANGE_ATTRIBUTE_REFERENCE = 167, + RECORD_REPRESENTATION_CLAUSE = 168, + REQUEUE_STATEMENT = 169, + RETURN_STATEMENT = 170, + SELECTIVE_ACCEPT = 171, + SEQUENCE_OF_STATEMENTS = 172, + SINGLE_PROTECTED_DECLARATION = 173, + SINGLE_TASK_DECLARATION = 174, + STATEMENT = 175, + SUBTYPE_DECLARATION = 176, + SUBTYPE_INDICATION = 177, + SUBTYPE_MARK = 178, + SUBUNIT = 179, + TASK_BODY = 180, + TASK_BODY_STUB = 181, + TASK_TYPE_DECLARATION = 182, + TERMINATE_ALTERNATIVE = 183, + TIMED_ENTRY_CALL = 184, + TRIGGERING_ALTERNATIVE = 185, + USE_CLAUSE = 186, + USE_TYPE_CLAUSE = 187, + VARIANT = 188, + VARIANT_PART = 189, + WITH_CLAUSE = 190, + ABSTRACT_FUNCTION_DECLARATION = 191, + ABSTRACT_PROCEDURE_DECLARATION = 192, + ACCESS_TO_FUNCTION_DECLARATION = 193, + ACCESS_TO_OBJECT_DECLARATION = 194, + ACCESS_TO_PROCEDURE_DECLARATION = 195, + ARRAY_OBJECT_DECLARATION = 196, + ARRAY_TYPE_DECLARATION = 197, + AND_THEN = 198, + BASIC_DECLARATIVE_ITEMS_OPT = 199, + BLOCK_BODY = 200, + BLOCK_BODY_OPT = 201, + CALL_STATEMENT = 202, + COMPONENT_CLAUSES_OPT = 203, + COMPONENT_ITEMS = 204, + COND_CLAUSE = 205, + DECIMAL_FIXED_POINT_DECLARATION = 206, + DECLARE_OPT = 207, + DERIVED_RECORD_EXTENSION = 208, + DISCRETE_SUBTYPE_DEF_OPT = 209, + DISCRIMINANT_SPECIFICATIONS = 210, + DISCRIM_PART_OPT = 211, + ELSE_OPT = 212, + ELSIFS_OPT = 213, + END_ID_OPT = 214, + ENTRY_INDEX_OPT = 215, + ENUMERATION_TYPE_DECLARATION = 216, + EXCEPT_HANDLER_PART_OPT = 217, + EXTENSION_OPT = 218, + FLOATING_POINT_DECLARATION = 219, + FORMAL_DECIMAL_FIXED_POINT_DECLARATION = 220, + FORMAL_DISCRETE_TYPE_DECLARATION = 221, + FORMAL_FLOATING_POINT_DECLARATION = 222, + FORMAL_FUNCTION_DECLARATION = 223, + FORMAL_MODULAR_TYPE_DECLARATION = 224, + FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION = 225, + FORMAL_ORDINARY_FIXED_POINT_DECLARATION = 226, + FORMAL_PART_OPT = 227, + FORMAL_PRIVATE_EXTENSION_DECLARATION = 228, + FORMAL_PRIVATE_TYPE_DECLARATION = 229, + FORMAL_PROCEDURE_DECLARATION = 230, + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION = 231, + FUNCTION_BODY = 232, + FUNCTION_BODY_STUB = 233, + FUNCTION_DECLARATION = 234, + FUNCTION_RENAMING_DECLARATION = 235, + GENERIC_FUNCTION_DECLARATION = 236, + GENERIC_FUNCTION_INSTANTIATION = 237, + GENERIC_FUNCTION_RENAMING = 238, + GENERIC_PACKAGE_INSTANTIATION = 239, + GENERIC_PACKAGE_RENAMING = 240, + GENERIC_PROCEDURE_DECLARATION = 241, + GENERIC_PROCEDURE_INSTANTIATION = 242, + GENERIC_PROCEDURE_RENAMING = 243, + GUARD_OPT = 244, + IDENTIFIER_COLON_OPT = 245, + ID_OPT = 246, + INIT_OPT = 247, + ITERATION_SCHEME_OPT = 248, + LABEL_OPT = 249, + MARK_WITH_CONSTRAINT = 250, + MODIFIERS = 251, + MODULAR_TYPE_DECLARATION = 252, + MOD_CLAUSE_OPT = 253, + NOT_IN = 254, + ORDINARY_DERIVED_TYPE_DECLARATION = 255, + ORDINARY_FIXED_POINT_DECLARATION = 256, + OR_ELSE = 257, + OR_SELECT_OPT = 258, + PARENTHESIZED_PRIMARY = 259, + PRIVATE_DECLARATIVE_ITEMS_OPT = 260, + PRIVATE_TASK_ITEMS_OPT = 261, + PROCEDURE_BODY = 262, + PROCEDURE_BODY_STUB = 263, + PROCEDURE_DECLARATION = 264, + PROCEDURE_RENAMING_DECLARATION = 265, + PROT_MEMBER_DECLARATIONS = 266, + PROT_OP_BODIES_OPT = 267, + PROT_OP_DECLARATIONS = 268, + PROT_PRIVATE_OPT = 269, + RANGED_EXPRS = 270, + RANGE_CONSTRAINT = 271, + RECORD_TYPE_DECLARATION = 272, + SELECTOR_NAMES_OPT = 273, + SIGNED_INTEGER_TYPE_DECLARATION = 274, + TASK_ITEMS_OPT = 275, + UNARY_MINUS = 276, + UNARY_PLUS = 277, + VALUE = 278, + VALUES = 279, + VARIANTS = 280, + COMMENT_INTRO = 281, + OX = 282, + TIC_OR_CHARACTER_LITERAL = 283, + DIGIT = 284, + EXPONENT = 285, + EXTENDED_DIGIT = 286, + BASED_INTEGER = 287, + WS_ = 288, + COMMENT = 289, + NULL_TREE_LOOKAHEAD = 3 + }; +#ifdef __cplusplus +}; +#endif +#endif /*INC_AdaTokenTypes_hpp_*/ diff --git a/languages/ada/AdaTokenTypes.txt b/languages/ada/AdaTokenTypes.txt new file mode 100644 index 00000000..2415ea0c --- /dev/null +++ b/languages/ada/AdaTokenTypes.txt @@ -0,0 +1,288 @@ +// $ANTLR 2.7.7 (20070609): ada.g -> AdaTokenTypes.txt$ +Ada // output token vocab name +PRAGMA="pragma"=4 +IDENTIFIER=5 +SEMI=6 +LPAREN=7 +COMMA=8 +RPAREN=9 +RIGHT_SHAFT=10 +WITH="with"=11 +DOT=12 +USE="use"=13 +TYPE="type"=14 +TIC=15 +RANGE="range"=16 +DIGITS="digits"=17 +DELTA="delta"=18 +ACCESS="access"=19 +PRIVATE="private"=20 +PACKAGE="package"=21 +BODY="body"=22 +IS="is"=23 +PROCEDURE="procedure"=24 +FUNCTION="function"=25 +NEW="new"=26 +OTHERS="others"=27 +PIPE=28 +DOT_DOT=29 +ALL="all"=30 +COLON=31 +IN="in"=32 +OUT="out"=33 +RENAMES="renames"=34 +CHARACTER_LITERAL=35 +CHAR_STRING=36 +NuLL="null"=37 +RECORD="record"=38 +SEPARATE="separate"=39 +ABSTRACT="abstract"=40 +RETURN="return"=41 +TASK="task"=42 +PROTECTED="protected"=43 +BOX=44 +ASSIGN=45 +ENTRY="entry"=46 +FOR="for"=47 +END="end"=48 +AT="at"=49 +MOD="mod"=50 +SUBTYPE="subtype"=51 +EXCEPTION="exception"=52 +CONSTANT="constant"=53 +ARRAY="array"=54 +OF="of"=55 +ALIASED="aliased"=56 +CASE="case"=57 +WHEN="when"=58 +TAGGED="tagged"=59 +LIMITED="limited"=60 +GENERIC="generic"=61 +BEGIN="begin"=62 +LT_LT=63 +GT_GT=64 +IF="if"=65 +THEN="then"=66 +ELSIF="elsif"=67 +ELSE="else"=68 +LOOP="loop"=69 +WHILE="while"=70 +REVERSE="reverse"=71 +DECLARE="declare"=72 +EXIT="exit"=73 +GOTO="goto"=74 +ACCEPT="accept"=75 +DO="do"=76 +DELAY="delay"=77 +UNTIL="until"=78 +SELECT="select"=79 +ABORT="abort"=80 +OR="or"=81 +TERMINATE="terminate"=82 +RAISE="raise"=83 +REQUEUE="requeue"=84 +AND="and"=85 +XOR="xor"=86 +NOT="not"=87 +EQ=88 +NE=89 +LT_=90 +LE=91 +GT=92 +GE=93 +PLUS=94 +MINUS=95 +CONCAT=96 +STAR=97 +DIV=98 +REM="rem"=99 +ABS="abs"=100 +EXPON=101 +NUMERIC_LIT=102 +ABORTABLE_PART=103 +ABORT_STATEMENT=104 +ACCEPT_ALTERNATIVE=105 +ACCEPT_STATEMENT=106 +ALLOCATOR=107 +ASSIGNMENT_STATEMENT=108 +ASYNCHRONOUS_SELECT=109 +ATTRIBUTE_DEFINITION_CLAUSE=110 +AT_CLAUSE=111 +BLOCK_STATEMENT=112 +CASE_STATEMENT=113 +CASE_STATEMENT_ALTERNATIVE=114 +CODE_STATEMENT=115 +COMPONENT_DECLARATION=116 +CONDITIONAL_ENTRY_CALL=117 +CONTEXT_CLAUSE=118 +DECLARATIVE_PART=119 +DEFINING_IDENTIFIER_LIST=120 +DELAY_ALTERNATIVE=121 +DELAY_STATEMENT=122 +DELTA_CONSTRAINT=123 +DIGITS_CONSTRAINT=124 +DISCRIMINANT_ASSOCIATION=125 +DISCRIMINANT_CONSTRAINT=126 +DISCRIMINANT_SPECIFICATION=127 +ENTRY_BODY=128 +ENTRY_CALL_ALTERNATIVE=129 +ENTRY_CALL_STATEMENT=130 +ENTRY_DECLARATION=131 +ENTRY_INDEX_SPECIFICATION=132 +ENUMERATION_REPESENTATION_CLAUSE=133 +EXCEPTION_DECLARATION=134 +EXCEPTION_HANDLER=135 +EXCEPTION_RENAMING_DECLARATION=136 +EXIT_STATEMENT=137 +FORMAL_PACKAGE_DECLARATION=138 +GENERIC_FORMAL_PART=139 +GENERIC_PACKAGE_DECLARATION=140 +GOTO_STATEMENT=141 +HANDLED_SEQUENCE_OF_STATEMENTS=142 +HANDLED_STMTS_OPT=143 +IF_STATEMENT=144 +INCOMPLETE_TYPE_DECLARATION=145 +INDEXED_COMPONENT=146 +INDEX_CONSTRAINT=147 +LIBRARY_ITEM=148 +LOOP_STATEMENT=149 +NAME=150 +NULL_STATEMENT=151 +NUMBER_DECLARATION=152 +OBJECT_DECLARATION=153 +OBJECT_RENAMING_DECLARATION=154 +OPERATOR_SYMBOL=155 +PACKAGE_BODY=156 +PACKAGE_BODY_STUB=157 +PACKAGE_RENAMING_DECLARATION=158 +PACKAGE_SPECIFICATION=159 +PARAMETER_SPECIFICATION=160 +PRIVATE_EXTENSION_DECLARATION=161 +PRIVATE_TYPE_DECLARATION=162 +PROTECTED_BODY=163 +PROTECTED_BODY_STUB=164 +PROTECTED_TYPE_DECLARATION=165 +RAISE_STATEMENT=166 +RANGE_ATTRIBUTE_REFERENCE=167 +RECORD_REPRESENTATION_CLAUSE=168 +REQUEUE_STATEMENT=169 +RETURN_STATEMENT=170 +SELECTIVE_ACCEPT=171 +SEQUENCE_OF_STATEMENTS=172 +SINGLE_PROTECTED_DECLARATION=173 +SINGLE_TASK_DECLARATION=174 +STATEMENT=175 +SUBTYPE_DECLARATION=176 +SUBTYPE_INDICATION=177 +SUBTYPE_MARK=178 +SUBUNIT=179 +TASK_BODY=180 +TASK_BODY_STUB=181 +TASK_TYPE_DECLARATION=182 +TERMINATE_ALTERNATIVE=183 +TIMED_ENTRY_CALL=184 +TRIGGERING_ALTERNATIVE=185 +USE_CLAUSE=186 +USE_TYPE_CLAUSE=187 +VARIANT=188 +VARIANT_PART=189 +WITH_CLAUSE=190 +ABSTRACT_FUNCTION_DECLARATION=191 +ABSTRACT_PROCEDURE_DECLARATION=192 +ACCESS_TO_FUNCTION_DECLARATION=193 +ACCESS_TO_OBJECT_DECLARATION=194 +ACCESS_TO_PROCEDURE_DECLARATION=195 +ARRAY_OBJECT_DECLARATION=196 +ARRAY_TYPE_DECLARATION=197 +AND_THEN=198 +BASIC_DECLARATIVE_ITEMS_OPT=199 +BLOCK_BODY=200 +BLOCK_BODY_OPT=201 +CALL_STATEMENT=202 +COMPONENT_CLAUSES_OPT=203 +COMPONENT_ITEMS=204 +COND_CLAUSE=205 +DECIMAL_FIXED_POINT_DECLARATION=206 +DECLARE_OPT=207 +DERIVED_RECORD_EXTENSION=208 +DISCRETE_SUBTYPE_DEF_OPT=209 +DISCRIMINANT_SPECIFICATIONS=210 +DISCRIM_PART_OPT=211 +ELSE_OPT=212 +ELSIFS_OPT=213 +END_ID_OPT=214 +ENTRY_INDEX_OPT=215 +ENUMERATION_TYPE_DECLARATION=216 +EXCEPT_HANDLER_PART_OPT=217 +EXTENSION_OPT=218 +FLOATING_POINT_DECLARATION=219 +FORMAL_DECIMAL_FIXED_POINT_DECLARATION=220 +FORMAL_DISCRETE_TYPE_DECLARATION=221 +FORMAL_FLOATING_POINT_DECLARATION=222 +FORMAL_FUNCTION_DECLARATION=223 +FORMAL_MODULAR_TYPE_DECLARATION=224 +FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION=225 +FORMAL_ORDINARY_FIXED_POINT_DECLARATION=226 +FORMAL_PART_OPT=227 +FORMAL_PRIVATE_EXTENSION_DECLARATION=228 +FORMAL_PRIVATE_TYPE_DECLARATION=229 +FORMAL_PROCEDURE_DECLARATION=230 +FORMAL_SIGNED_INTEGER_TYPE_DECLARATION=231 +FUNCTION_BODY=232 +FUNCTION_BODY_STUB=233 +FUNCTION_DECLARATION=234 +FUNCTION_RENAMING_DECLARATION=235 +GENERIC_FUNCTION_DECLARATION=236 +GENERIC_FUNCTION_INSTANTIATION=237 +GENERIC_FUNCTION_RENAMING=238 +GENERIC_PACKAGE_INSTANTIATION=239 +GENERIC_PACKAGE_RENAMING=240 +GENERIC_PROCEDURE_DECLARATION=241 +GENERIC_PROCEDURE_INSTANTIATION=242 +GENERIC_PROCEDURE_RENAMING=243 +GUARD_OPT=244 +IDENTIFIER_COLON_OPT=245 +ID_OPT=246 +INIT_OPT=247 +ITERATION_SCHEME_OPT=248 +LABEL_OPT=249 +MARK_WITH_CONSTRAINT=250 +MODIFIERS=251 +MODULAR_TYPE_DECLARATION=252 +MOD_CLAUSE_OPT=253 +NOT_IN=254 +ORDINARY_DERIVED_TYPE_DECLARATION=255 +ORDINARY_FIXED_POINT_DECLARATION=256 +OR_ELSE=257 +OR_SELECT_OPT=258 +PARENTHESIZED_PRIMARY=259 +PRIVATE_DECLARATIVE_ITEMS_OPT=260 +PRIVATE_TASK_ITEMS_OPT=261 +PROCEDURE_BODY=262 +PROCEDURE_BODY_STUB=263 +PROCEDURE_DECLARATION=264 +PROCEDURE_RENAMING_DECLARATION=265 +PROT_MEMBER_DECLARATIONS=266 +PROT_OP_BODIES_OPT=267 +PROT_OP_DECLARATIONS=268 +PROT_PRIVATE_OPT=269 +RANGED_EXPRS=270 +RANGE_CONSTRAINT=271 +RECORD_TYPE_DECLARATION=272 +SELECTOR_NAMES_OPT=273 +SIGNED_INTEGER_TYPE_DECLARATION=274 +TASK_ITEMS_OPT=275 +UNARY_MINUS=276 +UNARY_PLUS=277 +VALUE=278 +VALUES=279 +VARIANTS=280 +COMMENT_INTRO=281 +OX=282 +TIC_OR_CHARACTER_LITERAL=283 +DIGIT=284 +EXPONENT=285 +EXTENDED_DIGIT=286 +BASED_INTEGER=287 +WS_=288 +COMMENT=289 diff --git a/languages/ada/AdaTreeParserSuper.cpp b/languages/ada/AdaTreeParserSuper.cpp new file mode 100644 index 00000000..be5f0623 --- /dev/null +++ b/languages/ada/AdaTreeParserSuper.cpp @@ -0,0 +1,9050 @@ +/* $ANTLR 2.7.7 (20070609): "ada.tree.g" -> "AdaTreeParserSuper.cpp"$ */ +#include "AdaTreeParserSuper.hpp" +#include +#include +#include +#include +#include +#include +#line 1 "ada.tree.g" +#line 11 "AdaTreeParserSuper.cpp" +AdaTreeParserSuper::AdaTreeParserSuper() + : ANTLR_USE_NAMESPACE(antlr)TreeParser() { +} + +void AdaTreeParserSuper::compilation_unit(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST compilation_unit_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + context_items_opt(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case LIBRARY_ITEM: + { + library_item(_t); + _t = _retTree; + break; + } + case SUBUNIT: + { + subunit(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == PRAGMA)) { + pragma(_t); + _t = _retTree; + } + else { + goto _loop4; + } + + } + _loop4:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::context_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST context_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t12 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp1_AST_in = _t; + match(_t,CONTEXT_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case WITH_CLAUSE: + { + with_clause(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + default: + { + goto _loop14; + } + } + } + _loop14:; + } // ( ... )* + _t = __t12; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::library_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST library_item_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t32 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp2_AST_in = _t; + match(_t,LIBRARY_ITEM); + _t = _t->getFirstChild(); + modifiers(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl_or_rename_or_inst_or_body(_t); + _t = _retTree; + break; + } + case PACKAGE_BODY: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t34 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp3_AST_in = _t; + match(_t,PACKAGE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t34; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_INSTANTIATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t35 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp4_AST_in = _t; + match(_t,GENERIC_PACKAGE_INSTANTIATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t35; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_SPECIFICATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t36 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp5_AST_in = _t; + match(_t,PACKAGE_SPECIFICATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_spec_part(_t); + _t = _retTree; + _t = __t36; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t37 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp6_AST_in = _t; + match(_t,PACKAGE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t37; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + { + generic_decl(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t32; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subunit(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subunit_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t514 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp7_AST_in = _t; + match(_t,SUBUNIT); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case FUNCTION_BODY: + case PROCEDURE_BODY: + { + subprogram_body(_t); + _t = _retTree; + break; + } + case PACKAGE_BODY: + { + package_body(_t); + _t = _retTree; + break; + } + case TASK_BODY: + { + task_body(_t); + _t = _retTree; + break; + } + case PROTECTED_BODY: + { + protected_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t514; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::pragma(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST pragma_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t6 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp8_AST_in = _t; + match(_t,PRAGMA); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp9_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_0.member(_t->getType()))) { + pragma_arg(_t); + _t = _retTree; + } + else { + goto _loop8; + } + + } + _loop8:; + } // ( ... )* + _t = __t6; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::pragma_arg(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST pragma_arg_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RIGHT_SHAFT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t10 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp10_AST_in = _t; + match(_t,RIGHT_SHAFT); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp11_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + _t = __t10; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST expression_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case AND: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t472 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp12_AST_in = _t; + match(_t,AND); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t472; + _t = _t->getNextSibling(); + break; + } + case AND_THEN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t473 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp13_AST_in = _t; + match(_t,AND_THEN); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t473; + _t = _t->getNextSibling(); + break; + } + case OR: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t474 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp14_AST_in = _t; + match(_t,OR); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t474; + _t = _t->getNextSibling(); + break; + } + case OR_ELSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t475 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp15_AST_in = _t; + match(_t,OR_ELSE); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t475; + _t = _t->getNextSibling(); + break; + } + case XOR: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t476 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp16_AST_in = _t; + match(_t,XOR); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + relation(_t); + _t = _retTree; + _t = __t476; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case NOT_IN: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + relation(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::with_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST with_clause_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t16 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp17_AST_in = _t; + match(_t,WITH_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt18=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) { + compound_name(_t); + _t = _retTree; + } + else { + if ( _cnt18>=1 ) { goto _loop18; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt18++; + } + _loop18:; + } // ( ... )+ + _t = __t16; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::use_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST use_clause_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case USE_TYPE_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t22 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp18_AST_in = _t; + match(_t,USE_TYPE_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt24=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT || _t->getType() == TIC)) { + subtype_mark(_t); + _t = _retTree; + } + else { + if ( _cnt24>=1 ) { goto _loop24; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt24++; + } + _loop24:; + } // ( ... )+ + _t = __t22; + _t = _t->getNextSibling(); + break; + } + case USE_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t25 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp19_AST_in = _t; + match(_t,USE_CLAUSE); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt27=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) { + compound_name(_t); + _t = _retTree; + } + else { + if ( _cnt27>=1 ) { goto _loop27; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt27++; + } + _loop27:; + } // ( ... )+ + _t = __t25; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::compound_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST compound_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp20_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t20 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp21_AST_in = _t; + match(_t,DOT); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp22_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + _t = __t20; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subtype_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subtype_mark_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case TIC: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t29 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp23_AST_in = _t; + match(_t,TIC); + _t = _t->getFirstChild(); + compound_name(_t); + _t = _retTree; + attribute_id(_t); + _t = _retTree; + _t = __t29; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::attribute_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST attribute_id_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp24_AST_in = _t; + match(_t,RANGE); + _t = _t->getNextSibling(); + break; + } + case DIGITS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp25_AST_in = _t; + match(_t,DIGITS); + _t = _t->getNextSibling(); + break; + } + case DELTA: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp26_AST_in = _t; + match(_t,DELTA); + _t = _t->getNextSibling(); + break; + } + case ACCESS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp27_AST_in = _t; + match(_t,ACCESS); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp28_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::modifiers(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST modifiers_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t39 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp29_AST_in = _t; + match(_t,MODIFIERS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp30_AST_in = _t; + match(_t,ABSTRACT); + _t = _t->getNextSibling(); + break; + } + case ACCESS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp31_AST_in = _t; + match(_t,ACCESS); + _t = _t->getNextSibling(); + break; + } + case ALIASED: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp32_AST_in = _t; + match(_t,ALIASED); + _t = _t->getNextSibling(); + break; + } + case ALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp33_AST_in = _t; + match(_t,ALL); + _t = _t->getNextSibling(); + break; + } + case CONSTANT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp34_AST_in = _t; + match(_t,CONSTANT); + _t = _t->getNextSibling(); + break; + } + case IN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp35_AST_in = _t; + match(_t,IN); + _t = _t->getNextSibling(); + break; + } + case LIMITED: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp36_AST_in = _t; + match(_t,LIMITED); + _t = _t->getNextSibling(); + break; + } + case OUT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp37_AST_in = _t; + match(_t,OUT); + _t = _t->getNextSibling(); + break; + } + case PRIVATE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp38_AST_in = _t; + match(_t,PRIVATE); + _t = _t->getNextSibling(); + break; + } + case PROTECTED: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp39_AST_in = _t; + match(_t,PROTECTED); + _t = _t->getNextSibling(); + break; + } + case REVERSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp40_AST_in = _t; + match(_t,REVERSE); + _t = _t->getNextSibling(); + break; + } + case TAGGED: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp41_AST_in = _t; + match(_t,TAGGED); + _t = _t->getNextSibling(); + break; + } + default: + { + goto _loop41; + } + } + } + _loop41:; + } // ( ... )* + _t = __t39; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprog_decl_or_rename_or_inst_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprog_decl_or_rename_or_inst_or_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::def_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST def_id_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + compound_name(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::pkg_body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST pkg_body_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + declarative_part(_t); + _t = _retTree; + block_body_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::generic_inst(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST generic_inst_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + compound_name(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case VALUES: + { + value_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::pkg_spec_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST pkg_spec_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + basic_declarative_items_opt(_t); + _t = _retTree; + private_declarative_items_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::renames(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST renames_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case CHARACTER_STRING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp42_AST_in = _t; + match(_t,CHARACTER_STRING); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp43_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::generic_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST generic_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PACKAGE_RENAMING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t277 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp44_AST_in = _t; + match(_t,GENERIC_PACKAGE_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t277; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t278 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp45_AST_in = _t; + match(_t,GENERIC_PACKAGE_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + pkg_spec_part(_t); + _t = _retTree; + _t = __t278; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PROCEDURE_RENAMING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t279 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp46_AST_in = _t; + match(_t,GENERIC_PROCEDURE_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t279; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t280 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp47_AST_in = _t; + match(_t,GENERIC_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t280; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_RENAMING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t281 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp48_AST_in = _t; + match(_t,GENERIC_FUNCTION_RENAMING); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t281; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t282 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp49_AST_in = _t; + match(_t,GENERIC_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + generic_formal_part_opt(_t); + _t = _retTree; + def_id(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t282; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST id_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t43 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp50_AST_in = _t; + match(_t,ID_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case OPERATOR_SYMBOL: + { + def_designator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t43; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::def_designator(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST def_designator_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case OPERATOR_SYMBOL: + { + definable_operator_symbol(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::end_id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST end_id_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t46 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp51_AST_in = _t; + match(_t,END); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case OPERATOR_SYMBOL: + { + def_designator(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t46; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprog_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprog_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PROCEDURE_INSTANTIATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t49 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp52_AST_in = _t; + match(_t,GENERIC_PROCEDURE_INSTANTIATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t49; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t50 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp53_AST_in = _t; + match(_t,PROCEDURE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t50; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t51 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp54_AST_in = _t; + match(_t,PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t51; + _t = _t->getNextSibling(); + break; + } + case PROCEDURE_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t52 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp55_AST_in = _t; + match(_t,PROCEDURE_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t52; + _t = _t->getNextSibling(); + break; + } + case ABSTRACT_PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t53 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp56_AST_in = _t; + match(_t,ABSTRACT_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t53; + _t = _t->getNextSibling(); + break; + } + case GENERIC_FUNCTION_INSTANTIATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t54 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp57_AST_in = _t; + match(_t,GENERIC_FUNCTION_INSTANTIATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t54; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t55 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp58_AST_in = _t; + match(_t,FUNCTION_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t55; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t56 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp59_AST_in = _t; + match(_t,FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t56; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t57 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp60_AST_in = _t; + match(_t,FUNCTION_BODY_STUB); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t57; + _t = _t->getNextSibling(); + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t58 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp61_AST_in = _t; + match(_t,ABSTRACT_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t58; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST formal_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t84 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp62_AST_in = _t; + match(_t,FORMAL_PART_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == PARAMETER_SPECIFICATION)) { + parameter_specification(_t); + _t = _retTree; + } + else { + goto _loop86; + } + + } + _loop86:; + } // ( ... )* + _t = __t84; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::function_tail(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST function_tail_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + formal_part_opt(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::value_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST value_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t468 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp63_AST_in = _t; + match(_t,VALUES); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt470=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_1.member(_t->getType()))) { + value(_t); + _t = _retTree; + } + else { + if ( _cnt470>=1 ) { goto _loop470; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt470++; + } + _loop470:; + } // ( ... )+ + _t = __t468; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::value(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST value_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case OTHERS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t63 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp64_AST_in = _t; + match(_t,OTHERS); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + _t = __t63; + _t = _t->getNextSibling(); + break; + } + case RIGHT_SHAFT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t64 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp65_AST_in = _t; + match(_t,RIGHT_SHAFT); + _t = _t->getFirstChild(); + ranged_expr_s(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t64; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case PIPE: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + ranged_expr_s(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::ranged_expr_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST ranged_expr_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t66 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp66_AST_in = _t; + match(_t,PIPE); + _t = _t->getFirstChild(); + ranged_expr_s(_t); + _t = _retTree; + ranged_expr(_t); + _t = _retTree; + _t = __t66; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + ranged_expr(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::ranged_expr(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST ranged_expr_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t68 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp67_AST_in = _t; + match(_t,DOT_DOT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t68; + _t = _t->getNextSibling(); + break; + } + case RANGE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t69 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp68_AST_in = _t; + match(_t,RANGE); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + _t = __t69; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::simple_expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST simple_expression_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PLUS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t488 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp69_AST_in = _t; + match(_t,PLUS); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t488; + _t = _t->getNextSibling(); + break; + } + case MINUS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t489 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp70_AST_in = _t; + match(_t,MINUS); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t489; + _t = _t->getNextSibling(); + break; + } + case CONCAT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t490 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp71_AST_in = _t; + match(_t,CONCAT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + signed_term(_t); + _t = _retTree; + _t = __t490; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + signed_term(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + range_dots(_t); + _t = _retTree; + break; + } + case RANGE_ATTRIBUTE_REFERENCE: + { + range_attrib_ref(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t71 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp72_AST_in = _t; + match(_t,RANGE_CONSTRAINT); + _t = _t->getFirstChild(); + range(_t); + _t = _retTree; + _t = __t71; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_dots(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_dots_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t75 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp73_AST_in = _t; + match(_t,DOT_DOT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t75; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_attrib_ref(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_attrib_ref_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t77 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp74_AST_in = _t; + match(_t,RANGE_ATTRIBUTE_REFERENCE); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t77; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prefix(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prefix_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp75_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t80 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp76_AST_in = _t; + match(_t,DOT); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp77_AST_in = _t; + match(_t,ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp78_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t80; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t82 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp79_AST_in = _t; + match(_t,INDEXED_COMPONENT); + _t = _t->getFirstChild(); + prefix(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t82; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::parameter_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST parameter_specification_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t88 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp80_AST_in = _t; + match(_t,PARAMETER_SPECIFICATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t88; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::defining_identifier_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST defining_identifier_list_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t90 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp81_AST_in = _t; + match(_t,DEFINING_IDENTIFIER_LIST); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt92=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER)) { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp82_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + else { + if ( _cnt92>=1 ) { goto _loop92; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt92++; + } + _loop92:; + } // ( ... )+ + _t = __t90; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::init_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST init_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t136 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp83_AST_in = _t; + match(_t,INIT_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t136; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp84_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t95 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp85_AST_in = _t; + match(_t,DOT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp86_AST_in = _t; + match(_t,ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp87_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp88_AST_in = _t; + match(_t,CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp89_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t95; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t97 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp90_AST_in = _t; + match(_t,INDEXED_COMPONENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t97; + _t = _t->getNextSibling(); + break; + } + case TIC: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t98 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp91_AST_in = _t; + match(_t,TIC); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + attribute_id(_t); + _t = _retTree; + _t = __t98; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::definable_operator_symbol(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST definable_operator_symbol_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp92_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::parenthesized_primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST parenthesized_primary_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t101 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp93_AST_in = _t; + match(_t,PARENTHESIZED_PRIMARY); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case NuLL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp94_AST_in = _t; + match(_t,NuLL); + _t = _t->getNextSibling(); + break; + } + case VALUES: + { + value_s(_t); + _t = _retTree; + extension_opt(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t101; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::extension_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST extension_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t104 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp95_AST_in = _t; + match(_t,EXTENSION_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case NuLL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp96_AST_in = _t; + match(_t,NuLL); + _t = _t->getNextSibling(); + break; + } + case VALUES: + { + value_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t104; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::spec_decl_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST spec_decl_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case GENERIC_PACKAGE_INSTANTIATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t109 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp97_AST_in = _t; + match(_t,GENERIC_PACKAGE_INSTANTIATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + generic_inst(_t); + _t = _retTree; + _t = __t109; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_SPECIFICATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t110 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp98_AST_in = _t; + match(_t,PACKAGE_SPECIFICATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_spec_part(_t); + _t = _retTree; + _t = __t110; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t111 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp99_AST_in = _t; + match(_t,PACKAGE_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + renames(_t); + _t = _retTree; + _t = __t111; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::basic_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST basic_declarative_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t114 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp100_AST_in = _t; + match(_t,BASIC_DECLARATIVE_ITEMS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_2.member(_t->getType()))) { + basic_decl_item(_t); + _t = _retTree; + } + else { + goto _loop116; + } + + } + _loop116:; + } // ( ... )* + _t = __t114; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::private_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST private_declarative_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t118 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp101_AST_in = _t; + match(_t,PRIVATE_DECLARATIVE_ITEMS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_2.member(_t->getType()))) { + basic_decl_item(_t); + _t = _retTree; + } + else { + goto _loop120; + } + + } + _loop120:; + } // ( ... )* + _t = __t118; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::basic_decl_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST basic_decl_item_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case GENERIC_PACKAGE_INSTANTIATION: + { + spec_decl_part(_t); + _t = _retTree; + break; + } + case SINGLE_TASK_DECLARATION: + case TASK_TYPE_DECLARATION: + { + task_type_or_single_decl(_t); + _t = _retTree; + break; + } + case PROTECTED_TYPE_DECLARATION: + case SINGLE_PROTECTED_DECLARATION: + { + prot_type_or_single_decl(_t); + _t = _retTree; + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SUBTYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + decl_common(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::task_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST task_type_or_single_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case TASK_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t123 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp102_AST_in = _t; + match(_t,TASK_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + task_definition_opt(_t); + _t = _retTree; + _t = __t123; + _t = _t->getNextSibling(); + break; + } + case SINGLE_TASK_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t124 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp103_AST_in = _t; + match(_t,SINGLE_TASK_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + task_definition_opt(_t); + _t = _retTree; + _t = __t124; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_type_or_single_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROTECTED_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t164 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp104_AST_in = _t; + match(_t,PROTECTED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + protected_definition(_t); + _t = _retTree; + _t = __t164; + _t = _t->getNextSibling(); + break; + } + case SINGLE_PROTECTED_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t165 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp105_AST_in = _t; + match(_t,SINGLE_PROTECTED_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + protected_definition(_t); + _t = _retTree; + _t = __t165; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::decl_common(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST decl_common_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENUMERATION_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t184 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp106_AST_in = _t; + match(_t,ENUMERATION_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp107_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + enum_id_s(_t); + _t = _retTree; + _t = __t184; + _t = _t->getNextSibling(); + break; + } + case SIGNED_INTEGER_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t185 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp108_AST_in = _t; + match(_t,SIGNED_INTEGER_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp109_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + range(_t); + _t = _retTree; + _t = __t185; + _t = _t->getNextSibling(); + break; + } + case MODULAR_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t186 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp110_AST_in = _t; + match(_t,MODULAR_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp111_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + _t = __t186; + _t = _t->getNextSibling(); + break; + } + case FLOATING_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t187 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp112_AST_in = _t; + match(_t,FLOATING_POINT_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp113_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t187; + _t = _t->getNextSibling(); + break; + } + case ORDINARY_FIXED_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t188 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp114_AST_in = _t; + match(_t,ORDINARY_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp115_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + _t = __t188; + _t = _t->getNextSibling(); + break; + } + case DECIMAL_FIXED_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t189 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp116_AST_in = _t; + match(_t,DECIMAL_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp117_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + expression(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t189; + _t = _t->getNextSibling(); + break; + } + case ARRAY_TYPE_DECLARATION: + { + array_type_declaration(_t); + _t = _retTree; + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + { + access_type_declaration(_t); + _t = _retTree; + break; + } + case INCOMPLETE_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t190 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp118_AST_in = _t; + match(_t,INCOMPLETE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp119_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + discrim_part_opt(_t); + _t = _retTree; + _t = __t190; + _t = _t->getNextSibling(); + break; + } + case PRIVATE_EXTENSION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t191 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp120_AST_in = _t; + match(_t,PRIVATE_EXTENSION_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t191; + _t = _t->getNextSibling(); + break; + } + case DERIVED_RECORD_EXTENSION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t192 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp121_AST_in = _t; + match(_t,DERIVED_RECORD_EXTENSION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + record_definition(_t); + _t = _retTree; + _t = __t192; + _t = _t->getNextSibling(); + break; + } + case ORDINARY_DERIVED_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t193 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp122_AST_in = _t; + match(_t,ORDINARY_DERIVED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t193; + _t = _t->getNextSibling(); + break; + } + case PRIVATE_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t194 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp123_AST_in = _t; + match(_t,PRIVATE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + _t = __t194; + _t = _t->getNextSibling(); + break; + } + case RECORD_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t195 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp124_AST_in = _t; + match(_t,RECORD_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_and_discrim(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + record_definition(_t); + _t = _retTree; + _t = __t195; + _t = _t->getNextSibling(); + break; + } + case SUBTYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t196 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp125_AST_in = _t; + match(_t,SUBTYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp126_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + subtype_ind(_t); + _t = _retTree; + _t = __t196; + _t = _t->getNextSibling(); + break; + } + case GENERIC_PACKAGE_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + { + generic_decl(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + case EXCEPTION_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t197 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp127_AST_in = _t; + match(_t,EXCEPTION_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + compound_name(_t); + _t = _retTree; + _t = __t197; + _t = _t->getNextSibling(); + break; + } + case OBJECT_RENAMING_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t198 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp128_AST_in = _t; + match(_t,OBJECT_RENAMING_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + name(_t); + _t = _retTree; + _t = __t198; + _t = _t->getNextSibling(); + break; + } + case EXCEPTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t199 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp129_AST_in = _t; + match(_t,EXCEPTION_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + _t = __t199; + _t = _t->getNextSibling(); + break; + } + case NUMBER_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t200 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp130_AST_in = _t; + match(_t,NUMBER_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t200; + _t = _t->getNextSibling(); + break; + } + case ARRAY_OBJECT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t201 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp131_AST_in = _t; + match(_t,ARRAY_OBJECT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + array_type_definition(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t201; + _t = _t->getNextSibling(); + break; + } + case OBJECT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t202 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp132_AST_in = _t; + match(_t,OBJECT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t202; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrim_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrim_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t127 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp133_AST_in = _t; + match(_t,DISCRIM_PART_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp134_AST_in = _t; + match(_t,BOX); + _t = _t->getNextSibling(); + break; + } + case DISCRIMINANT_SPECIFICATIONS: + { + discriminant_specifications(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t127; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::task_definition_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST task_definition_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + task_items_opt(_t); + _t = _retTree; + private_task_items_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST task_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t139 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp135_AST_in = _t; + match(_t,TASK_ITEMS_OPT); + _t = _t->getFirstChild(); + entrydecls_repspecs_opt(_t); + _t = _retTree; + _t = __t139; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::private_task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST private_task_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t162 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp136_AST_in = _t; + match(_t,PRIVATE_TASK_ITEMS_OPT); + _t = _t->getFirstChild(); + entrydecls_repspecs_opt(_t); + _t = _retTree; + _t = __t162; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_specifications(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_specifications_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t130 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp137_AST_in = _t; + match(_t,DISCRIMINANT_SPECIFICATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == DISCRIMINANT_SPECIFICATION)) { + discriminant_specification(_t); + _t = _retTree; + } + else { + goto _loop132; + } + + } + _loop132:; + } // ( ... )* + _t = __t130; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_specification_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t134 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp138_AST_in = _t; + match(_t,DISCRIMINANT_SPECIFICATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_mark(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t134; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entrydecls_repspecs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entrydecls_repspecs_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENTRY_DECLARATION: + { + entry_declaration(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + default: + { + goto _loop142; + } + } + } + _loop142:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t144 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp139_AST_in = _t; + match(_t,ENTRY_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp140_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + discrete_subtype_def_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t144; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::rep_spec(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST rep_spec_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RECORD_REPRESENTATION_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t150 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp141_AST_in = _t; + match(_t,RECORD_REPRESENTATION_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + align_opt(_t); + _t = _retTree; + comp_loc_s(_t); + _t = _retTree; + _t = __t150; + _t = _t->getNextSibling(); + break; + } + case AT_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t151 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp142_AST_in = _t; + match(_t,AT_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t151; + _t = _t->getNextSibling(); + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t152 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp143_AST_in = _t; + match(_t,ATTRIBUTE_DEFINITION_CLAUSE); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t152; + _t = _t->getNextSibling(); + break; + } + case ENUMERATION_REPESENTATION_CLAUSE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t153 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp144_AST_in = _t; + match(_t,ENUMERATION_REPESENTATION_CLAUSE); + _t = _t->getFirstChild(); + local_enum_name(_t); + _t = _retTree; + enumeration_aggregate(_t); + _t = _retTree; + _t = __t153; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrete_subtype_def_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrete_subtype_def_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t146 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp145_AST_in = _t; + match(_t,DISCRETE_SUBTYPE_DEF_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + case SUBTYPE_INDICATION: + { + discrete_subtype_definition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t146; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrete_subtype_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrete_subtype_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case SUBTYPE_INDICATION: + { + subtype_ind(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subtype_ind(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subtype_ind_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t221 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp146_AST_in = _t; + match(_t,SUBTYPE_INDICATION); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + constraint_opt(_t); + _t = _retTree; + _t = __t221; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::align_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST align_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t155 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp147_AST_in = _t; + match(_t,MOD_CLAUSE_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t155; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::comp_loc_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST comp_loc_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t158 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp148_AST_in = _t; + match(_t,COMPONENT_CLAUSES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + { + subtype_mark(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + range(_t); + _t = _retTree; + break; + } + default: + { + goto _loop160; + } + } + } + _loop160:; + } // ( ... )* + _t = __t158; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::local_enum_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST local_enum_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp149_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::enumeration_aggregate(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST enumeration_aggregate_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_1.member(_t->getType()))) { + value(_t); + _t = _retTree; + } + else { + goto _loop275; + } + + } + _loop275:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::protected_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST protected_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + prot_op_decl_s(_t); + _t = _retTree; + prot_private_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_private_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_private_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t167 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp150_AST_in = _t; + match(_t,PROT_PRIVATE_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROT_MEMBER_DECLARATIONS: + { + prot_member_decl_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t167; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_member_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_member_decl_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t178 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp151_AST_in = _t; + match(_t,PROT_MEMBER_DECLARATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENTRY_DECLARATION: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + case FUNCTION_DECLARATION: + case PROCEDURE_DECLARATION: + { + prot_op_decl(_t); + _t = _retTree; + break; + } + case COMPONENT_DECLARATION: + { + comp_decl(_t); + _t = _retTree; + break; + } + default: + { + goto _loop180; + } + } + } + _loop180:; + } // ( ... )* + _t = __t178; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_op_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_op_decl_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t171 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp152_AST_in = _t; + match(_t,PROT_OP_DECLARATIONS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_3.member(_t->getType()))) { + prot_op_decl(_t); + _t = _retTree; + } + else { + goto _loop173; + } + + } + _loop173:; + } // ( ... )* + _t = __t171; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_op_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_op_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ENTRY_DECLARATION: + { + entry_declaration(_t); + _t = _retTree; + break; + } + case PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t175 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp153_AST_in = _t; + match(_t,PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t175; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t176 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp154_AST_in = _t; + match(_t,FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t176; + _t = _t->getNextSibling(); + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case RECORD_REPRESENTATION_CLAUSE: + { + rep_spec(_t); + _t = _retTree; + break; + } + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::comp_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST comp_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t182 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp155_AST_in = _t; + match(_t,COMPONENT_DECLARATION); + _t = _t->getFirstChild(); + defining_identifier_list(_t); + _t = _retTree; + component_subtype_def(_t); + _t = _retTree; + init_opt(_t); + _t = _retTree; + _t = __t182; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::component_subtype_def(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST component_subtype_def_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::enum_id_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST enum_id_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )+ + int _cnt206=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER || _t->getType() == CHARACTER_LITERAL)) { + enumeration_literal_specification(_t); + _t = _retTree; + } + else { + if ( _cnt206>=1 ) { goto _loop206; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt206++; + } + _loop206:; + } // ( ... )+ + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_constraint_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE_CONSTRAINT: + { + range_constraint(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST array_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t212 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp156_AST_in = _t; + match(_t,ARRAY_TYPE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp157_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + array_type_definition(_t); + _t = _retTree; + _t = __t212; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST access_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ACCESS_TO_PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t245 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp158_AST_in = _t; + match(_t,ACCESS_TO_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp159_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t245; + _t = _t->getNextSibling(); + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t246 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp160_AST_in = _t; + match(_t,ACCESS_TO_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp161_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t246; + _t = _t->getNextSibling(); + break; + } + case ACCESS_TO_OBJECT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t247 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp162_AST_in = _t; + match(_t,ACCESS_TO_OBJECT_DECLARATION); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp163_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t247; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::id_and_discrim(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST id_and_discrim_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp164_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + discrim_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::record_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST record_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case COMPONENT_ITEMS: + { + component_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::array_type_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST array_type_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + index_or_discrete_range_s(_t); + _t = _retTree; + component_subtype_def(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::enumeration_literal_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST enumeration_literal_specification_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp165_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp166_AST_in = _t; + match(_t,CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::index_or_discrete_range_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST index_or_discrete_range_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case RANGE: + case DOT_DOT: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + index_or_discrete_range(_t); + _t = _retTree; + break; + } + case COMMA: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t214 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp167_AST_in = _t; + match(_t,COMMA); + _t = _t->getFirstChild(); + index_or_discrete_range_s(_t); + _t = _retTree; + index_or_discrete_range(_t); + _t = _retTree; + _t = __t214; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::index_or_discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST index_or_discrete_range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t216 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp168_AST_in = _t; + match(_t,DOT_DOT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t216; + _t = _t->getNextSibling(); + break; + } + case RANGE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t217 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp169_AST_in = _t; + match(_t,RANGE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp170_AST_in = _t; + match(_t,BOX); + _t = _t->getNextSibling(); + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t217; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + simple_expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST constraint_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case RANGE_CONSTRAINT: + { + range_constraint(_t); + _t = _retTree; + break; + } + case DIGITS_CONSTRAINT: + { + digits_constraint(_t); + _t = _retTree; + break; + } + case DELTA_CONSTRAINT: + { + delta_constraint(_t); + _t = _retTree; + break; + } + case INDEX_CONSTRAINT: + { + index_constraint(_t); + _t = _retTree; + break; + } + case DISCRIMINANT_CONSTRAINT: + { + discriminant_constraint(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::digits_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST digits_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t225 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp171_AST_in = _t; + match(_t,DIGITS_CONSTRAINT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t225; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::delta_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST delta_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t227 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp172_AST_in = _t; + match(_t,DELTA_CONSTRAINT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + range_constraint_opt(_t); + _t = _retTree; + _t = __t227; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::index_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST index_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t229 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp173_AST_in = _t; + match(_t,INDEX_CONSTRAINT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt231=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == DOT_DOT || _t->getType() == RANGE_ATTRIBUTE_REFERENCE || _t->getType() == SUBTYPE_INDICATION)) { + discrete_range(_t); + _t = _retTree; + } + else { + if ( _cnt231>=1 ) { goto _loop231; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt231++; + } + _loop231:; + } // ( ... )+ + _t = __t229; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t234 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp174_AST_in = _t; + match(_t,DISCRIMINANT_CONSTRAINT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt236=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == DISCRIMINANT_ASSOCIATION)) { + discriminant_association(_t); + _t = _retTree; + } + else { + if ( _cnt236>=1 ) { goto _loop236; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt236++; + } + _loop236:; + } // ( ... )+ + _t = __t234; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrete_range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case SUBTYPE_INDICATION: + { + subtype_ind(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_association(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_association_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t238 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp175_AST_in = _t; + match(_t,DISCRIMINANT_ASSOCIATION); + _t = _t->getFirstChild(); + selector_names_opt(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t238; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::selector_names_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST selector_names_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t240 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp176_AST_in = _t; + match(_t,SELECTOR_NAMES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == IDENTIFIER)) { + selector_name(_t); + _t = _retTree; + } + else { + goto _loop242; + } + + } + _loop242:; + } // ( ... )* + _t = __t240; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::selector_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST selector_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp177_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::component_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST component_list_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + component_items(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case VARIANT_PART: + { + variant_part(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::component_items(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST component_items_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t253 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp178_AST_in = _t; + match(_t,COMPONENT_ITEMS); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case COMPONENT_DECLARATION: + { + comp_decl(_t); + _t = _retTree; + break; + } + default: + { + goto _loop255; + } + } + } + _loop255:; + } // ( ... )* + _t = __t253; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::variant_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST variant_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t257 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp179_AST_in = _t; + match(_t,VARIANT_PART); + _t = _t->getFirstChild(); + discriminant_direct_name(_t); + _t = _retTree; + variant_s(_t); + _t = _retTree; + _t = __t257; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discriminant_direct_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_direct_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp180_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::variant_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST variant_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t260 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp181_AST_in = _t; + match(_t,VARIANTS); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt262=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == VARIANT)) { + variant(_t); + _t = _retTree; + } + else { + if ( _cnt262>=1 ) { goto _loop262; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt262++; + } + _loop262:; + } // ( ... )+ + _t = __t260; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::variant(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST variant_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t264 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp182_AST_in = _t; + match(_t,VARIANT); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case COMPONENT_ITEMS: + { + component_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t264; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST choice_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t267 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp183_AST_in = _t; + match(_t,PIPE); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + choice(_t); + _t = _retTree; + _t = __t267; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case OTHERS: + case DOT_DOT: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case RANGE_ATTRIBUTE_REFERENCE: + case AND_THEN: + case MARK_WITH_CONSTRAINT: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + choice(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST choice_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case OTHERS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp184_AST_in = _t; + match(_t,OTHERS); + _t = _t->getNextSibling(); + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + case MARK_WITH_CONSTRAINT: + { + discrete_with_range(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::discrete_with_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST discrete_with_range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case MARK_WITH_CONSTRAINT: + { + mark_with_constraint(_t); + _t = _retTree; + break; + } + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::mark_with_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST mark_with_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t271 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp185_AST_in = _t; + match(_t,MARK_WITH_CONSTRAINT); + _t = _t->getFirstChild(); + subtype_mark(_t); + _t = _retTree; + range_constraint(_t); + _t = _retTree; + _t = __t271; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::generic_formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST generic_formal_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t284 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp186_AST_in = _t; + match(_t,GENERIC_FORMAL_PART); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + { + use_clause(_t); + _t = _retTree; + break; + } + case FORMAL_PACKAGE_DECLARATION: + case PARAMETER_SPECIFICATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case FORMAL_DECIMAL_FIXED_POINT_DECLARATION: + case FORMAL_DISCRETE_TYPE_DECLARATION: + case FORMAL_FLOATING_POINT_DECLARATION: + case FORMAL_FUNCTION_DECLARATION: + case FORMAL_MODULAR_TYPE_DECLARATION: + case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION: + case FORMAL_ORDINARY_FIXED_POINT_DECLARATION: + case FORMAL_PRIVATE_EXTENSION_DECLARATION: + case FORMAL_PRIVATE_TYPE_DECLARATION: + case FORMAL_PROCEDURE_DECLARATION: + case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION: + { + generic_formal_parameter(_t); + _t = _retTree; + break; + } + default: + { + goto _loop286; + } + } + } + _loop286:; + } // ( ... )* + _t = __t284; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::generic_formal_parameter(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST generic_formal_parameter_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case FORMAL_DISCRETE_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t288 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp187_AST_in = _t; + match(_t,FORMAL_DISCRETE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t288; + _t = _t->getNextSibling(); + break; + } + case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t289 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp188_AST_in = _t; + match(_t,FORMAL_SIGNED_INTEGER_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t289; + _t = _t->getNextSibling(); + break; + } + case FORMAL_MODULAR_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t290 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp189_AST_in = _t; + match(_t,FORMAL_MODULAR_TYPE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t290; + _t = _t->getNextSibling(); + break; + } + case FORMAL_DECIMAL_FIXED_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t291 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp190_AST_in = _t; + match(_t,FORMAL_DECIMAL_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t291; + _t = _t->getNextSibling(); + break; + } + case FORMAL_ORDINARY_FIXED_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t292 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp191_AST_in = _t; + match(_t,FORMAL_ORDINARY_FIXED_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t292; + _t = _t->getNextSibling(); + break; + } + case FORMAL_FLOATING_POINT_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t293 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp192_AST_in = _t; + match(_t,FORMAL_FLOATING_POINT_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t293; + _t = _t->getNextSibling(); + break; + } + case ARRAY_TYPE_DECLARATION: + { + formal_array_type_declaration(_t); + _t = _retTree; + break; + } + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + { + formal_access_type_declaration(_t); + _t = _retTree; + break; + } + case FORMAL_PRIVATE_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t294 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp193_AST_in = _t; + match(_t,FORMAL_PRIVATE_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + _t = __t294; + _t = _t->getNextSibling(); + break; + } + case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t295 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp194_AST_in = _t; + match(_t,FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t295; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PRIVATE_EXTENSION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t296 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp195_AST_in = _t; + match(_t,FORMAL_PRIVATE_EXTENSION_DECLARATION); + _t = _t->getFirstChild(); + id_part(_t); + _t = _retTree; + modifiers(_t); + _t = _retTree; + subtype_ind(_t); + _t = _retTree; + _t = __t296; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t297 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp196_AST_in = _t; + match(_t,FORMAL_PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + subprogram_default_opt(_t); + _t = _retTree; + _t = __t297; + _t = _t->getNextSibling(); + break; + } + case FORMAL_FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t298 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp197_AST_in = _t; + match(_t,FORMAL_FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + subprogram_default_opt(_t); + _t = _retTree; + _t = __t298; + _t = _t->getNextSibling(); + break; + } + case FORMAL_PACKAGE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t299 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp198_AST_in = _t; + match(_t,FORMAL_PACKAGE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + compound_name(_t); + _t = _retTree; + formal_package_actual_part_opt(_t); + _t = _retTree; + _t = __t299; + _t = _t->getNextSibling(); + break; + } + case PARAMETER_SPECIFICATION: + { + parameter_specification(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::formal_array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST formal_array_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + array_type_declaration(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::formal_access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST formal_access_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + access_type_declaration(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::id_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST id_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + def_id(_t); + _t = _retTree; + discrim_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprogram_default_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprogram_default_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp199_AST_in = _t; + match(_t,BOX); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::formal_package_actual_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST formal_package_actual_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case BOX: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp200_AST_in = _t; + match(_t,BOX); + _t = _t->getNextSibling(); + break; + } + case DEFINING_IDENTIFIER_LIST: + { + defining_identifier_list(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::procedure_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST procedure_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t309 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp201_AST_in = _t; + match(_t,PROCEDURE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t309; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::function_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST function_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t311 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp202_AST_in = _t; + match(_t,FUNCTION_BODY); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t311; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST body_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + declarative_part(_t); + _t = _retTree; + block_body(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::declarative_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST declarative_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t314 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp203_AST_in = _t; + match(_t,DECLARATIVE_PART); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PACKAGE_BODY: + case PACKAGE_BODY_STUB: + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case PROTECTED_BODY: + case PROTECTED_BODY_STUB: + case PROTECTED_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SINGLE_PROTECTED_DECLARATION: + case SINGLE_TASK_DECLARATION: + case SUBTYPE_DECLARATION: + case TASK_BODY: + case TASK_BODY_STUB: + case TASK_TYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_INSTANTIATION: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + declarative_item(_t); + _t = _retTree; + break; + } + default: + { + goto _loop316; + } + } + } + _loop316:; + } // ( ... )* + _t = __t314; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::block_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST block_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t336 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp204_AST_in = _t; + match(_t,BLOCK_BODY); + _t = _t->getFirstChild(); + handled_stmt_s(_t); + _t = _retTree; + _t = __t336; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::declarative_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST declarative_item_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PACKAGE_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t318 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp205_AST_in = _t; + match(_t,PACKAGE_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t318; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_BODY: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t319 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp206_AST_in = _t; + match(_t,PACKAGE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t319; + _t = _t->getNextSibling(); + break; + } + case PACKAGE_RENAMING_DECLARATION: + case PACKAGE_SPECIFICATION: + case GENERIC_PACKAGE_INSTANTIATION: + { + spec_decl_part(_t); + _t = _retTree; + break; + } + case TASK_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t320 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp207_AST_in = _t; + match(_t,TASK_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t320; + _t = _t->getNextSibling(); + break; + } + case TASK_BODY: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t321 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp208_AST_in = _t; + match(_t,TASK_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t321; + _t = _t->getNextSibling(); + break; + } + case SINGLE_TASK_DECLARATION: + case TASK_TYPE_DECLARATION: + { + task_type_or_single_decl(_t); + _t = _retTree; + break; + } + case PROTECTED_BODY_STUB: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t322 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp209_AST_in = _t; + match(_t,PROTECTED_BODY_STUB); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + _t = __t322; + _t = _t->getNextSibling(); + break; + } + case PROTECTED_BODY: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t323 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp210_AST_in = _t; + match(_t,PROTECTED_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + prot_op_bodies_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t323; + _t = _t->getNextSibling(); + break; + } + case PROTECTED_TYPE_DECLARATION: + case SINGLE_PROTECTED_DECLARATION: + { + prot_type_or_single_decl(_t); + _t = _retTree; + break; + } + case ABSTRACT_FUNCTION_DECLARATION: + case ABSTRACT_PROCEDURE_DECLARATION: + case FUNCTION_BODY: + case FUNCTION_BODY_STUB: + case FUNCTION_DECLARATION: + case FUNCTION_RENAMING_DECLARATION: + case GENERIC_FUNCTION_INSTANTIATION: + case GENERIC_PROCEDURE_INSTANTIATION: + case PROCEDURE_BODY: + case PROCEDURE_BODY_STUB: + case PROCEDURE_DECLARATION: + case PROCEDURE_RENAMING_DECLARATION: + { + subprog_decl_or_rename_or_inst_or_body(_t); + _t = _retTree; + break; + } + case ATTRIBUTE_DEFINITION_CLAUSE: + case AT_CLAUSE: + case ENUMERATION_REPESENTATION_CLAUSE: + case EXCEPTION_DECLARATION: + case EXCEPTION_RENAMING_DECLARATION: + case GENERIC_PACKAGE_DECLARATION: + case INCOMPLETE_TYPE_DECLARATION: + case NUMBER_DECLARATION: + case OBJECT_DECLARATION: + case OBJECT_RENAMING_DECLARATION: + case PRIVATE_EXTENSION_DECLARATION: + case PRIVATE_TYPE_DECLARATION: + case RECORD_REPRESENTATION_CLAUSE: + case SUBTYPE_DECLARATION: + case USE_CLAUSE: + case USE_TYPE_CLAUSE: + case ACCESS_TO_FUNCTION_DECLARATION: + case ACCESS_TO_OBJECT_DECLARATION: + case ACCESS_TO_PROCEDURE_DECLARATION: + case ARRAY_OBJECT_DECLARATION: + case ARRAY_TYPE_DECLARATION: + case DECIMAL_FIXED_POINT_DECLARATION: + case DERIVED_RECORD_EXTENSION: + case ENUMERATION_TYPE_DECLARATION: + case FLOATING_POINT_DECLARATION: + case GENERIC_FUNCTION_DECLARATION: + case GENERIC_FUNCTION_RENAMING: + case GENERIC_PACKAGE_RENAMING: + case GENERIC_PROCEDURE_DECLARATION: + case GENERIC_PROCEDURE_RENAMING: + case MODULAR_TYPE_DECLARATION: + case ORDINARY_DERIVED_TYPE_DECLARATION: + case ORDINARY_FIXED_POINT_DECLARATION: + case RECORD_TYPE_DECLARATION: + case SIGNED_INTEGER_TYPE_DECLARATION: + { + decl_common(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::prot_op_bodies_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST prot_op_bodies_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t329 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp211_AST_in = _t; + match(_t,PROT_OP_BODIES_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case ENTRY_BODY: + { + entry_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + case FUNCTION_DECLARATION: + case PROCEDURE_BODY: + case PROCEDURE_DECLARATION: + { + subprog_decl_or_body(_t); + _t = _retTree; + break; + } + default: + { + goto _loop331; + } + } + } + _loop331:; + } // ( ... )* + _t = __t329; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::block_body_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST block_body_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t326 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp212_AST_in = _t; + match(_t,BLOCK_BODY_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case HANDLED_SEQUENCE_OF_STATEMENTS: + { + handled_stmt_s(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t326; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::handled_stmt_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST handled_stmt_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t338 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp213_AST_in = _t; + match(_t,HANDLED_SEQUENCE_OF_STATEMENTS); + _t = _t->getFirstChild(); + statements(_t); + _t = _retTree; + except_handler_part_opt(_t); + _t = _retTree; + _t = __t338; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t398 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp214_AST_in = _t; + match(_t,ENTRY_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + entry_body_formal_part(_t); + _t = _retTree; + entry_barrier(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t398; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprog_decl_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprog_decl_or_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case PROCEDURE_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t333 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp215_AST_in = _t; + match(_t,PROCEDURE_DECLARATION); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + _t = __t333; + _t = _t->getNextSibling(); + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + case FUNCTION_DECLARATION: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t334 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp216_AST_in = _t; + match(_t,FUNCTION_DECLARATION); + _t = _t->getFirstChild(); + def_designator(_t); + _t = _retTree; + function_tail(_t); + _t = _retTree; + _t = __t334; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST statements_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t343 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp217_AST_in = _t; + match(_t,SEQUENCE_OF_STATEMENTS); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt345=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case STATEMENT: + { + statement(_t); + _t = _retTree; + break; + } + default: + { + if ( _cnt345>=1 ) { goto _loop345; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + } + _cnt345++; + } + _loop345:; + } // ( ... )+ + _t = __t343; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::except_handler_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST except_handler_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t448 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp218_AST_in = _t; + match(_t,EXCEPT_HANDLER_PART_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == EXCEPTION_HANDLER)) { + exception_handler(_t); + _t = _retTree; + } + else { + goto _loop450; + } + + } + _loop450:; + } // ( ... )* + _t = __t448; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::handled_stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST handled_stmts_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t340 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp219_AST_in = _t; + match(_t,HANDLED_STMTS_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case SEQUENCE_OF_STATEMENTS: + { + statements(_t); + _t = _retTree; + except_handler_part_opt(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t340; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::statement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST statement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t347 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp220_AST_in = _t; + match(_t,STATEMENT); + _t = _t->getFirstChild(); + def_label_opt(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case NULL_STATEMENT: + { + null_stmt(_t); + _t = _retTree; + break; + } + case EXIT_STATEMENT: + { + exit_stmt(_t); + _t = _retTree; + break; + } + case RETURN_STATEMENT: + { + return_stmt(_t); + _t = _retTree; + break; + } + case GOTO_STATEMENT: + { + goto_stmt(_t); + _t = _retTree; + break; + } + case DELAY_STATEMENT: + { + delay_stmt(_t); + _t = _retTree; + break; + } + case ABORT_STATEMENT: + { + abort_stmt(_t); + _t = _retTree; + break; + } + case RAISE_STATEMENT: + { + raise_stmt(_t); + _t = _retTree; + break; + } + case REQUEUE_STATEMENT: + { + requeue_stmt(_t); + _t = _retTree; + break; + } + case ACCEPT_STATEMENT: + { + accept_stmt(_t); + _t = _retTree; + break; + } + case ASYNCHRONOUS_SELECT: + case CONDITIONAL_ENTRY_CALL: + case SELECTIVE_ACCEPT: + case TIMED_ENTRY_CALL: + { + select_stmt(_t); + _t = _retTree; + break; + } + case IF_STATEMENT: + { + if_stmt(_t); + _t = _retTree; + break; + } + case CASE_STATEMENT: + { + case_stmt(_t); + _t = _retTree; + break; + } + case LOOP_STATEMENT: + { + loop_stmt(_t); + _t = _retTree; + id_opt(_t); + _t = _retTree; + break; + } + case BLOCK_STATEMENT: + { + block(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + break; + } + case ASSIGNMENT_STATEMENT: + case CALL_STATEMENT: + { + call_or_assignment(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t347; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::def_label_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST def_label_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t350 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp221_AST_in = _t; + match(_t,LABEL_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp222_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t350; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::null_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST null_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp223_AST_in = _t; + match(_t,NULL_STATEMENT); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::exit_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST exit_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t385 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp224_AST_in = _t; + match(_t,EXIT_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + label_name(_t); + _t = _retTree; + break; + } + case 3: + case WHEN: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case WHEN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp225_AST_in = _t; + match(_t,WHEN); + _t = _t->getNextSibling(); + condition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t385; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::return_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST return_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t390 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp226_AST_in = _t; + match(_t,RETURN_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t390; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::goto_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST goto_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t393 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp227_AST_in = _t; + match(_t,GOTO_STATEMENT); + _t = _t->getFirstChild(); + label_name(_t); + _t = _retTree; + _t = __t393; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::delay_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST delay_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t412 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp228_AST_in = _t; + match(_t,DELAY_STATEMENT); + _t = _t->getFirstChild(); + modifiers(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t412; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::abort_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST abort_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t444 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp229_AST_in = _t; + match(_t,ABORT_STATEMENT); + _t = _t->getFirstChild(); + { // ( ... )+ + int _cnt446=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_tokenSet_4.member(_t->getType()))) { + name(_t); + _t = _retTree; + } + else { + if ( _cnt446>=1 ) { goto _loop446; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt446++; + } + _loop446:; + } // ( ... )+ + _t = __t444; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::raise_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST raise_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t460 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp230_AST_in = _t; + match(_t,RAISE_STATEMENT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t460; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::requeue_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST requeue_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t463 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp231_AST_in = _t; + match(_t,REQUEUE_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ABORT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp232_AST_in = _t; + match(_t,ABORT); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t463; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::accept_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST accept_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t407 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp233_AST_in = _t; + match(_t,ACCEPT_STATEMENT); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + entry_index_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + handled_stmts_opt(_t); + _t = _retTree; + end_id_opt(_t); + _t = _retTree; + _t = __t407; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::select_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST select_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ASYNCHRONOUS_SELECT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t414 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp234_AST_in = _t; + match(_t,ASYNCHRONOUS_SELECT); + _t = _t->getFirstChild(); + triggering_alternative(_t); + _t = _retTree; + abortable_part(_t); + _t = _retTree; + _t = __t414; + _t = _t->getNextSibling(); + break; + } + case SELECTIVE_ACCEPT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t415 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp235_AST_in = _t; + match(_t,SELECTIVE_ACCEPT); + _t = _t->getFirstChild(); + selective_accept(_t); + _t = _retTree; + _t = __t415; + _t = _t->getNextSibling(); + break; + } + case TIMED_ENTRY_CALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t416 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp236_AST_in = _t; + match(_t,TIMED_ENTRY_CALL); + _t = _t->getFirstChild(); + entry_call_alternative(_t); + _t = _retTree; + delay_alternative(_t); + _t = _retTree; + _t = __t416; + _t = _t->getNextSibling(); + break; + } + case CONDITIONAL_ENTRY_CALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t417 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp237_AST_in = _t; + match(_t,CONDITIONAL_ENTRY_CALL); + _t = _t->getFirstChild(); + entry_call_alternative(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t417; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::if_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST if_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t354 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp238_AST_in = _t; + match(_t,IF_STATEMENT); + _t = _t->getFirstChild(); + cond_clause(_t); + _t = _retTree; + elsifs_opt(_t); + _t = _retTree; + else_opt(_t); + _t = _retTree; + _t = __t354; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::case_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST case_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t366 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp239_AST_in = _t; + match(_t,CASE_STATEMENT); + _t = _t->getFirstChild(); + expression(_t); + _t = _retTree; + alternative_s(_t); + _t = _retTree; + _t = __t366; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::loop_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST loop_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t373 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp240_AST_in = _t; + match(_t,LOOP_STATEMENT); + _t = _t->getFirstChild(); + iteration_scheme_opt(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t373; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::block(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST block_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t380 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp241_AST_in = _t; + match(_t,BLOCK_STATEMENT); + _t = _t->getFirstChild(); + declare_opt(_t); + _t = _retTree; + block_body(_t); + _t = _retTree; + _t = __t380; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::call_or_assignment(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST call_or_assignment_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ASSIGNMENT_STATEMENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t395 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp242_AST_in = _t; + match(_t,ASSIGNMENT_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + expression(_t); + _t = _retTree; + _t = __t395; + _t = _t->getNextSibling(); + break; + } + case CALL_STATEMENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t396 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp243_AST_in = _t; + match(_t,CALL_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + _t = __t396; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::cond_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST cond_clause_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t356 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp244_AST_in = _t; + match(_t,COND_CLAUSE); + _t = _t->getFirstChild(); + condition(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t356; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::elsifs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST elsifs_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t359 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp245_AST_in = _t; + match(_t,ELSIFS_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == COND_CLAUSE)) { + cond_clause(_t); + _t = _retTree; + } + else { + goto _loop361; + } + + } + _loop361:; + } // ( ... )* + _t = __t359; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::else_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST else_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t363 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp246_AST_in = _t; + match(_t,ELSE_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case SEQUENCE_OF_STATEMENTS: + { + statements(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t363; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::condition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST condition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + expression(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::alternative_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST alternative_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )+ + int _cnt369=0; + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == CASE_STATEMENT_ALTERNATIVE)) { + case_statement_alternative(_t); + _t = _retTree; + } + else { + if ( _cnt369>=1 ) { goto _loop369; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);} + } + + _cnt369++; + } + _loop369:; + } // ( ... )+ + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::case_statement_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST case_statement_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t371 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp247_AST_in = _t; + match(_t,CASE_STATEMENT_ALTERNATIVE); + _t = _t->getFirstChild(); + choice_s(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t371; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::iteration_scheme_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST iteration_scheme_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t375 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp248_AST_in = _t; + match(_t,ITERATION_SCHEME_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case WHILE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t377 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp249_AST_in = _t; + match(_t,WHILE); + _t = _t->getFirstChild(); + condition(_t); + _t = _retTree; + _t = __t377; + _t = _t->getNextSibling(); + break; + } + case FOR: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t378 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp250_AST_in = _t; + match(_t,FOR); + _t = _t->getFirstChild(); + ANTLR_USE_NAMESPACE(antlr)RefAST tmp251_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + modifiers(_t); + _t = _retTree; + discrete_subtype_definition(_t); + _t = _retTree; + _t = __t378; + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t375; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::declare_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST declare_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t382 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp252_AST_in = _t; + match(_t,DECLARE_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DECLARATIVE_PART: + { + declarative_part(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t382; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::label_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST label_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST tmp253_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_body_formal_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_body_formal_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + entry_index_spec_opt(_t); + _t = _retTree; + formal_part_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_barrier(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_barrier_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + condition(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_index_spec_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_index_spec_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t401 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp254_AST_in = _t; + match(_t,ENTRY_INDEX_SPECIFICATION); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + def_id(_t); + _t = _retTree; + discrete_subtype_definition(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t401; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_call_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_call_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t405 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp255_AST_in = _t; + match(_t,ENTRY_CALL_STATEMENT); + _t = _t->getFirstChild(); + name(_t); + _t = _retTree; + _t = __t405; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_index_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_index_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t409 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp256_AST_in = _t; + match(_t,ENTRY_INDEX_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + expression(_t); + _t = _retTree; + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t409; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::triggering_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST triggering_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t419 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp257_AST_in = _t; + match(_t,TRIGGERING_ALTERNATIVE); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DELAY_STATEMENT: + { + delay_stmt(_t); + _t = _retTree; + break; + } + case ENTRY_CALL_STATEMENT: + { + entry_call_stmt(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + stmts_opt(_t); + _t = _retTree; + _t = __t419; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::abortable_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST abortable_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t422 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp258_AST_in = _t; + match(_t,ABORTABLE_PART); + _t = _t->getFirstChild(); + stmts_opt(_t); + _t = _retTree; + _t = __t422; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::selective_accept(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST selective_accept_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + guard_opt(_t); + _t = _retTree; + select_alternative(_t); + _t = _retTree; + or_select_opt(_t); + _t = _retTree; + else_opt(_t); + _t = _retTree; + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::entry_call_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST entry_call_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t424 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp259_AST_in = _t; + match(_t,ENTRY_CALL_ALTERNATIVE); + _t = _t->getFirstChild(); + entry_call_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t424; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::delay_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST delay_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t435 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp260_AST_in = _t; + match(_t,DELAY_ALTERNATIVE); + _t = _t->getFirstChild(); + delay_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t435; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST stmts_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PRAGMA: + { + pragma(_t); + _t = _retTree; + break; + } + case STATEMENT: + { + statement(_t); + _t = _retTree; + break; + } + default: + { + goto _loop438; + } + } + } + _loop438:; + } // ( ... )* + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::guard_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST guard_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t427 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp261_AST_in = _t; + match(_t,GUARD_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case IN: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case OR: + case AND: + case XOR: + case NOT: + case EQ: + case NE: + case LT_: + case LE: + case GT: + case GE: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case AND_THEN: + case NOT_IN: + case OR_ELSE: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + condition(_t); + _t = _retTree; + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == PRAGMA)) { + pragma(_t); + _t = _retTree; + } + else { + goto _loop430; + } + + } + _loop430:; + } // ( ... )* + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t427; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::select_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST select_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ACCEPT_ALTERNATIVE: + { + accept_alternative(_t); + _t = _retTree; + break; + } + case DELAY_ALTERNATIVE: + { + delay_alternative(_t); + _t = _retTree; + break; + } + case TERMINATE_ALTERNATIVE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp262_AST_in = _t; + match(_t,TERMINATE_ALTERNATIVE); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::or_select_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST or_select_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t440 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp263_AST_in = _t; + match(_t,OR_SELECT_OPT); + _t = _t->getFirstChild(); + { // ( ... )* + for (;;) { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + if ((_t->getType() == GUARD_OPT)) { + guard_opt(_t); + _t = _retTree; + select_alternative(_t); + _t = _retTree; + } + else { + goto _loop442; + } + + } + _loop442:; + } // ( ... )* + _t = __t440; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::accept_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST accept_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t433 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp264_AST_in = _t; + match(_t,ACCEPT_ALTERNATIVE); + _t = _t->getFirstChild(); + accept_stmt(_t); + _t = _retTree; + stmts_opt(_t); + _t = _retTree; + _t = __t433; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::exception_handler(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST exception_handler_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t452 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp265_AST_in = _t; + match(_t,EXCEPTION_HANDLER); + _t = _t->getFirstChild(); + identifier_colon_opt(_t); + _t = _retTree; + except_choice_s(_t); + _t = _retTree; + statements(_t); + _t = _retTree; + _t = __t452; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::identifier_colon_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST identifier_colon_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t454 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp266_AST_in = _t; + match(_t,IDENTIFIER_COLON_OPT); + _t = _t->getFirstChild(); + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp267_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case 3: + { + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t454; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::except_choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST except_choice_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PIPE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t457 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp268_AST_in = _t; + match(_t,PIPE); + _t = _t->getFirstChild(); + except_choice_s(_t); + _t = _retTree; + exception_choice(_t); + _t = _retTree; + _t = __t457; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case OTHERS: + { + exception_choice(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::exception_choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST exception_choice_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + { + compound_name(_t); + _t = _retTree; + break; + } + case OTHERS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp269_AST_in = _t; + match(_t,OTHERS); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::operator_call(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST operator_call_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t466 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp270_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getFirstChild(); + value_s(_t); + _t = _retTree; + _t = __t466; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::relation(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST relation_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t478 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp271_AST_in = _t; + match(_t,IN); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + range_or_mark(_t); + _t = _retTree; + _t = __t478; + _t = _t->getNextSibling(); + break; + } + case NOT_IN: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t479 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp272_AST_in = _t; + match(_t,NOT_IN); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + range_or_mark(_t); + _t = _retTree; + _t = __t479; + _t = _t->getNextSibling(); + break; + } + case EQ: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t480 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp273_AST_in = _t; + match(_t,EQ); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t480; + _t = _t->getNextSibling(); + break; + } + case NE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t481 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp274_AST_in = _t; + match(_t,NE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t481; + _t = _t->getNextSibling(); + break; + } + case LT_: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t482 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp275_AST_in = _t; + match(_t,LT_); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t482; + _t = _t->getNextSibling(); + break; + } + case LE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t483 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp276_AST_in = _t; + match(_t,LE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t483; + _t = _t->getNextSibling(); + break; + } + case GT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t484 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp277_AST_in = _t; + match(_t,GT); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t484; + _t = _t->getNextSibling(); + break; + } + case GE: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t485 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp278_AST_in = _t; + match(_t,GE); + _t = _t->getFirstChild(); + simple_expression(_t); + _t = _retTree; + simple_expression(_t); + _t = _retTree; + _t = __t485; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case PLUS: + case MINUS: + case CONCAT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + case UNARY_MINUS: + case UNARY_PLUS: + { + simple_expression(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::range_or_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST range_or_mark_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case DOT_DOT: + case RANGE_ATTRIBUTE_REFERENCE: + { + range(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case DOT: + case TIC: + { + subtype_mark(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::signed_term(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST signed_term_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case UNARY_PLUS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t492 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp279_AST_in = _t; + match(_t,UNARY_PLUS); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + _t = __t492; + _t = _t->getNextSibling(); + break; + } + case UNARY_MINUS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t493 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp280_AST_in = _t; + match(_t,UNARY_MINUS); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + _t = __t493; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case MOD: + case NOT: + case STAR: + case DIV: + case REM: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + term(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::term(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST term_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case STAR: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t495 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp281_AST_in = _t; + match(_t,STAR); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t495; + _t = _t->getNextSibling(); + break; + } + case DIV: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t496 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp282_AST_in = _t; + match(_t,DIV); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t496; + _t = _t->getNextSibling(); + break; + } + case MOD: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t497 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp283_AST_in = _t; + match(_t,MOD); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t497; + _t = _t->getNextSibling(); + break; + } + case REM: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t498 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp284_AST_in = _t; + match(_t,REM); + _t = _t->getFirstChild(); + term(_t); + _t = _retTree; + factor(_t); + _t = _retTree; + _t = __t498; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NOT: + case ABS: + case EXPON: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + factor(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::factor(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST factor_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case NOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t500 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp285_AST_in = _t; + match(_t,NOT); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + _t = __t500; + _t = _t->getNextSibling(); + break; + } + case ABS: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t501 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp286_AST_in = _t; + match(_t,ABS); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + _t = __t501; + _t = _t->getNextSibling(); + break; + } + case EXPON: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t502 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp287_AST_in = _t; + match(_t,EXPON); + _t = _t->getFirstChild(); + primary(_t); + _t = _retTree; + primary(_t); + _t = _retTree; + _t = __t502; + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + case DOT: + case TIC: + case CHARACTER_LITERAL: + case CHAR_STRING: + case NuLL: + case NUMERIC_LIT: + case ALLOCATOR: + case INDEXED_COMPONENT: + case OPERATOR_SYMBOL: + case PARENTHESIZED_PRIMARY: + { + primary(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST primary_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + case DOT: + case TIC: + case INDEXED_COMPONENT: + { + name_or_qualified(_t); + _t = _retTree; + break; + } + case PARENTHESIZED_PRIMARY: + { + parenthesized_primary(_t); + _t = _retTree; + break; + } + case ALLOCATOR: + { + allocator(_t); + _t = _retTree; + break; + } + case NuLL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp288_AST_in = _t; + match(_t,NuLL); + _t = _t->getNextSibling(); + break; + } + case NUMERIC_LIT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp289_AST_in = _t; + match(_t,NUMERIC_LIT); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp290_AST_in = _t; + match(_t,CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case CHAR_STRING: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp291_AST_in = _t; + match(_t,CHAR_STRING); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + operator_call(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::name_or_qualified(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST name_or_qualified_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp292_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case DOT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t506 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp293_AST_in = _t; + match(_t,DOT); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case ALL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp294_AST_in = _t; + match(_t,ALL); + _t = _t->getNextSibling(); + break; + } + case IDENTIFIER: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp295_AST_in = _t; + match(_t,IDENTIFIER); + _t = _t->getNextSibling(); + break; + } + case CHARACTER_LITERAL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp296_AST_in = _t; + match(_t,CHARACTER_LITERAL); + _t = _t->getNextSibling(); + break; + } + case OPERATOR_SYMBOL: + { + ANTLR_USE_NAMESPACE(antlr)RefAST tmp297_AST_in = _t; + match(_t,OPERATOR_SYMBOL); + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t506; + _t = _t->getNextSibling(); + break; + } + case INDEXED_COMPONENT: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t508 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp298_AST_in = _t; + match(_t,INDEXED_COMPONENT); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + value_s(_t); + _t = _retTree; + _t = __t508; + _t = _t->getNextSibling(); + break; + } + case TIC: + { + ANTLR_USE_NAMESPACE(antlr)RefAST __t509 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp299_AST_in = _t; + match(_t,TIC); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + { + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PARENTHESIZED_PRIMARY: + { + parenthesized_primary(_t); + _t = _retTree; + break; + } + case IDENTIFIER: + case RANGE: + case DIGITS: + case DELTA: + case ACCESS: + { + attribute_id(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + _t = __t509; + _t = _t->getNextSibling(); + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::allocator(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST allocator_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t512 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp300_AST_in = _t; + match(_t,ALLOCATOR); + _t = _t->getFirstChild(); + name_or_qualified(_t); + _t = _retTree; + _t = __t512; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::subprogram_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST subprogram_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = ASTNULL; + switch ( _t->getType()) { + case PROCEDURE_BODY: + { + procedure_body(_t); + _t = _retTree; + break; + } + case FUNCTION_BODY: + { + function_body(_t); + _t = _retTree; + break; + } + default: + { + throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t); + } + } + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::package_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST package_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t518 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp301_AST_in = _t; + match(_t,PACKAGE_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + pkg_body_part(_t); + _t = _retTree; + _t = __t518; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::task_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST task_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t520 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp302_AST_in = _t; + match(_t,TASK_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + body_part(_t); + _t = _retTree; + _t = __t520; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::protected_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) { + ANTLR_USE_NAMESPACE(antlr)RefAST protected_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t; + + try { // for error handling + ANTLR_USE_NAMESPACE(antlr)RefAST __t522 = _t; + ANTLR_USE_NAMESPACE(antlr)RefAST tmp303_AST_in = _t; + match(_t,PROTECTED_BODY); + _t = _t->getFirstChild(); + def_id(_t); + _t = _retTree; + prot_op_bodies_opt(_t); + _t = _retTree; + _t = __t522; + _t = _t->getNextSibling(); + } + catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { + reportError(ex); + if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST ) + _t = _t->getNextSibling(); + } + _retTree = _t; +} + +void AdaTreeParserSuper::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& ) +{ +} +const char* AdaTreeParserSuper::tokenNames[] = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "\"pragma\"", + "IDENTIFIER", + "SEMI", + "LPAREN", + "COMMA", + "RPAREN", + "RIGHT_SHAFT", + "\"with\"", + "DOT", + "\"use\"", + "\"type\"", + "TIC", + "\"range\"", + "\"digits\"", + "\"delta\"", + "\"access\"", + "\"private\"", + "\"package\"", + "\"body\"", + "\"is\"", + "\"procedure\"", + "\"function\"", + "\"new\"", + "\"others\"", + "PIPE", + "DOT_DOT", + "\"all\"", + "COLON", + "\"in\"", + "\"out\"", + "\"renames\"", + "CHARACTER_LITERAL", + "CHAR_STRING", + "\"null\"", + "\"record\"", + "\"separate\"", + "\"abstract\"", + "\"return\"", + "\"task\"", + "\"protected\"", + "BOX", + "ASSIGN", + "\"entry\"", + "\"for\"", + "\"end\"", + "\"at\"", + "\"mod\"", + "\"subtype\"", + "\"exception\"", + "\"constant\"", + "\"array\"", + "\"of\"", + "\"aliased\"", + "\"case\"", + "\"when\"", + "\"tagged\"", + "\"limited\"", + "\"generic\"", + "\"begin\"", + "LT_LT", + "GT_GT", + "\"if\"", + "\"then\"", + "\"elsif\"", + "\"else\"", + "\"loop\"", + "\"while\"", + "\"reverse\"", + "\"declare\"", + "\"exit\"", + "\"goto\"", + "\"accept\"", + "\"do\"", + "\"delay\"", + "\"until\"", + "\"select\"", + "\"abort\"", + "\"or\"", + "\"terminate\"", + "\"raise\"", + "\"requeue\"", + "\"and\"", + "\"xor\"", + "\"not\"", + "EQ", + "NE", + "LT_", + "LE", + "GT", + "GE", + "PLUS", + "MINUS", + "CONCAT", + "STAR", + "DIV", + "\"rem\"", + "\"abs\"", + "EXPON", + "NUMERIC_LIT", + "ABORTABLE_PART", + "ABORT_STATEMENT", + "ACCEPT_ALTERNATIVE", + "ACCEPT_STATEMENT", + "ALLOCATOR", + "ASSIGNMENT_STATEMENT", + "ASYNCHRONOUS_SELECT", + "ATTRIBUTE_DEFINITION_CLAUSE", + "AT_CLAUSE", + "BLOCK_STATEMENT", + "CASE_STATEMENT", + "CASE_STATEMENT_ALTERNATIVE", + "CODE_STATEMENT", + "COMPONENT_DECLARATION", + "CONDITIONAL_ENTRY_CALL", + "CONTEXT_CLAUSE", + "DECLARATIVE_PART", + "DEFINING_IDENTIFIER_LIST", + "DELAY_ALTERNATIVE", + "DELAY_STATEMENT", + "DELTA_CONSTRAINT", + "DIGITS_CONSTRAINT", + "DISCRIMINANT_ASSOCIATION", + "DISCRIMINANT_CONSTRAINT", + "DISCRIMINANT_SPECIFICATION", + "ENTRY_BODY", + "ENTRY_CALL_ALTERNATIVE", + "ENTRY_CALL_STATEMENT", + "ENTRY_DECLARATION", + "ENTRY_INDEX_SPECIFICATION", + "ENUMERATION_REPESENTATION_CLAUSE", + "EXCEPTION_DECLARATION", + "EXCEPTION_HANDLER", + "EXCEPTION_RENAMING_DECLARATION", + "EXIT_STATEMENT", + "FORMAL_PACKAGE_DECLARATION", + "GENERIC_FORMAL_PART", + "GENERIC_PACKAGE_DECLARATION", + "GOTO_STATEMENT", + "HANDLED_SEQUENCE_OF_STATEMENTS", + "HANDLED_STMTS_OPT", + "IF_STATEMENT", + "INCOMPLETE_TYPE_DECLARATION", + "INDEXED_COMPONENT", + "INDEX_CONSTRAINT", + "LIBRARY_ITEM", + "LOOP_STATEMENT", + "NAME", + "NULL_STATEMENT", + "NUMBER_DECLARATION", + "OBJECT_DECLARATION", + "OBJECT_RENAMING_DECLARATION", + "OPERATOR_SYMBOL", + "PACKAGE_BODY", + "PACKAGE_BODY_STUB", + "PACKAGE_RENAMING_DECLARATION", + "PACKAGE_SPECIFICATION", + "PARAMETER_SPECIFICATION", + "PRIVATE_EXTENSION_DECLARATION", + "PRIVATE_TYPE_DECLARATION", + "PROTECTED_BODY", + "PROTECTED_BODY_STUB", + "PROTECTED_TYPE_DECLARATION", + "RAISE_STATEMENT", + "RANGE_ATTRIBUTE_REFERENCE", + "RECORD_REPRESENTATION_CLAUSE", + "REQUEUE_STATEMENT", + "RETURN_STATEMENT", + "SELECTIVE_ACCEPT", + "SEQUENCE_OF_STATEMENTS", + "SINGLE_PROTECTED_DECLARATION", + "SINGLE_TASK_DECLARATION", + "STATEMENT", + "SUBTYPE_DECLARATION", + "SUBTYPE_INDICATION", + "SUBTYPE_MARK", + "SUBUNIT", + "TASK_BODY", + "TASK_BODY_STUB", + "TASK_TYPE_DECLARATION", + "TERMINATE_ALTERNATIVE", + "TIMED_ENTRY_CALL", + "TRIGGERING_ALTERNATIVE", + "USE_CLAUSE", + "USE_TYPE_CLAUSE", + "VARIANT", + "VARIANT_PART", + "WITH_CLAUSE", + "ABSTRACT_FUNCTION_DECLARATION", + "ABSTRACT_PROCEDURE_DECLARATION", + "ACCESS_TO_FUNCTION_DECLARATION", + "ACCESS_TO_OBJECT_DECLARATION", + "ACCESS_TO_PROCEDURE_DECLARATION", + "ARRAY_OBJECT_DECLARATION", + "ARRAY_TYPE_DECLARATION", + "AND_THEN", + "BASIC_DECLARATIVE_ITEMS_OPT", + "BLOCK_BODY", + "BLOCK_BODY_OPT", + "CALL_STATEMENT", + "COMPONENT_CLAUSES_OPT", + "COMPONENT_ITEMS", + "COND_CLAUSE", + "DECIMAL_FIXED_POINT_DECLARATION", + "DECLARE_OPT", + "DERIVED_RECORD_EXTENSION", + "DISCRETE_SUBTYPE_DEF_OPT", + "DISCRIMINANT_SPECIFICATIONS", + "DISCRIM_PART_OPT", + "ELSE_OPT", + "ELSIFS_OPT", + "END_ID_OPT", + "ENTRY_INDEX_OPT", + "ENUMERATION_TYPE_DECLARATION", + "EXCEPT_HANDLER_PART_OPT", + "EXTENSION_OPT", + "FLOATING_POINT_DECLARATION", + "FORMAL_DECIMAL_FIXED_POINT_DECLARATION", + "FORMAL_DISCRETE_TYPE_DECLARATION", + "FORMAL_FLOATING_POINT_DECLARATION", + "FORMAL_FUNCTION_DECLARATION", + "FORMAL_MODULAR_TYPE_DECLARATION", + "FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION", + "FORMAL_ORDINARY_FIXED_POINT_DECLARATION", + "FORMAL_PART_OPT", + "FORMAL_PRIVATE_EXTENSION_DECLARATION", + "FORMAL_PRIVATE_TYPE_DECLARATION", + "FORMAL_PROCEDURE_DECLARATION", + "FORMAL_SIGNED_INTEGER_TYPE_DECLARATION", + "FUNCTION_BODY", + "FUNCTION_BODY_STUB", + "FUNCTION_DECLARATION", + "FUNCTION_RENAMING_DECLARATION", + "GENERIC_FUNCTION_DECLARATION", + "GENERIC_FUNCTION_INSTANTIATION", + "GENERIC_FUNCTION_RENAMING", + "GENERIC_PACKAGE_INSTANTIATION", + "GENERIC_PACKAGE_RENAMING", + "GENERIC_PROCEDURE_DECLARATION", + "GENERIC_PROCEDURE_INSTANTIATION", + "GENERIC_PROCEDURE_RENAMING", + "GUARD_OPT", + "IDENTIFIER_COLON_OPT", + "ID_OPT", + "INIT_OPT", + "ITERATION_SCHEME_OPT", + "LABEL_OPT", + "MARK_WITH_CONSTRAINT", + "MODIFIERS", + "MODULAR_TYPE_DECLARATION", + "MOD_CLAUSE_OPT", + "NOT_IN", + "ORDINARY_DERIVED_TYPE_DECLARATION", + "ORDINARY_FIXED_POINT_DECLARATION", + "OR_ELSE", + "OR_SELECT_OPT", + "PARENTHESIZED_PRIMARY", + "PRIVATE_DECLARATIVE_ITEMS_OPT", + "PRIVATE_TASK_ITEMS_OPT", + "PROCEDURE_BODY", + "PROCEDURE_BODY_STUB", + "PROCEDURE_DECLARATION", + "PROCEDURE_RENAMING_DECLARATION", + "PROT_MEMBER_DECLARATIONS", + "PROT_OP_BODIES_OPT", + "PROT_OP_DECLARATIONS", + "PROT_PRIVATE_OPT", + "RANGED_EXPRS", + "RANGE_CONSTRAINT", + "RECORD_TYPE_DECLARATION", + "SELECTOR_NAMES_OPT", + "SIGNED_INTEGER_TYPE_DECLARATION", + "TASK_ITEMS_OPT", + "UNARY_MINUS", + "UNARY_PLUS", + "VALUE", + "VALUES", + "VARIANTS", + "COMMENT_INTRO", + "OX", + "TIC_OR_CHARACTER_LITERAL", + "DIGIT", + "EXPONENT", + "EXTENDED_DIGIT", + "BASED_INTEGER", + "WS_", + "COMMENT", + "CHARACTER_STRING", + 0 +}; + +const unsigned long AdaTreeParserSuper::_tokenSet_0_data_[] = { 37920UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER RIGHT_SHAFT DOT TIC "in" CHARACTER_LITERAL CHAR_STRING "null" +// "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR +// DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT OPERATOR_SYMBOL +// AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS UNARY_PLUS +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_0(_tokenSet_0_data_,20); +const unsigned long AdaTreeParserSuper::_tokenSet_1_data_[] = { 939627552UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER RIGHT_SHAFT DOT TIC "range" "others" PIPE DOT_DOT "in" CHARACTER_LITERAL +// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS +// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT +// OPERATOR_SYMBOL AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS +// UNARY_PLUS +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_1(_tokenSet_1_data_,20); +const unsigned long AdaTreeParserSuper::_tokenSet_2_data_[] = { 0UL, 0UL, 0UL, 49152UL, 3338801504UL, 2353094950UL, 151076927UL, 2416967168UL, 328577UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENUMERATION_REPESENTATION_CLAUSE +// EXCEPTION_DECLARATION EXCEPTION_RENAMING_DECLARATION GENERIC_PACKAGE_DECLARATION +// INCOMPLETE_TYPE_DECLARATION NUMBER_DECLARATION OBJECT_DECLARATION OBJECT_RENAMING_DECLARATION +// PACKAGE_RENAMING_DECLARATION PACKAGE_SPECIFICATION PRIVATE_EXTENSION_DECLARATION +// PRIVATE_TYPE_DECLARATION PROTECTED_TYPE_DECLARATION RECORD_REPRESENTATION_CLAUSE +// SINGLE_PROTECTED_DECLARATION SINGLE_TASK_DECLARATION SUBTYPE_DECLARATION +// TASK_TYPE_DECLARATION USE_CLAUSE USE_TYPE_CLAUSE ABSTRACT_FUNCTION_DECLARATION +// ABSTRACT_PROCEDURE_DECLARATION ACCESS_TO_FUNCTION_DECLARATION ACCESS_TO_OBJECT_DECLARATION +// ACCESS_TO_PROCEDURE_DECLARATION ARRAY_OBJECT_DECLARATION ARRAY_TYPE_DECLARATION +// DECIMAL_FIXED_POINT_DECLARATION DERIVED_RECORD_EXTENSION ENUMERATION_TYPE_DECLARATION +// FLOATING_POINT_DECLARATION FUNCTION_BODY_STUB FUNCTION_DECLARATION FUNCTION_RENAMING_DECLARATION +// GENERIC_FUNCTION_DECLARATION GENERIC_FUNCTION_INSTANTIATION GENERIC_FUNCTION_RENAMING +// GENERIC_PACKAGE_INSTANTIATION GENERIC_PACKAGE_RENAMING GENERIC_PROCEDURE_DECLARATION +// GENERIC_PROCEDURE_INSTANTIATION GENERIC_PROCEDURE_RENAMING MODULAR_TYPE_DECLARATION +// ORDINARY_DERIVED_TYPE_DECLARATION ORDINARY_FIXED_POINT_DECLARATION PROCEDURE_BODY_STUB +// PROCEDURE_DECLARATION PROCEDURE_RENAMING_DECLARATION RECORD_TYPE_DECLARATION +// SIGNED_INTEGER_TYPE_DECLARATION +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_2(_tokenSet_2_data_,20); +const unsigned long AdaTreeParserSuper::_tokenSet_3_data_[] = { 16UL, 0UL, 0UL, 49152UL, 40UL, 256UL, 0UL, 1024UL, 256UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// "pragma" ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENTRY_DECLARATION ENUMERATION_REPESENTATION_CLAUSE +// RECORD_REPRESENTATION_CLAUSE FUNCTION_DECLARATION PROCEDURE_DECLARATION +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_3(_tokenSet_3_data_,20); +const unsigned long AdaTreeParserSuper::_tokenSet_4_data_[] = { 36896UL, 0UL, 0UL, 0UL, 262144UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +// IDENTIFIER DOT TIC INDEXED_COMPONENT +const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_4(_tokenSet_4_data_,12); + + diff --git a/languages/ada/AdaTreeParserSuper.hpp b/languages/ada/AdaTreeParserSuper.hpp new file mode 100644 index 00000000..a4d164f0 --- /dev/null +++ b/languages/ada/AdaTreeParserSuper.hpp @@ -0,0 +1,241 @@ +#ifndef INC_AdaTreeParserSuper_hpp_ +#define INC_AdaTreeParserSuper_hpp_ + +#include +#include "AdaTreeParserSuperTokenTypes.hpp" +/* $ANTLR 2.7.7 (20070609): "ada.tree.g" -> "AdaTreeParserSuper.hpp"$ */ +#include + +class CUSTOM_API AdaTreeParserSuper : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public AdaTreeParserSuperTokenTypes +{ +#line 1 "ada.tree.g" +#line 13 "AdaTreeParserSuper.hpp" +public: + AdaTreeParserSuper(); + static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); + int getNumTokens() const + { + return AdaTreeParserSuper::NUM_TOKENS; + } + const char* getTokenName( int type ) const + { + if( type > getNumTokens() ) return 0; + return AdaTreeParserSuper::tokenNames[type]; + } + const char* const* getTokenNames() const + { + return AdaTreeParserSuper::tokenNames; + } + public: void compilation_unit(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void context_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void library_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subunit(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void pragma(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void pragma_arg(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void with_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void use_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void compound_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subtype_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void attribute_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void modifiers(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprog_decl_or_rename_or_inst_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void def_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void pkg_body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void generic_inst(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void pkg_spec_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void renames(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void generic_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void def_designator(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void end_id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprog_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void function_tail(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void value_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void value(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void ranged_expr_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void ranged_expr(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void simple_expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_dots(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_attrib_ref(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prefix(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void parameter_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void defining_identifier_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void init_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void definable_operator_symbol(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void parenthesized_primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void extension_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void spec_decl_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void basic_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void private_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void basic_decl_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void task_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void decl_common(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrim_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void task_definition_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void private_task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_specifications(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entrydecls_repspecs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void rep_spec(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrete_subtype_def_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrete_subtype_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subtype_ind(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void align_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void comp_loc_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void local_enum_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void enumeration_aggregate(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void protected_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_private_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_member_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_op_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_op_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void comp_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void component_subtype_def(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void enum_id_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void id_and_discrim(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void record_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void array_type_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void enumeration_literal_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void index_or_discrete_range_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void index_or_discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void digits_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void delta_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void index_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_association(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void selector_names_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void selector_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void component_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void component_items(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void variant_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discriminant_direct_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void variant_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void variant(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void discrete_with_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void mark_with_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void generic_formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void generic_formal_parameter(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void formal_array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void formal_access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void id_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprogram_default_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void formal_package_actual_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void procedure_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void function_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void declarative_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void block_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void declarative_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void prot_op_bodies_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void block_body_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void handled_stmt_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprog_decl_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void except_handler_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void handled_stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void statement(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void def_label_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void null_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void exit_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void return_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void goto_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void delay_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void abort_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void raise_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void requeue_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void accept_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void select_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void if_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void case_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void loop_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void block(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void call_or_assignment(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void cond_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void elsifs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void else_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void condition(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void alternative_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void case_statement_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void iteration_scheme_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void declare_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void label_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_body_formal_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_barrier(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_index_spec_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_call_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_index_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void triggering_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void abortable_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void selective_accept(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void entry_call_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void delay_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void guard_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void select_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void or_select_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void accept_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void exception_handler(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void identifier_colon_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void except_choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void exception_choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void operator_call(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void relation(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void range_or_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void signed_term(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void term(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void factor(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void name_or_qualified(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void allocator(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void subprogram_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void package_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void task_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); + public: void protected_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t); +public: + ANTLR_USE_NAMESPACE(antlr)RefAST getAST() + { + return returnAST; + } + +protected: + ANTLR_USE_NAMESPACE(antlr)RefAST returnAST; + ANTLR_USE_NAMESPACE(antlr)RefAST _retTree; +private: + static const char* tokenNames[]; +#ifndef NO_STATIC_CONSTS + static const int NUM_TOKENS = 291; +#else + enum { + NUM_TOKENS = 291 + }; +#endif + + static const unsigned long _tokenSet_0_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; + static const unsigned long _tokenSet_1_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; + static const unsigned long _tokenSet_2_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; + static const unsigned long _tokenSet_3_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; + static const unsigned long _tokenSet_4_data_[]; + static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; +}; + +#endif /*INC_AdaTreeParserSuper_hpp_*/ diff --git a/languages/ada/AdaTreeParserSuperTokenTypes.hpp b/languages/ada/AdaTreeParserSuperTokenTypes.hpp new file mode 100644 index 00000000..924b7415 --- /dev/null +++ b/languages/ada/AdaTreeParserSuperTokenTypes.hpp @@ -0,0 +1,307 @@ +#ifndef INC_AdaTreeParserSuperTokenTypes_hpp_ +#define INC_AdaTreeParserSuperTokenTypes_hpp_ + +/* $ANTLR 2.7.7 (20070609): "ada.tree.g" -> "AdaTreeParserSuperTokenTypes.hpp"$ */ + +#ifndef CUSTOM_API +# define CUSTOM_API +#endif + +#ifdef __cplusplus +struct CUSTOM_API AdaTreeParserSuperTokenTypes { +#endif + enum { + EOF_ = 1, + PRAGMA = 4, + IDENTIFIER = 5, + SEMI = 6, + LPAREN = 7, + COMMA = 8, + RPAREN = 9, + RIGHT_SHAFT = 10, + WITH = 11, + DOT = 12, + USE = 13, + TYPE = 14, + TIC = 15, + RANGE = 16, + DIGITS = 17, + DELTA = 18, + ACCESS = 19, + PRIVATE = 20, + PACKAGE = 21, + BODY = 22, + IS = 23, + PROCEDURE = 24, + FUNCTION = 25, + NEW = 26, + OTHERS = 27, + PIPE = 28, + DOT_DOT = 29, + ALL = 30, + COLON = 31, + IN = 32, + OUT = 33, + RENAMES = 34, + CHARACTER_LITERAL = 35, + CHAR_STRING = 36, + NuLL = 37, + RECORD = 38, + SEPARATE = 39, + ABSTRACT = 40, + RETURN = 41, + TASK = 42, + PROTECTED = 43, + BOX = 44, + ASSIGN = 45, + ENTRY = 46, + FOR = 47, + END = 48, + AT = 49, + MOD = 50, + SUBTYPE = 51, + EXCEPTION = 52, + CONSTANT = 53, + ARRAY = 54, + OF = 55, + ALIASED = 56, + CASE = 57, + WHEN = 58, + TAGGED = 59, + LIMITED = 60, + GENERIC = 61, + BEGIN = 62, + LT_LT = 63, + GT_GT = 64, + IF = 65, + THEN = 66, + ELSIF = 67, + ELSE = 68, + LOOP = 69, + WHILE = 70, + REVERSE = 71, + DECLARE = 72, + EXIT = 73, + GOTO = 74, + ACCEPT = 75, + DO = 76, + DELAY = 77, + UNTIL = 78, + SELECT = 79, + ABORT = 80, + OR = 81, + TERMINATE = 82, + RAISE = 83, + REQUEUE = 84, + AND = 85, + XOR = 86, + NOT = 87, + EQ = 88, + NE = 89, + LT_ = 90, + LE = 91, + GT = 92, + GE = 93, + PLUS = 94, + MINUS = 95, + CONCAT = 96, + STAR = 97, + DIV = 98, + REM = 99, + ABS = 100, + EXPON = 101, + NUMERIC_LIT = 102, + ABORTABLE_PART = 103, + ABORT_STATEMENT = 104, + ACCEPT_ALTERNATIVE = 105, + ACCEPT_STATEMENT = 106, + ALLOCATOR = 107, + ASSIGNMENT_STATEMENT = 108, + ASYNCHRONOUS_SELECT = 109, + ATTRIBUTE_DEFINITION_CLAUSE = 110, + AT_CLAUSE = 111, + BLOCK_STATEMENT = 112, + CASE_STATEMENT = 113, + CASE_STATEMENT_ALTERNATIVE = 114, + CODE_STATEMENT = 115, + COMPONENT_DECLARATION = 116, + CONDITIONAL_ENTRY_CALL = 117, + CONTEXT_CLAUSE = 118, + DECLARATIVE_PART = 119, + DEFINING_IDENTIFIER_LIST = 120, + DELAY_ALTERNATIVE = 121, + DELAY_STATEMENT = 122, + DELTA_CONSTRAINT = 123, + DIGITS_CONSTRAINT = 124, + DISCRIMINANT_ASSOCIATION = 125, + DISCRIMINANT_CONSTRAINT = 126, + DISCRIMINANT_SPECIFICATION = 127, + ENTRY_BODY = 128, + ENTRY_CALL_ALTERNATIVE = 129, + ENTRY_CALL_STATEMENT = 130, + ENTRY_DECLARATION = 131, + ENTRY_INDEX_SPECIFICATION = 132, + ENUMERATION_REPESENTATION_CLAUSE = 133, + EXCEPTION_DECLARATION = 134, + EXCEPTION_HANDLER = 135, + EXCEPTION_RENAMING_DECLARATION = 136, + EXIT_STATEMENT = 137, + FORMAL_PACKAGE_DECLARATION = 138, + GENERIC_FORMAL_PART = 139, + GENERIC_PACKAGE_DECLARATION = 140, + GOTO_STATEMENT = 141, + HANDLED_SEQUENCE_OF_STATEMENTS = 142, + HANDLED_STMTS_OPT = 143, + IF_STATEMENT = 144, + INCOMPLETE_TYPE_DECLARATION = 145, + INDEXED_COMPONENT = 146, + INDEX_CONSTRAINT = 147, + LIBRARY_ITEM = 148, + LOOP_STATEMENT = 149, + NAME = 150, + NULL_STATEMENT = 151, + NUMBER_DECLARATION = 152, + OBJECT_DECLARATION = 153, + OBJECT_RENAMING_DECLARATION = 154, + OPERATOR_SYMBOL = 155, + PACKAGE_BODY = 156, + PACKAGE_BODY_STUB = 157, + PACKAGE_RENAMING_DECLARATION = 158, + PACKAGE_SPECIFICATION = 159, + PARAMETER_SPECIFICATION = 160, + PRIVATE_EXTENSION_DECLARATION = 161, + PRIVATE_TYPE_DECLARATION = 162, + PROTECTED_BODY = 163, + PROTECTED_BODY_STUB = 164, + PROTECTED_TYPE_DECLARATION = 165, + RAISE_STATEMENT = 166, + RANGE_ATTRIBUTE_REFERENCE = 167, + RECORD_REPRESENTATION_CLAUSE = 168, + REQUEUE_STATEMENT = 169, + RETURN_STATEMENT = 170, + SELECTIVE_ACCEPT = 171, + SEQUENCE_OF_STATEMENTS = 172, + SINGLE_PROTECTED_DECLARATION = 173, + SINGLE_TASK_DECLARATION = 174, + STATEMENT = 175, + SUBTYPE_DECLARATION = 176, + SUBTYPE_INDICATION = 177, + SUBTYPE_MARK = 178, + SUBUNIT = 179, + TASK_BODY = 180, + TASK_BODY_STUB = 181, + TASK_TYPE_DECLARATION = 182, + TERMINATE_ALTERNATIVE = 183, + TIMED_ENTRY_CALL = 184, + TRIGGERING_ALTERNATIVE = 185, + USE_CLAUSE = 186, + USE_TYPE_CLAUSE = 187, + VARIANT = 188, + VARIANT_PART = 189, + WITH_CLAUSE = 190, + ABSTRACT_FUNCTION_DECLARATION = 191, + ABSTRACT_PROCEDURE_DECLARATION = 192, + ACCESS_TO_FUNCTION_DECLARATION = 193, + ACCESS_TO_OBJECT_DECLARATION = 194, + ACCESS_TO_PROCEDURE_DECLARATION = 195, + ARRAY_OBJECT_DECLARATION = 196, + ARRAY_TYPE_DECLARATION = 197, + AND_THEN = 198, + BASIC_DECLARATIVE_ITEMS_OPT = 199, + BLOCK_BODY = 200, + BLOCK_BODY_OPT = 201, + CALL_STATEMENT = 202, + COMPONENT_CLAUSES_OPT = 203, + COMPONENT_ITEMS = 204, + COND_CLAUSE = 205, + DECIMAL_FIXED_POINT_DECLARATION = 206, + DECLARE_OPT = 207, + DERIVED_RECORD_EXTENSION = 208, + DISCRETE_SUBTYPE_DEF_OPT = 209, + DISCRIMINANT_SPECIFICATIONS = 210, + DISCRIM_PART_OPT = 211, + ELSE_OPT = 212, + ELSIFS_OPT = 213, + END_ID_OPT = 214, + ENTRY_INDEX_OPT = 215, + ENUMERATION_TYPE_DECLARATION = 216, + EXCEPT_HANDLER_PART_OPT = 217, + EXTENSION_OPT = 218, + FLOATING_POINT_DECLARATION = 219, + FORMAL_DECIMAL_FIXED_POINT_DECLARATION = 220, + FORMAL_DISCRETE_TYPE_DECLARATION = 221, + FORMAL_FLOATING_POINT_DECLARATION = 222, + FORMAL_FUNCTION_DECLARATION = 223, + FORMAL_MODULAR_TYPE_DECLARATION = 224, + FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION = 225, + FORMAL_ORDINARY_FIXED_POINT_DECLARATION = 226, + FORMAL_PART_OPT = 227, + FORMAL_PRIVATE_EXTENSION_DECLARATION = 228, + FORMAL_PRIVATE_TYPE_DECLARATION = 229, + FORMAL_PROCEDURE_DECLARATION = 230, + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION = 231, + FUNCTION_BODY = 232, + FUNCTION_BODY_STUB = 233, + FUNCTION_DECLARATION = 234, + FUNCTION_RENAMING_DECLARATION = 235, + GENERIC_FUNCTION_DECLARATION = 236, + GENERIC_FUNCTION_INSTANTIATION = 237, + GENERIC_FUNCTION_RENAMING = 238, + GENERIC_PACKAGE_INSTANTIATION = 239, + GENERIC_PACKAGE_RENAMING = 240, + GENERIC_PROCEDURE_DECLARATION = 241, + GENERIC_PROCEDURE_INSTANTIATION = 242, + GENERIC_PROCEDURE_RENAMING = 243, + GUARD_OPT = 244, + IDENTIFIER_COLON_OPT = 245, + ID_OPT = 246, + INIT_OPT = 247, + ITERATION_SCHEME_OPT = 248, + LABEL_OPT = 249, + MARK_WITH_CONSTRAINT = 250, + MODIFIERS = 251, + MODULAR_TYPE_DECLARATION = 252, + MOD_CLAUSE_OPT = 253, + NOT_IN = 254, + ORDINARY_DERIVED_TYPE_DECLARATION = 255, + ORDINARY_FIXED_POINT_DECLARATION = 256, + OR_ELSE = 257, + OR_SELECT_OPT = 258, + PARENTHESIZED_PRIMARY = 259, + PRIVATE_DECLARATIVE_ITEMS_OPT = 260, + PRIVATE_TASK_ITEMS_OPT = 261, + PROCEDURE_BODY = 262, + PROCEDURE_BODY_STUB = 263, + PROCEDURE_DECLARATION = 264, + PROCEDURE_RENAMING_DECLARATION = 265, + PROT_MEMBER_DECLARATIONS = 266, + PROT_OP_BODIES_OPT = 267, + PROT_OP_DECLARATIONS = 268, + PROT_PRIVATE_OPT = 269, + RANGED_EXPRS = 270, + RANGE_CONSTRAINT = 271, + RECORD_TYPE_DECLARATION = 272, + SELECTOR_NAMES_OPT = 273, + SIGNED_INTEGER_TYPE_DECLARATION = 274, + TASK_ITEMS_OPT = 275, + UNARY_MINUS = 276, + UNARY_PLUS = 277, + VALUE = 278, + VALUES = 279, + VARIANTS = 280, + COMMENT_INTRO = 281, + OX = 282, + TIC_OR_CHARACTER_LITERAL = 283, + DIGIT = 284, + EXPONENT = 285, + EXTENDED_DIGIT = 286, + BASED_INTEGER = 287, + WS_ = 288, + COMMENT = 289, + CHARACTER_STRING = 290, + NULL_TREE_LOOKAHEAD = 3 + }; +#ifdef __cplusplus +}; +#endif +#endif /*INC_AdaTreeParserSuperTokenTypes_hpp_*/ diff --git a/languages/ada/AdaTreeParserSuperTokenTypes.txt b/languages/ada/AdaTreeParserSuperTokenTypes.txt new file mode 100644 index 00000000..dfd0b0df --- /dev/null +++ b/languages/ada/AdaTreeParserSuperTokenTypes.txt @@ -0,0 +1,289 @@ +// $ANTLR 2.7.7 (20070609): ada.tree.g -> AdaTreeParserSuperTokenTypes.txt$ +AdaTreeParserSuper // output token vocab name +PRAGMA="pragma"=4 +IDENTIFIER=5 +SEMI=6 +LPAREN=7 +COMMA=8 +RPAREN=9 +RIGHT_SHAFT=10 +WITH="with"=11 +DOT=12 +USE="use"=13 +TYPE="type"=14 +TIC=15 +RANGE="range"=16 +DIGITS="digits"=17 +DELTA="delta"=18 +ACCESS="access"=19 +PRIVATE="private"=20 +PACKAGE="package"=21 +BODY="body"=22 +IS="is"=23 +PROCEDURE="procedure"=24 +FUNCTION="function"=25 +NEW="new"=26 +OTHERS="others"=27 +PIPE=28 +DOT_DOT=29 +ALL="all"=30 +COLON=31 +IN="in"=32 +OUT="out"=33 +RENAMES="renames"=34 +CHARACTER_LITERAL=35 +CHAR_STRING=36 +NuLL="null"=37 +RECORD="record"=38 +SEPARATE="separate"=39 +ABSTRACT="abstract"=40 +RETURN="return"=41 +TASK="task"=42 +PROTECTED="protected"=43 +BOX=44 +ASSIGN=45 +ENTRY="entry"=46 +FOR="for"=47 +END="end"=48 +AT="at"=49 +MOD="mod"=50 +SUBTYPE="subtype"=51 +EXCEPTION="exception"=52 +CONSTANT="constant"=53 +ARRAY="array"=54 +OF="of"=55 +ALIASED="aliased"=56 +CASE="case"=57 +WHEN="when"=58 +TAGGED="tagged"=59 +LIMITED="limited"=60 +GENERIC="generic"=61 +BEGIN="begin"=62 +LT_LT=63 +GT_GT=64 +IF="if"=65 +THEN="then"=66 +ELSIF="elsif"=67 +ELSE="else"=68 +LOOP="loop"=69 +WHILE="while"=70 +REVERSE="reverse"=71 +DECLARE="declare"=72 +EXIT="exit"=73 +GOTO="goto"=74 +ACCEPT="accept"=75 +DO="do"=76 +DELAY="delay"=77 +UNTIL="until"=78 +SELECT="select"=79 +ABORT="abort"=80 +OR="or"=81 +TERMINATE="terminate"=82 +RAISE="raise"=83 +REQUEUE="requeue"=84 +AND="and"=85 +XOR="xor"=86 +NOT="not"=87 +EQ=88 +NE=89 +LT_=90 +LE=91 +GT=92 +GE=93 +PLUS=94 +MINUS=95 +CONCAT=96 +STAR=97 +DIV=98 +REM="rem"=99 +ABS="abs"=100 +EXPON=101 +NUMERIC_LIT=102 +ABORTABLE_PART=103 +ABORT_STATEMENT=104 +ACCEPT_ALTERNATIVE=105 +ACCEPT_STATEMENT=106 +ALLOCATOR=107 +ASSIGNMENT_STATEMENT=108 +ASYNCHRONOUS_SELECT=109 +ATTRIBUTE_DEFINITION_CLAUSE=110 +AT_CLAUSE=111 +BLOCK_STATEMENT=112 +CASE_STATEMENT=113 +CASE_STATEMENT_ALTERNATIVE=114 +CODE_STATEMENT=115 +COMPONENT_DECLARATION=116 +CONDITIONAL_ENTRY_CALL=117 +CONTEXT_CLAUSE=118 +DECLARATIVE_PART=119 +DEFINING_IDENTIFIER_LIST=120 +DELAY_ALTERNATIVE=121 +DELAY_STATEMENT=122 +DELTA_CONSTRAINT=123 +DIGITS_CONSTRAINT=124 +DISCRIMINANT_ASSOCIATION=125 +DISCRIMINANT_CONSTRAINT=126 +DISCRIMINANT_SPECIFICATION=127 +ENTRY_BODY=128 +ENTRY_CALL_ALTERNATIVE=129 +ENTRY_CALL_STATEMENT=130 +ENTRY_DECLARATION=131 +ENTRY_INDEX_SPECIFICATION=132 +ENUMERATION_REPESENTATION_CLAUSE=133 +EXCEPTION_DECLARATION=134 +EXCEPTION_HANDLER=135 +EXCEPTION_RENAMING_DECLARATION=136 +EXIT_STATEMENT=137 +FORMAL_PACKAGE_DECLARATION=138 +GENERIC_FORMAL_PART=139 +GENERIC_PACKAGE_DECLARATION=140 +GOTO_STATEMENT=141 +HANDLED_SEQUENCE_OF_STATEMENTS=142 +HANDLED_STMTS_OPT=143 +IF_STATEMENT=144 +INCOMPLETE_TYPE_DECLARATION=145 +INDEXED_COMPONENT=146 +INDEX_CONSTRAINT=147 +LIBRARY_ITEM=148 +LOOP_STATEMENT=149 +NAME=150 +NULL_STATEMENT=151 +NUMBER_DECLARATION=152 +OBJECT_DECLARATION=153 +OBJECT_RENAMING_DECLARATION=154 +OPERATOR_SYMBOL=155 +PACKAGE_BODY=156 +PACKAGE_BODY_STUB=157 +PACKAGE_RENAMING_DECLARATION=158 +PACKAGE_SPECIFICATION=159 +PARAMETER_SPECIFICATION=160 +PRIVATE_EXTENSION_DECLARATION=161 +PRIVATE_TYPE_DECLARATION=162 +PROTECTED_BODY=163 +PROTECTED_BODY_STUB=164 +PROTECTED_TYPE_DECLARATION=165 +RAISE_STATEMENT=166 +RANGE_ATTRIBUTE_REFERENCE=167 +RECORD_REPRESENTATION_CLAUSE=168 +REQUEUE_STATEMENT=169 +RETURN_STATEMENT=170 +SELECTIVE_ACCEPT=171 +SEQUENCE_OF_STATEMENTS=172 +SINGLE_PROTECTED_DECLARATION=173 +SINGLE_TASK_DECLARATION=174 +STATEMENT=175 +SUBTYPE_DECLARATION=176 +SUBTYPE_INDICATION=177 +SUBTYPE_MARK=178 +SUBUNIT=179 +TASK_BODY=180 +TASK_BODY_STUB=181 +TASK_TYPE_DECLARATION=182 +TERMINATE_ALTERNATIVE=183 +TIMED_ENTRY_CALL=184 +TRIGGERING_ALTERNATIVE=185 +USE_CLAUSE=186 +USE_TYPE_CLAUSE=187 +VARIANT=188 +VARIANT_PART=189 +WITH_CLAUSE=190 +ABSTRACT_FUNCTION_DECLARATION=191 +ABSTRACT_PROCEDURE_DECLARATION=192 +ACCESS_TO_FUNCTION_DECLARATION=193 +ACCESS_TO_OBJECT_DECLARATION=194 +ACCESS_TO_PROCEDURE_DECLARATION=195 +ARRAY_OBJECT_DECLARATION=196 +ARRAY_TYPE_DECLARATION=197 +AND_THEN=198 +BASIC_DECLARATIVE_ITEMS_OPT=199 +BLOCK_BODY=200 +BLOCK_BODY_OPT=201 +CALL_STATEMENT=202 +COMPONENT_CLAUSES_OPT=203 +COMPONENT_ITEMS=204 +COND_CLAUSE=205 +DECIMAL_FIXED_POINT_DECLARATION=206 +DECLARE_OPT=207 +DERIVED_RECORD_EXTENSION=208 +DISCRETE_SUBTYPE_DEF_OPT=209 +DISCRIMINANT_SPECIFICATIONS=210 +DISCRIM_PART_OPT=211 +ELSE_OPT=212 +ELSIFS_OPT=213 +END_ID_OPT=214 +ENTRY_INDEX_OPT=215 +ENUMERATION_TYPE_DECLARATION=216 +EXCEPT_HANDLER_PART_OPT=217 +EXTENSION_OPT=218 +FLOATING_POINT_DECLARATION=219 +FORMAL_DECIMAL_FIXED_POINT_DECLARATION=220 +FORMAL_DISCRETE_TYPE_DECLARATION=221 +FORMAL_FLOATING_POINT_DECLARATION=222 +FORMAL_FUNCTION_DECLARATION=223 +FORMAL_MODULAR_TYPE_DECLARATION=224 +FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION=225 +FORMAL_ORDINARY_FIXED_POINT_DECLARATION=226 +FORMAL_PART_OPT=227 +FORMAL_PRIVATE_EXTENSION_DECLARATION=228 +FORMAL_PRIVATE_TYPE_DECLARATION=229 +FORMAL_PROCEDURE_DECLARATION=230 +FORMAL_SIGNED_INTEGER_TYPE_DECLARATION=231 +FUNCTION_BODY=232 +FUNCTION_BODY_STUB=233 +FUNCTION_DECLARATION=234 +FUNCTION_RENAMING_DECLARATION=235 +GENERIC_FUNCTION_DECLARATION=236 +GENERIC_FUNCTION_INSTANTIATION=237 +GENERIC_FUNCTION_RENAMING=238 +GENERIC_PACKAGE_INSTANTIATION=239 +GENERIC_PACKAGE_RENAMING=240 +GENERIC_PROCEDURE_DECLARATION=241 +GENERIC_PROCEDURE_INSTANTIATION=242 +GENERIC_PROCEDURE_RENAMING=243 +GUARD_OPT=244 +IDENTIFIER_COLON_OPT=245 +ID_OPT=246 +INIT_OPT=247 +ITERATION_SCHEME_OPT=248 +LABEL_OPT=249 +MARK_WITH_CONSTRAINT=250 +MODIFIERS=251 +MODULAR_TYPE_DECLARATION=252 +MOD_CLAUSE_OPT=253 +NOT_IN=254 +ORDINARY_DERIVED_TYPE_DECLARATION=255 +ORDINARY_FIXED_POINT_DECLARATION=256 +OR_ELSE=257 +OR_SELECT_OPT=258 +PARENTHESIZED_PRIMARY=259 +PRIVATE_DECLARATIVE_ITEMS_OPT=260 +PRIVATE_TASK_ITEMS_OPT=261 +PROCEDURE_BODY=262 +PROCEDURE_BODY_STUB=263 +PROCEDURE_DECLARATION=264 +PROCEDURE_RENAMING_DECLARATION=265 +PROT_MEMBER_DECLARATIONS=266 +PROT_OP_BODIES_OPT=267 +PROT_OP_DECLARATIONS=268 +PROT_PRIVATE_OPT=269 +RANGED_EXPRS=270 +RANGE_CONSTRAINT=271 +RECORD_TYPE_DECLARATION=272 +SELECTOR_NAMES_OPT=273 +SIGNED_INTEGER_TYPE_DECLARATION=274 +TASK_ITEMS_OPT=275 +UNARY_MINUS=276 +UNARY_PLUS=277 +VALUE=278 +VALUES=279 +VARIANTS=280 +COMMENT_INTRO=281 +OX=282 +TIC_OR_CHARACTER_LITERAL=283 +DIGIT=284 +EXPONENT=285 +EXTENDED_DIGIT=286 +BASED_INTEGER=287 +WS_=288 +COMMENT=289 +CHARACTER_STRING=290 diff --git a/languages/ada/Makefile.am b/languages/ada/Makefile.am new file mode 100644 index 00000000..4a7eb0c1 --- /dev/null +++ b/languages/ada/Makefile.am @@ -0,0 +1,41 @@ +# Here resides the Ada support part. +KDE_CXXFLAGS = $(USE_EXCEPTIONS) + +INCLUDES = -I$(top_srcdir)/lib/antlr -I$(top_srcdir)/lib/interfaces \ + -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \ + $(all_includes) +SUBDIRS = app_templates file_templates doc + + +kde_module_LTLIBRARIES = libkdevadasupport.la +libkdevadasupport_la_LDFLAGS = $(LEXLIB) $(all_libraries) $(KDE_PLUGIN) +libkdevadasupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/antlr/src/libantlr.la + +libkdevadasupport_la_SOURCES = adasupportpart.cpp problemreporter.cpp backgroundparser.cpp addclassdlg.ui addclass.cpp configproblemreporter.ui ada_utils.cpp adasupport.cpp AdaLexer.cpp AdaParser.cpp AdaTreeParserSuper.cpp AdaStoreWalker.cpp + +METASOURCES = AUTO + +EXTRA_DIST = ada.g ada.tree.g ada.store.g + +## The following three rules assume that you have Java installed, +## ANTLR installed, and you have the antlr jar in your CLASSPATH. + +#AdaLexer.hpp AdaLexer.cpp AdaParser.hpp AdaParser.cpp: ada.g +# antlr ada.g + +#AdaTreeParserSuper.hpp AdaTreeParserSuper.cpp: ada.tree.g +# antlr ada.tree.g + +#AdaStoreWalker.hpp AdaStoreWalker.cpp: ada.store.g +# antlr -glib ada.tree.g ada.store.g + +genparser: + antlr ada.g && antlr ada.tree.g && antlr -glib ada.tree.g ada.store.g + +servicedir = $(kde_servicesdir) +service_DATA = kdevadasupport.desktop + +rcdir = $(kde_datadir)/kdevadasupport +rc_DATA = kdevadasupport.rc + +KDE_OPTIONS = nofinal diff --git a/languages/ada/README b/languages/ada/README new file mode 100644 index 00000000..0146b60f --- /dev/null +++ b/languages/ada/README @@ -0,0 +1 @@ +Please read the README.dox file. \ No newline at end of file diff --git a/languages/ada/README.dox b/languages/ada/README.dox new file mode 100644 index 00000000..e71e6d45 --- /dev/null +++ b/languages/ada/README.dox @@ -0,0 +1,31 @@ +/** \class AdaSupportPart +Ada Language Support + +The ANTLR Ada core support files are: + - ada.g -- contains AdaLexer and AdaParser, requires AdaAST.hpp and adasupport.cpp + - ada.tree.g -- contains the AdaTreeParserSuper + - AdaAST.hpp -- definition of the AST node used by ada.g + - adasupport.hpp -- general purpose utilities + - adasupport.cpp -- implementation of general purpose utilities and implementation of AdaParser class methods from ada.g + +These are ANTLR master files. +They only depend on the ANTLR C++ runtime support and on the C++ STL. +They should be kept free of all other dependencies. +In particular, they do not depend on Kdevelop, KDE, or Qt. + +In order to generate the parser by hand, antlr v2.7.2 is required. +There are parser compilation errors with some gcc versions. To avoid +them, replace file antlr/CppCodeGenerator.java in the antlr source code tree +with the one from ftp://fara.cs.uni-potsdam.de/incoming/CppCodeGenerator.java.gz. + +\unmaintained This part is currently un-maintained. + +\authors Oliver Kellogg +\authors Roberto Raggi +\authors Alexander Dymo + +\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part. + +\requirement Ada compiler + +*/ diff --git a/languages/ada/ada.g b/languages/ada/ada.g new file mode 100644 index 00000000..5f97952b --- /dev/null +++ b/languages/ada/ada.g @@ -0,0 +1,1982 @@ +/* + * Ada95 Grammar for ANTLR, target language C++ + * + * Copyright (C) 2003 Oliver M. Kellogg + * Modifications (C) 2005 Daniel Zuberbuehler + * + * Adapted from lexer9x.l/grammar9x.y, + * + ******* A YACC grammar for Ada 9X ********************************* + * Copyright (C) Intermetrics, Inc. 1994 Cambridge, MA USA * + * Copying permitted if accompanied by this statement. * + * Derivative works are permitted if accompanied by this statement.* + * This grammar is thought to be correct as of May 1, 1994 * + * but as usual there is *no warranty* to that effect. * + ******************************************************************* + * + * $Id$ + * + * Not all rules from the Ada95 Reference Manual (RM) Annex P, + * Syntax Summary, are mirrored as rules here. + * The tree nodes follow the RM grammar as closely as sensible. + * This applies in particular to the terminals. OTOH, trivially + * reconstructable non-terminal rules are not reflected in the tree. + * FIXME: Document the exact rationale of the tree design. + * + */ + + +header "pre_include_hpp" { +#include // antlr wants this +#include "AdaAST.hpp" +#include "preambles.h" +} + +options { + language="Cpp"; +} + +//----------------------------------------------------------------------------- +// Define a Parser, calling it AdaParser +//----------------------------------------------------------------------------- +class AdaParser extends Parser; +options { + k = 2; // token lookahead + exportVocab=Ada; // Call its vocabulary "Ada" + // codeGenMakeSwitchThreshold = 2; // Some optimizations + // codeGenBitsetTestThreshold = 3; + defaultErrorHandler = false; // Generate parser error handlers + buildAST = true; + ASTLabelType = "RefAdaAST"; +} + +{ + ANTLR_PARSER_PREAMBLE + +public: + // Ada support stuff + void push_def_id (const RefAdaAST& defid); + const RefAdaAST& pop_def_id (); + bool end_id_matches_def_id (const RefAdaAST& endid); + bool definable_operator (const char *string); // operator_symbol sans "/=" + bool is_operator_symbol (const char *string); +} + +// Compilation Unit: This is the start rule for this parser. +// The rules in this grammar are listed in the order in which +// compilation_unit introduces them, depth first, with the +// exception of the expression related rules which are listed +// towards the end. +compilation_unit + : context_items_opt ( library_item | subunit ) ( pragma )* + ; + +// The pragma related rules are pulled up here to get them out of the way. + +pragma : PRAGMA^ IDENTIFIER pragma_args_opt SEMI! + ; + +pragma_args_opt : ( LPAREN! pragma_arg ( COMMA! pragma_arg )* RPAREN! )? + ; + +pragma_arg : ( IDENTIFIER RIGHT_SHAFT^ )? expression + ; + +context_items_opt : ( pragma | with_clause | use_clause )* + { #context_items_opt = + #(#[CONTEXT_CLAUSE, "CONTEXT_CLAUSE"], #context_items_opt); } + // RM Annex P neglects pragmas; we include them. + // The node should really be named CONTEXT_ITEMS_OPT but we + // stick with the RM wording. + ; + +with_clause : w:WITH^ c_name_list SEMI! + { Set(#w, WITH_CLAUSE); } + ; + +c_name_list : compound_name ( COMMA! compound_name )* + ; + +compound_name : IDENTIFIER ( DOT^ IDENTIFIER )* + // Strangely, the RM never defines this rule, which however is + // required for tightening up the syntax of certain names + // (library unit names etc.) + ; + +use_clause : u:USE^ + ( TYPE! subtype_mark ( COMMA! subtype_mark )* + { Set(#u, USE_TYPE_CLAUSE); } + | c_name_list { Set(#u, USE_CLAUSE); } + ) + SEMI! + ; + +subtype_mark : compound_name ( TIC^ attribute_id )? + // { #subtype_mark = #(#[SUBTYPE_MARK, "SUBTYPE_MARK"], #subtype_mark); } + ; + +attribute_id : RANGE + | DIGITS + | DELTA + | ACCESS + | IDENTIFIER + ; + +library_item : private_opt + /* Slightly loose; PRIVATE can only precede + {generic|package|subprog}_decl. + Semantic check required to ensure it.*/ + ( lib_pkg_spec_or_body + | subprog_decl_or_rename_or_inst_or_body[true] + | generic_decl[true] + ) + { #library_item = #(#[LIBRARY_ITEM, "LIBRARY_ITEM"], #library_item); } + ; + +private_opt : ( PRIVATE )? + { #private_opt = #(#[MODIFIERS, "MODIFIERS"], #private_opt); } + ; + +lib_pkg_spec_or_body + : pkg:PACKAGE^ + ( BODY! def_id[true] IS! pkg_body_part SEMI! + { Set(#pkg, PACKAGE_BODY); } + | def_id[true] spec_decl_part[#pkg] + ) + ; + +subprog_decl [boolean lib_level] + { RefAdaAST t; } + : p:PROCEDURE^ def_id[lib_level] + ( generic_subp_inst + { Set(#p, GENERIC_PROCEDURE_INSTANTIATION); } + | formal_part_opt + ( renames { Set(#p, PROCEDURE_RENAMING_DECLARATION); } + | is_separate_or_abstract_or_decl[#p] + ) + SEMI! + ) + | f:FUNCTION^ def_designator[lib_level] + ( generic_subp_inst + { Set(#f, GENERIC_FUNCTION_INSTANTIATION); } + | function_tail + ( renames { Set(#f, FUNCTION_RENAMING_DECLARATION); } + | is_separate_or_abstract_or_decl[#f] + ) + SEMI! + ) + ; + +def_id [boolean lib_level] + : { lib_level }? cn:compound_name { push_def_id(#cn); } + | { !lib_level }? n:IDENTIFIER { push_def_id(#n); } + ; + +generic_subp_inst : IS! generic_inst SEMI! + ; + +generic_inst : NEW! compound_name ( LPAREN! value_s RPAREN! )? + { pop_def_id(); } + ; + +parenth_values : LPAREN! value ( COMMA! value )* RPAREN! + ; + +value : ( OTHERS^ RIGHT_SHAFT! expression + | ranged_expr_s ( RIGHT_SHAFT^ expression )? + ) + // { #value = #(#[VALUE, "VALUE"], #value); } + ; + +ranged_expr_s : ranged_expr ( PIPE^ ranged_expr )* + // { #ranged_expr_s = + // #(#[RANGED_EXPRS, "RANGED_EXPRS"], #ranged_expr_s); } + ; + +ranged_expr : expression + ( DOT_DOT^ simple_expression + | RANGE^ range + )? + ; + +range_constraint : r:RANGE^ range + { Set(#r, RANGE_CONSTRAINT); } + ; + +range : ( (range_dots) => range_dots + | range_attrib_ref + ) + // Current assumption is we don't need an extra node for range, + // otherwise uncomment the following line: + // { #range = #(#[RANGE_EXPR, "RANGE_EXPR"], #range); } + ; + +range_dots : simple_expression DOT_DOT^ simple_expression + ; + +range_attrib_ref : // "name TIC RANGE" is ambiguous; instead: + prefix TIC! r:RANGE^ ( LPAREN! expression RPAREN! )? + { Set(#r, RANGE_ATTRIBUTE_REFERENCE); } + ; + +// Here, the definition of `prefix' deviates from the RM. +// This gives us some more strictness than `name' (which the RM uses to +// define `prefix'.) +prefix : IDENTIFIER + ( DOT^ ( ALL | IDENTIFIER ) + | p:LPAREN^ value_s RPAREN! + { Set(#p, INDEXED_COMPONENT); } + )* + ; + +formal_part_opt : ( LPAREN! parameter_specification + ( SEMI! parameter_specification )* + RPAREN! )? + { #formal_part_opt = #([FORMAL_PART_OPT, "FORMAL_PART_OPT"], + #formal_part_opt); } + ; + +parameter_specification : def_ids_colon mode_opt subtype_mark init_opt + { #parameter_specification = + #(#[PARAMETER_SPECIFICATION, + "PARAMETER_SPECIFICATION"], #parameter_specification); } + ; + +def_ids_colon : defining_identifier_list COLON! + ; + +defining_identifier_list : IDENTIFIER ( COMMA! IDENTIFIER )* + { #defining_identifier_list = + #(#[DEFINING_IDENTIFIER_LIST, + "DEFINING_IDENTIFIER_LIST"], #defining_identifier_list); } + ; + +mode_opt : ( IN ( OUT )? | OUT | ACCESS )? + { #mode_opt = #(#[MODIFIERS, "MODIFIERS"], #mode_opt); } + ; + +renames { RefAdaAST dummy; } + : RENAMES! ( name + | dummy=definable_operator_symbol + ) + { pop_def_id(); } + ; + +name { RefAdaAST dummy; } + : IDENTIFIER + ( DOT^ ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | dummy=is_operator + ) + | p:LPAREN^ value_s RPAREN! + { Set(#p, INDEXED_COMPONENT); } + | TIC^ attribute_id // must be in here because of e.g. + // Character'Pos (x) + )* + // { #name = #(#[NAME, "NAME"], #name); } + ; + +is_operator returns [RefAdaAST d] + : { is_operator_symbol(LT(1)->getText().c_str()) }? + op:CHAR_STRING { #op->setType(OPERATOR_SYMBOL); d=#op; } + ; + +definable_operator_symbol returns [RefAdaAST d] + : { definable_operator(LT(1)->getText().c_str()) }? + op:CHAR_STRING { #op->setType(OPERATOR_SYMBOL); d=#op; } + ; + +parenthesized_primary : pp:LPAREN^ + ( NuLL RECORD! + | value_s extension_opt + ) + RPAREN! + { Set(#pp, PARENTHESIZED_PRIMARY); } + ; + +extension_opt : ( WITH! ( NuLL RECORD! | value_s ) )? + { #extension_opt = + #(#[EXTENSION_OPT, "EXTENSION_OPT"], #extension_opt); } + ; + +is_separate_or_abstract_or_decl! [RefAdaAST t] + : IS! separate_or_abstract[t] + | { pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, PROCEDURE_DECLARATION); + else + Set(t, FUNCTION_DECLARATION); + } + ; + +separate_or_abstract! [RefAdaAST t] + : SEPARATE! + { pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, PROCEDURE_BODY_STUB); + else + Set(t, FUNCTION_BODY_STUB); + } + | ABSTRACT! + { pop_def_id(); + if (t->getType() == AdaTokenTypes::PROCEDURE) + Set(t, ABSTRACT_PROCEDURE_DECLARATION); + else + Set(t, ABSTRACT_FUNCTION_DECLARATION); + } + ; + +def_designator [boolean lib_level] + { RefAdaAST d; } + : { lib_level }? n:compound_name { push_def_id(#n); } + | { !lib_level }? d=designator { push_def_id(d); } + ; + +designator returns [RefAdaAST d] + { RefAdaAST op; } + : op=definable_operator_symbol { d = op; } + | n:IDENTIFIER { d = #n; } + ; + +function_tail : func_formal_part_opt RETURN! subtype_mark + ; + +// formal_part_opt is not strict enough for functions, i.e. it permits +// "in out" and "out" as modes, thus we make an extra rule: +func_formal_part_opt : ( LPAREN! func_param ( SEMI! func_param )* RPAREN! )? + { #func_formal_part_opt = + #([FORMAL_PART_OPT, + "FORMAL_PART_OPT"], #func_formal_part_opt); } + ; + +func_param : def_ids_colon in_access_opt subtype_mark init_opt + { #func_param = + #(#[PARAMETER_SPECIFICATION, + "PARAMETER_SPECIFICATION"], #func_param); } + ; + +in_access_opt : ( IN | ACCESS )? + { #in_access_opt = #(#[MODIFIERS, "MODIFIERS"], #in_access_opt); } + ; + +spec_decl_part [RefAdaAST pkg] + : ( IS! ( generic_inst { Set(pkg, GENERIC_PACKAGE_INSTANTIATION); } + | pkg_spec_part { Set(pkg, PACKAGE_SPECIFICATION); } + ) + | renames { Set(pkg, PACKAGE_RENAMING_DECLARATION); } + ) + SEMI! + ; + +pkg_spec_part : basic_declarative_items_opt + private_declarative_items_opt + end_id_opt + ; + +private_declarative_items_opt : ( PRIVATE! ( basic_decl_item | pragma )* )? + { #private_declarative_items_opt = + #(#[PRIVATE_DECLARATIVE_ITEMS_OPT, + "PRIVATE_DECLARATIVE_ITEMS_OPT"], + #private_declarative_items_opt); } + ; + +basic_declarative_items_opt : ( basic_decl_item | pragma )* + { #basic_declarative_items_opt = + #(#[BASIC_DECLARATIVE_ITEMS_OPT, + "BASIC_DECLARATIVE_ITEMS_OPT"], + #basic_declarative_items_opt); } + ; + +basic_declarative_items : ( basic_decl_item | pragma )+ + { #basic_declarative_items = + #(#[BASIC_DECLARATIVE_ITEMS_OPT, + "BASIC_DECLARATIVE_ITEMS_OPT"], + #basic_declarative_items); } + ; + +basic_decl_item + : pkg:PACKAGE^ def_id[false] spec_decl_part[#pkg] + | tsk:TASK^ task_type_or_single_decl[#tsk] + | pro:PROTECTED^ prot_type_or_single_decl[#pro] SEMI! + | subprog_decl[false] + | decl_common + ; + +task_type_or_single_decl [RefAdaAST tsk] + : TYPE! def_id[false] discrim_part_opt task_definition_opt + { Set(tsk, TASK_TYPE_DECLARATION); } + | def_id[false] task_definition_opt + { Set(tsk, SINGLE_TASK_DECLARATION); } + ; + +task_definition_opt + : IS! task_items_opt private_task_items_opt end_id_opt SEMI! + | SEMI! { pop_def_id(); } + ; + +discrim_part_opt + : ( discrim_part_text )? + { #discrim_part_opt = + #(#[DISCRIM_PART_OPT, + "DISCRIM_PART_OPT"], #discrim_part_opt); } + ; + +discrim_part_text : LPAREN! (BOX | discriminant_specifications) RPAREN! + ; + +known_discrim_part + : LPAREN! discriminant_specifications RPAREN! + { #known_discrim_part = + #(#[DISCRIM_PART_OPT, + "DISCRIM_PART_OPT"], #known_discrim_part); } + ; + +empty_discrim_opt : /* empty */ + { #empty_discrim_opt = + #(#[DISCRIM_PART_OPT, + "DISCRIM_PART_OPT"], #empty_discrim_opt); } + ; + +discrim_part + : discrim_part_text + { #discrim_part = + #(#[DISCRIM_PART_OPT, + "DISCRIM_PART_OPT"], #discrim_part); } + ; + +discriminant_specifications : discriminant_specification + ( SEMI! discriminant_specification )* + { #discriminant_specifications = + #(#[DISCRIMINANT_SPECIFICATIONS, + "DISCRIMINANT_SPECIFICATIONS"], + #discriminant_specifications); } + ; + +discriminant_specification : def_ids_colon access_opt subtype_mark init_opt + { #discriminant_specification = + #(#[DISCRIMINANT_SPECIFICATION, + "DISCRIMINANT_SPECIFICATION"], + #discriminant_specification); } + ; + +access_opt : ( ACCESS )? + { #access_opt = #(#[MODIFIERS, "MODIFIERS"], #access_opt); } + ; + +init_opt : ( ASSIGN! expression )? + { #init_opt = #(#[INIT_OPT, "INIT_OPT"], #init_opt); } + ; // `expression' is of course much too loose; + // semantic checks are required in the usage contexts. + +task_items_opt : ( pragma )* entrydecls_repspecs_opt + { #task_items_opt = + #(#[TASK_ITEMS_OPT, "TASK_ITEMS_OPT"], #task_items_opt); } + ; + +entrydecls_repspecs_opt : ( entry_declaration ( pragma | rep_spec )* )* + ; + +entry_declaration : e:ENTRY^ IDENTIFIER + discrete_subtype_def_opt formal_part_opt SEMI! + { Set (#e, ENTRY_DECLARATION); } + ; + +discrete_subtype_def_opt : ( (LPAREN discrete_subtype_definition RPAREN) => + LPAREN! discrete_subtype_definition RPAREN! + | /* empty */ + ) + { #discrete_subtype_def_opt = + #(#[DISCRETE_SUBTYPE_DEF_OPT, + "DISCRETE_SUBTYPE_DEF_OPT"], #discrete_subtype_def_opt); } + ; + +discrete_subtype_definition : ( (range) => range + | subtype_ind + ) + // Looks alot like discrete_range, but it's not + // (as soon as we start doing semantics.) + /* TBC: No need for extra node, just use the inner nodes? + { #discrete_subtype_definition = + #(#[DISCRETE_SUBTYPE_DEFINITION, + "DISCRETE_SUBTYPE_DEFINITION"], + #discrete_subtype_definition); } + */ + ; + +rep_spec : r:FOR^ subtype_mark USE! rep_spec_part[#r] SEMI! + ; + +rep_spec_part [RefAdaAST t] + : RECORD! align_opt comp_loc_s END! RECORD! // record_type_spec + { Set(t, RECORD_REPRESENTATION_CLAUSE); } + | AT! expression // address_spec (Ada83) + { Set(t, AT_CLAUSE); } + | expression // attrib_def. Semantic check must ensure that the + // respective subtype_mark contains an attribute reference. + { Set(t, ATTRIBUTE_DEFINITION_CLAUSE); } + ; + +align_opt : ( AT! MOD! expression SEMI! )? + { #align_opt = #(#[MOD_CLAUSE_OPT, "MOD_CLAUSE_OPT"], #align_opt); } + ; + +comp_loc_s : ( pragma | subtype_mark AT! expression RANGE! range SEMI! )* + { #comp_loc_s = #(#[COMPONENT_CLAUSES_OPT, "COMPONENT_CLAUSES_OPT"], + #comp_loc_s); } + ; + +private_task_items_opt : ( PRIVATE! ( pragma )* entrydecls_repspecs_opt )? + { #private_task_items_opt = + #(#[PRIVATE_TASK_ITEMS_OPT, + "PRIVATE_TASK_ITEMS_OPT"], #private_task_items_opt); } + // Maybe we could just reuse TASK_ITEMS_OPT here instead of + // making a separate node type. + ; + +prot_type_or_single_decl [RefAdaAST pro] + : TYPE! def_id[false] discrim_part_opt protected_definition + { Set(pro, PROTECTED_TYPE_DECLARATION); } + | def_id[false] protected_definition + { Set(pro, SINGLE_PROTECTED_DECLARATION); } + ; + +prot_private_opt : ( PRIVATE! ( prot_op_decl | comp_decl )* )? + { #prot_private_opt = + #(#[PROT_PRIVATE_OPT, + "PROT_PRIVATE_OPT"], #prot_private_opt); } + ; + +protected_definition + : IS! prot_op_decl_s prot_private_opt end_id_opt + ; + +prot_op_decl_s : ( prot_op_decl )* + { #prot_op_decl_s = #(#[PROT_OP_DECLARATIONS, + "PROT_OP_DECLARATIONS"], #prot_op_decl_s); } + ; + +prot_op_decl : entry_declaration + | p:PROCEDURE^ def_id[false] formal_part_opt SEMI! + { pop_def_id(); Set(#p, PROCEDURE_DECLARATION); } + | f:FUNCTION^ def_designator[false] function_tail SEMI! + { pop_def_id(); Set(#f, FUNCTION_DECLARATION); } + | rep_spec + | pragma + ; + +prot_member_decl_s : ( prot_op_decl | comp_decl )* + { #prot_member_decl_s = + #(#[PROT_MEMBER_DECLARATIONS, + "PROT_MEMBER_DECLARATIONS"], #prot_member_decl_s); } + ; + +comp_decl : def_ids_colon component_subtype_def init_opt SEMI! + { #comp_decl = + #(#[COMPONENT_DECLARATION, + "COMPONENT_DECLARATION"], #comp_decl); } + ; + +// decl_common is shared between declarative_item and basic_decl_item. +// decl_common only contains specifications. +decl_common + : t:TYPE^ IDENTIFIER + ( IS! type_def[#t] + | ( discrim_part + ( IS! derived_or_private_or_record[#t, true] + | { Set(#t, INCOMPLETE_TYPE_DECLARATION); } + ) + | empty_discrim_opt + { Set(#t, INCOMPLETE_TYPE_DECLARATION); } + // NB: In this case, the discrim_part_opt does not + // appear in the INCOMPLETE_TYPE_DECLARATION node. + ) + /* The artificial derived_or_private_or_record rule + gives us some syntax-level control over where a + discrim_part may appear. + However, a semantic check is still necessary to make + sure the discrim_part is not given for a derived type + of an elementary type, or for the full view of a + private type that turns out to be such. */ + ) + SEMI! + | s:SUBTYPE^ IDENTIFIER IS! subtype_ind SEMI! // subtype_decl + { Set(#s, SUBTYPE_DECLARATION); } + | generic_decl[false] + | use_clause + | r:FOR^ ( (local_enum_name USE LPAREN) => local_enum_name USE! + enumeration_aggregate + { Set(#r, ENUMERATION_REPESENTATION_CLAUSE); } + | subtype_mark USE! rep_spec_part[#r] + ) + SEMI! + | (IDENTIFIER COLON EXCEPTION RENAMES) => + IDENTIFIER erd:COLON^ EXCEPTION! RENAMES! compound_name SEMI! + { Set(#erd, EXCEPTION_RENAMING_DECLARATION); } + | (IDENTIFIER COLON subtype_mark RENAMES) => + IDENTIFIER ord:COLON^ subtype_mark RENAMES! name SEMI! + { Set(#ord, OBJECT_RENAMING_DECLARATION); } + | defining_identifier_list od:COLON^ // object_declaration + ( EXCEPTION! + { Set(#od, EXCEPTION_DECLARATION); } + | (CONSTANT ASSIGN) => CONSTANT! ASSIGN! expression + { Set(#od, NUMBER_DECLARATION); } + | aliased_constant_opt + ( array_type_definition[#od] init_opt + { Set(#od, ARRAY_OBJECT_DECLARATION); } + // Not an RM rule, but simplifies distinction + // from the non-array object_declaration. + | subtype_ind init_opt + { Set(#od, OBJECT_DECLARATION); } + ) + ) + SEMI! + ; + +type_def [RefAdaAST t] + : LPAREN! enum_id_s RPAREN! + { Set(t, ENUMERATION_TYPE_DECLARATION); } + | RANGE! range + { Set(t, SIGNED_INTEGER_TYPE_DECLARATION); } + | MOD! expression + { Set(t, MODULAR_TYPE_DECLARATION); } + | DIGITS! expression range_constraint_opt + { Set(t, FLOATING_POINT_DECLARATION); } + | DELTA! expression + ( RANGE! range + { Set(t, ORDINARY_FIXED_POINT_DECLARATION); } + | DIGITS! expression range_constraint_opt + { Set(t, DECIMAL_FIXED_POINT_DECLARATION); } + ) + | array_type_definition[t] + | access_type_definition[t] + | empty_discrim_opt derived_or_private_or_record[t, false] + ; + +enum_id_s : enumeration_literal_specification + ( COMMA! enumeration_literal_specification )* + ; + +enumeration_literal_specification : IDENTIFIER | CHARACTER_LITERAL + ; + +range_constraint_opt : ( range_constraint )? + ; + +array_type_definition [RefAdaAST t] + : ARRAY! LPAREN! index_or_discrete_range_s RPAREN! + OF! component_subtype_def + { Set(t, ARRAY_TYPE_DECLARATION); } + ; + +index_or_discrete_range_s + : index_or_discrete_range ( COMMA^ index_or_discrete_range )* + ; + +index_or_discrete_range + : simple_expression + ( DOT_DOT^ simple_expression // constrained + | RANGE^ ( BOX // unconstrained + | range // constrained + ) + )? + ; + +component_subtype_def : aliased_opt subtype_ind + ; + +aliased_opt : ( ALIASED )? + { #aliased_opt = #(#[MODIFIERS, "MODIFIERS"], #aliased_opt); } + ; + +subtype_ind : subtype_mark constraint_opt + { #subtype_ind = #(#[SUBTYPE_INDICATION, "SUBTYPE_INDICATION"], + #subtype_ind); } + ; + +constraint_opt : ( range_constraint + | digits_constraint + | delta_constraint + | (index_constraint) => index_constraint + | discriminant_constraint + )? + ; + +digits_constraint : d:DIGITS^ expression range_constraint_opt + { Set(#d, DIGITS_CONSTRAINT); } + ; + +delta_constraint : d:DELTA^ expression range_constraint_opt + { Set(#d, DELTA_CONSTRAINT); } + ; + +index_constraint : p:LPAREN^ discrete_range ( COMMA! discrete_range )* RPAREN! + { Set(#p, INDEX_CONSTRAINT); } + ; + +discrete_range + : (range) => range + | subtype_ind + ; + +discriminant_constraint : p:LPAREN^ discriminant_association + ( COMMA! discriminant_association )* RPAREN! + { Set(#p, DISCRIMINANT_CONSTRAINT); } + ; + +discriminant_association : selector_names_opt expression + { #discriminant_association = + #(#[DISCRIMINANT_ASSOCIATION, + "DISCRIMINANT_ASSOCIATION"], #discriminant_association); } + ; + +selector_names_opt : ( (association_head) => association_head + | /* empty */ + ) + { #selector_names_opt = + #(#[SELECTOR_NAMES_OPT, + "SELECTOR_NAMES_OPT"], #selector_names_opt); } + ; + +association_head : selector_name ( PIPE! selector_name )* RIGHT_SHAFT! + ; + +selector_name : IDENTIFIER // TBD: sem pred + ; + +access_type_definition [RefAdaAST t] + : ACCESS! + ( protected_opt + ( PROCEDURE! formal_part_opt + { Set(t, ACCESS_TO_PROCEDURE_DECLARATION); } + | FUNCTION! func_formal_part_opt RETURN! subtype_mark + { Set(t, ACCESS_TO_FUNCTION_DECLARATION); } + ) + | constant_all_opt subtype_ind + { Set(t, ACCESS_TO_OBJECT_DECLARATION); } + ) + ; + +protected_opt : ( PROTECTED )? + { #protected_opt = #(#[MODIFIERS, "MODIFIERS"], #protected_opt); } + ; + +constant_all_opt : ( CONSTANT | ALL )? + { #constant_all_opt = + #(#[MODIFIERS, "MODIFIERS"], #constant_all_opt); } + ; + +derived_or_private_or_record [RefAdaAST t, boolean has_discrim] + : ( ( ABSTRACT )? NEW subtype_ind WITH ) => + abstract_opt NEW! subtype_ind WITH! + ( PRIVATE! { Set(t, PRIVATE_EXTENSION_DECLARATION); } + | record_definition[has_discrim] + { Set(t, DERIVED_RECORD_EXTENSION); } + ) + | NEW! subtype_ind { Set(t, ORDINARY_DERIVED_TYPE_DECLARATION); } + | abstract_tagged_limited_opt + ( PRIVATE! { Set(t, PRIVATE_TYPE_DECLARATION); } + | record_definition[has_discrim] + { Set(t, RECORD_TYPE_DECLARATION); } + ) + ; + +abstract_opt : ( ABSTRACT )? + { #abstract_opt = #(#[MODIFIERS, "MODIFIERS"], #abstract_opt); } + ; + +record_definition [boolean has_discrim] + : RECORD! component_list[has_discrim] END! RECORD! + | NuLL! RECORD! // Thus the component_list is optional in the tree. + ; + +component_list [boolean has_discrim] + : NuLL! SEMI! // Thus the component_list is optional in the tree. + | component_items ( variant_part { has_discrim }? )? + | empty_component_items variant_part { has_discrim }? + ; + +component_items : ( pragma | comp_decl )+ + { #component_items = + #(#[COMPONENT_ITEMS, + "COMPONENT_ITEMS"], #component_items); } + ; + +empty_component_items : + { #empty_component_items = + #(#[COMPONENT_ITEMS, + "COMPONENT_ITEMS"], #empty_component_items); } + ; + +variant_part : c:CASE^ discriminant_direct_name IS! variant_s END! CASE! SEMI! + { Set (#c, VARIANT_PART); } + ; + +discriminant_direct_name : IDENTIFIER // TBD: symtab lookup. + ; + +variant_s : ( variant )+ + { #variant_s = #(#[VARIANTS, "VARIANTS"], #variant_s); } + ; + +variant : w:WHEN^ choice_s RIGHT_SHAFT! component_list[true] + { Set (#w, VARIANT); } + ; + +choice_s : choice ( PIPE^ choice )* + ; + +choice : OTHERS + | (discrete_with_range) => discrete_with_range + | expression // ( DOT_DOT^ simple_expression )? + ; // No, that's already in discrete_with_range + +discrete_with_range : (mark_with_constraint) => mark_with_constraint + | range + ; + +mark_with_constraint : subtype_mark range_constraint + { #mark_with_constraint = + #(#[MARK_WITH_CONSTRAINT, + "MARK_WITH_CONSTRAINT"], #mark_with_constraint); } + ; + +abstract_tagged_limited_opt + : ( ABSTRACT TAGGED! | TAGGED )? + ( LIMITED )? + { #abstract_tagged_limited_opt = + #(#[MODIFIERS, "MODIFIERS"], #abstract_tagged_limited_opt); } + ; + +local_enum_name : IDENTIFIER // to be refined: do a symbol table lookup + ; + +enumeration_aggregate : parenth_values + ; + +aliased_constant_opt : ( ALIASED )? ( CONSTANT )? + { #aliased_constant_opt = + #(#[MODIFIERS, "MODIFIERS"], #aliased_constant_opt); } + ; + +generic_decl [boolean lib_level] + : g:GENERIC^ generic_formal_part_opt + ( PACKAGE! def_id[lib_level] + ( renames { Set(#g, GENERIC_PACKAGE_RENAMING); } + | IS! pkg_spec_part { Set(#g, GENERIC_PACKAGE_DECLARATION); } + ) + | PROCEDURE! def_id[lib_level] formal_part_opt + ( renames { Set(#g, GENERIC_PROCEDURE_RENAMING); } + // ^^^ Semantic check must ensure that the (generic_formal)* + // after GENERIC is not given here. + | { Set(#g, GENERIC_PROCEDURE_DECLARATION); pop_def_id(); } + ) + | FUNCTION! def_designator[lib_level] function_tail + ( renames { Set(#g, GENERIC_FUNCTION_RENAMING); } + // ^^^ Semantic check must ensure that the (generic_formal)* + // after GENERIC is not given here. + | { Set(#g, GENERIC_FUNCTION_DECLARATION); pop_def_id(); } + ) + ) + SEMI! + ; + +generic_formal_part_opt : ( use_clause | pragma | generic_formal_parameter )* + { #generic_formal_part_opt = + #(#[GENERIC_FORMAL_PART, + "GENERIC_FORMAL_PART"], + #generic_formal_part_opt); } + ; + +generic_formal_parameter : + ( t:TYPE^ def_id[false] + ( IS! + ( LPAREN! BOX! RPAREN! + { Set (#t, FORMAL_DISCRETE_TYPE_DECLARATION); } + | RANGE! BOX! + { Set (#t, FORMAL_SIGNED_INTEGER_TYPE_DECLARATION); } + | MOD! BOX! + { Set (#t, FORMAL_MODULAR_TYPE_DECLARATION); } + | DELTA! BOX! + ( DIGITS! BOX! + { Set (#t, FORMAL_DECIMAL_FIXED_POINT_DECLARATION); } + | { Set (#t, FORMAL_ORDINARY_FIXED_POINT_DECLARATION); } + ) + | DIGITS! BOX! + { Set (#t, FORMAL_FLOATING_POINT_DECLARATION); } + | array_type_definition[#t] + | access_type_definition[#t] + | empty_discrim_opt discriminable_type_definition[#t] + ) + | discrim_part IS! discriminable_type_definition[#t] + ) + { pop_def_id(); } + | w:WITH^ ( PROCEDURE! def_id[false] formal_part_opt subprogram_default_opt + { Set(#w, FORMAL_PROCEDURE_DECLARATION); } + | FUNCTION! def_designator[false] function_tail subprogram_default_opt + { Set(#w, FORMAL_FUNCTION_DECLARATION); } + | PACKAGE! def_id[false] IS! NEW! compound_name formal_package_actual_part_opt + { Set(#w, FORMAL_PACKAGE_DECLARATION); } + ) + { pop_def_id(); } + | parameter_specification + ) + SEMI! + ; + +discriminable_type_definition [RefAdaAST t] + : ( ( ABSTRACT )? NEW subtype_ind WITH ) => + abstract_opt NEW! subtype_ind WITH! PRIVATE! + { Set (t, FORMAL_PRIVATE_EXTENSION_DECLARATION); } + | NEW! subtype_ind + { Set (t, FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION); } + | abstract_tagged_limited_opt PRIVATE! + { Set (t, FORMAL_PRIVATE_TYPE_DECLARATION); } + ; + +subprogram_default_opt : ( IS! ( BOX | name ) )? + ; + +formal_package_actual_part_opt + : ( LPAREN! ( BOX | defining_identifier_list ) RPAREN! )? + ; + +subprog_decl_or_rename_or_inst_or_body [boolean lib_level] + { RefAdaAST t; } + : p:PROCEDURE^ def_id[lib_level] + ( generic_subp_inst + { Set(#p, GENERIC_PROCEDURE_INSTANTIATION); } + | formal_part_opt + ( renames { Set(#p, PROCEDURE_RENAMING_DECLARATION); } + | IS! ( separate_or_abstract[#p] + | body_part { Set(#p, PROCEDURE_BODY); } + ) + | { pop_def_id(); + Set(#p, PROCEDURE_DECLARATION); } + ) + SEMI! + ) + | f:FUNCTION^ def_designator[lib_level] + ( generic_subp_inst + { Set(#f, GENERIC_FUNCTION_INSTANTIATION); } + | function_tail + ( renames { Set(#f, FUNCTION_RENAMING_DECLARATION); } + | IS! ( separate_or_abstract[#f] + | body_part { Set(#f, FUNCTION_BODY); } + ) + | { pop_def_id(); + Set(#f, FUNCTION_DECLARATION); } + ) + SEMI! + ) + ; + +body_part : declarative_part block_body end_id_opt + ; + +declarative_part : ( pragma | declarative_item )* + { #declarative_part = + #(#[DECLARATIVE_PART, "DECLARATIVE_PART"], + #declarative_part); } + ; + +// A declarative_item may appear in the declarative part of any body. +declarative_item : + ( pkg:PACKAGE^ ( body_is + ( separate { Set(#pkg, PACKAGE_BODY_STUB); } + | pkg_body_part + { Set(#pkg, PACKAGE_BODY); } + ) + SEMI! + | def_id[false] spec_decl_part[#pkg] + ) + | tsk:TASK^ ( body_is + ( separate { Set(#tsk, TASK_BODY_STUB); } + | body_part { Set(#tsk, TASK_BODY); } + ) + SEMI! + | task_type_or_single_decl[#tsk] + ) + | pro:PROTECTED^ + ( body_is + ( separate { Set(#pro, PROTECTED_BODY_STUB); } + | prot_op_bodies_opt end_id_opt + { Set(#pro, PROTECTED_BODY); } + ) + | prot_type_or_single_decl[#pro] + ) + SEMI! + | subprog_decl_or_rename_or_inst_or_body[false] + | decl_common + ) + /* DECLARATIVE_ITEM is just a pass-thru node so we omit it. + Objections anybody? + { #declarative_item = + #(#[DECLARATIVE_ITEM, + "DECLARATIVE_ITEM"], #declarative_item); } + */ + ; + +body_is : BODY! def_id[false] IS! + ; + +separate : SEPARATE! { pop_def_id(); } + ; + +pkg_body_part : declarative_part block_body_opt end_id_opt + ; + +block_body_opt : ( BEGIN! handled_stmt_s )? + { #block_body_opt = + #(#[BLOCK_BODY_OPT, + "BLOCK_BODY_OPT"], #block_body_opt); } + ; + +prot_op_bodies_opt : ( entry_body + | subprog_decl_or_body + | pragma + )* + { #prot_op_bodies_opt = + #(#[PROT_OP_BODIES_OPT, + "PROT_OP_BODIES_OPT"], #prot_op_bodies_opt); } + ; + +subprog_decl_or_body + : p:PROCEDURE^ def_id[false] formal_part_opt + ( IS! body_part { Set(#p, PROCEDURE_BODY); } + | { pop_def_id(); Set(#p, PROCEDURE_DECLARATION); } + ) + SEMI! + | f:FUNCTION^ def_designator[false] function_tail + ( IS! body_part { Set(#f, FUNCTION_BODY); } + | { pop_def_id(); Set(#f, FUNCTION_DECLARATION); } + ) + SEMI! + ; + +block_body : b:BEGIN^ handled_stmt_s + { Set(#b, BLOCK_BODY); } + ; + +handled_stmt_s : statements except_handler_part_opt + { #handled_stmt_s = + #(#[HANDLED_SEQUENCE_OF_STATEMENTS, + "HANDLED_SEQUENCE_OF_STATEMENTS"], #handled_stmt_s); } + ; + +handled_stmts_opt : ( statements except_handler_part_opt )? + { #handled_stmts_opt = + #(#[HANDLED_STMTS_OPT, + "HANDLED_STMTS_OPT"], #handled_stmts_opt); } + ; + +statements : ( pragma | statement )+ + { #statements = #(#[SEQUENCE_OF_STATEMENTS, + "SEQUENCE_OF_STATEMENTS"], #statements); } + ; + +statement : def_label_opt + ( null_stmt + | exit_stmt + | return_stmt + | goto_stmt + | delay_stmt + | abort_stmt + | raise_stmt + | requeue_stmt + | accept_stmt + | select_stmt + | if_stmt + | case_stmt + | loop_stmt SEMI! + | block END! SEMI! + | statement_identifier + ( loop_stmt id_opt SEMI! + | block end_id_opt SEMI! + ) + | call_or_assignment + // | code_stmt // TBD: resolve ambiguity + ) + { #statement = #(#[STATEMENT, "STATEMENT"], #statement); } + ; + +def_label_opt : ( LT_LT! IDENTIFIER GT_GT! )? + { #def_label_opt = #(#[LABEL_OPT, "LABEL_OPT"], #def_label_opt); } + ; + +null_stmt : s:NuLL SEMI! + { Set(#s, NULL_STATEMENT); } + ; + +if_stmt : s:IF^ cond_clause elsifs_opt + else_opt + END! IF! SEMI! + { Set(#s, IF_STATEMENT); } + ; + +cond_clause : condition c:THEN^ statements + { Set(#c, COND_CLAUSE); } + ; + +condition : expression + // { #condition = #(#[CONDITION, "CONDITION"], #condition); } + ; + +elsifs_opt : ( ELSIF! cond_clause )* + { #elsifs_opt = #(#[ELSIFS_OPT, "ELSIFS_OPT"], #elsifs_opt); } + ; + +else_opt : ( ELSE! statements )? + { #else_opt = #(#[ELSE_OPT, "ELSE_OPT"], #else_opt); } + ; + +case_stmt : s:CASE^ expression IS! alternative_s END! CASE! SEMI! + { Set(#s, CASE_STATEMENT); } + ; + +alternative_s : ( case_statement_alternative )+ + ; + +case_statement_alternative : s:WHEN^ choice_s RIGHT_SHAFT! statements + { Set(#s, CASE_STATEMENT_ALTERNATIVE); } + ; + +loop_stmt : iteration_scheme_opt + l:LOOP^ statements END! LOOP! // basic_loop + { Set(#l, LOOP_STATEMENT); } + ; + +iteration_scheme_opt : ( WHILE^ condition + | FOR^ IDENTIFIER IN! reverse_opt discrete_subtype_definition + )? + { #iteration_scheme_opt = + #(#[ITERATION_SCHEME_OPT, + "ITERATION_SCHEME_OPT"], #iteration_scheme_opt); } + ; + +reverse_opt : ( REVERSE )? + { #reverse_opt = #(#[MODIFIERS, "MODIFIERS"], #reverse_opt); } + ; + +id_opt_aux { RefAdaAST endid; } : + endid=definable_operator_symbol { end_id_matches_def_id (endid) }? + | n:compound_name { end_id_matches_def_id (#n) }? + /* Ordinarily we would need to be stricter here, i.e. + match compound_name only for the library-level case + (and IDENTIFIER otherwise), but end_id_matches_def_id + does the right thing for us. */ + | { pop_def_id(); } + ; + +id_opt : id_opt_aux + { #id_opt = #(#[ID_OPT, "ID_OPT"], #id_opt); } + ; + +end_id_opt : e:END^ id_opt_aux + { Set(#e, END_ID_OPT); } + ; + +/* Note: This rule should really be `statement_identifier_opt'. + However, manual disambiguation of `loop_stmt' from `block' + in the presence of the statement_identifier in `statement' + results in this rule. The case of loop_stmt/block given + without the statement_identifier is directly coded in + `statement'. */ +statement_identifier! : n:IDENTIFIER COLON! + { push_def_id(#n); } + ; + +/* +statement_identifier_opt : ( n:IDENTIFIER COLON! { push_def_id(#n); } )? + { #statement_identifier_opt = + #(#[STATEMENT_IDENTIFIER_OPT, + "STATEMENT_IDENTIFIER_OPT"], #statement_identifier_opt); } + ; + */ + +block : declare_opt block_body + { #block = #(#[BLOCK_STATEMENT, "BLOCK_STATEMENT"], #block); } + ; + +declare_opt : ( DECLARE! declarative_part )? + { #declare_opt = #(#[DECLARE_OPT, "DECLARE_OPT"], #declare_opt); } + ; + +exit_stmt : s:EXIT^ ( label_name )? ( WHEN condition )? SEMI! + { Set(#s, EXIT_STATEMENT); } + ; + +label_name : IDENTIFIER + ; + +return_stmt : s:RETURN^ ( expression )? SEMI! + { Set(#s, RETURN_STATEMENT); } + ; + +goto_stmt : s:GOTO^ label_name SEMI! + { Set(#s, GOTO_STATEMENT); } + ; + +call_or_assignment : // procedure_call is in here. + name ( ASSIGN! expression + { #call_or_assignment = + #(#[ASSIGNMENT_STATEMENT, + "ASSIGNMENT_STATEMENT"], #call_or_assignment); } + | { #call_or_assignment = + #(#[CALL_STATEMENT, + "CALL_STATEMENT"], #call_or_assignment); } + /* Preliminary. Use semantic analysis to produce + {PROCEDURE|ENTRY}_CALL_STATEMENT. */ + ) + SEMI! + ; + +entry_body : e:ENTRY^ def_id[false] entry_body_formal_part entry_barrier IS! + body_part SEMI! + { Set (#e, ENTRY_BODY); } + ; + +entry_body_formal_part : entry_index_spec_opt formal_part_opt + ; + +entry_index_spec_opt : + ( (LPAREN FOR) => + LPAREN! FOR! def_id[false] IN! discrete_subtype_definition RPAREN! + | /* empty */ + ) + { #entry_index_spec_opt = + #(#[ENTRY_INDEX_SPECIFICATION, + "ENTRY_INDEX_SPECIFICATION"], #entry_index_spec_opt); } + ; + +entry_barrier : WHEN! condition + ; + +entry_call_stmt : name SEMI! // Semantic analysis required, for example + // to ensure `name' is an entry. + { #entry_call_stmt = + #(#[ENTRY_CALL_STATEMENT, + "ENTRY_CALL_STATEMENT"], #entry_call_stmt); } + ; + +accept_stmt : a:ACCEPT^ def_id[false] entry_index_opt formal_part_opt + ( DO! handled_stmts_opt end_id_opt SEMI! + | SEMI! { pop_def_id(); } + ) + { Set (#a, ACCEPT_STATEMENT); } + ; + +entry_index_opt : ( (LPAREN expression RPAREN) => LPAREN! expression RPAREN! + // Looks alot like parenthesized_expr_opt, but it's not. + // We need the syn pred for the usage context in accept_stmt. + // The formal_part_opt that follows the entry_index_opt there + // creates ambiguity (due to the opening LPAREN.) + | /* empty */ + ) + { #entry_index_opt = + #(#[ENTRY_INDEX_OPT, + "ENTRY_INDEX_OPT"], #entry_index_opt); } + ; + +delay_stmt : d:DELAY^ until_opt expression SEMI! + { Set (#d, DELAY_STATEMENT); } + ; + +until_opt : ( UNTIL )? + { #until_opt = #(#[MODIFIERS, "MODIFIERS"], #until_opt); } + ; + +// SELECT_STATEMENT itself is not modeled since it is trivially +// reconstructed: +// select_statement ::= selective_accept | timed_entry_call +// | conditional_entry_call | asynchronous_select +// +select_stmt : s:SELECT^ + ( (triggering_alternative THEN ABORT) => + triggering_alternative THEN! ABORT! abortable_part + { Set (#s, ASYNCHRONOUS_SELECT); } + | selective_accept + { Set (#s, SELECTIVE_ACCEPT); } + | entry_call_alternative + ( OR! delay_alternative { Set (#s, TIMED_ENTRY_CALL); } + | ELSE! statements { Set (#s, CONDITIONAL_ENTRY_CALL); } + ) + ) + END! SELECT! SEMI! + // { Set (#s, SELECT_STATEMENT); } + ; + +triggering_alternative : ( delay_stmt | entry_call_stmt ) stmts_opt + { #triggering_alternative = + #(#[TRIGGERING_ALTERNATIVE, + "TRIGGERING_ALTERNATIVE"], #triggering_alternative); } + ; + +abortable_part : stmts_opt + { #abortable_part = + #(#[ABORTABLE_PART, + "ABORTABLE_PART"], #abortable_part); } + ; + +entry_call_alternative : entry_call_stmt stmts_opt + { #entry_call_alternative = + #(#[ENTRY_CALL_ALTERNATIVE, + "ENTRY_CALL_ALTERNATIVE"], #entry_call_alternative); } + ; + +selective_accept : guard_opt select_alternative or_select_opt else_opt + ; + +guard_opt : ( w:WHEN^ condition RIGHT_SHAFT! ( pragma )* )? + { Set(#w, GUARD_OPT); } + ; + +select_alternative // Not modeled since it's just a pass-through. + : accept_alternative + | delay_alternative + | t:TERMINATE SEMI! { Set(#t, TERMINATE_ALTERNATIVE); } + ; + +accept_alternative : accept_stmt stmts_opt + { #accept_alternative = + #(#[ACCEPT_ALTERNATIVE, + "ACCEPT_ALTERNATIVE"], #accept_alternative); } + ; + +delay_alternative : delay_stmt stmts_opt + { #delay_alternative = + #(#[DELAY_ALTERNATIVE, + "DELAY_ALTERNATIVE"], #delay_alternative); } + ; + +stmts_opt : ( pragma | statement )* + ; + +or_select_opt : ( OR! guard_opt select_alternative )* + { #or_select_opt = + #(#[OR_SELECT_OPT, "OR_SELECT_OPT"], #or_select_opt); } + ; + +abort_stmt : a:ABORT^ name ( COMMA! name )* SEMI! + { Set (#a, ABORT_STATEMENT); } + ; + +except_handler_part_opt : ( EXCEPTION! ( exception_handler )+ )? + { #except_handler_part_opt = + #(#[EXCEPT_HANDLER_PART_OPT, + "EXCEPT_HANDLER_PART_OPT"], #except_handler_part_opt); } + ; + +exception_handler : w:WHEN^ identifier_colon_opt except_choice_s RIGHT_SHAFT! + statements + { Set (#w, EXCEPTION_HANDLER); } + ; + +identifier_colon_opt : ( IDENTIFIER COLON! )? + { #identifier_colon_opt = + #(#[IDENTIFIER_COLON_OPT, + "IDENTIFIER_COLON_OPT"], #identifier_colon_opt); } + ; + +except_choice_s : exception_choice ( PIPE^ exception_choice )* + ; + +exception_choice : compound_name + | OTHERS + ; + +raise_stmt : r:RAISE^ ( compound_name )? SEMI! + { Set (#r, RAISE_STATEMENT); } + ; + +requeue_stmt : r:REQUEUE^ name ( WITH! ABORT )? SEMI! + { Set (#r, REQUEUE_STATEMENT); } + ; + +operator_call : cs:CHAR_STRING^ operator_call_tail[#cs] + ; + +operator_call_tail [RefAdaAST opstr] + : LPAREN! { is_operator_symbol(opstr->getText().c_str()) }? + value_s RPAREN! { opstr->setType(OPERATOR_SYMBOL); } + ; + +value_s : value ( COMMA! value )* + { #value_s = #(#[VALUES, "VALUES"], #value_s); } + ; + +/* +literal : NUMERIC_LIT + | CHARACTER_LITERAL + | CHAR_STRING + | NuLL + ; + */ + +expression : relation + ( a:AND^ ( THEN! { Set (#a, AND_THEN); } )? relation + | o:OR^ ( ELSE! { Set (#o, OR_ELSE); } )? relation + | XOR^ relation + )* + ; + +relation : simple_expression + ( IN^ range_or_mark + | n:NOT^ IN! range_or_mark { Set (#n, NOT_IN); } + | EQ^ simple_expression + | NE^ simple_expression + | LT_^ simple_expression + | LE^ simple_expression + | GT^ simple_expression + | GE^ simple_expression + )? + ; + +range_or_mark : (range) => range + | subtype_mark + ; + +simple_expression : signed_term + ( PLUS^ signed_term + | MINUS^ signed_term + | CONCAT^ signed_term + )* + ; + +signed_term + : p:PLUS^ term { Set(#p, UNARY_PLUS); } + | m:MINUS^ term { Set(#m, UNARY_MINUS); } + | term + ; + +term : factor ( STAR^ factor + | DIV^ factor + | MOD^ factor + | REM^ factor + )* + ; + +factor : ( NOT^ primary + | ABS^ primary + | primary ( EXPON^ primary )? + ) + ; + +primary : ( name_or_qualified + | parenthesized_primary + | allocator + | NuLL + | NUMERIC_LIT + | CHARACTER_LITERAL + | cs:CHAR_STRING^ ( operator_call_tail[#cs] )? + ) + ; + +// Temporary, to be turned into just `qualified'. +// We get away with it because `qualified' is always mentioned +// together with `name'. +// Only exception: `code_stmt', which is not yet implemented. +name_or_qualified { RefAdaAST dummy; } + : IDENTIFIER + ( DOT^ ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | dummy=is_operator + ) + | p:LPAREN^ value_s RPAREN! + { Set(#p, INDEXED_COMPONENT); } + | TIC^ ( parenthesized_primary | attribute_id ) + )* + ; + +allocator : n:NEW^ name_or_qualified + { Set(#n, ALLOCATOR); } + ; + +subunit : sep:SEPARATE^ LPAREN! compound_name RPAREN! + { Set(#sep, SUBUNIT); } + ( subprogram_body + | package_body + | task_body + | protected_body + ) + ; + +subprogram_body + : p:PROCEDURE^ def_id[false] formal_part_opt IS! body_part SEMI! + { pop_def_id(); Set(#p, PROCEDURE_BODY); } + | f:FUNCTION^ def_designator[false] function_tail IS! body_part SEMI! + { pop_def_id(); Set(#f, FUNCTION_BODY); } + ; + +package_body : p:PACKAGE^ body_is pkg_body_part SEMI! + { Set(#p, PACKAGE_BODY); } + ; + +task_body : t:TASK^ body_is body_part SEMI! + { Set(#t, TASK_BODY); } + ; + +protected_body : p:PROTECTED^ body_is prot_op_bodies_opt end_id_opt SEMI! + { Set(#p, PROTECTED_BODY); } + ; + +// TBD +// code_stmt : qualified SEMI! +// ; + +//---------------------------------------------------------------------------- +// The Ada scanner +//---------------------------------------------------------------------------- +{ +#include "preambles.h" +} +class AdaLexer extends Lexer; + +options { + charVocabulary = '\3'..'\377'; + exportVocab = Ada; // call the vocabulary "Ada" + testLiterals = false; // don't automatically test for literals + k = 4; // number of characters of lookahead + caseSensitive = false; + caseSensitiveLiterals = false; + ///defaultErrorHandler = true; +} + +tokens { + // part 1: keywords + ABORT = "abort" ; + ABS = "abs" ; + ABSTRACT = "abstract" ; + ACCEPT = "accept" ; + ACCESS = "access" ; + ALIASED = "aliased" ; + ALL = "all" ; + AND = "and" ; + ARRAY = "array" ; + AT = "at" ; + BEGIN = "begin" ; + BODY = "body" ; + CASE = "case" ; + CONSTANT = "constant" ; + DECLARE = "declare" ; + DELAY = "delay" ; + DELTA = "delta" ; + DIGITS = "digits" ; + DO = "do" ; + ELSE = "else" ; + ELSIF = "elsif" ; + END = "end" ; + ENTRY = "entry" ; + EXCEPTION = "exception" ; + EXIT = "exit" ; + FOR = "for" ; + FUNCTION = "function" ; + GENERIC = "generic" ; + GOTO = "goto" ; + IF = "if" ; + IN = "in" ; + IS = "is" ; + LIMITED = "limited" ; + LOOP = "loop" ; + MOD = "mod" ; + NEW = "new" ; + NOT = "not" ; + NuLL = "null" ; + OF = "of" ; + OR = "or" ; + OTHERS = "others" ; + OUT = "out" ; + PACKAGE = "package" ; + PRAGMA = "pragma" ; + PRIVATE = "private" ; + PROCEDURE = "procedure" ; + PROTECTED = "protected" ; + RAISE = "raise" ; + RANGE = "range" ; + RECORD = "record" ; + REM = "rem" ; + RENAMES = "renames" ; + REQUEUE = "requeue" ; + RETURN = "return" ; + REVERSE = "reverse" ; + SELECT = "select" ; + SEPARATE = "separate" ; + SUBTYPE = "subtype" ; + TAGGED = "tagged" ; + TASK = "task" ; + TERMINATE = "terminate" ; + THEN = "then" ; + TYPE = "type" ; + UNTIL = "until" ; + USE = "use" ; + WHEN = "when" ; + WHILE = "while" ; + WITH = "with" ; + XOR = "xor" ; + + // part 2: RM tokens (synthetic) + ABORTABLE_PART; + ABORT_STATEMENT; + /*ABSTRACT_SUBPROGRAM_DECLARATION; => + ABSTRACT_{FUNCTION|PROCEDURE}_DECLARATION */ + ACCEPT_ALTERNATIVE; + ACCEPT_STATEMENT; + /* ACCESS_TO_FUNCTION_DEFINITION => ACCESS_TO_FUNCTION_DECLARATION */ + /* ACCESS_TO_OBJECT_DEFINITION => ACCESS_TO_OBJECT_DECLARATION */ + /* ACCESS_TO_PROCEDURE_DEFINITION => ACCESS_TO_PROCEDURE_DECLARATION */ + /* ACCESS_TYPE_DEFINITION => ACCESS_TYPE_DECLARATION */ + ALLOCATOR; + /* ARRAY_TYPE_DEFINITION => ARRAY_TYPE_DECLARATION */ + ASSIGNMENT_STATEMENT; + ASYNCHRONOUS_SELECT; + ATTRIBUTE_DEFINITION_CLAUSE; + AT_CLAUSE; + BLOCK_STATEMENT; + CASE_STATEMENT; + CASE_STATEMENT_ALTERNATIVE; + CODE_STATEMENT; + COMPONENT_DECLARATION; + // COMPONENT_LIST; // not currently used as an explicit node + // CONDITION; // not currently used + CONDITIONAL_ENTRY_CALL; + CONTEXT_CLAUSE; + /* DECIMAL_FIXED_POINT_DEFINITION => DECIMAL_FIXED_POINT_DECLARATION */ + // DECLARATIVE_ITEM; // not currently used + DECLARATIVE_PART; + DEFINING_IDENTIFIER_LIST; + DELAY_ALTERNATIVE; + DELAY_STATEMENT; + DELTA_CONSTRAINT; + /* DERIVED_TYPE_DEFINITION; => + DERIVED_RECORD_EXTENSION, ORDINARY_DERIVED_TYPE_DECLARATION */ + DIGITS_CONSTRAINT; + // DISCRETE_RANGE; // Not used; instead, directly use its RHS alternatives. + DISCRIMINANT_ASSOCIATION; + DISCRIMINANT_CONSTRAINT; + DISCRIMINANT_SPECIFICATION; + ENTRY_BODY; + ENTRY_CALL_ALTERNATIVE; + ENTRY_CALL_STATEMENT; + ENTRY_DECLARATION; + ENTRY_INDEX_SPECIFICATION; + ENUMERATION_REPESENTATION_CLAUSE; + /* ENUMERATION_TYPE_DEFINITION => ENUMERATION_TYPE_DECLARATION */ + EXCEPTION_DECLARATION; + EXCEPTION_HANDLER; + EXCEPTION_RENAMING_DECLARATION; + EXIT_STATEMENT; + /* FLOATING_POINT_DEFINITION => FLOATING_POINT_DECLARATION */ + /* FORMAL_ACCESS_TYPE_DEFINITION => FORMAL_ACCESS_TYPE_DECLARATION */ + /* FORMAL_ARRAY_TYPE_DEFINITION => FORMAL_ARRAY_TYPE_DECLARATION */ + /* FORMAL_DECIMAL_FIXED_POINT_DEFINITION => + FORMAL_DECIMAL_FIXED_POINT_DECLARATION */ + /* FORMAL_DERIVED_TYPE_DEFINITION => + FORMAL_{ORDINARY_DERIVED_TYPE|PRIVATE_EXTENSION}_DECLARATION */ + /* FORMAL_DISCRETE_TYPE_DEFINITION => FORMAL_DISCRETE_TYPE_DECLARATION */ + /* FORMAL_FLOATING_POINT_DEFINITION => + FORMAL_FLOATING_POINT_DECLARATION */ + /* FORMAL_MODULAR_TYPE_DEFINITION => FORMAL_MODULAR_TYPE_DECLARATION */ + /* FORMAL_ORDINARY_FIXED_POINT_DEFINITION => + FORMAL_ORDINARY_FIXED_POINT_DECLARATION */ + FORMAL_PACKAGE_DECLARATION; + /* FORMAL_PRIVATE_TYPE_DEFINITION => FORMAL_PRIVATE_TYPE_DECLARATION */ + /* FORMAL_SIGNED_INTEGER_TYPE_DEFINITION => + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION */ + /* FORMAL_SUBPROGRAM_DECLARATION; => + FORMAL_{FUNCTION|PROCEDURE}_DECLARATION */ + /* FORMAL_TYPE_DECLARATION; not used, replaced by the corresponding + finer grained declarations */ + /* FORMAL_TYPE_DEFINITION; not used at all; we use declarations + not definitions */ + /* FULL_TYPE_DECLARATION; not used, replaced by the corresponding + finer grained declarations */ + GENERIC_FORMAL_PART; + /* GENERIC_INSTANTIATION; => + GENERIC_{FUNCTION|PACKAGE|PROCEDURE}_INSTANTIATION */ + GENERIC_PACKAGE_DECLARATION; + /* GENERIC_RENAMING_DECLARATION; => + GENERIC_{FUNCTION|PACKAGE|PROCEDURE}_RENAMING */ + /* GENERIC_SUBPROGRAM_DECLARATION; => + GENERIC_{FUNCTION|PROCEDURE}_DECLARATION */ + GOTO_STATEMENT; + HANDLED_SEQUENCE_OF_STATEMENTS; + HANDLED_STMTS_OPT; + IF_STATEMENT; + INCOMPLETE_TYPE_DECLARATION; + INDEXED_COMPONENT; + INDEX_CONSTRAINT; + LIBRARY_ITEM; + LOOP_STATEMENT; + /* MODULAR_TYPE_DEFINITION => MODULAR_TYPE_DECLARATION */ + NAME; + NULL_STATEMENT; + NUMBER_DECLARATION; + OBJECT_DECLARATION; + OBJECT_RENAMING_DECLARATION; + OPERATOR_SYMBOL; + /* ORDINARY_FIXED_POINT_DEFINITION => ORDINARY_FIXED_POINT_DECLARATION */ + PACKAGE_BODY; + PACKAGE_BODY_STUB; + PACKAGE_RENAMING_DECLARATION; + PACKAGE_SPECIFICATION; + PARAMETER_SPECIFICATION; + // PREFIX; // not used + // PRIMARY; // not used + PRIVATE_EXTENSION_DECLARATION; + PRIVATE_TYPE_DECLARATION; + // PROCEDURE_CALL_STATEMENT; // NYI, using CALL_STATEMENT for now. + PROTECTED_BODY; + PROTECTED_BODY_STUB; + PROTECTED_TYPE_DECLARATION; + RAISE_STATEMENT; + RANGE_ATTRIBUTE_REFERENCE; + RECORD_REPRESENTATION_CLAUSE; + /* RECORD_TYPE_DEFINITION => RECORD_TYPE_DECLARATION */ + REQUEUE_STATEMENT; + RETURN_STATEMENT; + SELECTIVE_ACCEPT; + /* SELECT_ALTERNATIVE; Not used - instead, we use the finer grained rules + ACCEPT_ALTERNATIVE | DELAY_ALTERNATIVE + | TERMINATE_ALTERNATIVE */ + /* SELECT_STATEMENT; Not used - instead, we use the finer grained rules + SELECTIVE_ACCEPT | TIMED_ENTRY_CALL + | CONDITIONAL_ENTRY_CALL | ASYNCHRONOUS_SELECT */ + SEQUENCE_OF_STATEMENTS; + /* SIGNED_INTEGER_TYPE_DEFINITION => SIGNED_INTEGER_TYPE_DECLARATION */ + SINGLE_PROTECTED_DECLARATION; + SINGLE_TASK_DECLARATION; + STATEMENT; + /* SUBPROGRAM_BODY; => {FUNCTION|PROCEDURE}_BODY */ + /* SUBPROGRAM_BODY_STUB; => {FUNCTION|PROCEDURE}_BODY_STUB */ + /* SUBPROGRAM_DECLARATION; => {FUNCTION|PROCEDURE}_DECLARATION */ + /* SUBPROGRAM_RENAMING_DECLARATION; => + {FUNCTION|PROCEDURE}_RENAMING_DECLARATION */ + SUBTYPE_DECLARATION; + SUBTYPE_INDICATION; + SUBTYPE_MARK; + SUBUNIT; + TASK_BODY; + TASK_BODY_STUB; + TASK_TYPE_DECLARATION; + TERMINATE_ALTERNATIVE; + TIMED_ENTRY_CALL; + TRIGGERING_ALTERNATIVE; + /* TYPE_DECLARATION; not used, replaced by the corresponding + finer grained declarations */ + USE_CLAUSE; + USE_TYPE_CLAUSE; + VARIANT; + VARIANT_PART; + WITH_CLAUSE; + + // part 3: Non-RM synthetic tokens. + // They exist mainly to normalize the node structure with respect to + // optional items. (Without them, the presence or absence of an optional + // item would change the node layout, but we want a fixed layout.) + ABSTRACT_FUNCTION_DECLARATION; + ABSTRACT_PROCEDURE_DECLARATION; + ACCESS_TO_FUNCTION_DECLARATION; + ACCESS_TO_OBJECT_DECLARATION; + ACCESS_TO_PROCEDURE_DECLARATION; + /* ACCESS_TYPE_DECLARATION; not used, replaced by + ACCESS_TO_{FUNCTION|OBJECT|PROCEDURE}_DECLARATION + */ + ARRAY_OBJECT_DECLARATION; + ARRAY_TYPE_DECLARATION; + AND_THEN; + BASIC_DECLARATIVE_ITEMS_OPT; + BLOCK_BODY; + BLOCK_BODY_OPT; + CALL_STATEMENT; // See {PROCEDURE|ENTRY}_CALL_STATEMENT + COMPONENT_CLAUSES_OPT; + COMPONENT_ITEMS; + COND_CLAUSE; + DECIMAL_FIXED_POINT_DECLARATION; + DECLARE_OPT; + DERIVED_RECORD_EXTENSION; + // DERIVED_TYPE_DECLARATION; // not used + DISCRETE_SUBTYPE_DEF_OPT; + DISCRIMINANT_SPECIFICATIONS; + DISCRIM_PART_OPT; + ELSE_OPT; + ELSIFS_OPT; + END_ID_OPT; + ENTRY_INDEX_OPT; + ENUMERATION_TYPE_DECLARATION; + EXCEPT_HANDLER_PART_OPT; + EXTENSION_OPT; + FLOATING_POINT_DECLARATION; + /* FORMAL_ACCESS_TYPE_DECLARATION => ACCESS_TYPE_DECLARATION */ + /* FORMAL_ARRAY_TYPE_DECLARATION => ARRAY_TYPE_DECLARATION */ + FORMAL_DECIMAL_FIXED_POINT_DECLARATION; + FORMAL_DISCRETE_TYPE_DECLARATION; + FORMAL_FLOATING_POINT_DECLARATION; + FORMAL_FUNCTION_DECLARATION; + FORMAL_MODULAR_TYPE_DECLARATION; + FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION; + FORMAL_ORDINARY_FIXED_POINT_DECLARATION; + FORMAL_PART_OPT; + FORMAL_PRIVATE_EXTENSION_DECLARATION; + FORMAL_PRIVATE_TYPE_DECLARATION; + FORMAL_PROCEDURE_DECLARATION; + FORMAL_SIGNED_INTEGER_TYPE_DECLARATION; + FUNCTION_BODY; + FUNCTION_BODY_STUB; + FUNCTION_DECLARATION; + FUNCTION_RENAMING_DECLARATION; + GENERIC_FUNCTION_DECLARATION; + GENERIC_FUNCTION_INSTANTIATION; + GENERIC_FUNCTION_RENAMING; + GENERIC_PACKAGE_INSTANTIATION; + GENERIC_PACKAGE_RENAMING; + GENERIC_PROCEDURE_DECLARATION; + GENERIC_PROCEDURE_INSTANTIATION; + GENERIC_PROCEDURE_RENAMING; + GUARD_OPT; + IDENTIFIER_COLON_OPT; + ID_OPT; + INIT_OPT; + ITERATION_SCHEME_OPT; + LABEL_OPT; + MARK_WITH_CONSTRAINT; + MODIFIERS; /* Possible values: abstract access aliased all constant in + limited out private protected reverse tagged */ + MODULAR_TYPE_DECLARATION; + MOD_CLAUSE_OPT; + // NAME_OR_QUALIFIED; + NOT_IN; + ORDINARY_DERIVED_TYPE_DECLARATION; + ORDINARY_FIXED_POINT_DECLARATION; + OR_ELSE; + OR_SELECT_OPT; + PARENTHESIZED_PRIMARY; + // PARENTHESIZED_VALUES; + // PARENTHESIZED_VALUES_OPT; + PRIVATE_DECLARATIVE_ITEMS_OPT; + PRIVATE_TASK_ITEMS_OPT; + PROCEDURE_BODY; + PROCEDURE_BODY_STUB; + PROCEDURE_DECLARATION; + PROCEDURE_RENAMING_DECLARATION; + PROT_MEMBER_DECLARATIONS; + PROT_OP_BODIES_OPT; + PROT_OP_DECLARATIONS; + PROT_PRIVATE_OPT; + RANGED_EXPRS; // ugh, what an ugly name + RANGE_CONSTRAINT; + RECORD_TYPE_DECLARATION; + SELECTOR_NAMES_OPT; + SIGNED_INTEGER_TYPE_DECLARATION; + TASK_ITEMS_OPT; + UNARY_MINUS; + UNARY_PLUS; + VALUE; + VALUES; + VARIANTS; +} + +{ + ANTLR_LEXER_PREAMBLE + private: + bool lastTokenWasTicCompatible; +} + +//---------------------------------------------------------------------------- +// OPERATORS +//---------------------------------------------------------------------------- +COMMENT_INTRO : "--" {lastTokenWasTicCompatible=false;}; +DOT_DOT : ".." {lastTokenWasTicCompatible=false;}; +LT_LT : "<<" {lastTokenWasTicCompatible=false;}; +OX : "<>" {lastTokenWasTicCompatible=false;}; +GT_GT : ">>" {lastTokenWasTicCompatible=false;}; +ASSIGN : ":=" {lastTokenWasTicCompatible=false;}; +RIGHT_SHAFT : "=>" {lastTokenWasTicCompatible=false;}; +NE : "/=" {lastTokenWasTicCompatible=false;}; +LE : "<=" {lastTokenWasTicCompatible=false;}; +GE : ">=" {lastTokenWasTicCompatible=false;}; +EXPON : "**" {lastTokenWasTicCompatible=false;}; +PIPE : '|' {lastTokenWasTicCompatible=false;}; +CONCAT : '&' {lastTokenWasTicCompatible=false;}; +DOT : '.' {lastTokenWasTicCompatible=false;}; +EQ : '=' {lastTokenWasTicCompatible=false;}; +LT_ : '<' {lastTokenWasTicCompatible=false;}; +GT : '>' {lastTokenWasTicCompatible=false;}; +PLUS : '+' {lastTokenWasTicCompatible=false;}; +MINUS : '-' {lastTokenWasTicCompatible=false;}; +STAR : '*' {lastTokenWasTicCompatible=false;}; +DIV : '/' {lastTokenWasTicCompatible=false;}; +LPAREN : '(' {lastTokenWasTicCompatible=false;}; +RPAREN : ')' {lastTokenWasTicCompatible=true;}; +COLON : ':' {lastTokenWasTicCompatible=false;}; +COMMA : ',' {lastTokenWasTicCompatible=false;}; +SEMI : ';' {lastTokenWasTicCompatible=false;}; + + +// Literals. + +// Rule for IDENTIFIER: testLiterals is set to true. This means that +// after we match the rule, we look in the literals table to see if +// it's a keyword or really an identifier. +IDENTIFIER + options {testLiterals=true;} + : ( 'a'..'z' ) ( ('_')? ( 'a'..'z'|'0'..'9' ) )* + ; + +TIC_OR_CHARACTER_LITERAL : + "'"! { $setType(TIC); } ( + { ! lastTokenWasTicCompatible }? . "'"! + { $setType(CHARACTER_LITERAL); } + )? + {lastTokenWasTicCompatible=false;}; + +CHAR_STRING : '"'! ("\"\"" | ~('"'))* '"'! + {lastTokenWasTicCompatible=true;}; + +NUMERIC_LIT : ( DIGIT )+ + ( '#' BASED_INTEGER ( '.' BASED_INTEGER )? '#' + | ( '_' ( DIGIT )+ )+ // INTEGER + )? + ( { LA(2)!='.' }? //&& LA(3)!='.' }? + ( '.' ( DIGIT )+ ( '_' ( DIGIT )+ )* ( EXPONENT )? + | EXPONENT + ) + )? + {lastTokenWasTicCompatible=false;}; + +// a couple protected methods to assist in matching the various numbers + +protected +DIGIT : ( '0'..'9' ) {lastTokenWasTicCompatible=false;}; + +protected +EXPONENT : ('e') ('+'|'-')? ( DIGIT )+ {lastTokenWasTicCompatible=false;}; + +protected +EXTENDED_DIGIT : ( DIGIT | 'a'..'f' ) {lastTokenWasTicCompatible=false;}; + +protected +BASED_INTEGER : ( EXTENDED_DIGIT ) ( ('_')? EXTENDED_DIGIT )* {lastTokenWasTicCompatible=false;}; + + +// Whitespace -- ignored +WS_ : ( ' ' + | '\t' + | '\f' + // handle newlines + | ( "\r\n" // Evil DOS + | '\r' // Macintosh + | '\n' // Unix (the right way) + ) + { newline(); } + ) + { $setType(antlr::Token::SKIP); } + ; + +// Single-line comments +COMMENT : COMMENT_INTRO (~('\n'|'\r'))* ('\n'|'\r'('\n')?) + { $setType(antlr::Token::SKIP); + newline(); + lastTokenWasTicCompatible=false; } + ; + diff --git a/languages/ada/ada.store.g b/languages/ada/ada.store.g new file mode 100644 index 00000000..dbca7312 --- /dev/null +++ b/languages/ada/ada.store.g @@ -0,0 +1,610 @@ +/* $Id$ + * ANTLR Ada tree walker for building the Kdevelop class store + * Copyright (C) 2003 Oliver Kellogg + */ + +header "pre_include_hpp" { +#include +#include +#include + +#include +#include "AdaAST.hpp" +#include "ada_utils.hpp" +} + +header "post_include_hpp" { +#include +#include +} + +options { + language="Cpp"; +} + +class AdaStoreWalker extends AdaTreeParserSuper; +options { + importVocab = Ada; + ASTLabelType = "RefAdaAST"; +} + +{ +private: + QString m_fileName; + QValueList m_scopeStack; + CodeModel* m_model; + QValueList m_imports; + NamespaceDom m_currentContainer; + int m_currentAccess; + bool m_addToStore; /* auxiliary variable: for the moment, this is `true' + only when we are in specs, not bodies. */ + bool m_isSubprogram; // auxiliary to def_id() + FileDom m_file; + +public: + void setCodeModel (CodeModel* model) { m_model = model; } + CodeModel* codeModel () { return m_model; } + const CodeModel* codeModel () const { return m_model; } + + QString fileName () const { return m_fileName; } + void setFileName (const QString& fileName) { m_fileName = fileName; } + + void init () { + m_scopeStack.clear (); + m_imports.clear (); + m_currentContainer = m_model->globalNamespace (); + m_scopeStack.append (m_currentContainer); + m_currentAccess = CodeModelItem::Public; + m_addToStore = false; + m_isSubprogram = false; + if (m_model->hasFile(m_fileName)) + m_model->removeFile (m_model->fileByName(m_fileName)); + m_file = m_model->create(); + m_file->setName(m_fileName); + m_model->addFile(m_file); + } + + void wipeout () { m_model->wipeout (); } +// void out () { m_store->out (); } + void removeWithReferences (const QString& fileName) { + m_model->removeFile (m_model->fileByName(fileName)); + } + NamespaceDom insertScopeContainer + (NamespaceDom scope, const QStringList & scopes ) { + QStringList::ConstIterator it = scopes.begin(); + QString prefix( *it ); + NamespaceDom ns = scope->namespaceByName( prefix ); +// kdDebug() << "insertScopeContainer begin with prefix " << prefix << endl; + if (!ns.data()) { +// kdDebug() << "insertScopeContainer: ns is empty" << endl; + ns = m_model->create(); +// kdDebug() << "insertScopeContainer: ns created" << endl; + ns->setName( prefix ); +// kdDebug() << "insertScopeContainer: ns name set" << endl; + scope->addNamespace( ns ); +// kdDebug() << "insertScopeContainer: ns added to a scope" << endl; + + if (scope == m_model->globalNamespace()) + m_file->addNamespace( ns ); + } +// kdDebug() << "insertScopeContainer: while" << endl; + while ( ++it != scopes.end() ) { + QString nameSegment( *it ); + prefix += "." + nameSegment; +// kdDebug() << "insertScopeContainer: while prefix = " << prefix << endl; + NamespaceDom inner = scope->namespaceByName( prefix ); + if (!inner.data() ) { +// kdDebug() << "insertScopeContainer: inner is empty " << endl; + inner = m_model->create(); +// kdDebug() << "insertScopeContainer: inner created " << endl; + inner->setName( nameSegment ); + ns->addNamespace( inner ); +// kdDebug() << "insertScopeContainer: inner added " << endl; + } + ns = inner; + } + return ns; + } + NamespaceDom defineScope( RefAdaAST namenode ) { + QStringList scopes( qnamelist( namenode ) ); +// kdDebug() << "defineScope: " << scopes.join(" ") << endl; + NamespaceDom psc = insertScopeContainer( m_currentContainer, scopes ); +// kdDebug() << "defineScope psc created" << endl; + psc->setStartPosition(namenode->getLine(), namenode->getColumn()); +// kdDebug() << "defineScope start position set" << endl; + psc->setFileName(m_fileName); +// kdDebug() << "defineScope file name set" << endl; + // psc->setEndPosition (endLine, 0); +// kdDebug() << "defineScope return" << endl; + return psc; + } +} + +/* + * Only those rules that require specific action for the kdevelop + * class store are overloaded here. + */ + +compilation_unit + : { init(); } + context_items_opt ( library_item | subunit ) ( pragma )* + ; + + +with_clause + : #(WITH_CLAUSE ( compound_name + // TBD: slurp in the actual files + )+ ) + ; + +/* +compound_name + : IDENTIFIER + | #(DOT compound_name IDENTIFIER) + ; + */ + +use_clause + : #(USE_TYPE_CLAUSE ( subtype_mark )+ ) + | #(USE_CLAUSE ( c:compound_name + { m_imports.back ().push_back (qtext (#c)); } + )+ ) + ; + + +library_item : + #(LIBRARY_ITEM + #(MODIFIERS ( PRIVATE { m_currentAccess = CodeModelItem::Protected; } )? ) + ( lib_subprog_decl_or_rename_or_inst_or_body + | #(PACKAGE_BODY pb:def_id pkg_body_part) + | #(GENERIC_PACKAGE_INSTANTIATION gpi:def_id + { + defineScope( #gpi ); + } + generic_inst + ) + | #(PACKAGE_SPECIFICATION ps:def_id + { + NamespaceDom psc = defineScope( #ps ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + } + pkg_spec_part + { + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) { + kdDebug() << "adastore: m_scopeStack is empty!" << endl; + m_scopeStack.append( m_model->globalNamespace() ); + } + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setEndPosition (endLine, 0); + m_addToStore = false; + } + ) + | #(PACKAGE_RENAMING_DECLARATION prd:def_id + { + defineScope( #prd ); + } + renames + ) + | generic_decl + ) + ) + ; + + +subprog_def_id + : { m_isSubprogram = true; } + def_id + { m_isSubprogram = false; } + ; + +subprog_decl + : #(GENERIC_PROCEDURE_INSTANTIATION subprog_def_id generic_inst) + | #(PROCEDURE_RENAMING_DECLARATION subprog_def_id formal_part_opt renames) + | #(PROCEDURE_DECLARATION subprog_def_id formal_part_opt) + | #(PROCEDURE_BODY_STUB subprog_def_id formal_part_opt) + | #(ABSTRACT_PROCEDURE_DECLARATION subprog_def_id formal_part_opt) + | #(GENERIC_FUNCTION_INSTANTIATION def_designator generic_inst) + | #(FUNCTION_RENAMING_DECLARATION def_designator function_tail renames) + | #(FUNCTION_DECLARATION def_designator function_tail) + | #(FUNCTION_BODY_STUB def_designator function_tail) + | #(ABSTRACT_FUNCTION_DECLARATION subprog_def_id function_tail) + ; + + +def_id + : cn:compound_name + { +// kdDebug() << "cn:compound_name started " << endl; + if (m_addToStore) { +// kdDebug() << "cn:compound_name m_addToStore " << endl; + if (m_isSubprogram) { +// kdDebug() << "cn:compound_name m_isSubprogram " << endl; + FunctionDom method = m_model->create(); + method->setName (qtext (cn)); + method->setFileName(m_fileName); +// kdDebug() << "cn:compound_name method->setStartPosition(" << endl; + method->setStartPosition(#cn->getLine(), #cn->getColumn()); + + if (m_currentContainer == m_model->globalNamespace()) + m_file->addFunction(method); + else + m_currentContainer->addFunction(method); + //FIXME: adymo: is this valid for CodeModel +/* ParsedMethod *old = m_currentContainer->getMethod (method); + if (old) { + delete (method); + method = old; + } else { + m_currentContainer->addMethod (method); + }*/ + } else { + // TBC: what about other declarations? + } + } + } + ; + +/* +generic_inst : compound_name ( value_s )? + ; + */ + +/* +formal_part_opt : #(FORMAL_PART_OPT ( parameter_specification )* ) + ; + */ + +/* +parameter_specification + : #(PARAMETER_SPECIFICATION defining_identifier_list modifiers + subtype_mark init_opt) + ; + */ + +/* +defining_identifier_list : #(DEFINING_IDENTIFIER_LIST ( IDENTIFIER )+ ) + ; + */ + +/* +renames : CHARACTER_STRING // CHARACTER_STRING should not really be there. + | OPERATOR_SYMBOL // OPERATOR_SYMBOL should be used instead. + | name + ; + */ + +/* +name : IDENTIFIER + | #(DOT name + ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | OPERATOR_SYMBOL + ) + ) + | #(INDEXED_COMPONENT name value_s) + | #(TIC name attribute_id) + ; + */ + +def_designator + : cn:compound_name + { +// kdDebug() << "def_designator cn:compound_name started" << endl; + if (m_addToStore) { +// kdDebug() << "def_designator cn:compound_name m_addToStore" << endl; + FunctionDom method = m_model->create(); + method->setName (qtext (cn)); + method->setFileName(m_fileName); +// kdDebug() << "def_designator cn:compound_name method->setStartPosition(" << endl; + method->setStartPosition(#cn->getLine(), #cn->getColumn()); + + if (m_currentContainer == m_model->globalNamespace()) + m_file->addFunction(method); + else + m_currentContainer->addFunction(method); + //FIXME: adymo: is this valid for CodeModel +/* ParsedMethod *old = m_currentContainer->getMethod (method); + if (old) { + delete method; + method = old; + } else { + m_currentContainer->addMethod (method); + }*/ + } + } + | definable_operator_symbol + ; + +/* +function_tail : formal_part_opt subtype_mark + ; + */ + +spec_decl_part + : #(GENERIC_PACKAGE_INSTANTIATION def_id generic_inst) + | #(PACKAGE_SPECIFICATION ps:def_id + { + NamespaceDom psc = defineScope( #ps ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + } + pkg_spec_part + { + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) { + kdDebug() << "adastore: m_scopeStack is empty!" << endl; + m_scopeStack.append( m_model->globalNamespace() ); + } + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setDeclarationEndsOnLine (endLine); + m_addToStore = false; + } + ) + | #(PACKAGE_RENAMING_DECLARATION def_id renames) + ; + +pkg_spec_part : + basic_declarative_items_opt + private_declarative_items_opt + end_id_opt + ; + +private_declarative_items_opt + : ( { m_currentAccess = CodeModelItem::Protected; } + ( basic_decl_item | pragma )+ + { m_currentAccess = CodeModelItem::Public; } + )? + ; + +/* +task_type_or_single_decl + : #(TASK_TYPE_DECLARATION def_id discrim_part_opt task_definition_opt) + | #(SINGLE_TASK_DECLARATION def_id task_definition_opt) + ; + */ + +/* +discriminant_specification + : #(DISCRIMINANT_SPECIFICATION defining_identifier_list + modifiers subtype_mark init_opt) + ; + */ + +/* +entry_declaration + : #(ENTRY_DECLARATION IDENTIFIER + discrete_subtype_def_opt formal_part_opt) + ; + */ + +/* +prot_op_decl + : entry_declaration + | #(PROCEDURE_DECLARATION def_id formal_part_opt) + | #(FUNCTION_DECLARATION def_designator function_tail) + | rep_spec + | pragma + ; + */ + +/* +prot_member_decl_s + : #(PROT_MEMBER_DECLARATIONS ( prot_op_decl | comp_decl )* ) + ; + +comp_decl + : #(COMPONENT_DECLARATION defining_identifier_list component_subtype_def init_opt) + ; + */ + +/* +// decl_common is shared between declarative_item and basic_decl_item. +// decl_common only contains specifications. +decl_common + : // type_def: + #(ENUMERATION_TYPE_DECLARATION IDENTIFIER enum_id_s) + | #(SIGNED_INTEGER_TYPE_DECLARATION IDENTIFIER range) + | #(MODULAR_TYPE_DECLARATION IDENTIFIER expression) + | #(FLOATING_POINT_DECLARATION IDENTIFIER expression range_constraint_opt) + | #(ORDINARY_FIXED_POINT_DECLARATION IDENTIFIER expression range) + | #(DECIMAL_FIXED_POINT_DECLARATION IDENTIFIER expression expression range_constraint_opt) + | array_type_declaration + | access_type_declaration + // + | #(INCOMPLETE_TYPE_DECLARATION IDENTIFIER discrim_part_opt) + // derived_or_private_or_record + | #(PRIVATE_EXTENSION_DECLARATION id_and_discrim modifiers subtype_ind) + | #(DERIVED_RECORD_EXTENSION id_and_discrim modifiers subtype_ind record_definition) + | #(ORDINARY_DERIVED_TYPE_DECLARATION id_and_discrim subtype_ind) + | #(PRIVATE_TYPE_DECLARATION id_and_discrim modifiers) + | #(RECORD_TYPE_DECLARATION id_and_discrim modifiers record_definition) + // + | #(SUBTYPE_DECLARATION IDENTIFIER subtype_ind) + | generic_decl + | use_clause + | rep_spec // enumeration_representation_clause only + | #(EXCEPTION_RENAMING_DECLARATION def_id compound_name) + | #(OBJECT_RENAMING_DECLARATION def_id subtype_mark name) + | #(EXCEPTION_DECLARATION defining_identifier_list) + | #(NUMBER_DECLARATION defining_identifier_list expression) + | #(ARRAY_OBJECT_DECLARATION defining_identifier_list modifiers + array_type_definition init_opt) + | #(OBJECT_DECLARATION defining_identifier_list modifiers + subtype_ind init_opt) + ; + */ + +/* +id_and_discrim + : IDENTIFIER discrim_part_opt + ; + */ + +/* +enumeration_literal_specification : IDENTIFIER | CHARACTER_LITERAL + ; + */ + +/* +array_type_declaration + : #(ARRAY_TYPE_DECLARATION IDENTIFIER array_type_definition) + ; + */ + +/* +access_type_declaration + : #(ACCESS_TO_PROCEDURE_DECLARATION IDENTIFIER modifiers formal_part_opt) + | #(ACCESS_TO_FUNCTION_DECLARATION IDENTIFIER modifiers function_tail) + | #(ACCESS_TO_OBJECT_DECLARATION IDENTIFIER modifiers subtype_ind) + ; + */ + + +generic_decl + : #(GENERIC_PACKAGE_RENAMING generic_formal_part_opt def_id renames) + | #(GENERIC_PACKAGE_DECLARATION generic_formal_part_opt gpd:def_id + { + NamespaceDom psc = defineScope( #gpd ); + m_currentContainer = psc; + m_scopeStack.append( psc ); + m_addToStore = true; + } + pkg_spec_part + { + m_scopeStack.remove(m_scopeStack.last()); + if (m_scopeStack.count() == 0) + m_scopeStack.append( m_model->globalNamespace() ); + m_currentContainer = m_scopeStack.last(); + // m_currentContainer->setDeclarationEndsOnLine (endLine); + m_addToStore = false; + } + ) + | #(GENERIC_PROCEDURE_RENAMING generic_formal_part_opt def_id + formal_part_opt renames) + | #(GENERIC_PROCEDURE_DECLARATION generic_formal_part_opt subprog_def_id + formal_part_opt) + | #(GENERIC_FUNCTION_RENAMING generic_formal_part_opt def_designator + function_tail renames) + | #(GENERIC_FUNCTION_DECLARATION generic_formal_part_opt subprog_def_id + function_tail) + ; + +/* +generic_formal_part_opt + : #(GENERIC_FORMAL_PART + ( pragma | use_clause | generic_formal_parameter )* + ) + ; + */ + +/* +generic_formal_parameter + : // FORMAL_TYPE_DECLARATIONs: + #(FORMAL_DISCRETE_TYPE_DECLARATION def_id) + | #(FORMAL_SIGNED_INTEGER_TYPE_DECLARATION def_id) + | #(FORMAL_MODULAR_TYPE_DECLARATION def_id) + | #(FORMAL_DECIMAL_FIXED_POINT_DECLARATION def_id) + | #(FORMAL_ORDINARY_FIXED_POINT_DECLARATION def_id) + | #(FORMAL_FLOATING_POINT_DECLARATION def_id) + | formal_array_type_declaration + | formal_access_type_declaration + | #(FORMAL_PRIVATE_TYPE_DECLARATION id_part modifiers) + | #(FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION id_part subtype_ind) + | #(FORMAL_PRIVATE_EXTENSION_DECLARATION id_part modifiers subtype_ind) + | #(FORMAL_PROCEDURE_DECLARATION def_id formal_part_opt + subprogram_default_opt) + | #(FORMAL_FUNCTION_DECLARATION def_designator function_tail + subprogram_default_opt) + | #(FORMAL_PACKAGE_DECLARATION def_id compound_name formal_package_actual_part_opt) + | parameter_specification + ; + */ + +lib_subprog_decl_or_rename_or_inst_or_body + : { m_addToStore = true; } + ( subprog_decl + | procedure_body + | function_body + ) + { m_addToStore = false; } + ; + +subprog_decl_or_rename_or_inst_or_body + : subprog_decl + | procedure_body + | function_body + ; + + +/* +// A declarative_item may appear in the declarative part of any body. +declarative_item + : #(PACKAGE_BODY_STUB def_id) + | #(PACKAGE_BODY def_id pkg_body_part) + | spec_decl_part + | #(TASK_BODY_STUB def_id) + | #(TASK_BODY def_id body_part) + | task_type_or_single_decl + | #(PROTECTED_BODY_STUB def_id) + | #(PROTECTED_BODY def_id prot_op_bodies_opt) + | prot_type_or_single_decl + | subprog_decl_or_rename_or_inst_or_body + | decl_common + ; + */ + + +subprog_decl_or_body + : procedure_body + | #(PROCEDURE_DECLARATION subprog_def_id formal_part_opt) + | function_body + | #(FUNCTION_DECLARATION def_designator function_tail) + ; + +/* +// Temporary, to be turned into just `qualified'. +// We get away with it because `qualified' is always mentioned +// together with `name'. +// Only exception: `code_stmt', which is not yet implemented. +name_or_qualified + : IDENTIFIER + | #(DOT name_or_qualified + ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | OPERATOR_SYMBOL + ) + ) + | #(INDEXED_COMPONENT name_or_qualified value_s) + | #(TIC name_or_qualified + ( parenthesized_primary + | attribute_id + ) + ) + ; + */ + +package_body + : #(PACKAGE_BODY id:def_id + /* TBD + { QString name (qtext (id)); + } + */ + pkg_body_part) + ; + +/* +task_body : #(TASK_BODY def_id body_part) + ; + */ + +/* +protected_body : #(PROTECTED_BODY def_id prot_op_bodies_opt) + ; + */ + diff --git a/languages/ada/ada.tree.g b/languages/ada/ada.tree.g new file mode 100644 index 00000000..df167dcd --- /dev/null +++ b/languages/ada/ada.tree.g @@ -0,0 +1,964 @@ +/* + * ANTLR Ada95 tree super grammar (base class) + * + * Oliver M. Kellogg + * + * $Id$ + * + */ + + +options { + language="Cpp"; +} + +class AdaTreeParserSuper extends TreeParser; +options { + importVocab=Ada; +} + +// Compilation Unit: This is the start rule. + +compilation_unit + : context_items_opt ( library_item | subunit ) ( pragma )* + ; + +pragma : #(PRAGMA IDENTIFIER ( pragma_arg )* ) + ; + +pragma_arg + : #(RIGHT_SHAFT IDENTIFIER expression) + | expression + ; + +context_items_opt + : #(CONTEXT_CLAUSE ( pragma | with_clause | use_clause )* ) + ; + +with_clause + : #(WITH_CLAUSE ( compound_name )+ ) + ; + +compound_name + : IDENTIFIER + | #(DOT compound_name IDENTIFIER) + ; + +use_clause + : #(USE_TYPE_CLAUSE ( subtype_mark )+ ) + | #(USE_CLAUSE ( compound_name )+ ) + ; + +subtype_mark + : compound_name + | #(TIC compound_name attribute_id) + ; + +attribute_id : RANGE + | DIGITS + | DELTA + | ACCESS + | IDENTIFIER + ; + +library_item : + #(LIBRARY_ITEM modifiers + ( subprog_decl_or_rename_or_inst_or_body + | #(PACKAGE_BODY def_id pkg_body_part) + | #(GENERIC_PACKAGE_INSTANTIATION def_id generic_inst) + | #(PACKAGE_SPECIFICATION def_id pkg_spec_part) + | #(PACKAGE_RENAMING_DECLARATION def_id renames) + | generic_decl + ) + ) + ; + +modifiers : #(MODIFIERS + ( ABSTRACT + | ACCESS + | ALIASED + | ALL + | CONSTANT + | IN + | LIMITED + | OUT + | PRIVATE + | PROTECTED + | REVERSE + | TAGGED + )* + // We can afford to be this loose because the parser + // has already fended off illegal usages, i.e. we can + // be sure that we are only dealing with permissible + // values for each usage context here. + // Only exception: PRIVATE as the prefix of private + // {generic|package|subprogram} library-level decl. + // The parser has let this in for bodies as well + // (which is not legal), so we need a semantic check. + ) + ; + +id_opt : #(ID_OPT ( def_designator )? ) + ; + +end_id_opt : #(END ( def_designator )? ) + ; + +subprog_decl + : #(GENERIC_PROCEDURE_INSTANTIATION def_id generic_inst) + | #(PROCEDURE_RENAMING_DECLARATION def_id formal_part_opt renames) + | #(PROCEDURE_DECLARATION def_id formal_part_opt) + | #(PROCEDURE_BODY_STUB def_id formal_part_opt) + | #(ABSTRACT_PROCEDURE_DECLARATION def_id formal_part_opt) + | #(GENERIC_FUNCTION_INSTANTIATION def_designator generic_inst) + | #(FUNCTION_RENAMING_DECLARATION def_designator function_tail renames) + | #(FUNCTION_DECLARATION def_designator function_tail) + | #(FUNCTION_BODY_STUB def_designator function_tail) + | #(ABSTRACT_FUNCTION_DECLARATION def_id function_tail) + ; + +def_id : compound_name // Can afford looseness because parser is tight. + ; + +generic_inst : compound_name ( value_s )? + ; + +value : #(OTHERS expression) + | #(RIGHT_SHAFT ranged_expr_s expression) + | ranged_expr_s + ; + +ranged_expr_s + : #(PIPE ranged_expr_s ranged_expr) + | ranged_expr + ; + +ranged_expr + : #(DOT_DOT expression simple_expression) + | #(RANGE expression range) + | expression + ; + +range_constraint : #(RANGE_CONSTRAINT range) + ; + +range : ( range_dots + | range_attrib_ref + ) + ; + +range_dots : #(DOT_DOT simple_expression simple_expression) + ; + +range_attrib_ref : #(RANGE_ATTRIBUTE_REFERENCE prefix ( expression )? ) + ; + +prefix : IDENTIFIER + | #(DOT prefix ( ALL | IDENTIFIER ) ) + | #(INDEXED_COMPONENT prefix value_s ) + ; + +formal_part_opt : #(FORMAL_PART_OPT ( parameter_specification )* ) + ; + +parameter_specification + : #(PARAMETER_SPECIFICATION defining_identifier_list modifiers + subtype_mark init_opt) + ; + +defining_identifier_list : #(DEFINING_IDENTIFIER_LIST ( IDENTIFIER )+ ) + ; + +renames : CHARACTER_STRING // CHARACTER_STRING should not really be there. + | OPERATOR_SYMBOL // OPERATOR_SYMBOL should be used instead. + | name + ; + +name : IDENTIFIER + | #(DOT name + ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | OPERATOR_SYMBOL + ) + ) + | #(INDEXED_COMPONENT name value_s) + | #(TIC name attribute_id) + ; + +definable_operator_symbol : OPERATOR_SYMBOL + ; + +parenthesized_primary + : #(PARENTHESIZED_PRIMARY ( NuLL | value_s extension_opt ) ) + ; + +extension_opt : #(EXTENSION_OPT ( NuLL | value_s )? ) + ; + +def_designator + : compound_name + | definable_operator_symbol + ; + +function_tail : formal_part_opt subtype_mark + ; + +spec_decl_part + : #(GENERIC_PACKAGE_INSTANTIATION def_id generic_inst) + | #(PACKAGE_SPECIFICATION def_id pkg_spec_part) + | #(PACKAGE_RENAMING_DECLARATION def_id renames) + ; + +pkg_spec_part + : basic_declarative_items_opt + private_declarative_items_opt + end_id_opt + ; + +basic_declarative_items_opt + : #(BASIC_DECLARATIVE_ITEMS_OPT ( basic_decl_item )* ) + ; + +private_declarative_items_opt + : #(PRIVATE_DECLARATIVE_ITEMS_OPT ( basic_decl_item )* ) + ; + +basic_decl_item + : spec_decl_part + | task_type_or_single_decl + | prot_type_or_single_decl + | subprog_decl + | decl_common + ; + +task_type_or_single_decl + : #(TASK_TYPE_DECLARATION def_id discrim_part_opt task_definition_opt) + | #(SINGLE_TASK_DECLARATION def_id task_definition_opt) + ; + +task_definition_opt + : task_items_opt private_task_items_opt + ; + +discrim_part_opt + : #(DISCRIM_PART_OPT ( BOX | discriminant_specifications )? ) + ; + +discriminant_specifications + : #(DISCRIMINANT_SPECIFICATIONS ( discriminant_specification )* ) + ; + +discriminant_specification + : #(DISCRIMINANT_SPECIFICATION defining_identifier_list + modifiers subtype_mark init_opt) + ; + +init_opt : #(INIT_OPT ( expression )? ) + ; // `expression' is of course much too loose; + // semantic checks are required in the usage contexts. + +task_items_opt + : #(TASK_ITEMS_OPT entrydecls_repspecs_opt) + ; + +entrydecls_repspecs_opt + : ( entry_declaration | pragma | rep_spec )* + ; + +entry_declaration + : #(ENTRY_DECLARATION IDENTIFIER + discrete_subtype_def_opt formal_part_opt) + ; + +discrete_subtype_def_opt + : #(DISCRETE_SUBTYPE_DEF_OPT ( discrete_subtype_definition )? ) + ; + +discrete_subtype_definition // TBD + : range + | subtype_ind + ; + +rep_spec : #(RECORD_REPRESENTATION_CLAUSE subtype_mark align_opt comp_loc_s) + | #(AT_CLAUSE subtype_mark expression) + | #(ATTRIBUTE_DEFINITION_CLAUSE subtype_mark expression) + // attrib_def. Semantic check must ensure that the + // subtype_mark contains an attribute reference. + | #(ENUMERATION_REPESENTATION_CLAUSE local_enum_name enumeration_aggregate) + ; + +align_opt : #(MOD_CLAUSE_OPT ( expression )? ) + ; + +comp_loc_s + : #(COMPONENT_CLAUSES_OPT + ( pragma + | subtype_mark expression range + )* + ) + ; + +private_task_items_opt + : #(PRIVATE_TASK_ITEMS_OPT entrydecls_repspecs_opt ) + ; + +prot_type_or_single_decl + : #(PROTECTED_TYPE_DECLARATION def_id discrim_part_opt protected_definition) + | #(SINGLE_PROTECTED_DECLARATION def_id protected_definition) + ; + +prot_private_opt : #(PROT_PRIVATE_OPT ( prot_member_decl_s )? ) + ; + +protected_definition + : prot_op_decl_s prot_private_opt end_id_opt + ; + +prot_op_decl_s + : #(PROT_OP_DECLARATIONS ( prot_op_decl )* ) + ; + +prot_op_decl + : entry_declaration + | #(PROCEDURE_DECLARATION def_id formal_part_opt) + | #(FUNCTION_DECLARATION def_designator function_tail) + | rep_spec + | pragma + ; + +prot_member_decl_s + : #(PROT_MEMBER_DECLARATIONS ( prot_op_decl | comp_decl )* ) + ; + +comp_decl + : #(COMPONENT_DECLARATION defining_identifier_list component_subtype_def init_opt) + ; + +// decl_common is shared between declarative_item and basic_decl_item. +// decl_common only contains specifications. +decl_common + : // type_def: + #(ENUMERATION_TYPE_DECLARATION IDENTIFIER enum_id_s) + | #(SIGNED_INTEGER_TYPE_DECLARATION IDENTIFIER range) + | #(MODULAR_TYPE_DECLARATION IDENTIFIER expression) + | #(FLOATING_POINT_DECLARATION IDENTIFIER expression range_constraint_opt) + | #(ORDINARY_FIXED_POINT_DECLARATION IDENTIFIER expression range) + | #(DECIMAL_FIXED_POINT_DECLARATION IDENTIFIER expression expression range_constraint_opt) + | array_type_declaration + | access_type_declaration + // + | #(INCOMPLETE_TYPE_DECLARATION IDENTIFIER discrim_part_opt) + // derived_or_private_or_record + | #(PRIVATE_EXTENSION_DECLARATION id_and_discrim modifiers subtype_ind) + | #(DERIVED_RECORD_EXTENSION id_and_discrim modifiers subtype_ind record_definition) + | #(ORDINARY_DERIVED_TYPE_DECLARATION id_and_discrim subtype_ind) + | #(PRIVATE_TYPE_DECLARATION id_and_discrim modifiers) + | #(RECORD_TYPE_DECLARATION id_and_discrim modifiers record_definition) + // + | #(SUBTYPE_DECLARATION IDENTIFIER subtype_ind) + | generic_decl + | use_clause + | rep_spec // enumeration_representation_clause only + | #(EXCEPTION_RENAMING_DECLARATION def_id compound_name) + | #(OBJECT_RENAMING_DECLARATION def_id subtype_mark name) + | #(EXCEPTION_DECLARATION defining_identifier_list) + | #(NUMBER_DECLARATION defining_identifier_list expression) + | #(ARRAY_OBJECT_DECLARATION defining_identifier_list modifiers + array_type_definition init_opt) + | #(OBJECT_DECLARATION defining_identifier_list modifiers + subtype_ind init_opt) + ; + +id_and_discrim + : IDENTIFIER discrim_part_opt + ; + +enum_id_s : ( enumeration_literal_specification )+ + ; + +enumeration_literal_specification : IDENTIFIER | CHARACTER_LITERAL + ; + +array_type_definition + : index_or_discrete_range_s component_subtype_def + ; + +range_constraint_opt : ( range_constraint )? + ; + +array_type_declaration + : #(ARRAY_TYPE_DECLARATION IDENTIFIER array_type_definition) + ; + +index_or_discrete_range_s + : index_or_discrete_range + | #(COMMA index_or_discrete_range_s index_or_discrete_range) + ; + +index_or_discrete_range + : #(DOT_DOT simple_expression simple_expression) + | #(RANGE simple_expression ( BOX | range) ) + | simple_expression + ; + +component_subtype_def : modifiers subtype_ind // mod=aliased_opt + ; + +subtype_ind + : #(SUBTYPE_INDICATION subtype_mark constraint_opt) + ; + +constraint_opt + : ( range_constraint + | digits_constraint + | delta_constraint + | index_constraint + | discriminant_constraint + )? + ; + +digits_constraint + : #(DIGITS_CONSTRAINT expression range_constraint_opt) + ; + +delta_constraint + : #(DELTA_CONSTRAINT expression range_constraint_opt) + ; + +index_constraint + : #(INDEX_CONSTRAINT ( discrete_range )+ ) + ; + +discrete_range + : range + | subtype_ind + ; + +discriminant_constraint + : #(DISCRIMINANT_CONSTRAINT ( discriminant_association )+ ) + ; + +discriminant_association + : #(DISCRIMINANT_ASSOCIATION selector_names_opt expression) + ; + +selector_names_opt + : #(SELECTOR_NAMES_OPT ( selector_name )* ) + ; + +selector_name : IDENTIFIER // TBD: sem pred + ; + +access_type_declaration + : #(ACCESS_TO_PROCEDURE_DECLARATION IDENTIFIER modifiers formal_part_opt) + | #(ACCESS_TO_FUNCTION_DECLARATION IDENTIFIER modifiers function_tail) + | #(ACCESS_TO_OBJECT_DECLARATION IDENTIFIER modifiers subtype_ind) + ; + +record_definition : ( component_list )? + ; + +component_list + : component_items ( variant_part )? + ; + +component_items + : #(COMPONENT_ITEMS ( pragma | comp_decl )* ) + ; + +variant_part + : #(VARIANT_PART discriminant_direct_name variant_s) + ; + +discriminant_direct_name : IDENTIFIER // TBD: symtab lookup. + ; + +variant_s : #(VARIANTS ( variant )+ ) + ; + +variant : #(VARIANT choice_s ( component_list )? ) + ; + +choice_s : #(PIPE choice_s choice ) + | choice + ; + +choice : OTHERS + | discrete_with_range + | expression + ; + +discrete_with_range : mark_with_constraint | range + ; + +mark_with_constraint + : #(MARK_WITH_CONSTRAINT subtype_mark range_constraint) + ; + +local_enum_name : IDENTIFIER // to be refined: do a symbol table lookup + ; + +enumeration_aggregate : ( value )* + ; + +generic_decl + : #(GENERIC_PACKAGE_RENAMING generic_formal_part_opt def_id renames) + | #(GENERIC_PACKAGE_DECLARATION generic_formal_part_opt def_id + pkg_spec_part) + | #(GENERIC_PROCEDURE_RENAMING generic_formal_part_opt def_id + formal_part_opt renames) + | #(GENERIC_PROCEDURE_DECLARATION generic_formal_part_opt def_id + formal_part_opt) + | #(GENERIC_FUNCTION_RENAMING generic_formal_part_opt def_designator + function_tail renames) + | #(GENERIC_FUNCTION_DECLARATION generic_formal_part_opt def_id + function_tail) + ; + +generic_formal_part_opt + : #(GENERIC_FORMAL_PART + ( pragma | use_clause | generic_formal_parameter )* + ) + ; + +generic_formal_parameter + : // FORMAL_TYPE_DECLARATIONs: + #(FORMAL_DISCRETE_TYPE_DECLARATION def_id) + | #(FORMAL_SIGNED_INTEGER_TYPE_DECLARATION def_id) + | #(FORMAL_MODULAR_TYPE_DECLARATION def_id) + | #(FORMAL_DECIMAL_FIXED_POINT_DECLARATION def_id) + | #(FORMAL_ORDINARY_FIXED_POINT_DECLARATION def_id) + | #(FORMAL_FLOATING_POINT_DECLARATION def_id) + | formal_array_type_declaration + | formal_access_type_declaration + | #(FORMAL_PRIVATE_TYPE_DECLARATION id_part modifiers) + | #(FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION id_part subtype_ind) + | #(FORMAL_PRIVATE_EXTENSION_DECLARATION id_part modifiers subtype_ind) + | #(FORMAL_PROCEDURE_DECLARATION def_id formal_part_opt + subprogram_default_opt) + | #(FORMAL_FUNCTION_DECLARATION def_designator function_tail + subprogram_default_opt) + | #(FORMAL_PACKAGE_DECLARATION def_id compound_name formal_package_actual_part_opt) + | parameter_specification + ; + + +id_part : def_id discrim_part_opt + ; + +formal_array_type_declaration : array_type_declaration + ; + +formal_access_type_declaration : access_type_declaration + ; + +subprogram_default_opt : ( BOX | name )? + // #(SUBPROGRAM_DEFAULT_OPT ( BOX | name )? ) + ; + +formal_package_actual_part_opt + : ( BOX | defining_identifier_list )? + ; + +subprog_decl_or_rename_or_inst_or_body + : subprog_decl + | procedure_body + | function_body + ; + +procedure_body + : #(PROCEDURE_BODY def_id formal_part_opt body_part) + ; + +function_body + : #(FUNCTION_BODY def_designator function_tail body_part) + ; + +body_part : declarative_part block_body end_id_opt + ; + +declarative_part + : #(DECLARATIVE_PART ( pragma | declarative_item )* ) + ; + +// A declarative_item may appear in the declarative part of any body. +declarative_item + : #(PACKAGE_BODY_STUB def_id) + | #(PACKAGE_BODY def_id pkg_body_part) + | spec_decl_part + | #(TASK_BODY_STUB def_id) + | #(TASK_BODY def_id body_part end_id_opt) + | task_type_or_single_decl + | #(PROTECTED_BODY_STUB def_id) + | #(PROTECTED_BODY def_id prot_op_bodies_opt end_id_opt) + | prot_type_or_single_decl + | subprog_decl_or_rename_or_inst_or_body + | decl_common + ; + +pkg_body_part : declarative_part block_body_opt end_id_opt + ; + +block_body_opt + : #(BLOCK_BODY_OPT ( handled_stmt_s )? ) + ; + +prot_op_bodies_opt + : #(PROT_OP_BODIES_OPT + ( pragma | entry_body | subprog_decl_or_body )* + ) + ; + +subprog_decl_or_body + : procedure_body + | #(PROCEDURE_DECLARATION def_id formal_part_opt) + | function_body + | #(FUNCTION_DECLARATION def_designator function_tail) + ; + +block_body : #(BLOCK_BODY handled_stmt_s) + ; + +handled_stmt_s + : #(HANDLED_SEQUENCE_OF_STATEMENTS statements except_handler_part_opt) + ; + +handled_stmts_opt + : #(HANDLED_STMTS_OPT ( statements except_handler_part_opt )? ) + ; + +statements + : #(SEQUENCE_OF_STATEMENTS ( pragma | statement )+ ) + ; + +statement : #(STATEMENT def_label_opt + ( null_stmt + | exit_stmt + | return_stmt + | goto_stmt + | delay_stmt + | abort_stmt + | raise_stmt + | requeue_stmt + | accept_stmt + | select_stmt + | if_stmt + | case_stmt + | loop_stmt id_opt + | block end_id_opt + | call_or_assignment + // | code_stmt // not yet implemented in parser + ) + ) + ; + +def_label_opt : #(LABEL_OPT ( IDENTIFIER )? ) + ; + +null_stmt : NULL_STATEMENT + ; + +if_stmt : #(IF_STATEMENT cond_clause elsifs_opt else_opt) + ; + +cond_clause : #(COND_CLAUSE condition statements) + ; + +condition : expression + ; + +elsifs_opt : #(ELSIFS_OPT ( cond_clause )* ) + ; + +else_opt : #(ELSE_OPT ( statements )? ) + ; + +case_stmt : #(CASE_STATEMENT expression alternative_s) + ; + +alternative_s : ( case_statement_alternative )+ + ; + +case_statement_alternative + : #(CASE_STATEMENT_ALTERNATIVE choice_s statements) + ; + +loop_stmt + : #(LOOP_STATEMENT iteration_scheme_opt statements) + ; + +iteration_scheme_opt + : #(ITERATION_SCHEME_OPT + ( #(WHILE condition) + | #(FOR IDENTIFIER modifiers discrete_subtype_definition) + )? // mod=reverse_opt + ) + ; + +block : #(BLOCK_STATEMENT declare_opt block_body) + ; + +declare_opt + : #(DECLARE_OPT ( declarative_part )? ) + ; + +exit_stmt + : #(EXIT_STATEMENT ( label_name )? ( WHEN condition )? ) // TBD !!! + ; + +label_name : IDENTIFIER + ; + +return_stmt + : #(RETURN_STATEMENT ( expression )? ) + ; + +goto_stmt : #(GOTO_STATEMENT label_name) + ; + +call_or_assignment + : #(ASSIGNMENT_STATEMENT name expression) + | #(CALL_STATEMENT name) + ; + +entry_body + : #(ENTRY_BODY def_id entry_body_formal_part entry_barrier body_part) + ; + +entry_body_formal_part : entry_index_spec_opt formal_part_opt + ; + +entry_index_spec_opt + : #(ENTRY_INDEX_SPECIFICATION ( def_id discrete_subtype_definition )? ) + ; + +entry_barrier : condition + ; + +entry_call_stmt + : #(ENTRY_CALL_STATEMENT name) + ; + +accept_stmt + : #(ACCEPT_STATEMENT def_id entry_index_opt formal_part_opt + handled_stmts_opt end_id_opt ) + ; + +entry_index_opt + : #(ENTRY_INDEX_OPT ( expression )? ) + ; + +delay_stmt + : #(DELAY_STATEMENT modifiers expression) //mod=until_opt + ; + +// SELECT_STATEMENT itself is not modeled since it is trivially +// reconstructed: +// select_statement ::= selective_accept | timed_entry_call +// | conditional_entry_call | asynchronous_select +// +select_stmt + : #(ASYNCHRONOUS_SELECT triggering_alternative abortable_part) + | #(SELECTIVE_ACCEPT selective_accept) + | #(TIMED_ENTRY_CALL entry_call_alternative delay_alternative) + | #(CONDITIONAL_ENTRY_CALL entry_call_alternative statements) + ; + +triggering_alternative + : #(TRIGGERING_ALTERNATIVE + ( delay_stmt | entry_call_stmt ) stmts_opt + ) + ; + +abortable_part + : #(ABORTABLE_PART stmts_opt) + ; + +entry_call_alternative + : #(ENTRY_CALL_ALTERNATIVE entry_call_stmt stmts_opt) + ; + +selective_accept : guard_opt select_alternative or_select_opt else_opt + ; + +guard_opt : #(GUARD_OPT ( condition ( pragma )* )? ) + ; + +select_alternative + : accept_alternative + | delay_alternative + | TERMINATE_ALTERNATIVE + ; + +accept_alternative + : #(ACCEPT_ALTERNATIVE accept_stmt stmts_opt) + ; + +delay_alternative + : #(DELAY_ALTERNATIVE delay_stmt stmts_opt) + ; + +stmts_opt : ( pragma | statement )* + ; + +or_select_opt + : #(OR_SELECT_OPT ( guard_opt select_alternative )* ) + ; + +abort_stmt + : #(ABORT_STATEMENT ( name )+ ) + ; + +except_handler_part_opt + : #(EXCEPT_HANDLER_PART_OPT ( exception_handler )* ) + ; + +exception_handler + : #(EXCEPTION_HANDLER identifier_colon_opt except_choice_s + statements + ) + ; + +identifier_colon_opt + : #(IDENTIFIER_COLON_OPT ( IDENTIFIER )? ) + ; + +except_choice_s + : #(PIPE except_choice_s exception_choice) + | exception_choice + ; + +exception_choice : compound_name + | OTHERS + ; + +raise_stmt + : #(RAISE_STATEMENT ( compound_name )? ) + ; + +requeue_stmt + : #(REQUEUE_STATEMENT name ( ABORT )? ) + ; + +operator_call : #(OPERATOR_SYMBOL value_s) + ; + +value_s : #(VALUES ( value )+ ) + ; + +expression + : #(AND expression relation) + | #(AND_THEN expression relation) + | #(OR expression relation) + | #(OR_ELSE expression relation) + | #(XOR expression relation) + | relation + ; + +relation + : #(IN simple_expression range_or_mark) + | #(NOT_IN simple_expression range_or_mark) + | #(EQ simple_expression simple_expression) + | #(NE simple_expression simple_expression) + | #(LT_ simple_expression simple_expression) + | #(LE simple_expression simple_expression) + | #(GT simple_expression simple_expression) + | #(GE simple_expression simple_expression) + | simple_expression + ; + +range_or_mark + : range + | subtype_mark + ; + +simple_expression + : #(PLUS simple_expression signed_term) + | #(MINUS simple_expression signed_term) + | #(CONCAT simple_expression signed_term) + | signed_term + ; + +signed_term + : #(UNARY_PLUS term) + | #(UNARY_MINUS term) + | term + ; + +term : #(STAR term factor) + | #(DIV term factor) + | #(MOD term factor) + | #(REM term factor) + | factor + ; + +factor : #(NOT primary) + | #(ABS primary) + | #(EXPON primary primary) + | primary + ; + +primary : + ( name_or_qualified + | parenthesized_primary + | allocator + | NuLL + | NUMERIC_LIT + | CHARACTER_LITERAL + | CHAR_STRING + | operator_call + ) + ; + +// Temporary, to be turned into just `qualified'. +// We get away with it because `qualified' is always mentioned +// together with `name'. +// Only exception: `code_stmt', which is not yet implemented. +name_or_qualified + : IDENTIFIER + | #(DOT name_or_qualified + ( ALL + | IDENTIFIER + | CHARACTER_LITERAL + | OPERATOR_SYMBOL + ) + ) + | #(INDEXED_COMPONENT name_or_qualified value_s) + | #(TIC name_or_qualified + ( parenthesized_primary + | attribute_id + ) + ) + ; + +allocator : #(ALLOCATOR name_or_qualified) + ; + +subunit : #(SUBUNIT compound_name + ( subprogram_body + | package_body + | task_body + | protected_body + ) + ) + ; + +subprogram_body + : procedure_body + | function_body + ; + +package_body : #(PACKAGE_BODY def_id pkg_body_part) + ; + +task_body : #(TASK_BODY def_id body_part) + ; + +protected_body : #(PROTECTED_BODY def_id prot_op_bodies_opt) + ; + +// TBD +// code_stmt : #(CODE_STATEMENT qualified) +// ; + diff --git a/languages/ada/ada_utils.cpp b/languages/ada/ada_utils.cpp new file mode 100644 index 00000000..9630f058 --- /dev/null +++ b/languages/ada/ada_utils.cpp @@ -0,0 +1,69 @@ +/* + */ +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "ada_utils.hpp" +#include "adasupport.hpp" + +QString qtext (const RefAdaAST& n) +{ + return QString::fromLatin1 (text (n).c_str ()); +} + +QStringList qnamelist (const RefAdaAST& n) +{ + QString txt = qtext (n); + // kdDebug() << "qnamelist: input is " << txt << endl; + return QStringList::split ('.', txt); +} + +QString ada_spec_filename (const QString& comp_unit_name) +{ + QString fn (comp_unit_name.lower ()); + + fn.replace (QRegExp("."), "-"); + fn += ".ads"; + return fn; +} + +QString fq_specfilename (const QString& comp_unit_name) +{ + QString fname = ada_spec_filename (comp_unit_name); + + if (QFile::exists (fname)) + return fname; + + QString adaincpath = getenv ("ADA_INCLUDE_PATH"); + if (adaincpath.isNull ()) + return QString::null; + + QStringList dirs = QStringList::split (':', adaincpath); + QString fq_filename; + for (QStringList::Iterator it = dirs.begin (); it != dirs.end (); it++) { + fq_filename = *it; + if (! fq_filename.endsWith ("/")) + fq_filename += "/"; + fq_filename += fname; + if (QFile::exists (fq_filename)) + return fq_filename; + } + if (fname.startsWith ("ada-") || + fname.startsWith ("text_io") || + fname.startsWith ("system") || + fname.startsWith ("unchecked_")) { + kdDebug () << "resolution of Ada predefined library is TBD" << endl; + } else { + kdDebug () << "Cannot find file " << fname << endl; + } + return QString::null; +} + diff --git a/languages/ada/ada_utils.hpp b/languages/ada/ada_utils.hpp new file mode 100644 index 00000000..b1df43dd --- /dev/null +++ b/languages/ada/ada_utils.hpp @@ -0,0 +1,15 @@ +/* + */ +#ifndef ADA_UTILS_H +#define ADA_UTILS_H + +#include +#include "AdaAST.hpp" + +QString qtext (const RefAdaAST& n); +QStringList qnamelist (const RefAdaAST& n); +QString ada_spec_filename (const QString& comp_unit_name); +QString fq_specfilename (const QString& comp_unit_name); + +#endif + diff --git a/languages/ada/adasupport.cpp b/languages/ada/adasupport.cpp new file mode 100644 index 00000000..6b877b7b --- /dev/null +++ b/languages/ada/adasupport.cpp @@ -0,0 +1,168 @@ +#include +#include +#include +#include +#include +#include +#include +#include "AdaParser.hpp" +#include "AdaTokenTypes.hpp" +#include "adasupport.hpp" + +#define eq !strcmp + +using namespace std; + +const RefAdaAST AdaAST::nullAdaAST(antlr::nullAST.get() ); + +using namespace std; + +string text (const RefAdaAST& n) +{ + if (n == 0 || n == AdaAST::nullAdaAST) + return ""; + string retval; + int type = n->getType(); + if (type == AdaTokenTypes::DOT) { + const RefAdaAST& sibs = n->down (); + retval = text (sibs); + retval.append ("."); + retval.append (text (sibs->right())); + } else { + retval = n->getText(); + } + /* + const RefAdaAST& r = n->right(); + if (r != 0 && r->getType () == AdaTokenTypes::DOT) { + retval.append ("."); + retval.append (text (r->right())); + } + */ + return retval; +} + +int txteq (RefAdaAST n1, RefAdaAST n2) +{ + if (!n1 || !n2 || n1 == antlr::nullAST || n2 == antlr::nullAST) + return 0; + const char* s1 = n1->getText().c_str(); + const char* s2 = n2->getText().c_str(); + if (strcasecmp (s1, s2) != 0) + return 0; + n1 = n1->right (); + n2 = n2->right (); + if (!n1 || !n2 || n1 == antlr::nullAST || n2 == antlr::nullAST) + return 1; + if (n1->getType () == AdaTokenTypes::DOT) + if (n2->getType () == AdaTokenTypes::DOT) + return txteq (n1->right (), n2->right ()); + else + return 0; + else if (n2->getType () == AdaTokenTypes::DOT) + return 0; + return 1; +} + +std::stack defid_stack; + +void AdaParser::push_def_id (const RefAdaAST& defid) +{ +#ifdef __DEBUG__ + string txt (text (defid)); + printf ("push_def_id: pushing %s\n", txt.c_str()); +#endif + defid_stack.push (defid); +} + +const RefAdaAST& AdaParser::pop_def_id () +{ + if (defid_stack.size() == 0) { + fprintf (stderr, "pop_def_id() called on empty stack\n"); + // return static_cast(antlr::nullAST); + return AdaAST::nullAdaAST; + } + RefAdaAST& top = defid_stack.top (); +#ifdef __DEBUG__ + string txt (text (top)); + printf ("pop_def_id: popping %s\n", txt.c_str()); +#endif + defid_stack.pop (); + return top; +} + +bool AdaParser::end_id_matches_def_id (const RefAdaAST& endid) +{ + if (defid_stack.size() == 0) + return false; + RefAdaAST& top = defid_stack.top (); + string defid (text (top)); + defid_stack.pop(); + if (endid == 0 || endid == antlr::nullAST) + return false; + string txt (text (endid)); + if (strcasecmp (defid.c_str (), txt.c_str ()) != 0) { + string errtxt ("End id "); + errtxt.append (txt); + errtxt.append (" does not match "); + errtxt.append (defid); + reportError (errtxt); + return false; + } +#ifdef __DEBUG__ + printf ("end_id_matches_def_id: popped %s\n", txt.c_str()); +#endif + return true; +} + +char * strtolower (char *string) +{ + char *p = string; + if (!p) + return NULL; + while (*p) + { + if (isupper (*p)) + *p = tolower (*p); + p++; + } + return string; +} + +char * extracted_operator (const char *string) +{ + int len = strlen (string); + static char op[10]; + + if (len < 4 && len > 5 || *string != '"' || *(string + len - 1) != '"') + return NULL; + + strcpy (op, string + 1); + op[len - 2] = '\0'; /* discard ending quotation mark */ + strtolower (op); + return op; +} + +bool AdaParser::definable_operator (const char *string) +{ // operator_symbol sans "/=" + char *op = extracted_operator (string); + if (op == NULL) + return false; + return + (eq (op, "=") || + eq (op, "<") || eq (op, ">") || + eq (op, "<=") || eq (op, ">=") || + eq (op, "&") || eq (op, "**") || + eq (op, "*") || eq (op, "/") || eq (op, "+") || eq (op, "-") || + eq (op, "abs") || eq (op, "rem") || eq (op, "mod") || + eq (op, "and") || eq (op, "or") || eq (op, "xor") || eq (op, "not")); +} + +bool AdaParser::is_operator_symbol (const char *string) +{ + char *op; + if (definable_operator (string)) + return true; + op = extracted_operator (string); + return (eq (op, "/=")); +} + diff --git a/languages/ada/adasupport.hpp b/languages/ada/adasupport.hpp new file mode 100644 index 00000000..9d65e0e5 --- /dev/null +++ b/languages/ada/adasupport.hpp @@ -0,0 +1,13 @@ +/* + */ +#ifndef ADASUPPORT_H +#define ADASUPPORT_H + +#include +#include "AdaAST.hpp" + +std::string text (const RefAdaAST& n); +int txteq (RefAdaAST n1, RefAdaAST n2); + +#endif + diff --git a/languages/ada/adasupportpart.cpp b/languages/ada/adasupportpart.cpp new file mode 100644 index 00000000..39ead02a --- /dev/null +++ b/languages/ada/adasupportpart.cpp @@ -0,0 +1,376 @@ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "kdevgenericfactory.h" +#include "kdevcore.h" +#include "kdevproject.h" +#include "kdevmainwindow.h" +#include "kdevpartcontroller.h" +#include "codemodel.h" +#include "adasupportpart.h" +#include "problemreporter.h" +#include "backgroundparser.h" + +#include "AdaLexer.hpp" +#include "AdaParser.hpp" +#include "AdaStoreWalker.hpp" +#include "AdaAST.hpp" + +#include + +enum { KDEV_DB_VERSION = 6 }; +enum { KDEV_PCS_VERSION = 6 }; + +typedef KDevGenericFactory AdaSupportPartFactory; + +static const KDevPluginInfo data("kdevadasupport"); +K_EXPORT_COMPONENT_FACTORY (libkdevadasupport, AdaSupportPartFactory (data)) + + +struct AdaSupportPartData { + ProblemReporter* problemReporter; + + AdaSupportPartData () : problemReporter (0) {} +}; + +AdaSupportPart::AdaSupportPart (QObject *parent, const char *name, const QStringList &) + : KDevLanguageSupport (&data, parent, name ? name : "AdaSupportPart"), d (new AdaSupportPartData()) +{ + setInstance (AdaSupportPartFactory::instance ()); + + d->problemReporter = new ProblemReporter (this); +// connect (core (), SIGNAL (configWidget (KDialogBase*)), +// d->problemReporter, SLOT (configWidget (KDialogBase*))); + d->problemReporter->setIcon( SmallIcon("info") ); + mainWindow( )->embedOutputView( d->problemReporter, i18n("Problems"), i18n("Problem reporter")); + QWhatsThis::add(d->problemReporter, i18n("Problem reporter

This window shows various \"problems\" in your project. " + "It displays errors reported by a language parser.")); + + setXMLFile ("adasupportpart.rc"); + + connect (core (), SIGNAL (projectOpened ()), this, SLOT (projectOpened ())); + connect (core (), SIGNAL (projectClosed ()), this, SLOT (projectClosed ())); + + connect (partController (), SIGNAL (savedFile (const KURL&)), + this, SLOT (savedFile (const KURL&))); + +// connect (core (), SIGNAL (configWidget (KDialogBase*)), this, SLOT (configWidget (KDialogBase*))); + connect( core(), SIGNAL(configWidget(KDialogBase*)), + d->problemReporter, SLOT(configWidget(KDialogBase*)) ); + + // a small hack (robe) + //classStore ()->globalScope ()->setName ("(default packages)"); + //classStore ()->addScope (classStore ()->globalScope ()); + //classStore ()->globalScope ()->setName (QString::null); +} + + +AdaSupportPart::~AdaSupportPart () +{ + mainWindow ()->removeView (d->problemReporter); + delete (d->problemReporter); + d->problemReporter = 0; + + delete (d); + d = 0; +} + + +KDevLanguageSupport::Features AdaSupportPart::features () +{ + return KDevLanguageSupport::Features + ( // TBD: Classes | + Functions | Namespaces); +} + +void AdaSupportPart::projectOpened () +{ + connect (project (), SIGNAL (addedFilesToProject (const QStringList &)), + this, SLOT (addedFilesToProject (const QStringList &))); + connect (project (), SIGNAL (removedFilesFromProject (const QStringList &)), + this, SLOT (removedFilesFromProject (const QStringList &))); + connect( project( ), SIGNAL( changedFilesInProject( const QStringList & ) ), + this, SLOT( changedFilesInProject( const QStringList & ) ) ); + + QTimer::singleShot (0, this, SLOT (initialParse ())); +} + + +void AdaSupportPart::projectClosed () +{ + saveProjectSourceInfo(); +} + + +void AdaSupportPart::initialParse () +{ + kdDebug () << "------------------------------------------> initialParse ()" << endl; + + if (project ()) + { + mainWindow()->statusBar()->message( i18n("Updating...") ); + kapp->processEvents( ); + kapp->setOverrideCursor (waitCursor); + + int n = 0; + QStringList files = project ()->allFiles (); + + QProgressBar* bar = new QProgressBar( files.count( ), mainWindow( )->statusBar( ) ); + bar->setMinimumWidth( 120 ); + bar->setCenterIndicator( true ); + mainWindow( )->statusBar( )->addWidget( bar ); + bar->show( ); + + for (QStringList::Iterator it = files.begin (); it != files.end (); ++it) { + bar->setProgress( n++ ); + + QString fn = project ()->projectDirectory () + "/" + *it; + maybeParse (fn); + kapp->processEvents (500); + } + + emit updatedSourceInfo(); + + mainWindow( )->statusBar( )->removeWidget( bar ); + delete bar; + + kapp->restoreOverrideCursor (); + mainWindow( )->statusBar( )->message( i18n( "Done" ), 2000 ); +/* mainWindow ()->statusBar ()->message + (i18n ("Found 1 problem", "Found %n problems", d->problemReporter->childCount ()));*/ + } +} + +QStringList AdaSupportPart::fileExtensions () +{ + return QStringList () << "ads" << "adb"; +} + +void AdaSupportPart::maybeParse (const QString &fileName) +{ + kdDebug () << "AdaSupportPart::maybeParse: " << fileName << endl; + + if (!fileExtensions ().contains (QFileInfo (fileName).extension ())) + return; + +// mainWindow ()->statusBar ()->message (i18n ("Parsing file: %1").arg (fileName)); + parse (fileName); +} + + +void AdaSupportPart::addedFilesToProject (const QStringList &fileList) +{ + QStringList::ConstIterator it; + + for (it = fileList.begin (); it != fileList.end (); ++it) + { + QString path = project ()->projectDirectory () + "/" + (*it); + maybeParse (path); + emit addedSourceInfo( path ); + } +} + + +void AdaSupportPart::removedFilesFromProject (const QStringList &fileList) +{ + QStringList::ConstIterator it; + + for (it = fileList.begin (); it != fileList.end (); ++it) + { + kdDebug () << "AdaSupportPart::removedFileFromProject () -- " << (*it) << endl; + QString path = project ()->projectDirectory () + "/" + (*it); + + if( codeModel()->hasFile(path) ) + { + emit aboutToRemoveSourceInfo( path ); + codeModel()->removeFile( codeModel()->fileByName(path) ); + } + } + +// emit updatedSourceInfo(); +} + + +void AdaSupportPart::parse (const QString &fileName) +{ + kdDebug () << "AdaSupportPart::parse () -- " << fileName << endl; + + std::ifstream stream (QFile::encodeName( fileName ).data()); + QCString _fn = fileName.utf8 (); + std::string fn (_fn.data ()); + + AdaLexer lexer (stream); + lexer.setFilename (fn); + lexer.setProblemReporter (d->problemReporter); + + AdaParser parser (lexer); + parser.setFilename (fn); + parser.setProblemReporter (d->problemReporter); + + // make an ast factory + antlr::ASTFactory ast_factory; + // initialize and put it in the parser... + parser.initializeASTFactory (ast_factory); + parser.setASTFactory (&ast_factory); + // parser.setASTNodeType ("RefAdaAST"); + + try { + // old: parser.setASTNodeFactory (AdaAST::factory); + lexer.resetErrors (); + parser.resetErrors (); + + parser.compilation_unit (); + int errors = lexer.numberOfErrors () + parser.numberOfErrors (); + + RefAdaAST ast = RefAdaAST (parser.getAST ()); + + if (errors == 0 && ast != antlr::nullAST) { + kdDebug () << "-------------------> start StoreWalker" << endl; + AdaStoreWalker walker; + walker.setFileName (fileName); + walker.setCodeModel (codeModel ()); + walker.compilation_unit (ast); + } + } catch (antlr::ANTLRException& ex) { + kdDebug () << "*exception*: " << ex.toString ().c_str () << endl; + d->problemReporter->reportError (QString::fromLatin1( ex.getMessage ().c_str() ), + fileName, + lexer.getLine (), + lexer.getColumn ()); + } +} + +void AdaSupportPart::parseContents (const QString& contents, const QString& fileName) +{ + kdDebug () << "AdaSupportPart::parseContents () -- " << fileName << endl; + + QCString _fn = QFile::encodeName (fileName); + std::string fn (_fn.data ()); + + QCString text = contents.utf8 (); + std::istringstream stream ((const char *)text); + + AdaLexer lexer (stream); + lexer.setFilename (fn); + lexer.setProblemReporter (d->problemReporter); + + AdaParser parser (lexer); + parser.setFilename (fn); + parser.setProblemReporter (d->problemReporter); + + try { + lexer.resetErrors (); + parser.resetErrors (); + + parser.compilation_unit (); + int errors = lexer.numberOfErrors () + parser.numberOfErrors (); + Q_UNUSED( errors ); + + } catch (antlr::ANTLRException& ex) { + kdDebug () << "*exception*: " << ex.toString ().c_str () << endl; + d->problemReporter->reportError (QString::fromLatin1( ex.getMessage().c_str() ), + fileName, + lexer.getLine (), + lexer.getColumn ()); + } +} + + + +void AdaSupportPart::savedFile (const KURL& fileName) +{ + kdDebug () << "AdaSupportPart::savedFile ()" << endl; + + if (project ()->allFiles ().contains (fileName.path().mid (project ()->projectDirectory ().length () + 1))) { + maybeParse (fileName.path()); + emit updatedSourceInfo(); + } +} + +KMimeType::List AdaSupportPart::mimeTypes( ) +{ + KMimeType::List list; + + list << KMimeType::mimeType( "text/x-adasrc" ); + + return list; +} + +//@todo adymo: implement source info loading and saving +//hint: check javasupport for an example +// and modify initialParse() method +void AdaSupportPart::saveProjectSourceInfo( ) +{ +/* const FileList fileList = codeModel()->fileList(); + + if( !project() || fileList.isEmpty() ) + return; + + QFile f( project()->projectDirectory() + "/" + project()->projectName() + ".pcs" ); + if( !f.open( IO_WriteOnly ) ) + return; + + QDataStream stream( &f ); + QMap offsets; + + QString pcs( "PCS" ); + stream << pcs << KDEV_PCS_VERSION; + + stream << int( fileList.size() ); + for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){ + const FileDom dom = (*it); +#if QT_VERSION >= 0x030100 + stream << dom->name() << m_timestamp[ dom->name() ].toTime_t(); +#else + stream << dom->name() << toTime_t(m_timestamp[ dom->name() ]); +#endif + offsets.insert( dom->name(), stream.device()->at() ); + stream << (Q_ULONG)0; // dummy offset + } + + for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){ + const FileDom dom = (*it); + int offset = stream.device()->at(); + + dom->write( stream ); + + int end = stream.device()->at(); + + stream.device()->at( offsets[dom->name()] ); + stream << offset; + stream.device()->at( end ); + }*/ +} + +void AdaSupportPart::changedFilesInProject( const QStringList & fileList ) +{ + QStringList files = fileList; + + for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) + { + QString path = project ()->projectDirectory () + "/" + *it ; + + maybeParse( path ); + emit addedSourceInfo( path ); + } +} + + +#include "adasupportpart.moc" diff --git a/languages/ada/adasupportpart.h b/languages/ada/adasupportpart.h new file mode 100644 index 00000000..d9f2c45d --- /dev/null +++ b/languages/ada/adasupportpart.h @@ -0,0 +1,50 @@ +// +#ifndef __ADASUPPORTPART_H__ +#define __ADASUPPORTPART_H__ + +#include "kdevlanguagesupport.h" + +#include + +class AdaSupportPartData; +class KDialogBase; +class QStringList; + +class AdaSupportPart : public KDevLanguageSupport +{ + Q_OBJECT +public: + AdaSupportPart (QObject *parent, const char *name, const QStringList &); + ~AdaSupportPart (); + + void parseContents (const QString& contents, const QString& fileName); + +protected: + Features features (); + KMimeType::List mimeTypes (); + QStringList fileExtensions (); + +private slots: + void projectOpened (); + void projectClosed (); + + void addedFilesToProject (const QStringList &fileList); + void removedFilesFromProject (const QStringList &fileList); + void changedFilesInProject( const QStringList &fileList ); + + void initialParse (); + void savedFile (const KURL&); + +private: + void maybeParse (const QString &fileName); + void parse (const QString &fileName); + + void saveProjectSourceInfo( ); +private: + AdaSupportPartData* d; + +friend class ProblemReporter; +}; + + +#endif diff --git a/languages/ada/addclass.cpp b/languages/ada/addclass.cpp new file mode 100644 index 00000000..5a5ccb13 --- /dev/null +++ b/languages/ada/addclass.cpp @@ -0,0 +1,351 @@ +#include +#include + + +#include +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include + + +#include "addclassdlg.h" + + +#include "addclass.h" + + +AddClassInfo::AddClassInfo() + : interfaceOpt(false), abstractOpt(false), finalOpt(false), + createConstructor(true), createMain(false) +{ +} + + +QString AddClassInfo::adaFileName() const +{ + QString dest = className; + dest.replace(QRegExp("\\."), "/"); + return sourceDir + "/" + dest + ".ada"; +} + + +AddClass::AddClass() +{ +} + + +void AddClass::setInfo(const AddClassInfo &info) +{ + m_info = info; +} + + +AddClassInfo &AddClass::info() +{ + return m_info; +} + + +void AddClass::setBaseClasses(const QStringList &classes) +{ + m_baseClasses = classes; +} + + +bool AddClass::showDialog() +{ + AddClassDlg dlg; + + QString dir = m_info.projectDir; + if (m_info.sourceDir.isEmpty()) + m_info.sourceDir = "src"; + if (dir.isEmpty()) + dir = m_info.sourceDir; + else + dir = dir + "/" + m_info.sourceDir; + + dlg.SourcePath->setText(dir); + dlg.ClassName->setText(m_info.className); + dlg.Extends->insertStringList(m_baseClasses); + dlg.Extends->setEditText(m_info.extends); + dlg.Interface->setChecked(m_info.interfaceOpt); + dlg.Abstract->setChecked(m_info.abstractOpt); + dlg.Final->setChecked(m_info.finalOpt); + + switch (m_info.visibility) + { + case AddClassInfo::ProtectedClass: + dlg.Protected->setChecked(true); + break; + case AddClassInfo::PrivateClass: + dlg.Private->setChecked(true); + break; + default: + dlg.Public->setChecked(true); + break; + } + + dlg.Implements->insertStringList(m_info.implements); + dlg.Constructor->setChecked(m_info.createConstructor); + dlg.Main->setChecked(m_info.createMain); + dlg.Documentation->setText(m_info.documentation); + dlg.License->setEditText(m_info.license); + + if (dlg.exec() == QDialog::Accepted) + { + m_info.projectDir = ""; + m_info.sourceDir = dlg.SourcePath->text(); + m_info.className = dlg.ClassName->text(); + m_info.extends = dlg.Extends->currentText(); + m_info.interfaceOpt = dlg.Interface->isChecked(); + m_info.abstractOpt = dlg.Abstract->isChecked(); + m_info.finalOpt = dlg.Final->isChecked(); + + if (dlg.Protected->isChecked()) + m_info.visibility = AddClassInfo::ProtectedClass; + else if (dlg.Private->isChecked()) + m_info.visibility = AddClassInfo::PrivateClass; + else + m_info.visibility = AddClassInfo::PublicClass; + + m_info.implements = dlg.Implements->items(); + m_info.createConstructor = dlg.Constructor->isChecked(); + m_info.createMain = dlg.Main->isChecked(); + m_info.documentation = dlg.Documentation->text(); + m_info.license = dlg.License->currentText(); + + return true; + } + + return false; +} + + +static bool makeDirs(const QString &dest) +{ + QStringList dirs = QStringList::split("/", dest); + + QString d = ""; + + for (QStringList::Iterator it=dirs.begin(); it != dirs.end(); ++it) + { + d = d + "/" + *it; + + QFileInfo fi(d); + + if (fi.exists() && !fi.isDir()) + { + /// @todo message to user! + return false; + } + + if (!fi.exists()) + if (::mkdir(QFile::encodeName(d), 0755) != 0) + return false; + } + + return true; +} + + +bool AddClass::generate() +{ + QString code; + + // license + + if (!m_info.license.isEmpty()) + { + code += "/*\n"; + + if (m_info.license == "GPL") + { + code += + " * This program is free software; you can redistribute it and/or modify\n" + " * it under the terms of the GNU General Public License as published by\n" + " * the Free Software Foundation; either version 2 of the License, or\n" + " * (at your option) any later version.\n"; + } + else if (m_info.license == "LGPL") + { + code += + " * This program is free software; you can redistribute it and/or modify\n" + " * it under the terms of the GNU Library General Public License as\n" + " * published by the Free Software Foundation; either version 2 of the\n" + " * License, or (at your option) any later version.\n"; + } + else if (m_info.license == "QPL") + { + code += + " * This program may be distributed under the terms of the Q Public\n" + " * License as defined by Trolltech AS of Norway and appearing in the\n" + " * file LICENSE.QPL included in the packaging of this file.\n" + " *\n" + " * This program is distributed in the hope that it will be useful,\n" + " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"; + } + else + { + code += " * This program is licensed under the " + m_info.license + ".\n"; + code += " * Please see the documentation for details.\n"; + } + + code += " */\n\n\n"; + } + + // find class and package name + QString className, packageName; + + int i = m_info.className.findRev('.'); + if (i == -1) + { + packageName = ""; + className = m_info.className; + } + else + { + packageName = m_info.className.left(i); + className = m_info.className.mid(i+1); + } + + // package + if (!packageName.isEmpty()) + code += "package " + packageName + ";\n\n\n"; + + // documentation + + if (!m_info.documentation.isEmpty()) + { + code += "/**\n"; + + QTextStream ts(&m_info.documentation, IO_ReadOnly); + + while (!ts.eof()) + code += " * " + ts.readLine() + "\n"; + + code += " */\n\n"; + } + + // visibility + + switch (m_info.visibility) + { + case AddClassInfo::PrivateClass: + code += "private"; + break; + case AddClassInfo::ProtectedClass: + code += "protected"; + break; + default: + code += "public"; + break; + } + + // abstract, final + + if (!m_info.interfaceOpt) + { + if (m_info.abstractOpt) + code += " abstract"; + if (m_info.finalOpt) + code += " final"; + } + + // generate class/interface declaration + + if (m_info.interfaceOpt) + code += " interface "; + else + code += " class "; + + // classname + + code += className; + + // extends + + if (!m_info.extends.isEmpty()) + code += " extends " + m_info.extends; + + // implements + + if ((m_info.implements.count() > 0) && !m_info.interfaceOpt) + { + code += " implements "; + unsigned int c=0; + for (QStringList::Iterator it = m_info.implements.begin(); it != m_info.implements.end(); ++it, c++) + { + code += *it; + if (c+1 < m_info.implements.count()) + code += ", "; + } + } + + // body start + + code += "\n{\n\n"; + + // default constructor + + if (m_info.createConstructor && !m_info.interfaceOpt) + { + code += " " + className + "()\n"; + code += " {\n"; + if (!m_info.extends.isEmpty()) + code += " super();\n"; + code += " }\n\n"; + } + + // main method + + if (m_info.createMain && !m_info.interfaceOpt) + { + code += " public static void main(String[] args)\n"; + code += " {\n"; + code += " }\n\n"; + } + + // body end + + code += "};\n"; + + // create directories + + QString dest = packageName; + dest.replace(QRegExp("\\."), "/"); + dest = m_info.sourceDir + "/" + dest; + + if (!makeDirs(dest)) + return false; + + // write out the file + + if (QFile::exists(m_info.adaFileName())) + { + /// @todo ask before overwriting! + } + + QFile of(m_info.adaFileName()); + if (!of.open(IO_WriteOnly)) + { + /// @todo message to user + return false; + } + + QTextStream os(&of); + os << code; + + of.close(); + + return true; +} diff --git a/languages/ada/addclass.h b/languages/ada/addclass.h new file mode 100644 index 00000000..7bcfd370 --- /dev/null +++ b/languages/ada/addclass.h @@ -0,0 +1,55 @@ +#ifndef __ADDCLASS_H__ +#define __ADDCLASS_H__ + + +#include +#include + + +class AddClassInfo +{ +public: + + AddClassInfo(); + + enum Visibility { PublicClass, ProtectedClass, PrivateClass}; + + QString className; + QString extends; + bool interfaceOpt, abstractOpt, finalOpt; + QString projectDir, sourceDir; + Visibility visibility; + QStringList implements; + bool createConstructor, createMain; + QString documentation; + QString license; + + QString adaFileName() const; + +}; + + +class AddClass +{ +public: + + AddClass(); + + void setInfo(const AddClassInfo &info); + AddClassInfo &info(); + + void setBaseClasses(const QStringList &classes); + bool showDialog(); + + bool generate(); + + +private: + + AddClassInfo m_info; + QStringList m_baseClasses; + +}; + + +#endif diff --git a/languages/ada/addclassdlg.ui b/languages/ada/addclassdlg.ui new file mode 100644 index 00000000..49900786 --- /dev/null +++ b/languages/ada/addclassdlg.ui @@ -0,0 +1,434 @@ + +AddClassDlg + + + AddClassDlg + + + + 0 + 0 + 656 + 684 + + + + Add Class + + + + unnamed + + + + Implements + + + 1 + + + &Implements + + + + + GroupBox1 + + + &Class + + + + unnamed + + + + + Extends + + + true + + + false + + + + + Spacer2 + + + Horizontal + + + Expanding + + + + + Abstract + + + &Abstract + + + + + Interface + + + &Interface + + + + + TextLabel1 + + + &Name: + + + ClassName + + + + + ButtonGroup1 + + + 0 + + + + + + + unnamed + + + 0 + + + + + Public + + + &Public + + + true + + + + + Protected + + + P&rotected + + + + + Private + + + Pri&vate + + + + + + + Final + + + &Final + + + + + ClassName + + + + + Spacer1 + + + Horizontal + + + Expanding + + + + + TextLabel2 + + + &Extends: + + + Extends + + + + + BrowseSourcePath + + + + 1 + 1 + 0 + 0 + + + + ... + + + + + SourcePath + + + + + TextLabel1_2 + + + &Source path: + + + SourcePath + + + + + + + GroupBox3 + + + &Options + + + + unnamed + + + + + Constructor + + + &Create default constructor + + + true + + + + + Main + + + Create &main method + + + + + + + GroupBox4 + + + &Documentation + + + + unnamed + + + + + TextLabel5 + + + &License: + + + License + + + + + + LGPL + + + + + GPL + + + + + QPL + + + + License + + + true + + + + + Documentation + + + + + Spacer4 + + + Horizontal + + + Expanding + + + + + + + Line1 + + + HLine + + + Sunken + + + Horizontal + + + + + PushButton3 + + + &Help + + + + + Spacer5 + + + Horizontal + + + Expanding + + + + + PushButton1 + + + &Add + + + true + + + + + PushButton2 + + + &Cancel + + + + + + + Interface + toggled(bool) + Abstract + setDisabled(bool) + + + Interface + toggled(bool) + Final + setDisabled(bool) + + + PushButton1 + clicked() + AddClassDlg + accept() + + + PushButton2 + clicked() + AddClassDlg + reject() + + + Interface + toggled(bool) + Constructor + setDisabled(bool) + + + Interface + toggled(bool) + Main + setDisabled(bool) + + + Interface + toggled(bool) + Implements + setDisabled(bool) + + + + SourcePath + BrowseSourcePath + ClassName + Extends + Interface + Abstract + Final + Public + Protected + Private + Constructor + Main + License + PushButton1 + PushButton2 + PushButton3 + + + Public_toggled( bool ) + + + keditlistbox.h + kcombobox.h + klineedit.h + kdialog.h + + + + diff --git a/languages/ada/app_templates/Makefile.am b/languages/ada/app_templates/Makefile.am new file mode 100644 index 00000000..3da5006f --- /dev/null +++ b/languages/ada/app_templates/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = adahello + +profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/AdaIDE +profiles_DATA = ada.appwizard + diff --git a/languages/ada/app_templates/ada.appwizard b/languages/ada/app_templates/ada.appwizard new file mode 100644 index 00000000..2c31ec96 --- /dev/null +++ b/languages/ada/app_templates/ada.appwizard @@ -0,0 +1,2 @@ +[General] +List=adahello diff --git a/languages/ada/app_templates/adahello/.kdev_ignore b/languages/ada/app_templates/adahello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/ada/app_templates/adahello/Makefile.am b/languages/ada/app_templates/adahello/Makefile.am new file mode 100644 index 00000000..45e04df7 --- /dev/null +++ b/languages/ada/app_templates/adahello/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = main.adb app.kdevelop ada-Makefile app.kdevelop.filelist + +### no need to change below: +template_DATA = adahello.kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +adahello.tar.gz: + $(TAR) -cf adahello.tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 adahello.tar + +archivedir = ${appwizarddatadir} +archive_DATA = adahello.tar.gz adahello.png + +CLEANFILES = *.tar.gz + diff --git a/languages/ada/app_templates/adahello/ada-Makefile b/languages/ada/app_templates/adahello/ada-Makefile new file mode 100644 index 00000000..134ffab6 --- /dev/null +++ b/languages/ada/app_templates/adahello/ada-Makefile @@ -0,0 +1,2 @@ +all: + gnatmake src/%{APPNAMELC}.adb -o %{APPNAMELC} diff --git a/languages/ada/app_templates/adahello/ada-Makefile.am b/languages/ada/app_templates/adahello/ada-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/ada/app_templates/adahello/ada-Makefile.am @@ -0,0 +1,5 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +SUBDIRS = src diff --git a/languages/ada/app_templates/adahello/ada-Makefile.cvs b/languages/ada/app_templates/adahello/ada-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/ada/app_templates/adahello/ada-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/ada/app_templates/adahello/adahello b/languages/ada/app_templates/adahello/adahello new file mode 100644 index 00000000..73d82f8d --- /dev/null +++ b/languages/ada/app_templates/adahello/adahello @@ -0,0 +1,10 @@ +# KDE Config File +[General] +Name=Simple Hello world program +Name[fr]=Un simple programme de test Hello world +Icon=adahello.png +Category=Ada +Comment=Generates a simple Hello world program in Ada +Comment[fr]=Gnre un simple programme de test du type Hello world dans le language ADA. +FileTemplates=adb,AdaStyle +ShowFilesAfterGeneration=src/APPNAMELC.adb diff --git a/languages/ada/app_templates/adahello/adahello.kdevtemplate b/languages/ada/app_templates/adahello/adahello.kdevtemplate new file mode 100644 index 00000000..380f739b --- /dev/null +++ b/languages/ada/app_templates/adahello/adahello.kdevtemplate @@ -0,0 +1,132 @@ +# KDE Config File +[General] +Name=Simple Hello world program +Name[ca]=Simple programa Hello world +Name[da]=Simpelt Goddag verden program +Name[de]=Ein einfaches "Hello World"-Programm +Name[el]=Απλό πρόγραμμα Γεια σου Κόσμε +Name[es]=Programa «Hola mundo» sencillo +Name[et]=Lihtne "Tere, maailm" programm +Name[eu]="Kaixo mundua" programa sinplea +Name[fa]=برنامۀ سادۀ Hello world +Name[fr]=Programme « Bonjour monde » simple +Name[ga]=Ríomhchlár simplí "Hello World" +Name[gl]=Programa sinxelo Ola mundo +Name[hu]=Egyszerű Hello world program +Name[it]=Semplice programma di "Hello world" +Name[ja]=簡単な Hello world プログラム +Name[ms]=Program Hello World mudah +Name[nds]=En eenfach "Moin Welt"-Programm +Name[ne]=साधारण हेल्लो वोल्ड कार्यक्रम +Name[nl]=Eenvoudig 'Hello World' programma +Name[pl]=Prosty program witaj świecie +Name[pt]=Programa simples Olá Mundo +Name[pt_BR]=Programa simples Olá Mundo +Name[ru]=Простая программа Hello world +Name[sk]=Jednoduchý "Ahoj svet" program +Name[sl]=Preprost program Hello world +Name[sr]=Једноставан „Здраво свете“ програм +Name[sr@Latn]=Jednostavan „Zdravo svete“ program +Name[sv]=Enkelt Hello world-program +Name[tr]=Basit Merhaba dünya programı +Name[zh_CN]=简单的 Hello world 程序 +Name[zh_TW]=簡單的 Hello world 程式 +Icon=adahello.png +Category=Ada +Comment=Generates a simple Hello world program in Ada +Comment[ca]=Genera un simple programa de Hello world en Ada +Comment[da]=Genererer et simpelt Goddag verden program i Ada +Comment[de]=Erstellt ein einfaches "Hello World"-Program in Ada +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε Ada +Comment[es]=Genera un programa «Hola mundo» sencillo en Ada +Comment[et]=Lihtsa "Tere, maailm" programmi loomine ADA-s +Comment[eu]="Kaixo mundua" programa sinple bat sortzen du Adan +Comment[fa]=یک برنامۀ سادۀ Hello world در آدا تولید می‌کند +Comment[fr]=Génère un programme « Bonjour monde » simple en Ada +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí "Hello World" in Ada +Comment[gl]=Xera un programa sinxelo Hello world en Ada +Comment[hu]=Létrehoz egy egyszerű Hello world programot ADA nyelven +Comment[it]=Genera un semplice programma di "Hello world" in Ada +Comment[ja]=Ada で簡単な Hello world プログラムを作成します +Comment[ms]=Menjana program Hello World mudah dalam Ada +Comment[nds]=Stellt in Ada en eenfach "Moin Welt"-Programm op +Comment[ne]=एडामा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudig Hello World programma in Ada +Comment[pl]=Generuje prosty program Witaj świecie w Adzie +Comment[pt]=Gera um programa simples de Olá Mundo em Ada +Comment[pt_BR]=Gera um programa simples de Olá Mundo em Ada +Comment[ru]=Создание простой программы Hello world на Ada +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v Ada +Comment[sl]=Ustvari preprost program Hello world v Adi +Comment[sr]=Прави једноставан „Здраво свете“ у Ada-и +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ u Ada-i +Comment[sv]=Skapar ett enkelt Hello world-program i Ada +Comment[tr]=Ada dilinde basit bir Merhaba Dünya programı üretir. +Comment[zh_CN]=以 Ada 语言生成简单的 Hello world 程序 +Comment[zh_TW]=產生 Ada 的 Hello world 程式 +FileTemplates=adb,AdaStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.adb +Archive=adahello.tar.gz + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/ada-Makefile +Dest=%{dest}/Makefile + +[FILE3] +Type=install +Source=%{src}/app.kdevelop.filelist +Dest=%{dest}/%{APPNAMELC}.kdevelop.filelist + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE4] +Type=install +Source=%{src}/main.adb +Dest=%{dest}/src/%{APPNAMELC}.adb + +[MSG] +Type=message +Comment=A simple "Hello world" program in ADA was created in %{dest} +Comment[ca]=Un simple programa de "Hello world" en ADA ha estat creat en %{dest} +Comment[da]=Et simpelt "Goddag verden" program i ADA blev oprettet i %{dest} +Comment[de]=Ein einfaches "Hello world" Programm in Ada wurde in %{dest} erstellt +Comment[el]=Ένα απλό πρόγραμμα "Γεια σου Κόσμε" σε ADA δημιουργήθηκε στο %{dest} +Comment[es]=Un programa «Hola mundo» sencillo en ADA ha sido creado en %{dest} +Comment[et]=Lihtne "Tere, maailm" programm ADA-s loodi asukohta %{dest} +Comment[eu]="Kaixo mundua" programa sinple bat sortu da ADAn hemen: %{dest} +Comment[fa]=یک برنامۀ سادۀ «Hello world» در آدا در %{dest} ایجاد شد +Comment[fr]=Un programme « Bonjour monde » simple en ADA a été créé dans %{dest} +Comment[ga]=Cruthaíodh ríomhchlár simplí "Hello World" ADA i %{dest} +Comment[gl]=Creouse un programa sinxelo "Ola mundo" en ADA en %{dest} +Comment[hu]=Létrejött egy egyszerű Hello world program ADA nyelven itt: %{dest} +Comment[it]=È stato creato un semplice programma di "Hello world" in ADA in %{dest} +Comment[ja]=Ada で記述された "Hello world" プログラムを %{dest} に作成しました +Comment[ms]=Program "Hello World" mudah dalam ada telah dicipta dalam %{dest} +Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm in Ada opstellt +Comment[ne]=एउटा साधारण "हेल्लो वोल्ड" कार्यक्रम एडामा %{dest} सिर्जना गरिएको थियो +Comment[nl]=Een eenvoudig "Hello World" programma in Ada is aangemaakt in %{dest} +Comment[pl]=Prosty program "Witaj świecie" w języku ADA został utworzony w %{dest} +Comment[pt]=Foi criado um programa simples "Olá mundo" em ADA em %{dest} +Comment[pt_BR]=Foi criado um programa simples "Olá mundo" em ADA em %{dest} +Comment[ru]=Простая программа "Hello world" на ADA создана в %{dest} +Comment[sk]=Jednoduchý "Ahoj svet" program v Ada bol vytvorený v %{dest} +Comment[sl]=Preprost program »Hello world« v jeziku ADA je bil ustvarjen v %{dest} +Comment[sr]=Једноставан „Здраво свете“ програм у Ada-и је направљен у %{dest} +Comment[sr@Latn]=Jednostavan „Zdravo svete“ program u Ada-i je napravljen u %{dest} +Comment[sv]=Ett enkelt "Hello world"-program in Ada skapades i %{dest} +Comment[tr]=ADA'da basit bir "Merhaba Dünya" programı %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了 Ada 语言的“Hello world”程序 +Comment[zh_TW]=Ada 的 Hello world 程式已產生在 ${dest} diff --git a/languages/ada/app_templates/adahello/adahello.png b/languages/ada/app_templates/adahello/adahello.png new file mode 100644 index 00000000..888d4f13 Binary files /dev/null and b/languages/ada/app_templates/adahello/adahello.png differ diff --git a/languages/ada/app_templates/adahello/app.kdevelop b/languages/ada/app_templates/adahello/app.kdevelop new file mode 100644 index 00000000..b430f6e8 --- /dev/null +++ b/languages/ada/app_templates/adahello/app.kdevelop @@ -0,0 +1,84 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevCustomProject + Ada + + Ada + Code + + + + + build + / + %{APPNAMELC} + + false + false + + + + make + + + + + + bash + bash_bugs + c++_bugs_gcc + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + libc + libstdc++ + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + diff --git a/languages/ada/app_templates/adahello/app.kdevelop.filelist b/languages/ada/app_templates/adahello/app.kdevelop.filelist new file mode 100644 index 00000000..e5b69ca2 --- /dev/null +++ b/languages/ada/app_templates/adahello/app.kdevelop.filelist @@ -0,0 +1 @@ +src/%{APPNAMELC}.adb \ No newline at end of file diff --git a/languages/ada/app_templates/adahello/configure.in b/languages/ada/app_templates/adahello/configure.in new file mode 100644 index 00000000..a8f81958 --- /dev/null +++ b/languages/ada/app_templates/adahello/configure.in @@ -0,0 +1,10 @@ +AC_INIT(configure.in) + +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AM_CONFIG_HEADER(config.h) + +AC_LANG_ADA +AC_PROG_ADA +AC_ADA_LIBRARY_LDFLAGS + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/ada/app_templates/adahello/main.adb b/languages/ada/app_templates/adahello/main.adb new file mode 100644 index 00000000..e2c6f5da --- /dev/null +++ b/languages/ada/app_templates/adahello/main.adb @@ -0,0 +1,8 @@ +with Text_IO; + +procedure Main is + +begin + Text_IO.Put_Line ("Hello World"); +end Main; + diff --git a/languages/ada/app_templates/adahello/src-Makefile.am b/languages/ada/app_templates/adahello/src-Makefile.am new file mode 100644 index 00000000..06291dbf --- /dev/null +++ b/languages/ada/app_templates/adahello/src-Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = %{APPNAMELC}.adb + +# set the include path found by configure +INCLUDES= $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(all_libraries) diff --git a/languages/ada/backgroundparser.cpp b/languages/ada/backgroundparser.cpp new file mode 100644 index 00000000..f94f3216 --- /dev/null +++ b/languages/ada/backgroundparser.cpp @@ -0,0 +1,77 @@ +/*************************************************************************** + * Copyright (C) 2002 by Roberto Raggi * + * roberto@kdevelop.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "backgroundparser.h" +#include "problemreporter.h" +#include "AdaLexer.hpp" +#include "AdaParser.hpp" +#include "AdaAST.hpp" +#include +#include + +#include + +#include + +BackgroundParser::BackgroundParser( ProblemReporter* reporter, + const QString& source, + const QString& filename ) + : m_reporter( reporter ), + m_source( source.unicode(), source.length() ), + m_fileName( filename ) +{ +} + +BackgroundParser::~BackgroundParser() +{ +} + +void BackgroundParser::run() +{ + QCString _fn = QFile::encodeName(m_fileName); + std::string fn( _fn.data() ); + + std::istringstream stream( m_source.utf8().data() ); + + AdaLexer lexer( stream ); + lexer.setFilename( fn ); + lexer.setProblemReporter( m_reporter ); + + AdaParser parser( lexer ); + parser.setFilename( fn ); + parser.setProblemReporter( m_reporter ); + + // make an ast factory + antlr::ASTFactory ast_factory; + // initialize and put it in the parser... + parser.initializeASTFactory (ast_factory); + parser.setASTFactory (&ast_factory); + // parser.setASTNodeType ("RefAdaAST"); + + try{ + lexer.resetErrors(); + parser.resetErrors(); + + parser.compilation_unit(); + + } catch( antlr::ANTLRException& ex ){ + kdDebug() << "*exception*: " << ex.toString().c_str() << endl; + m_reporter->reportError( QString::fromLatin1( ex.getMessage().c_str() ), + m_fileName, + lexer.getLine(), + lexer.getColumn() ); + } + + kdDebug() << "BackgroundParser::run() FINISHED." << endl; +} + + + diff --git a/languages/ada/backgroundparser.h b/languages/ada/backgroundparser.h new file mode 100644 index 00000000..0b4eef16 --- /dev/null +++ b/languages/ada/backgroundparser.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2002 by Roberto Raggi + * roberto@kdevelop.org + * Copyright (C) 2003 Oliver Kellogg + * okellogg@users.sourceforge.net + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef BACKGROUNDPARSER_H +#define BACKGROUNDPARSER_H + +#include +#include +#include + +class ProblemReporter; + +class BackgroundParser: public QThread{ +public: + BackgroundParser( ProblemReporter* reporter, + const QString& source, + const QString& filename ); + virtual ~BackgroundParser(); + + virtual void run(); + +private: + ProblemReporter* m_reporter; + QString m_source; + QString m_fileName; +}; + +#endif diff --git a/languages/ada/configproblemreporter.ui b/languages/ada/configproblemreporter.ui new file mode 100644 index 00000000..75f35b1f --- /dev/null +++ b/languages/ada/configproblemreporter.ui @@ -0,0 +1,89 @@ + +ConfigureProblemReporter + + + ConfigureProblemReporter + + + + 0 + 0 + 390 + 304 + + + + + unnamed + + + + bgParserCheckbox + + + &Enable background parsing + + + + + delaySlider + + + 2000 + + + 250 + + + 500 + + + Horizontal + + + Right + + + 250 + + + + + Spacer1 + + + Vertical + + + Expanding + + + + 0 + 101 + + + + + + + + bgParserCheckbox + toggled(bool) + ConfigureProblemReporter + bgParserCheckbox_toggled(bool) + + + + kdialog.h + configproblemreporter.ui.h + + + init() + destroy() + accept() + bgParserCheckbox_toggled( bool b ) + + + + diff --git a/languages/ada/configproblemreporter.ui.h b/languages/ada/configproblemreporter.ui.h new file mode 100644 index 00000000..a336965c --- /dev/null +++ b/languages/ada/configproblemreporter.ui.h @@ -0,0 +1,39 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ + +#include +#include + +void ConfigureProblemReporter::init() +{ + KConfig* config = kapp->config(); + config->setGroup( "General Options" ); + bgParserCheckbox->setChecked( config->readBoolEntry("EnableAdaBgParser", true) ); + delaySlider->setEnabled( bgParserCheckbox->isChecked() ); + delaySlider->setValue( config->readNumEntry("BgParserDelay", 500) ); +} + +void ConfigureProblemReporter::destroy() +{ +} + +void ConfigureProblemReporter::accept() +{ + KConfig* config = kapp->config(); + config->setGroup( "General Options" ); + config->writeEntry( "EnableAdaBgParser", bgParserCheckbox->isChecked() ); + if( bgParserCheckbox->isChecked() ) + config->writeEntry( "BgParserDelay", delaySlider->value() ); + config->sync(); +} + + +void ConfigureProblemReporter::bgParserCheckbox_toggled( bool b ) +{ + delaySlider->setEnabled( b ); +} diff --git a/languages/ada/configure.in.in b/languages/ada/configure.in.in new file mode 100644 index 00000000..be677e4b --- /dev/null +++ b/languages/ada/configure.in.in @@ -0,0 +1,4 @@ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CHECK_HEADERS(sstream) +AC_LANG_RESTORE diff --git a/languages/ada/doc/Makefile.am b/languages/ada/doc/Makefile.am new file mode 100644 index 00000000..ff5f8a32 --- /dev/null +++ b/languages/ada/doc/Makefile.am @@ -0,0 +1,6 @@ +tocdir = ${kde_datadir}/kdevdocumentation/tocs +toc_DATA = ada.toc ada_bugs_gcc.toc + +#indexdir = ${kde_datadir}/devdoctreeview/indices +#index_DATA = + diff --git a/languages/ada/doc/ada.toc b/languages/ada/doc/ada.toc new file mode 100644 index 00000000..434a5b6a --- /dev/null +++ b/languages/ada/doc/ada.toc @@ -0,0 +1,130 @@ + + +Ada + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/languages/ada/doc/ada_bugs_gcc.toc b/languages/ada/doc/ada_bugs_gcc.toc new file mode 100644 index 00000000..9c543f0c --- /dev/null +++ b/languages/ada/doc/ada_bugs_gcc.toc @@ -0,0 +1,7 @@ + + +Ada bugs (GCC) + + + + diff --git a/languages/ada/file_templates/Makefile.am b/languages/ada/file_templates/Makefile.am new file mode 100644 index 00000000..58bbd907 --- /dev/null +++ b/languages/ada/file_templates/Makefile.am @@ -0,0 +1,3 @@ +templatedir = $(kde_datadir)/kdevfilecreate/file-templates +template_DATA = adb ads + diff --git a/languages/ada/file_templates/adb b/languages/ada/file_templates/adb new file mode 100644 index 00000000..0306105a --- /dev/null +++ b/languages/ada/file_templates/adb @@ -0,0 +1,12 @@ +-- +-- +-- Ada Body: $MODULE$ +-- +-- Description: +-- +-- +-- Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +-- +-- Copyright: See COPYING file that comes with this distribution +-- +-- diff --git a/languages/ada/file_templates/ads b/languages/ada/file_templates/ads new file mode 100644 index 00000000..46463d47 --- /dev/null +++ b/languages/ada/file_templates/ads @@ -0,0 +1,12 @@ +-- +-- +-- Ada Spec: $MODULE$ +-- +-- Description: +-- +-- +-- Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +-- +-- Copyright: See COPYING file that comes with this distribution +-- +-- diff --git a/languages/ada/kdevadasupport.desktop b/languages/ada/kdevadasupport.desktop new file mode 100644 index 00000000..4f99e10c --- /dev/null +++ b/languages/ada/kdevadasupport.desktop @@ -0,0 +1,87 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=Ada Language Support +Comment[ca]=Suport per al llenguatge Ada +Comment[da]=Ada sprogunderstøttelse +Comment[de]=Sprachunterstützung für Ada +Comment[el]=Υποστήριξη γλώσσας Ada +Comment[es]=Soporte para lenguaje Ada +Comment[et]=ADA keele toetus +Comment[eu]=Ada lenguaiaren euskarria +Comment[fa]=پشتیبانی زبان آدا +Comment[fr]=Prise en charge du langage ADA +Comment[ga]=Tacaíocht Ada +Comment[gl]=Soporte da linguaxe Ada +Comment[hi]=एडीए भाषा समर्थन +Comment[hu]=Ada nyelvi támogatás +Comment[is]=Stuðningur við Ada forritunarmálið +Comment[it]=Supporto al linguaggio Ada +Comment[ja]=Ada 言語サポート +Comment[ms]=Sokongan Bahasa Ada +Comment[nds]=Spraakünnerstütten för Ada +Comment[ne]=एडा भाषा समर्थन +Comment[nl]=Ondersteuning voor Ada +Comment[pl]=Obsługa języka Ada +Comment[pt]=Suporte à Linguagem Ada +Comment[pt_BR]=Suporte à Linguagem Ada +Comment[ru]=Поддержка языка Ada +Comment[sk]=Podpora jazyka Ada +Comment[sl]=Podpora jeziku ada +Comment[sr]=Ada језичка подршка +Comment[sr@Latn]=Ada jezička podrška +Comment[sv]=Stöd för språket Ada +Comment[ta]=அடா மொழி ஆதரவு +Comment[tg]=Ёри намудани забони Ada +Comment[tr]=Ada Dil Desteği +Comment[zh_CN]=Ada 语言支持 +Comment[zh_TW]=Ada 語言支援 +Name=KDevAdaSupport +Name[da]=KDevelop Ada-understøttelse +Name[de]=Unterstützung für Ada (KDevelop) +Name[hi]=के-डेव-एडीए-समर्थन +Name[nds]=Ada-Ünnerstütten för KDevelop +Name[ne]=केडीई विकास एडा समर्थन +Name[pl]=KDevObsługaAdy +Name[sk]=KDevAdaPodpora +Name[sv]=KDevelop Ada-stöd +Name[ta]=கெடெவ் அடா ஆதரவு +Name[zh_TW]=KDevelop Ada 支援 +GenericName=Ada Language Support +GenericName[ca]=Suport per al llenguatge Ada +GenericName[da]=Ada sprogunderstøttelse +GenericName[de]=Sprachunterstützung für Ada +GenericName[el]=Υποστήριξη γλώσσας Ada +GenericName[es]=Soporte para lenguaje Ada +GenericName[et]=ADA keele toetus +GenericName[eu]=Ada lenguaiaren euskarria +GenericName[fa]=پشتیبانی زبان آدا +GenericName[fr]=Prise en charge du langage ADA +GenericName[ga]=Tacaíocht Ada +GenericName[gl]=Soporte da linguaxe Ada +GenericName[hi]=एडीए भाषा समर्थन +GenericName[hu]=Ada-támogatás +GenericName[it]=Supporto al linguaggio Ada +GenericName[ja]=Ada 言語サポート +GenericName[ms]=Sokongan Bahasa Ada +GenericName[nds]=Ünnerstütten för de Spraak Ada +GenericName[ne]=एडा भाषा समर्थन +GenericName[nl]=Ondersteuning voor Ada +GenericName[pl]=Obsługa języka Ada +GenericName[pt]=Suporte à Linguagem Ada +GenericName[pt_BR]=Suporte à Linguagem Ada +GenericName[ru]=Поддержка языка Ada +GenericName[sk]=Podpora jazyka Ada +GenericName[sl]=Podpora jeziku ada +GenericName[sr]=Ada језичка подршка +GenericName[sr@Latn]=Ada jezička podrška +GenericName[sv]=Stöd för språket Ada +GenericName[ta]=அடா மொழி ஆதரவு +GenericName[tg]=Ёри намудани забони Ada +GenericName[tr]=Ada Dil Desteği +GenericName[zh_CN]=Ada 语言支持 +GenericName[zh_TW]=Ada 語言支援 +ServiceTypes=KDevelop/LanguageSupport +X-KDE-Library=libkdevadasupport +X-KDevelop-Version=5 +X-KDevelop-Language=Ada diff --git a/languages/ada/kdevadasupport.rc b/languages/ada/kdevadasupport.rc new file mode 100644 index 00000000..23b705db --- /dev/null +++ b/languages/ada/kdevadasupport.rc @@ -0,0 +1,11 @@ + + + +

&Tools + + + + + + + diff --git a/languages/ada/preambles.h b/languages/ada/preambles.h new file mode 100644 index 00000000..e9ea460b --- /dev/null +++ b/languages/ada/preambles.h @@ -0,0 +1,89 @@ +/* + * Two macros are defined here: ANTLR_PARSER_PREAMBLE and ANTLR_LEXER_PREAMBLE. + * They encapsulate the application specific extensions for the classes + * AdaParser and AdaLexer which are defined in ada.g. + * This keeps ada.g independent of the application. + * + * Kdevelop version: + * (C) 2003 Oliver M. Kellogg (okellogg@users.sourceforge.net) + */ +#ifndef _PREAMBLES_H_ +#define _PREAMBLES_H_ + +#include +#include "problemreporter.h" + +#define ANTLR_PARSER_PREAMBLE \ + private: \ + unsigned int m_numberOfErrors; \ + ProblemReporter* m_problemReporter; \ + \ + public: \ + void resetErrors () { m_numberOfErrors = 0; } \ + unsigned int numberOfErrors () const { return m_numberOfErrors; } \ + void setProblemReporter (ProblemReporter* r) { m_problemReporter = r; } \ + \ + void reportError (const antlr::RecognitionException& ex) { \ + m_problemReporter->reportError \ + (ex.toString().c_str (), \ + ex.getFilename().c_str (), \ + ex.getLine (), \ + ex.getColumn ()); \ + ++m_numberOfErrors; \ + } \ + \ + void reportError (const std::string& errorMessage) { \ + m_problemReporter->reportError \ + (errorMessage.c_str(), \ + getFilename ().c_str(), \ + LT(1)->getLine (), \ + LT(1)->getColumn ()); \ + ++m_numberOfErrors; \ + } \ + \ + void reportMessage (const std::string& message) { \ + m_problemReporter->reportMessage \ + (message.c_str (), \ + getFilename ().c_str (), \ + LT(1)->getLine (), \ + LT(1)->getColumn ()); \ + } + +#define ANTLR_LEXER_PREAMBLE \ + private: \ + unsigned int m_numberOfErrors; \ + ProblemReporter* m_problemReporter; \ + \ + public: \ + void resetErrors () { m_numberOfErrors = 0; } \ + unsigned int numberOfErrors () const { return m_numberOfErrors; } \ + void setProblemReporter (ProblemReporter* r) { m_problemReporter = r; } \ + \ + void reportError (const antlr::RecognitionException& ex) { \ + m_problemReporter->reportError \ + (ex.toString ().c_str (), \ + ex.getFilename ().c_str (), \ + ex.getLine (), \ + ex.getColumn ()); \ + ++m_numberOfErrors; \ + } \ + \ + void reportError (const std::string& errorMessage) { \ + m_problemReporter->reportError \ + (errorMessage.c_str (), \ + getFilename().c_str (), \ + getLine (), \ + getColumn ()); \ + ++m_numberOfErrors; \ + } \ + \ + void reportWarning (const std::string& warnMessage) { \ + m_problemReporter->reportWarning \ + (warnMessage.c_str (), \ + getFilename ().c_str (), \ + getLine (), \ + getColumn ()); \ + } + +#endif // _PREAMBLES_H_ + diff --git a/languages/ada/problemreporter.cpp b/languages/ada/problemreporter.cpp new file mode 100644 index 00000000..36ac6186 --- /dev/null +++ b/languages/ada/problemreporter.cpp @@ -0,0 +1,282 @@ +/* + Copyright (C) 2002 by Roberto Raggi + Copyright (C) 2003 Oliver Kellogg + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include "problemreporter.h" +#include "adasupportpart.h" +#include "kdevpartcontroller.h" +#include "kdevmainwindow.h" +#include "configproblemreporter.h" +#include "backgroundparser.h" + +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + + +class ProblemItem: public QListViewItem{ +public: + ProblemItem( QListView* parent, const QString& level, const QString& problem, + const QString& file, const QString& line, const QString& column ) + : QListViewItem( parent, level, problem, file, line, column ) {} + + ProblemItem( QListViewItem* parent, const QString& level, const QString& problem, + const QString& file, const QString& line, const QString& column ) + : QListViewItem( parent, level, problem, file, line, column ) {} + + int compare( QListViewItem* item, int column, bool ascending ) const { + if( column == 3 || column == 4 ){ + int a = text( column ).toInt(); + int b = item->text( column ).toInt(); + if( a == b ) + return 0; + return( a > b ? -1 : 1 ); + } + return QListViewItem::compare( item, column, ascending ); + } + +}; + +ProblemReporter::ProblemReporter( AdaSupportPart* part, QWidget* parent, const char* name ) + : QListView( parent, name ), + m_adaSupport( part ), + m_editor( 0 ), + m_document( 0 ), + m_markIface( 0 ), + m_bgParser( 0 ) +{ + QWhatsThis::add(this, i18n("Problem reporter

This window shows errors reported by a language parser.")); + + addColumn( i18n("Level") ); + addColumn( i18n("Problem") ); + addColumn( i18n("File") ); + addColumn( i18n("Line") ); + //addColumn( i18n("Column") ); + setAllColumnsShowFocus( TRUE ); + + m_timer = new QTimer( this ); + + connect( part->partController(), SIGNAL(activePartChanged(KParts::Part*)), + this, SLOT(slotActivePartChanged(KParts::Part*)) ); + connect( part->partController(), SIGNAL(partAdded(KParts::Part*)), + this, SLOT(slotPartAdded(KParts::Part*)) ); + connect( part->partController(), SIGNAL(partRemoved(KParts::Part*)), + this, SLOT(slotPartRemoved(KParts::Part*)) ); + + connect( m_timer, SIGNAL(timeout()), this, SLOT(reparse()) ); + + connect( this, SIGNAL(doubleClicked(QListViewItem*)), + this, SLOT(slotSelected(QListViewItem*)) ); + connect( this, SIGNAL(returnPressed(QListViewItem*)), + this, SLOT(slotSelected(QListViewItem*)) ); + + configure(); +} + +ProblemReporter::~ProblemReporter() +{ + if( m_bgParser ) { + m_bgParser->wait(); + } + + delete( m_bgParser ); + m_bgParser = 0; +} + +void ProblemReporter::slotActivePartChanged( KParts::Part* part ) +{ + if( !part ) + return; + + if( m_editor ) + reparse(); + + m_document = dynamic_cast( part ); + if( m_document ){ + m_filename = m_document->url().path(); + } + + m_editor = dynamic_cast( part ); + if( m_editor ) + connect( m_document, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) ); + + m_markIface = dynamic_cast( part ); + + m_timer->changeInterval( m_delay ); +} + +void ProblemReporter::slotTextChanged() +{ + if( m_active ) + m_timer->changeInterval( m_delay ); +} + +void ProblemReporter::reparse() +{ + kdDebug() << "ProblemReporter::reparse()" << endl; + + if( !m_editor ) + return; + + m_timer->stop(); + + if( m_bgParser ) { + if( m_bgParser->running() ) { + m_timer->changeInterval( m_delay ); + return; + } + + delete( m_bgParser ); + m_bgParser = 0; + } + + QListViewItem* current = firstChild(); + while( current ){ + QListViewItem* i = current; + current = current->nextSibling(); + + if( i->text(2) == m_filename ) + delete( i ); + } + + if( m_markIface ){ + QPtrList marks = m_markIface->marks(); + QPtrListIterator it( marks ); + while( it.current() ){ + m_markIface->removeMark( it.current()->line, KTextEditor::MarkInterface::markType07 ); + ++it; + } + } + +/* Temporarily deactivated (crashes)*/ + if (!m_adaSupport->fileExtensions ().contains (QFileInfo (m_filename).extension ())) + { + m_bgParser = new BackgroundParser( this, m_editor->text(), m_filename ); + m_bgParser->start(); + } + /**/ +} + +void ProblemReporter::slotSelected( QListViewItem* item ) +{ + KURL url( item->text(2) ); + int line = item->text( 3 ).toInt(); + // int column = item->text( 4 ).toInt(); + m_adaSupport->partController()->editDocument( url, line-1 ); +} + +void ProblemReporter::reportError( QString message, + QString filename, + int line, int column ) +{ + if( m_markIface ){ + m_markIface->addMark( line-1, KTextEditor::MarkInterface::markType07 ); + } + + new ProblemItem( this, + "error", + message.replace( QRegExp("\n"), "" ), + filename, + QString::number( line ), + QString::number( column ) ); +} + +void ProblemReporter::reportWarning( QString message, + QString filename, + int line, int column ) +{ + new ProblemItem( this, + "warning", + message.replace( QRegExp("\n"), "" ), + filename, + QString::number( line ), + QString::number( column ) ); +} + +void ProblemReporter::reportMessage( QString message, + QString filename, + int line, int column ) +{ + new QListViewItem( this, + "message", + message.replace( QRegExp("\n"), "" ), + filename, + QString::number( line ), + QString::number( column ) ); +} + +void ProblemReporter::configure() +{ + kdDebug() << "ProblemReporter::configure()" << endl; + KConfig* config = kapp->config(); + config->setGroup( "General Options" ); + m_active = config->readBoolEntry( "EnableAdaBgParser", TRUE ); + m_delay = config->readNumEntry( "BgParserDelay", 500 ); +} + +void ProblemReporter::configWidget( KDialogBase* dlg ) +{ + kdDebug() << "ProblemReporter::configWidget()" << endl; + QVBox *vbox = dlg->addVBoxPage(i18n("Ada Parsing"), i18n("Ada Parsing"), BarIcon( "source", KIcon::SizeMedium )); + ConfigureProblemReporter* w = new ConfigureProblemReporter( vbox ); + connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); + connect(dlg, SIGNAL(okClicked()), this, SLOT(configure())); +} + +void ProblemReporter::slotPartAdded( KParts::Part* part ) +{ + KTextEditor::MarkInterfaceExtension* iface = dynamic_cast( part ); + + if( !iface ) + return; + + iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") ); +} + +void ProblemReporter::slotPartRemoved( KParts::Part* part ) +{ + kdDebug() << "ProblemReporter::slotPartRemoved()" << endl; + if( part == m_document ){ + m_document = 0; + m_editor = 0; + m_timer->stop(); + } +} + +#include "problemreporter.moc" diff --git a/languages/ada/problemreporter.h b/languages/ada/problemreporter.h new file mode 100644 index 00000000..b42a6ad3 --- /dev/null +++ b/languages/ada/problemreporter.h @@ -0,0 +1,79 @@ +/* + Copyright (C) 2002 by Roberto Raggi + Copyright (C) 2003 Oliver Kellogg + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef PROBLEMSREPORTER_H +#define PROBLEMSREPORTER_H + +#include + +class AdaSupportPart; +class QTimer; +class KDialogBase; +class BackgroundParser; + +namespace KParts{ + class Part; +} + +namespace KTextEditor{ + class EditInterface; + class MarkInterface; + class Document; +} + +class ProblemReporter: public QListView{ + Q_OBJECT +public: + ProblemReporter( AdaSupportPart* part, QWidget* parent=0, const char* name=0 ); + virtual ~ProblemReporter(); + + virtual void reportError( QString message, QString filename, + int line, int column ); + + virtual void reportWarning( QString message, QString filename, + int line, int column ); + + virtual void reportMessage( QString message, QString filename, + int line, int column ); + +public slots: + void reparse(); + void configure(); + void configWidget( KDialogBase* ); + +private slots: + void slotPartAdded( KParts::Part* ); + void slotPartRemoved( KParts::Part* ); + void slotActivePartChanged( KParts::Part* ); + void slotTextChanged(); + void slotSelected( QListViewItem* ); + +private: + AdaSupportPart* m_adaSupport; + KTextEditor::EditInterface* m_editor; + KTextEditor::Document* m_document; + KTextEditor::MarkInterface* m_markIface; + QTimer* m_timer; + QString m_filename; + int m_active; + int m_delay; + BackgroundParser* m_bgParser; +}; + +#endif diff --git a/languages/bash/Makefile.am b/languages/bash/Makefile.am new file mode 100644 index 00000000..90b94689 --- /dev/null +++ b/languages/bash/Makefile.am @@ -0,0 +1,20 @@ +#Here resides the Bash Shell support part. + +INCLUDES = -I$(top_srcdir)/lib/interfaces \ + -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \ + $(all_includes) +SUBDIRS = app_templates doc + +kde_module_LTLIBRARIES = libkdevbashsupport.la +libkdevbashsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libkdevbashsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la + +libkdevbashsupport_la_SOURCES = bashsupport_part.cpp + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdevbashsupport.desktop + +rcdir = $(kde_datadir)/kdevbashsupport +rc_DATA = kdevbashsupport.rc diff --git a/languages/bash/README.dox b/languages/bash/README.dox new file mode 100644 index 00000000..95765f0a --- /dev/null +++ b/languages/bash/README.dox @@ -0,0 +1,15 @@ +/** \class BashSupportPart + +Supports bash language + +\authors Ian Reinhart Geiser + +\maintainer Ian Reinhart Geiser + +\feature function browser support +\feature runs bash script in external terminal +\feature syntax highlighting and code folding via katepart +\feature Code completion works for variables +\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part. + +*/ diff --git a/languages/bash/app_templates/Makefile.am b/languages/bash/app_templates/Makefile.am new file mode 100644 index 00000000..7dbe86af --- /dev/null +++ b/languages/bash/app_templates/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = bashhello +profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/ShellIDE +profiles_DATA = bash.appwizard diff --git a/languages/bash/app_templates/bash.appwizard b/languages/bash/app_templates/bash.appwizard new file mode 100644 index 00000000..2e4473b0 --- /dev/null +++ b/languages/bash/app_templates/bash.appwizard @@ -0,0 +1,2 @@ +[General] +List=bashhello diff --git a/languages/bash/app_templates/bashhello/.kdev_ignore b/languages/bash/app_templates/bashhello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/bash/app_templates/bashhello/Makefile.am b/languages/bash/app_templates/bashhello/Makefile.am new file mode 100644 index 00000000..45e403b8 --- /dev/null +++ b/languages/bash/app_templates/bashhello/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = app.sh app.kdevelop +templateName = bashhello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/bash/app_templates/bashhello/app.kdevelop b/languages/bash/app_templates/bashhello/app.kdevelop new file mode 100644 index 00000000..40e783a4 --- /dev/null +++ b/languages/bash/app_templates/bashhello/app.kdevelop @@ -0,0 +1,82 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevScriptProject + Bash + + Bash + + + KDevdistpart + KDevDebugger + + + + + src + *.sh + *~ + + + + + + + + + + ada + ada_bugs_gcc + c++_bugs_gcc + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + libc + libstdc++ + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + diff --git a/languages/bash/app_templates/bashhello/app.sh b/languages/bash/app_templates/bashhello/app.sh new file mode 100644 index 00000000..9e70bd5f --- /dev/null +++ b/languages/bash/app_templates/bashhello/app.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# $Id$ +# %{APPNAME} - Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}> + + +hello() +{ + echo "Hello $NAME" +} + +echo "This is a test" + +LST="Ian Ben Rook Kaz" +for NAME in $LST +do + hello +done diff --git a/languages/bash/app_templates/bashhello/bashhello b/languages/bash/app_templates/bashhello/bashhello new file mode 100644 index 00000000..7c9b9222 --- /dev/null +++ b/languages/bash/app_templates/bashhello/bashhello @@ -0,0 +1,10 @@ +# KDE Config File +[General] +Name=Simple Bash Shell Script +Name[fr]=Un simple script de test Hello world +Category=Shell +Category[fr]=Interprteur BASH +Comment=This generates a simplistic 'Hello world' program in Bash shell +Comment[fr]=Gnre un simple script de test du type Hello world pour l'interprteur BASH. +FileTemplates=sh,ShellStyle +ShowFilesAfterGeneration=APPNAMELC.sh diff --git a/languages/bash/app_templates/bashhello/bashhello.kdevtemplate b/languages/bash/app_templates/bashhello/bashhello.kdevtemplate new file mode 100644 index 00000000..e62b1514 --- /dev/null +++ b/languages/bash/app_templates/bashhello/bashhello.kdevtemplate @@ -0,0 +1,111 @@ +# KDE Config File +[General] +Name=Simple Bash Shell Script +Name[ca]=Simple script de l'intèrpret de comandaments Bash +Name[da]=Simpelt Bash skal-script +Name[de]=Ein einfaches Shell-Skript für Bash +Name[el]=Απλό σενάριο κελύφους Bash +Name[es]=Guión sencillo para el intérprete de órdenes Bash +Name[et]=Lihtne bash'i shelliskript +Name[eu]=Bash shell-aren script sinplea +Name[fa]=دست‌نوشتۀ سادۀ پوستۀ Bash +Name[fr]=Script shell Bash simple +Name[ga]=Script Shimplí Bhlaoisce Bash +Name[gl]=Script sinxelo en Bash Shell +Name[hu]=Egyszerű Bash-szkript +Name[it]=Semplice script shell Bash +Name[ja]=簡単な Bash シェルスクリプト +Name[nds]=En eenfach Konsoolskript för Bash +Name[ne]=साधारण ब्यास शेल स्क्रिप्ट +Name[nl]=Eenvoudig Bash-shellscript +Name[pl]=Prosty skrypt powłoki Bash +Name[pt]=Programa Simples da 'Shell' Bash +Name[pt_BR]=Programa Simples da 'Shell' Bash +Name[ru]=Простой скрипт Bash +Name[sk]=Jednoduchý skript pre Bash Shell +Name[sl]=Preprost skript za lupino Bash +Name[sr]=Једноставна скрипта шкољке Bash +Name[sr@Latn]=Jednostavna skripta školjke Bash +Name[sv]=Enkelt Bash-skalskript +Name[tr]=Basit Bash Kabuk Betiği +Name[zh_CN]=简单的 Bash Shell 脚本 +Name[zh_TW]=簡單的 Bash shell 文稿 +Category=Shell +Category[fr]=Interprteur BASH +Comment=This generates a simplistic 'Hello world' program in Bash shell +Comment[ca]=Genera un simple programa de 'Hello world' en l'intèrpret de comandaments Bash +Comment[da]=Dette genererer et simplistisk 'Goddag verden' program i en Bash skal +Comment[de]=Generiert ein einfaches "Hello world"-Programm für die Bash-Shell +Comment[el]=Αυτό δημιουργεί ένα απλό πρόγραμμα 'Γεια σου κόσμε' στο κέλυφος Bash +Comment[es]=Genera un sencillo programa «Hola mundo» para el intérprete de órdenes Bash +Comment[et]=Lihtsa "Tere, maailm" programmi loomine bash'i shellis +Comment[eu]=Honek "Kaixo mundua" programa sinple bat sortzen du Bash shell-erako +Comment[fa]=یک برنامۀ سادۀ «Hello world» در پوستۀ Bash تولید می‌کند +Comment[fr]=Génère un programme « Bonjour monde » des plus simples en shell Bash +Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" i mblaosc Bash +Comment[gl]=Xera un programa sinxelo 'Ola mundo' en Bash shell +Comment[hu]=Létrehoz egy egyszerű Hello world programot a Bash parancsértelmezőhöz +Comment[it]=Questo genera un semplice programma shell di "Hello world" in Bash +Comment[ja]=簡単な Hello world プログラムを Bash シェルで記述します +Comment[nds]=Dit stellt en eenfach "Moin Welt"-Programm för de Bash-Konsool op +Comment[ne]=यसले ब्यास शेलमा साधारण 'हेल्डो वोल्डकार' कार्यक्रम उत्पन्न गर्दछ +Comment[nl]=Dit genereert een eenvoudig "Hello World" programma in Bash-shell +Comment[pl]=Generuje prosty program 'Witaj świecie' jako skrypt powłoki Bash +Comment[pt]=Isto gera um programa simplista 'Olá mundo' para a linha de comandos Bash +Comment[pt_BR]=Isto gera um programa simplista 'Olá mundo' para a linha de comandos Bash +Comment[ru]=Создание простой программы 'Hello world' на Bash +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v Bash Shell +Comment[sl]=Ustvari preprost program 'Dobrodošel svet' v lupini Bash +Comment[sr]=Ово прави једноставан „Здраво свете“ програм за шкољку Bash +Comment[sr@Latn]=Ovo pravi jednostavan „Zdravo svete“ program za školjku Bash +Comment[sv]=Detta skapar ett förenklat 'Hello world'-program för Bash-skalet +Comment[tr]=Bu, Bash kabuğunda basit bir "Merhaba Dünya" programı üretir. +Comment[zh_CN]=这将生成 Bash shell 中可以使用的“Hello world”程序 +Comment[zh_TW]=這會產生一個簡單的 Bash shell 的 hello world 程式 +FileTemplates=sh,ShellStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.sh +Archive=bashhello.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/app.sh +Dest=%{dest}/%{APPNAMELC}.sh + +[MSG] +Type=message +Comment=A simple bash shell script project was created in %{dest} +Comment[ca]=Un simple script de l'intèrpret de comandaments Bash ha estat creat en %{dest} +Comment[da]=Et simpelt bash skalscript-projekt blev oprettet i %{dest} +Comment[de]=Ein einfaches Shell-Skript-Projekt für Bash wurde in %{dest} erstellt +Comment[el]=Ένα απλό σενάριο κελύφους bash δημιουργήθηκε στο %{dest} +Comment[es]=Un sencillo proyecto de guión de intérprete de órdenes ha sido creado en %{dest} +Comment[et]=Lihtne bash'i shelliskript loodi asukohta %{dest} +Comment[eu]=Bash shell-erako proiektu sinple bat sortu da hemen:%{dest} +Comment[fa]=یک پروژۀ دست‌نوشتۀ پوستۀ bash ساده در %{dest} ایجاد شد +Comment[fr]=Un projet de script shell Bash simple a été créé dans %{dest} +Comment[ga]=Cruthaíodh tionscadal simplí bash i %{dest} +Comment[gl]=Creouse un proxecto de script sinxelo en bash shell en %{dest} +Comment[hu]=Létrejött egy egyszerű Bash-szkript (projekt) itt: %{dest} +Comment[it]=È stato creato un semplice progetto di script shell in Bash in %{dest} +Comment[ja]=簡単な bash シェルスクリプトを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach Konsoolskript-Projekt för Bash opstellt +Comment[ne]=एउटा साधारण शेल स्क्रिप्ट परियोजना %{dest} मा सिर्जना गरिएको थियो +Comment[nl]=Een eenvoudig Bash-shellscript is aangemaakt in %{dest} +Comment[pl]=Prosty skrypt powłoki został utworzony w %{dest} +Comment[pt]=Foi criado um programa simples "Olá mundo" em Bash em %{dest} +Comment[pt_BR]=Foi criado um programa simples "Olá mundo" em Bash em %{dest} +Comment[ru]=Простая программа "Hello world" на Bash создана в %{dest} +Comment[sk]=Jednoduchý Bash Shell projekt bol vytvorený v %{dest} +Comment[sl]=Projekt s preprostim skriptom za lupino Bash je bil ustvarjen v %{dest} +Comment[sr]=Пројекат једноставне скрипте за шкољку Bash направљен је у %{dest} +Comment[sr@Latn]=Projekat jednostavne skripte za školjku Bash napravljen je u %{dest} +Comment[sv]=Ett enkelt Bash skalskriptprojekt skapades i %{dest} +Comment[tr]=Basit bir bash betik projesi %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了简单的 Bash Shell 脚本工程 +Comment[zh_TW]=Bash shell 的 Hello world 程式已產生在 ${dest} diff --git a/languages/bash/app_templates/bashhello/bashhello.png b/languages/bash/app_templates/bashhello/bashhello.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/bash/app_templates/bashhello/bashhello.png differ diff --git a/languages/bash/bashsupport_part.cpp b/languages/bash/bashsupport_part.cpp new file mode 100644 index 00000000..389c0a70 --- /dev/null +++ b/languages/bash/bashsupport_part.cpp @@ -0,0 +1,442 @@ +/* +* Copyright (C) 2003 Ian Reinhart Geiser +*/ +#include "bashsupport_part.h" + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef KDevGenericFactory BashSupportFactory; +static const KDevPluginInfo data("kdevbashsupport"); +K_EXPORT_COMPONENT_FACTORY( libkdevbashsupport, BashSupportFactory( data ) ) + +BashSupportPart::BashSupportPart(QObject *parent, const char *name, const QStringList& ) +: KDevLanguageSupport (&data, parent, name ? name : "BashSupportPart" ) +{ + setInstance(BashSupportFactory::instance()); + setXMLFile("kdevbashsupport.rc"); + + KAction *action; + action = new KAction( i18n("&Run"), "exec",Key_F9,this, SLOT(slotRun()),actionCollection(), "build_execute" ); + action->setToolTip(i18n("Run")); + action->setWhatsThis(i18n("Run

Starts an application.")); + + kdDebug() << "Creating BashSupportPart" << endl; + + connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)), + this, SLOT(projectConfigWidget(KDialogBase*)) ); + connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) ); + connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) ); + connect( partController(), SIGNAL(savedFile(const KURL&)), this, SLOT(savedFile(const KURL&)) ); + connect(partController(), SIGNAL(activePartChanged(KParts::Part*)), + this, SLOT(slotActivePartChanged(KParts::Part *))); + + m_cc = new BashCodeCompletion(); +} + + +BashSupportPart::~BashSupportPart() +{ + delete( m_cc ); + m_cc = 0; +} + + +void BashSupportPart::projectConfigWidget(KDialogBase *dlg) +{ + Q_UNUSED( dlg ); +// QVBox *vbox = dlg->addVBoxPage(i18n("Bash")); +// RubyConfigWidget *w = new RubyConfigWidget(*projectDom(), (QWidget *)vbox, "Bash config widget"); +// connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); +} + +void BashSupportPart::projectOpened() +{ + kdDebug(9014) << "projectOpened()" << endl; + + connect( project(), SIGNAL(addedFilesToProject(const QStringList &)), + this, SLOT(addedFilesToProject(const QStringList &)) ); + connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)), + this, SLOT(removedFilesFromProject(const QStringList &)) ); + + // We want to parse only after all components have been + // properly initialized + QTimer::singleShot(0, this, SLOT(parse())); +} + + +void BashSupportPart::projectClosed() +{ + +} + +void BashSupportPart::slotRun () +{ + QString file; + KParts::ReadOnlyPart *ro_part = dynamic_cast(partController()->activePart()); + if(ro_part) + file = ro_part->url().path(); + + QString cmd = interpreter() + " " + file; + startApplication(cmd); +} + +QString BashSupportPart::interpreter() +{ + QString prog = DomUtil::readEntry(*projectDom(), "/kdevrbashsupport/run/interpreter"); + if (prog.isEmpty()) + prog = "bash"; + return prog; +} + +void BashSupportPart::parse() +{ + kdDebug(9014) << "initialParse()" << endl; + + if (project()) + { + kapp->setOverrideCursor(waitCursor); + QStringList files = project()->allFiles(); + for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) + { + kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl; + parse(project()->projectDirectory() + "/" + *it); + } + emit updatedSourceInfo(); + kapp->restoreOverrideCursor(); + } else { + kdDebug(9014) << "No project" << endl; + } +} + +void BashSupportPart::addedFilesToProject(const QStringList &fileList) +{ +kdDebug(9014) << "addedFilesToProject()" << endl; + + QStringList::ConstIterator it; + + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + parse(project()->projectDirectory() + "/" + ( *it ) ); + } + + emit updatedSourceInfo(); +} + + +void BashSupportPart::removedFilesFromProject(const QStringList &fileList) +{ + kdDebug(9014) << "removedFilesFromProject()" << endl; + + QStringList::ConstIterator it; + + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + QString fileName = project()->projectDirectory() + "/" + ( *it ); + if( codeModel()->hasFile(fileName) ){ + emit aboutToRemoveSourceInfo( fileName ); + codeModel()->removeFile( codeModel()->fileByName(fileName) ); + } + } + + //emit updatedSourceInfo(); +} + +void BashSupportPart::savedFile(const KURL &fileName) +{ + kdDebug(9014) << "savedFile()" << endl; + + if (project()->allFiles().contains(fileName.path().mid ( project()->projectDirectory().length() + 1 ))) + { + parse(fileName.path()); + emit addedSourceInfo( fileName.path() ); + } +} + +void BashSupportPart::startApplication(const QString &program) +{ + kdDebug() << "starting application" << program << endl; + if (KDevAppFrontend *appFrontend = extension("KDevelop/AppFrontend")) + appFrontend->startAppCommand(QString::QString(), program, TRUE); +} + + +KDevLanguageSupport::Features BashSupportPart::features() +{ + return Features(Variables | Functions); +} + +void BashSupportPart::parse(const QString &fileName) +{ + QFileInfo fi(fileName); + m_vars.clear(); + if (fi.extension() == "sh") + { + if( codeModel()->hasFile(fileName) ){ + emit aboutToRemoveSourceInfo( fileName ); + codeModel()->removeFile( codeModel()->fileByName(fileName) ); + } + + FileDom m_file = codeModel()->create(); + m_file->setName( fileName ); + + m_vars.clear(); + QFile f(QFile::encodeName(fileName)); + if (!f.open(IO_ReadOnly)) + return; + QString rawline; + QString line; + uint lineNo = 0; + //KRegExp methodre("\\b([\\d\\w]+[\\s]*)\\([\\s]*\\)"); + QRegExp methodre("^\\s*(\\w+)\\s*\\(\\s*\\)"); + QRegExp varre( "^\\s*(\\w+)[=]" ); + QRegExp expvarre( "^export\\s*(\\w+)[=]" ); + QRegExp forvarre("\\bfor[\\s]+([\\d\\w]+)[\\s]+in[\\s]+"); + + QTextStream stream(&f); + while (!stream.atEnd()) + { + rawline = stream.readLine(); + line = rawline.stripWhiteSpace().local8Bit(); + kdDebug() << "Trying line: " << line << endl; + if (methodre.search(line) != -1) + { + FunctionDom method = codeModel()->create(); + method->setName(methodre.cap(1)); + method->setFileName(fileName); + method->setStartPosition(lineNo, 0); + + if( !m_file->hasFunction(method->name()) ){ + kdDebug() << "Add global method " << method->name() << endl; + m_file->addFunction( method ); + } + } + else if(varre.search(line) != -1) + { + addAttribute(varre.cap(1), m_file, lineNo); + } + else if(expvarre.search(line) != -1) + { + addAttribute(expvarre.cap(1), m_file, lineNo); + } + else if(forvarre.search(line) != -1) + { + addAttribute(forvarre.cap(1), m_file, lineNo); + } + ++lineNo; + } + f.close(); + + kdDebug() << "Trying to add list..." << endl; + codeModel()->addFile( m_file ); + VariableList attrList = codeModel()->globalNamespace()->variableList(); + for (VariableList::Iterator it = attrList.begin(); it != attrList.end(); ++it) + { + kdDebug() << "Adding " << (*it)->name() << endl; + m_vars.append((*it)->name()); + } + m_cc->setVars(m_vars); + + codeModel()->addFile( m_file ); + } + +} + +void BashSupportPart::slotActivePartChanged(KParts::Part *part) +{ + kdDebug() << "Changeing part..." << endl; + m_cc->setActiveEditorPart(part); +} + +void BashSupportPart::addAttribute(const QString &name, FileDom file, uint lineNo) +{ + VariableDom var = codeModel()->create(); + var->setName(name); + var->setFileName(file->name()); + var->setStartPosition( lineNo, 0 ); + var->setType(i18n("Variable")); + + if( !file->hasVariable(var->name()) ){ + kdDebug() << "Add global attribute " << var->name() << endl; + file->addVariable(var); + } +} + +BashCodeCompletion::BashCodeCompletion() +{ + m_argWidgetShow = false; + m_completionBoxShow=false; +} + +BashCodeCompletion::~BashCodeCompletion() +{ + +} + +void BashCodeCompletion::setActiveEditorPart(KParts::Part *part) +{ + if (!part || !part->widget()) + return; + + kdDebug() << "BashCodeCompletion::setActiveEditorPart" << endl; + +// We need to think about this +// if(!(m_config->getCodeCompletion() || m_config->getCodeHinting())){ +// return; // no help +// } + + m_editInterface = dynamic_cast(part); + if (!m_editInterface) + { + kdDebug() << "editor doesn't support the EditDocumentIface" << endl; + return; + } + + m_cursorInterface = dynamic_cast(part->widget()); + if (!m_cursorInterface) + { + kdDebug() << "editor does not support the ViewCursorInterface" << endl; + return; + } + + m_codeInterface = dynamic_cast(part->widget()); + if (!m_codeInterface) { // no CodeCompletionDocument available + kdDebug() << "editor doesn't support the CodeCompletionDocumentIface" << endl; + return; + } + + disconnect(part->widget(), 0, this, 0 ); // to make sure that it is't connected twice + connect(part->widget(), SIGNAL(cursorPositionChanged()), + this, SLOT(cursorPositionChanged())); + connect(part->widget(), SIGNAL(argHintHidden()), this, SLOT(argHintHidden())); + connect(part->widget(), SIGNAL(completionAborted()), this, SLOT(completionBoxAbort())); + connect(part->widget(), SIGNAL(completionDone()), this, SLOT(completionBoxHidden())); + +} + +void BashCodeCompletion::setVars(QStringList lst) +{ + m_vars = lst; +} + +QValueList BashCodeCompletion::getVars(const QString &startText) +{ + kdDebug() << "getVars for " << startText << endl; + QValueList varList; + QValueList::ConstIterator it; + for (it = m_vars.begin(); it != m_vars.end(); ++it) { + QString var = "$" + (*it); + kdDebug() << "Compair " << var << endl; + if( var.startsWith( startText )) + { + KTextEditor::CompletionEntry e; + e.text = var; + //e.postfix =""; + //e.prefix =""; + kdDebug() << "getVar: " << var << endl; + varList.append(e); + } + } + + return varList; +} + +void BashCodeCompletion::cursorPositionChanged() +{ + uint line, col; + m_cursorInterface->cursorPositionReal(&line, &col); + kdDebug() << "BashCodeCompletion::cursorPositionChanged:" << line << ":" << col << endl; + + QString lineStr = m_editInterface->textLine(line); + if(lineStr.isNull() || lineStr.isEmpty()){ + kdDebug() << "No Text..." << endl; + return; // nothing to do + } +// if(m_config->getCodeCompletion()) +// { + QString restLine = lineStr.mid(col); + QString prevText = lineStr.mid(0,col); + + if(restLine.left(1) != " " && restLine.left(1) != "\t" && !restLine.isNull()) + { + kdDebug() << "no codecompletion because no empty character after cursor:" << restLine << ":" << endl; + return; + } + + QRegExp prevReg("[$][\\d\\w]*\\b$"); + + int pos = prevReg.search( prevText ); + if (pos > -1 ) + { + // We are in completion mode + QString startMatch = prevReg.cap(0); + kdDebug() << "Matching: " << startMatch << endl; + m_completionBoxShow=true; + m_codeInterface->showCompletionBox(getVars(startMatch),2); + } + else + { + kdDebug() << "no vars in: " << prevText << endl; + return; + } + +// } + +} + +void BashCodeCompletion::completionBoxHidden() +{ + kdDebug() << "Complete..." << endl; + m_completionBoxShow=false; +/* uint line, col, start; + m_cursorInterface->cursorPositionReal(&line, &col); + QString lineStr = m_editInterface->textLine(line); + + start = lineStr.findRev(QRegExp("[$][\\d\\w]*\\b$")); + m_editInterface->removeText ( start, col, line, col ); +*/ +} + +void BashCodeCompletion::completionBoxAbort() +{ + kdDebug() << "aborted..." << endl; + m_completionBoxShow=false; +} + +KMimeType::List BashSupportPart::mimeTypes( ) +{ + KMimeType::List list; + + KMimeType::Ptr mime = KMimeType::mimeType( "application/x-shellscript" ); + if( mime ) + list << mime; + + return list; +} +#include "bashsupport_part.moc" diff --git a/languages/bash/bashsupport_part.h b/languages/bash/bashsupport_part.h new file mode 100644 index 00000000..20c11c4e --- /dev/null +++ b/languages/bash/bashsupport_part.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2003 Ian Reinhart Geiser + */ + + +#ifndef __KDEVPART_BASHSUPPORT_H__ +#define __KDEVPART_BASHSUPPORT_H__ + + +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +//class BashSupportWidget; + +class BashCodeCompletion : QObject +{ + Q_OBJECT + public: + BashCodeCompletion(); + ~BashCodeCompletion(); + void setActiveEditorPart(KParts::Part*); + void setVars(QStringList); + QValueList getVars(const QString& textHint); + + public slots: + void cursorPositionChanged(); + void completionBoxHidden(); + void completionBoxAbort(); + + private: + QStringList m_vars; + bool m_argWidgetShow; + bool m_completionBoxShow; + KTextEditor::EditInterface *m_editInterface; + KTextEditor::CodeCompletionInterface *m_codeInterface; + KTextEditor::ViewCursorInterface *m_cursorInterface; +}; + +class BashSupportPart : public KDevLanguageSupport +{ + Q_OBJECT + public: + BashSupportPart(QObject *parent, const char *name, const QStringList &); + virtual ~BashSupportPart(); + + protected: + virtual Features features(); + virtual KMimeType::List mimeTypes(); + + private slots: + void slotRun(); + void projectConfigWidget(KDialogBase *dlg); + void projectOpened(); + void projectClosed(); + void savedFile(const KURL &fileName); + void addedFilesToProject(const QStringList &fileList); + void removedFilesFromProject(const QStringList &fileList); + void parse(); + void slotActivePartChanged(KParts::Part *part); + + private: + void startApplication(const QString &program); + QString interpreter(); + void parse(const QString &fileName); + void addAttribute(const QString &name, FileDom file, uint line); + BashCodeCompletion *m_cc; + QStringList m_vars; + +}; + +#endif diff --git a/languages/bash/doc/Makefile.am b/languages/bash/doc/Makefile.am new file mode 100644 index 00000000..1474d939 --- /dev/null +++ b/languages/bash/doc/Makefile.am @@ -0,0 +1,6 @@ +tocdir = ${kde_datadir}/kdevdocumentation/tocs +toc_DATA = bash.toc bash_bugs.toc + +#indexdir = ${kde_datadir}/devdoctreeview/indices +#index_DATA = + diff --git a/languages/bash/doc/bash.toc b/languages/bash/doc/bash.toc new file mode 100644 index 00000000..060c59c7 --- /dev/null +++ b/languages/bash/doc/bash.toc @@ -0,0 +1,80 @@ + + +Bash Reference Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/languages/bash/doc/bash_bugs.toc b/languages/bash/doc/bash_bugs.toc new file mode 100644 index 00000000..aa7b42e3 --- /dev/null +++ b/languages/bash/doc/bash_bugs.toc @@ -0,0 +1,7 @@ + + +Bash bugs + + + + diff --git a/languages/bash/kdevbashsupport.desktop b/languages/bash/kdevbashsupport.desktop new file mode 100644 index 00000000..f46b99eb --- /dev/null +++ b/languages/bash/kdevbashsupport.desktop @@ -0,0 +1,85 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=Bash Support +Comment[ca]=Suport per a Bash +Comment[da]=Bash understøttelse +Comment[de]=Unterstützung für Bash +Comment[el]=Υποστήριξη Bash +Comment[es]=Soporte para Bash +Comment[et]=Bash'i toetus +Comment[eu]=Bash-en euskarria +Comment[fa]=پشتیبانی Bash +Comment[fr]=Prise en charge de BASH +Comment[ga]=Tacaíocht Bash +Comment[gl]=Soporte de Bash +Comment[hi]=बैश समर्थन +Comment[hu]=Bash-támogatás +Comment[is]=Bash stuðnigur +Comment[it]=Supporto per Bash +Comment[ja]=Bash サポート +Comment[nds]=Bash-Ünnerstütten +Comment[ne]=ब्यास समर्थन +Comment[nl]=Ondersteuning voor Bash +Comment[pl]=Obsługa bash-a +Comment[pt]=Suporte a Bash +Comment[pt_BR]=Suporte ao Bash +Comment[ru]=Поддержка языка Bash +Comment[sk]=Podpora Bash +Comment[sl]=Podpora bash +Comment[sr]=Bash подршка +Comment[sr@Latn]=Bash podrška +Comment[sv]=Bash-stöd +Comment[ta]=பாஷ் ஆதரவு +Comment[tg]=Ёри намудани забони Bash +Comment[tr]=Bash Desteği +Comment[zh_CN]=Bash 支持 +Comment[zh_TW]=Bash 支援 +Name=KDevBashSupport +Name[da]=KDevelop Bash-understøttelse +Name[de]=Unterstützung für Bash (KDevelop) +Name[hi]=के-डेव-बैश-समर्थन +Name[nds]=Bash-Ünnerstütten för KDevelop +Name[ne]=केडीई विकास ब्यास समर्थन +Name[pl]=KDevObsługaBasha +Name[sk]=KDevBashPodpora +Name[sv]=KDevelop Bash-stöd +Name[ta]=கெடெவ்பாஷ் ஆதரவு +Name[zh_TW]=KDevelop Bash 支援 +GenericName=Bash Support +GenericName[ca]=Suport per a Bash +GenericName[da]=Bash-understøttelse +GenericName[de]=Unterstützung für Bash +GenericName[el]=Υποστήριξη Bash +GenericName[es]=Soporte para Bash +GenericName[et]=Bash'i toetus +GenericName[eu]=Bash-en euskarria +GenericName[fa]=پشتیبانی Bash +GenericName[fr]=Prise en charge de BASH +GenericName[ga]=Tacaíocht Bash +GenericName[gl]=Soporte de Bash +GenericName[hi]=बैश समर्थन +GenericName[hu]=Bash-támogatás +GenericName[it]=Supporto Bash +GenericName[ja]=Bash サポート +GenericName[nds]=Ünnerstütten för Bash +GenericName[ne]=ब्यास समर्थन +GenericName[nl]=Ondersteuning voor Bash +GenericName[pl]=Obsługa bash-a +GenericName[pt]=Suporte de Bash +GenericName[pt_BR]=Suporte ao Bash +GenericName[ru]=Поддержка языка Bash +GenericName[sk]=Podpora Bash +GenericName[sl]=Podpora bash +GenericName[sr]=Bash подршка +GenericName[sr@Latn]=Bash podrška +GenericName[sv]=Bash-stöd +GenericName[ta]=பாஷ் ஆதரவு +GenericName[tg]=Ёри намудани забони Bash +GenericName[tr]=Bash Desteği +GenericName[zh_CN]=Bash 支持 +GenericName[zh_TW]=Bash 支援 +ServiceTypes=KDevelop/LanguageSupport +X-KDE-Library=libkdevbashsupport +X-KDevelop-Version=5 +X-KDevelop-Language=Bash diff --git a/languages/bash/kdevbashsupport.rc b/languages/bash/kdevbashsupport.rc new file mode 100644 index 00000000..d4592d6b --- /dev/null +++ b/languages/bash/kdevbashsupport.rc @@ -0,0 +1,11 @@ + + + +

+ + + + + + + diff --git a/languages/cpp/KDevCppSupportIface.cpp b/languages/cpp/KDevCppSupportIface.cpp new file mode 100644 index 00000000..f5af83c9 --- /dev/null +++ b/languages/cpp/KDevCppSupportIface.cpp @@ -0,0 +1,24 @@ + +#include "KDevCppSupportIface.h" +#include "cppsupportpart.h" + +KDevCppSupportIface::KDevCppSupportIface( CppSupportPart* cppSupport ) + : QObject( cppSupport ), DCOPObject( "KDevCppSupport" ), m_cppSupport( cppSupport ) +{ +} + +KDevCppSupportIface::~KDevCppSupportIface() +{ +} + +void KDevCppSupportIface::addClass() +{ + m_cppSupport->slotNewClass(); +} + +void KDevCppSupportIface::parseProject() +{ + m_cppSupport->parseProject(); +} + +#include "KDevCppSupportIface.moc" diff --git a/languages/cpp/KDevCppSupportIface.h b/languages/cpp/KDevCppSupportIface.h new file mode 100644 index 00000000..34780d8c --- /dev/null +++ b/languages/cpp/KDevCppSupportIface.h @@ -0,0 +1,27 @@ + +#ifndef KDEVCPPSUPPORTIFACE_H +#define KDEVCPPSUPPORTIFACE_H + +#include +#include + +class CppSupportPart; + +class KDevCppSupportIface : public QObject, public DCOPObject +{ + Q_OBJECT + K_DCOP +public: + KDevCppSupportIface( CppSupportPart* cppSupport ); + ~KDevCppSupportIface(); + +k_dcop: + void addClass(); + void parseProject(); + +private: + CppSupportPart* m_cppSupport; +}; + +#endif +// kate: indent-mode csands; tab-width 4; diff --git a/languages/cpp/Makefile.am b/languages/cpp/Makefile.am new file mode 100644 index 00000000..30ba6d44 --- /dev/null +++ b/languages/cpp/Makefile.am @@ -0,0 +1,59 @@ +# Here resides the C/C++ support part. + +SUBDIRS = templates subclassing_template newclass_templates file_templates \ + app_templates compiler pcsimporter debugger doc + +INCLUDES = -I$(top_srcdir)/languages/lib/designer_integration \ + -I$(top_srcdir)/languages/lib/interfaces -I$(top_srcdir)/lib/catalog -I$(top_srcdir)/lib/compat \ + -I$(top_srcdir)/lib/cppparser -I$(top_srcdir)/lib/interfaces \ + -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \ + -I$(top_builddir)/languages/lib/designer_integration -I$(top_builddir)/bdb/build_unix -I$(top_srcdir)/bdb/include \ + $(all_includes) + +kde_module_LTLIBRARIES = libkdevcppsupport.la +libkdevcppsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libkdevcppsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \ + $(top_builddir)/lib/catalog/libkdevcatalog.la $(top_builddir)/lib/cppparser/libkdevcppparser.la \ + $(top_builddir)/languages/lib/interfaces/liblang_interfaces.la \ + $(top_builddir)/languages/lib/designer_integration/libdesignerintegration.la $(top_builddir)/lib/interfaces/libkdevinterfaces.la + +libkdevcppsupport_la_SOURCES = KDevCppSupportIface.cpp KDevCppSupportIface.skel \ + addattributedialog.cpp addattributedialogbase.ui addmethoddialog.cpp addmethoddialogbase.ui \ + ast_utils.cpp backgroundparser.cpp ccconfigwidget.cpp ccconfigwidgetbase.ui \ + classgeneratorconfig.cpp classgeneratorconfigbase.ui codeinformationrepository.cpp \ + completiondebug.cpp configproblemreporter.ui cppcodecompletion.cpp \ + cppcodecompletionconfig.cpp cppevaluation.cpp cppimplementationwidget.cpp cppnewclassdlg.cpp \ + cppnewclassdlgbase.ui cppsplitheadersourceconfig.cpp cppsupport_utils.cpp \ + cppsupportfactory.cpp cppsupportpart.cpp creategettersetter.ui \ + creategettersetterconfiguration.cpp creategettersetterconfiguration.h creategettersetterdialog.cpp \ + creategettersetterdialog.h createpcsdialog.cpp createpcsdialogbase.ui doxydoc.cpp includefiles.cpp \ + includepathresolver.cpp kdevdriver.cpp problemreporter.cpp qtbuildconfig.cpp \ + qtdesignercppintegration.cpp setuphelper.cpp simplecontext.cpp simpletype.cpp simpletypecatalog.cpp \ + simpletypefunction.cpp simpletypenamespace.cpp store_walker.cpp storeconverter.cpp \ + stringhelpers.cpp subclassingdlg.cpp subclassingdlgbase.ui tag_creator.cpp typedesc.cpp + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdevcppsupport.desktop kdevcsupport.desktop + +rcdir = $(kde_datadir)/kdevcppsupport +rc_DATA = kdevcppsupport.rc + +templatedir = ${kde_datadir}/kdevabbrev/templates +template_DATA = cpptemplates + +configurationdir = ${kde_datadir}/kdevcppsupport +configuration_DATA = configuration + +AM_CXXFLAGS = -DAST_DEBUG + +#bin_PROGRAMS = r++ +#r___LDFLAGS = $(all_libraries) +#r___SOURCES = main.cpp +#r___DEPENDENCIES = libkdevcppsupport.la +#r___LDADD = libkdevcppsupport.la $(top_builddir)/lib/catalog/libkdevcatalog.la $(top_builddir)/lib/cppparser/libkdevcppparser.la +noinst_HEADERS = cppevaluation.h cppimplementationwidget.h \ + cppsplitheadersourceconfig.h declarationinfo.h expressioninfo.h includefiles.h includepathresolver.h \ + qtdesignercppintegration.h setuphelper.h simplecontext.h simpletypecatalog.h simpletypefunction.h \ + simpletypenamespace.h storeconverter.h diff --git a/languages/cpp/README.dox b/languages/cpp/README.dox new file mode 100644 index 00000000..ba1fbc05 --- /dev/null +++ b/languages/cpp/README.dox @@ -0,0 +1,34 @@ +/** \class CppSupportPart +Provides C/C++ language support for KDevelop. + +Well the first thing you should read is lib/catalog it contains the source of the persistant class store +after that languages/cpp/tag_creator.* +it is the component that stores the informations collected by the c++ parser into the PCS +then you can play with KDevPCSImporter the code of the dialog is in languages/cpp/createpcsdialog* and languages/cpp/pcsimporter/* +and of course lib/interfaces/kdevpcsimporter.* +and if you want play with the c++ parser go to lib/cppparser/, the best is to start to read driver.* + +\authors Roberto Raggi + +\maintainer Roberto Raggi + +\feature supports C/C++ language +\feature can do code completion +\feature has presistent class store +\feature code highlight +\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part. + +\bug bugs in cppsupport component at Bugzilla database + +\faq How can I have documentation on functions when using codecompletion ? + -# Create the xml-output with Doxygen of the files you want to add to the classstore + -# Create the new PCS-database with r++. Now you have to use the -d command line switch of r++ to have it include the documentation. + It is used like -d/path/of/doxygen/xml/output (notice that there is _no_ whitespace between -d and the path!). + You can use it multiple times to have r++ search for the informations in different directories. + r++ -d has to be used (like every other commandline switch) before you write the directories you want r++ to create the PCSdatabase from. + -# Activate your newly created Database in the Project->Project Options...->C++ Specific->Code Completion... + . +\faq How does this work ? I have no clue. Ask roberto! :) +\faq How does r++ work ? I have no clue. Ask roberto! :) + +*/ diff --git a/languages/cpp/addattributedialog.cpp b/languages/cpp/addattributedialog.cpp new file mode 100644 index 00000000..408b2ff8 --- /dev/null +++ b/languages/cpp/addattributedialog.cpp @@ -0,0 +1,265 @@ +/* +* Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org) +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Library General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; see the file COPYING.LIB. If not, write to +* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +* Boston, MA 02111-1307, USA. +* +*/ + +#include "addattributedialog.h" +#include "cppsupportpart.h" +#include "backgroundparser.h" +#include "cppsupport_utils.h" + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +AddAttributeDialog::AddAttributeDialog( CppSupportPart* cppSupport, ClassDom klass, + QWidget* parent, const char* name, bool modal, WFlags fl ) +: AddAttributeDialogBase( parent, name, modal, fl ), m_cppSupport( cppSupport ), m_klass( klass ), m_count( 0 ) +{ + access->insertStringList( QStringList() << "Public" << "Protected" << "Private" ); + + storage->insertStringList( QStringList() << "Normal" << "Static" ); + + returnType->setAutoCompletion( true ); + returnType->insertStringList( QStringList() + << "void" + << "char" + << "wchar_t" + << "bool" + << "short" + << "int" + << "long" + << "signed" + << "unsigned" + << "float" + << "double" ); + + returnType->insertStringList( typeNameList( m_cppSupport->codeModel() ) ); + + updateGUI(); + addAttribute(); +} + +AddAttributeDialog::~AddAttributeDialog() +{} + +void AddAttributeDialog::reject() +{ + QDialog::reject(); +} + +void AddAttributeDialog::accept() +{ + m_cppSupport->partController()->editDocument( KURL( m_klass->fileName() ) ); + KTextEditor::EditInterface* editIface = dynamic_cast( m_cppSupport->partController() ->activePart() ); + if ( !editIface ) + { + /// @todo show messagebox + QDialog::accept(); + return ; + } + + int line, column; + m_klass->getEndPosition( &line, &column ); + + // compute the insertion point map + QMap > points; + QStringList accessList; + + const VariableList variableList = m_klass->variableList(); + for ( VariableList::ConstIterator it = variableList.begin(); it != variableList.end(); ++it ) + { + int varEndLine, varEndColumn; + ( *it ) ->getEndPosition( &varEndLine, &varEndColumn ); + QString access = accessID( *it ); + QPair varEndPoint = qMakePair( varEndLine, varEndColumn ); + + if ( !points.contains( access ) || points[ access ] < varEndPoint ) + { + accessList.remove( access ); + accessList.push_back( access ); // move 'access' at the end of the list + + points[ access ] = varEndPoint; + } + } + + int insertedLine = 0; + + accessList += newAccessList( accessList ); + + for ( QStringList::iterator it = accessList.begin(); it != accessList.end(); ++it ) + { + QListViewItem* item = attributes->firstChild(); + while ( item ) + { + QListViewItem * currentItem = item; + + item = item->nextSibling(); + + if ( currentItem->text( 0 ) != *it ) + continue; + + QString access = ( *it ).lower(); + + QString str = variableDeclaration( currentItem ); + + QPair pt; + if ( points.contains( *it ) ) + { + pt = points[ *it ]; + } + else + { + str.prepend( access + ":\n" ); + points[ *it ] = qMakePair( line - 1, 0 ); + pt = points[ *it ]; // end of class declaration + } + + editIface->insertText( pt.first + insertedLine + 1, 0 /*pt.second*/, str ); + insertedLine += str.contains( QChar( '\n' ) ); + } + } + + m_cppSupport->backgroundParser() ->addFile( m_klass->fileName() ); + + QDialog::accept(); +} + +QString AddAttributeDialog::variableDeclaration( QListViewItem* item ) const +{ + QString str; + QTextStream stream( &str, IO_WriteOnly ); + QString ind; + ind.fill( QChar( ' ' ), 4 ); + + stream << ind; + if ( item->text( 1 ) == "Static" ) + stream << "static "; + stream << item->text( 2 ) << " " << item->text( 3 ); + stream << ";\n"; + + return str; +} + + +void AddAttributeDialog::updateGUI() +{ + bool enable = attributes->selectedItem() != 0; + + returnType->setEnabled( enable ); + declarator->setEnabled( enable ); + access->setEnabled( enable ); + storage->setEnabled( enable ); + + deleteAttributeButton->setEnabled( enable ); + + if ( enable ) + { + QListViewItem * item = attributes->selectedItem(); + item->setText( 0, access->currentText() ); + item->setText( 1, storage->currentText() ); + item->setText( 2, returnType->currentText() ); + item->setText( 3, declarator->text() ); + } +} + +void AddAttributeDialog::addAttribute() +{ + QListViewItem * item = new QListViewItem( attributes, "Protected", "Normal", + "int", QString( "attribute_%1" ).arg( ++m_count ) ); + attributes->setCurrentItem( item ); + attributes->setSelected( item, true ); + + returnType->setFocus(); +} + +void AddAttributeDialog::deleteCurrentAttribute() +{ + delete( attributes->currentItem() ); +} + +void AddAttributeDialog::currentChanged( QListViewItem* item ) +{ + if ( item ) + { + QString _access = item->text( 0 ); + QString _storage = item->text( 1 ); + QString _returnType = item->text( 2 ); + QString _declarator = item->text( 3 ); + + access->setCurrentText( _access ); + storage->setCurrentText( _storage ); + returnType->setCurrentText( _returnType ); + declarator->setText( _declarator ); + } + + updateGUI(); +} + +QStringList AddAttributeDialog::newAccessList( const QStringList& accessList ) const +{ + QStringList newAccessList; + + QListViewItem* item = attributes->firstChild(); + while ( item ) + { + QListViewItem * currentItem = item; + + item = item->nextSibling(); + + QString access = currentItem->text( 0 ); + if ( !( accessList.contains( access ) || newAccessList.contains( access ) ) ) + newAccessList.push_back( access ); + } + + return newAccessList; +} + +QString AddAttributeDialog::accessID( VariableDom var ) const +{ + switch ( var->access() ) + { + case CodeModelItem::Public: + return QString::fromLatin1( "Public" ); + + case CodeModelItem::Protected: + return QString::fromLatin1( "Protected" ); + + case CodeModelItem::Private: + return QString::fromLatin1( "Private" ); + } + + return QString::null; +} + +#include "addattributedialog.moc" +//kate: indent-mode csands; tab-width 4; space-indent off; + diff --git a/languages/cpp/addattributedialog.h b/languages/cpp/addattributedialog.h new file mode 100644 index 00000000..18818ef7 --- /dev/null +++ b/languages/cpp/addattributedialog.h @@ -0,0 +1,60 @@ +/* +* Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org) +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Library General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; see the file COPYING.LIB. If not, write to +* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +* Boston, MA 02111-1307, USA. +* +*/ + +#ifndef ADDATTRIBUTEDIALOG_H +#define ADDATTRIBUTEDIALOG_H + +#include "addattributedialogbase.h" +#include + +class CppSupportPart; + +class AddAttributeDialog : public AddAttributeDialogBase +{ + Q_OBJECT +public: + AddAttributeDialog( CppSupportPart* cppSupport, ClassDom klass, + QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ~AddAttributeDialog(); + + virtual void addAttribute(); + virtual void deleteCurrentAttribute(); + virtual void currentChanged( QListViewItem* item ); + virtual void updateGUI(); + +protected: + virtual void reject(); + virtual void accept(); + +private: + QString accessID( VariableDom var ) const; + QStringList newAccessList( const QStringList& accessList ) const; + QString variableDeclaration( QListViewItem* item ) const; + +private: + CppSupportPart* m_cppSupport; + ClassDom m_klass; + int m_count; +}; + +#endif +// kate: indent-mode csands; tab-width 4; + + diff --git a/languages/cpp/addattributedialogbase.ui b/languages/cpp/addattributedialogbase.ui new file mode 100644 index 00000000..eabd89fe --- /dev/null +++ b/languages/cpp/addattributedialogbase.ui @@ -0,0 +1,375 @@ + +AddAttributeDialogBase + + + AddAttributeDialogBase + + + + 0 + 0 + 619 + 413 + + + + Add Attribute + + + true + + + + unnamed + + + + + Access + + + true + + + true + + + + + Storage + + + true + + + true + + + + + Type + + + true + + + true + + + + + Declarator + + + true + + + true + + + + attributes + + + true + + + LastColumn + + + + + layout3 + + + + unnamed + + + + spacer3 + + + Horizontal + + + Expanding + + + + 111 + 20 + + + + + + addAttributeButton + + + &Add Attribute + + + + + deleteAttributeButton + + + &Delete Attribute + + + + + + + groupBox1 + + + Attribute Properties + + + + unnamed + + + + layout4 + + + + unnamed + + + + textLabel1 + + + T&ype: + + + returnType + + + + + returnType + + + true + + + + + declarator + + + + + textLabel2 + + + D&eclarator: + + + declarator + + + + + + + layout5 + + + + unnamed + + + + storage + + + + + textLabel5 + + + S&torage: + + + storage + + + + + textLabel3 + + + Acce&ss: + + + access + + + + + access + + + + + + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + Horizontal Spacing2 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + buttonOk + + + &OK + + + + + + true + + + true + + + + + buttonCancel + + + &Cancel + + + + + + true + + + + + + + + + buttonOk + clicked() + AddAttributeDialogBase + accept() + + + buttonCancel + clicked() + AddAttributeDialogBase + reject() + + + addAttributeButton + clicked() + AddAttributeDialogBase + addAttribute() + + + deleteAttributeButton + clicked() + AddAttributeDialogBase + deleteCurrentAttribute() + + + attributes + selectionChanged(QListViewItem*) + AddAttributeDialogBase + currentChanged(QListViewItem*) + + + returnType + activated(const QString&) + AddAttributeDialogBase + updateGUI() + + + declarator + textChanged(const QString&) + AddAttributeDialogBase + updateGUI() + + + access + activated(const QString&) + AddAttributeDialogBase + updateGUI() + + + storage + activated(const QString&) + AddAttributeDialogBase + updateGUI() + + + returnType + textChanged(const QString&) + AddAttributeDialogBase + updateGUI() + + + + attributes + addAttributeButton + deleteAttributeButton + returnType + declarator + access + storage + buttonOk + buttonCancel + + + kdialog.h + + + init() + destroy() + addAttribute() + deleteCurrentAttribute() + currentChanged(QListViewItem*) + updateGUI() + + + + diff --git a/languages/cpp/addmethoddialog.cpp b/languages/cpp/addmethoddialog.cpp new file mode 100644 index 00000000..943f15d7 --- /dev/null +++ b/languages/cpp/addmethoddialog.cpp @@ -0,0 +1,420 @@ +/* +* Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org) +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Library General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; see the file COPYING.LIB. If not, write to +* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +* Boston, MA 02111-1307, USA. +* +*/ + +#include "addmethoddialog.h" +#include "cppsupportpart.h" +#include "backgroundparser.h" +#include "cppsupport_utils.h" +#include "domutil.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +AddMethodDialog::AddMethodDialog( CppSupportPart* cppSupport, ClassDom klass, + QWidget* parent, const char* name, bool modal, WFlags fl ) +: AddMethodDialogBase( parent, name, modal, fl ), m_cppSupport( cppSupport ), m_klass( klass ), m_count( 0 ) +{ + QString fileName = m_klass->fileName(); + + access->insertStringList( QStringList() << "Public" << "Protected" << "Private" << "Signals" << + "Public Slots" << "Protected Slots" << "Private Slots" ); + + storage->insertStringList( QStringList() << "Normal" << "Static" << "Virtual" << "Pure Virtual" << "Friend" ); + + // setup sourceFile combo + QMap m; +#if 0 /// \FIXME ROBE + + FunctionList l = m_klass->functionList(); + { + for ( FunctionList::Iterator it = l.begin(); it != l.end(); ++it ) + { + if ( ( *it ) ->hasImplementation() ) + m.insert( ( *it ) ->implementedInFile(), true ); + } + } +#endif + + { + QStringList headers = QStringList::split( ",", "h,H,hh,hxx,hpp,inl,tlh,diff,ui.h" ); + QStringList fileList; + QMap::Iterator it = m.begin(); + while ( it != m.end() ) + { + QString ext = QFileInfo( it.key() ).extension(); + if ( !headers.contains( ext ) ) + sourceFile->insertItem( it.key() ); + ++it; + } + + if ( sourceFile->count() == 0 ) + { + QFileInfo info( fileName ); + QString impl = DomUtil::readEntry( *cppSupport->projectDom(), "/cppsupportpart/filetemplates/implementationsuffix", "cpp" ); + sourceFile->insertItem( info.dirPath( true ) + "/" + info.baseName() + impl ); + } + } + + returnType->setAutoCompletion( true ); + returnType->insertStringList( QStringList() + << "void" + << "char" + << "wchar_t" + << "bool" + << "short" + << "int" + << "long" + << "signed" + << "unsigned" + << "float" + << "double" ); + + returnType->insertStringList( typeNameList( m_cppSupport->codeModel() ) ); + + updateGUI(); + addMethod(); +} + +AddMethodDialog::~AddMethodDialog() +{} + +void AddMethodDialog::reject() +{ + QDialog::reject(); +} + +QString AddMethodDialog::accessID( FunctionDom fun ) const +{ + if ( fun->isSignal() ) + return QString::fromLatin1( "Signals" ); + + switch ( fun->access() ) + { + case CodeModelItem::Public: + if ( fun->isSlot() ) + return QString::fromLatin1( "Public Slots" ); + return QString::fromLatin1( "Public" ); + + case CodeModelItem::Protected: + if ( fun->isSlot() ) + return QString::fromLatin1( "Protected Slots" ); + return QString::fromLatin1( "Protected" ); + + case CodeModelItem::Private: + if ( fun->isSlot() ) + return QString::fromLatin1( "Private Slots" ); + return QString::fromLatin1( "Private" ); + } + + return QString::null; +} + +void AddMethodDialog::accept() +{ + m_cppSupport->partController() ->editDocument( KURL( m_klass->fileName() ) ); + KTextEditor::EditInterface* editIface = dynamic_cast( m_cppSupport->partController() ->activePart() ); + if ( !editIface ) + { + /// @todo show messagebox + QDialog::accept(); + return ; + } + + int line, column; + m_klass->getEndPosition( &line, &column ); + + // compute the insertion point map + QMap > points; + QStringList accessList; + + const FunctionList functionList = m_klass->functionList(); + for ( FunctionList::ConstIterator it = functionList.begin(); it != functionList.end(); ++it ) + { + int funEndLine, funEndColumn; + ( *it ) ->getEndPosition( &funEndLine, &funEndColumn ); + QString access = accessID( *it ); + QPair funEndPoint = qMakePair( funEndLine, funEndColumn ); + + if ( !points.contains( access ) || points[ access ] < funEndPoint ) + { + accessList.remove( access ); + accessList.push_back( access ); // move 'access' at the end of the list + + points[ access ] = funEndPoint; + } + } + + int insertedLine = 0; + + accessList += newAccessList( accessList ); + + for ( QStringList::iterator it = accessList.begin(); it != accessList.end(); ++it ) + { + QListViewItem* item = methods->firstChild(); + while ( item ) + { + QListViewItem * currentItem = item; + + item = item->nextSibling(); + + if ( currentItem->text( 1 ) != *it ) + continue; + + QString access = ( *it ).lower(); + + bool isInline = currentItem->text( 0 ) == "True"; + QString str = isInline ? functionDefinition( currentItem ) : functionDeclaration( currentItem ); + + QPair pt; + if ( points.contains( *it ) ) + { + pt = points[ *it ]; + } + else + { + str.prepend( access + ":\n" ); + points[ *it ] = qMakePair( line - 1, 0 ); + pt = points[ *it ]; // end of class declaration + } + + editIface->insertText( pt.first + insertedLine + 1, 0 /*pt.second*/, str ); + insertedLine += str.contains( QChar( '\n' ) ); + } + } + + m_cppSupport->backgroundParser() ->addFile( m_klass->fileName() ); + + QString str; + QListViewItem* item = methods->firstChild(); + while ( item ) + { + QListViewItem * currentItem = item; + + item = item->nextSibling(); + + QString str = functionDefinition( currentItem ); + if ( str.isEmpty() ) + continue; + + QString implementationFile = currentItem->text( 5 ); + if ( currentItem->text( 0 ) == "True" ) + implementationFile = m_klass->fileName(); + + QFileInfo fileInfo( implementationFile ); + if ( !QFile::exists( fileInfo.absFilePath() ) ) + { + if ( KDevCreateFile * createFileSupp = m_cppSupport->extension( "KDevelop/CreateFile" ) ) + createFileSupp->createNewFile( fileInfo.extension(), fileInfo.dirPath( true ), fileInfo.baseName() ); + } + + m_cppSupport->partController() ->editDocument( KURL( implementationFile ) ); + editIface = dynamic_cast( m_cppSupport->partController() ->activePart() ); + if ( !editIface ) + continue; + + bool isInline = currentItem->text( 0 ) == "True"; + if ( !isInline ) + { + editIface->insertLine( editIface->numLines(), QString::fromLatin1( "" ) ); + editIface->insertText( editIface->numLines() - 1, 0, str ); + m_cppSupport->backgroundParser() ->addFile( implementationFile ); + } + } + + QDialog::accept(); +} + +void AddMethodDialog::updateGUI() +{ + bool enable = methods->selectedItem() != 0; + + returnType->setEnabled( enable ); + declarator->setEnabled( enable ); + access->setEnabled( enable ); + storage->setEnabled( enable ); + isInline->setEnabled( enable ); + + sourceFile->setEnabled( enable ); + browseButton->setEnabled( enable ); + + deleteMethodButton->setEnabled( enable ); + + if ( enable ) + { + QListViewItem * item = methods->selectedItem(); + item->setText( 0, isInline->isChecked() ? "True" : "False" ); + item->setText( 1, access->currentText() ); + item->setText( 2, storage->currentText() ); + item->setText( 3, returnType->currentText() ); + item->setText( 4, declarator->text() ); + item->setText( 5, sourceFile->currentText() ); + + if ( isInline->isChecked() || storage->currentText() == "Friend" || storage->currentText() == "Pure Virtual" ) + { + sourceFile->setEnabled( false ); + browseButton->setEnabled( false ); + } + } +} + +void AddMethodDialog::addMethod() +{ + QListViewItem * item = new QListViewItem( methods, "False", "Public", "Normal", + "void", QString( "method_%1()" ).arg( ++m_count ), + sourceFile->currentText() ); + methods->setCurrentItem( item ); + methods->setSelected( item, true ); + + returnType->setFocus(); +} + +void AddMethodDialog::deleteCurrentMethod() +{ + delete( methods->currentItem() ); + updateGUI(); +} + +void AddMethodDialog::currentChanged( QListViewItem* item ) +{ + if ( item ) + { + QString _isInline = item->text( 0 ); + QString _access = item->text( 1 ); + QString _storage = item->text( 2 ); + QString _returnType = item->text( 3 ); + QString _declarator = item->text( 4 ); + QString _sourceFile = item->text( 5 ); + + isInline->setChecked( _isInline == "True" ? true : false ); + access->setCurrentText( _access ); + storage->setCurrentText( _storage ); + returnType->setCurrentText( _returnType ); + declarator->setText( _declarator ); + sourceFile->setCurrentText( _sourceFile ); + } + + updateGUI(); +} + +void AddMethodDialog::browseImplementationFile() +{ + QString fileName = KFileDialog::getOpenFileName(); + sourceFile->setCurrentText( fileName ); + updateGUI(); +} + +QString AddMethodDialog::functionDeclaration( QListViewItem * item ) const +{ + QString str; + QTextStream stream( &str, IO_WriteOnly ); + + QString access = item->text( 1 ).lower(); + + stream << " "; /// @todo use AStyle + if ( item->text( 2 ) == "Virtual" || item->text( 2 ) == "Pure Virtual" ) + stream << "virtual "; + else if ( item->text( 2 ) == "Friend" ) + stream << "friend "; + else if ( item->text( 2 ) == "Static" ) + stream << "static "; + stream << item->text( 3 ) << " " << item->text( 4 ); + if ( item->text( 2 ) == "Pure Virtual" ) + stream << " = 0"; + stream << ";\n"; + + return str; +} + +QString AddMethodDialog::functionDefinition( QListViewItem* item ) const +{ + if ( item->text( 1 ) == "Signals" || item->text( 2 ) == "Pure Virtual" || + item->text( 2 ) == "Friend" ) + { + return QString::null; + } + + QString className = m_klass->name(); + QString fullName = m_klass->scope().join( "::" ); + if ( !fullName.isEmpty() ) + fullName += "::"; + fullName += className; + + QString str; + QTextStream stream( &str, IO_WriteOnly ); + + bool isInline = item->text( 0 ) == "True"; + + QString ind; + if ( isInline ) + ind.fill( QChar( ' ' ), 4 ); + + stream << "\n" + << ind << "/*!\n" + << ind << " \\fn " << fullName << "::" << item->text( 4 ) << "\n" + << ind << " */\n"; + + stream + << ind << item->text( 3 ) << " " << ( isInline ? QString::fromLatin1( "" ) : fullName + "::" ) + << item->text( 4 ) << "\n" + << ind << "{\n" + << ind << " /// @todo implement me\n" + << ind << "}\n"; + + return str; +} + +QStringList AddMethodDialog::newAccessList( const QStringList& accessList ) const +{ + QStringList newAccessList; + + QListViewItem* item = methods->firstChild(); + while ( item ) + { + QListViewItem * currentItem = item; + + item = item->nextSibling(); + + QString access = currentItem->text( 1 ); + if ( !( accessList.contains( access ) || newAccessList.contains( access ) ) ) + newAccessList.push_back( access ); + } + + return newAccessList; +} + +#include "addmethoddialog.moc" +//kate: indent-mode csands; tab-width 4; space-indent off; + diff --git a/languages/cpp/addmethoddialog.h b/languages/cpp/addmethoddialog.h new file mode 100644 index 00000000..695ddc80 --- /dev/null +++ b/languages/cpp/addmethoddialog.h @@ -0,0 +1,62 @@ +/* +* Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org) +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Library General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; see the file COPYING.LIB. If not, write to +* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +* Boston, MA 02111-1307, USA. +* +*/ + +#ifndef ADDMETHODDIALOG_H +#define ADDMETHODDIALOG_H + +#include "addmethoddialogbase.h" +#include + +class CppSupportPart; + +class AddMethodDialog : public AddMethodDialogBase +{ + Q_OBJECT +public: + AddMethodDialog( CppSupportPart* cppSupport, ClassDom klass, + QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ~AddMethodDialog(); + + virtual void addMethod(); + virtual void deleteCurrentMethod(); + virtual void currentChanged( QListViewItem* item ); + virtual void updateGUI(); + virtual void browseImplementationFile(); + +protected: + virtual void reject(); + virtual void accept(); + +private: + QString accessID( FunctionDom fun ) const; + QString functionDeclaration( QListViewItem* item ) const; + QString functionDefinition( QListViewItem* item ) const; + QStringList newAccessList( const QStringList& accessList ) const; + +private: + CppSupportPart* m_cppSupport; + ClassDom m_klass; + int m_count; +}; + +#endif +// kate: indent-mode csands; tab-width 4; + + diff --git a/languages/cpp/addmethoddialogbase.ui b/languages/cpp/addmethoddialogbase.ui new file mode 100644 index 00000000..5ab3f769 --- /dev/null +++ b/languages/cpp/addmethoddialogbase.ui @@ -0,0 +1,459 @@ + +AddMethodDialogBase + + + AddMethodDialogBase + + + + 0 + 0 + 613 + 568 + + + + Add Method + + + true + + + + unnamed + + + + + Inline + + + true + + + true + + + + + Access + + + true + + + true + + + + + Storage + + + true + + + true + + + + + Return Type + + + true + + + true + + + + + Declarator + + + true + + + true + + + + methods + + + true + + + LastColumn + + + + + layout3 + + + + unnamed + + + + spacer3 + + + Horizontal + + + Expanding + + + + 111 + 20 + + + + + + addMethodButton + + + &Add Method + + + + + deleteMethodButton + + + &Delete Method + + + + + + + groupBox1 + + + Method Properties + + + + unnamed + + + + layout4 + + + + unnamed + + + + textLabel1 + + + Return t&ype: + + + returnType + + + + + returnType + + + true + + + + + declarator + + + + + textLabel2 + + + D&eclarator: + + + declarator + + + + + + + layout5 + + + + unnamed + + + + storage + + + + + textLabel5 + + + S&torage: + + + storage + + + + + isInline + + + &Inline + + + + + textLabel3 + + + Acce&ss: + + + access + + + + + access + + + + + + + + + groupBox2 + + + I&mplementation File + + + + unnamed + + + + sourceFile + + + + 7 + 0 + 0 + 0 + + + + true + + + + + browseButton + + + TabFocus + + + ... + + + + + + + Layout1 + + + + unnamed + + + 0 + + + + Horizontal Spacing2 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + buttonOk + + + &OK + + + + + + true + + + true + + + + + buttonCancel + + + &Cancel + + + + + + true + + + + + + + + + buttonOk + clicked() + AddMethodDialogBase + accept() + + + buttonCancel + clicked() + AddMethodDialogBase + reject() + + + addMethodButton + clicked() + AddMethodDialogBase + addMethod() + + + deleteMethodButton + clicked() + AddMethodDialogBase + deleteCurrentMethod() + + + methods + selectionChanged(QListViewItem*) + AddMethodDialogBase + currentChanged(QListViewItem*) + + + returnType + activated(const QString&) + AddMethodDialogBase + updateGUI() + + + declarator + textChanged(const QString&) + AddMethodDialogBase + updateGUI() + + + access + activated(const QString&) + AddMethodDialogBase + updateGUI() + + + isInline + toggled(bool) + AddMethodDialogBase + updateGUI() + + + storage + activated(const QString&) + AddMethodDialogBase + updateGUI() + + + returnType + textChanged(const QString&) + AddMethodDialogBase + updateGUI() + + + sourceFile + textChanged(const QString&) + AddMethodDialogBase + updateGUI() + + + sourceFile + activated(const QString&) + AddMethodDialogBase + updateGUI() + + + browseButton + clicked() + AddMethodDialogBase + browseImplementationFile() + + + + methods + addMethodButton + deleteMethodButton + returnType + declarator + access + storage + isInline + sourceFile + browseButton + buttonOk + buttonCancel + + + kdialog.h + + + init() + destroy() + addMethod() + deleteCurrentMethod() + currentChanged(QListViewItem*) + updateGUI() + browseImplementationFile() + + + + diff --git a/languages/cpp/app_templates/Makefile.am b/languages/cpp/app_templates/Makefile.am new file mode 100644 index 00000000..a075677f --- /dev/null +++ b/languages/cpp/app_templates/Makefile.am @@ -0,0 +1,10 @@ +SUBDIRS = kapp kpartapp kpartplugin kcmodule kicker kioslave kdevpart kdevpart2 chello cpphello kscreensaver kofficepart chello_gba dcopservice konqnavpanel qmakesimple qmakeapp qt4makeapp khello khello2 kateplugin kateplugin2 qtopiaapp kdedcop wxhello cppsdlhello kconfig35 kdevlang noatunvisual noatunui kmod kfileplugin clanlib opieapp opieapplet opieinput opiemenu opienet opietoday kxt gtk2mmapp cppcurseshello win32hello win32gui cmakesimple cmakesimplec cmakelibcpp cmakelibc kscons_kxt kscons_kmdi qt4hello qmakeempty automakeempty makefileempty qtopia4app kde4app + +profilescdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE +profilesc_DATA = c.appwizard + +profilescppdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE +profilescpp_DATA = cpp.appwizard + +profileskdecppdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE +profileskdecpp_DATA = kdecpp.appwizard diff --git a/languages/cpp/app_templates/automakeempty/Makefile.am b/languages/cpp/app_templates/automakeempty/Makefile.am new file mode 100644 index 00000000..461e4322 --- /dev/null +++ b/languages/cpp/app_templates/automakeempty/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = automakeempty-Makefile.am automakeempty-Makefile.cvs \ + configure.in automakeempty.png app.kdevelop +templateName = automakeempty + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/automakeempty/app.kdevelop b/languages/cpp/app_templates/automakeempty/app.kdevelop new file mode 100644 index 00000000..6cadd049 --- /dev/null +++ b/languages/cpp/app_templates/automakeempty/app.kdevelop @@ -0,0 +1,101 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + + + + + + + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.am b/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.am new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.am @@ -0,0 +1 @@ + diff --git a/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.cvs b/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/cpp/app_templates/automakeempty/automakeempty.kdevtemplate b/languages/cpp/app_templates/automakeempty/automakeempty.kdevtemplate new file mode 100644 index 00000000..db3cdd13 --- /dev/null +++ b/languages/cpp/app_templates/automakeempty/automakeempty.kdevtemplate @@ -0,0 +1,99 @@ +# KDE Config File +[General] +Name=Empty Autotools Template +Name[ca]=Plantilla Autotools buida +Name[da]=Tom Autotools-skabelon +Name[de]=Leere Autotools-Vorlage +Name[el]=Κενό πρότυπο των Autotools +Name[es]=Plantilla Autotools vacía +Name[et]=Tühi autotoolsi mall +Name[hu]=Üres Autotools sablon +Name[it]=Modello di autotools vuoto +Name[nds]=Leddig Vörlaag för Automake un sien Kanuten +Name[nl]=Leeg Autotools-sjabloon +Name[pl]=Pusty szablon Autotools +Name[pt]=Modelo de Autotools Vazio +Name[pt_BR]=Modelo de Autotools Vazio +Name[ru]=Пустой шаблон autotools +Name[sk]=Prázdna šablóna Autotools +Name[sr]=Празан шаблон Autotools-а +Name[sr@Latn]=Prazan šablon Autotools-a +Name[sv]=Tom mall för Autotools +Name[zh_TW]=空的 Autotools 樣板 +Icon=automakeempty.png +Category=C++/Automake project +Comment=Generate an empty Automake based application +Comment[ca]=Genera una aplicació buida basada en Automake +Comment[da]=Opretter et tomt Automake-baseret program +Comment[de]=Erstellt eine leere auf Automake basierende Anwendung +Comment[el]=Δημιουργία μίας κενής εφαρμογής βασισμένης στο Automake +Comment[es]=Genera una aplicación vacía basada en Automake +Comment[et]=Tühja rakenduse loomine Automake'i põhjal +Comment[hu]=Létrehoz egy üres Automake-alapú alkalmazást +Comment[it]=Genera un'applicazione basata su un Automake vuoto +Comment[nds]=Stellt en leddig Programm op, dat op Automake opbuut +Comment[nl]=Genereer een leeg op Automake gebaseerd programma +Comment[pl]=Generuje pusty program używający Automake +Comment[pt]=Gera uma aplicação vazia baseada no Automake +Comment[pt_BR]=Gera uma aplicação vazia baseada no Automake +Comment[ru]=Создать пустое приложение, использующее Automake +Comment[sk]=Vygeneruje prázdnu aplikáciu založenú na Automake +Comment[sr]=Прави празан програм на основу Automake-а +Comment[sr@Latn]=Pravi prazan program na osnovu Automake-a +Comment[sv]=Skapar ett tomt Automake-baserat program +Comment[zh_TW]=產生一個空的使用 Automake 的應用程式 +FileTemplates=h,CStyle,cpp,CStyle +Archive=automakeempty.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE2] +Type=install +Source=%{src}/automakeempty-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/automakeempty-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE4] +Type=install +Source=%{src}/configure.in +Dest=%{dest}/configure.in + +[MSG] +Type=message +Comment=An Automake based application was created in %{dest} +Comment[ca]=S'ha creat una aplicació basada en Automake en %{dest} +Comment[da]=Et Automake-baseret program blev oprettet i %{dest} +Comment[de]=Eine auf Automake basierende Anwendung wurde in %{dest} erstellt. +Comment[el]=Μία εφαρμογή βασισμένη στο Automake δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación basada en Automake ha sido creada en %{dest} +Comment[et]=Rakendus Automake'i põhjal loodi asukohta %{dest} +Comment[hu]=Létrejött egy Automake-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione basata su automake in %{dest} +Comment[nds]=In %{dest} wöör en op Automake opbuut Programm opstellt +Comment[nl]=Een Automake-gebaseerd programma is aangemaakt in %{dest} +Comment[pl]=Program używający Automake został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação baseada no Automake em %{dest} +Comment[pt_BR]=Foi criada uma aplicação baseada no Automake em %{dest} +Comment[ru]=Использующее Automake приложение создано в %{dest} +Comment[sk]=Aplikácia založená na Automake bola vytvorená v %{dest} +Comment[sr]=Програм на основи Automake-а направљен је у %{dest} +Comment[sr@Latn]=Program na osnovi Automake-a napravljen je u %{dest} +Comment[sv]=Ett Automake-baserat program skapades i %{dest} +Comment[zh_TW]=一個以 Automake 為基礎的應用程式已建立於 %{dest} + diff --git a/languages/cpp/app_templates/automakeempty/automakeempty.png b/languages/cpp/app_templates/automakeempty/automakeempty.png new file mode 100644 index 00000000..519c007b Binary files /dev/null and b/languages/cpp/app_templates/automakeempty/automakeempty.png differ diff --git a/languages/cpp/app_templates/automakeempty/configure.in b/languages/cpp/app_templates/automakeempty/configure.in new file mode 100644 index 00000000..7464579b --- /dev/null +++ b/languages/cpp/app_templates/automakeempty/configure.in @@ -0,0 +1,10 @@ +AC_INIT(configure.in) + +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) + +AC_LANG_CPLUSPLUS +AC_PROG_CXX +AM_PROG_LIBTOOL + +AC_OUTPUT(Makefile) diff --git a/languages/cpp/app_templates/c.appwizard b/languages/cpp/app_templates/c.appwizard new file mode 100644 index 00000000..14009287 --- /dev/null +++ b/languages/cpp/app_templates/c.appwizard @@ -0,0 +1,2 @@ +[General] +List=chello,chellogba,cmakelibc,cmakesimplec,kmod,prc-tool diff --git a/languages/cpp/app_templates/chello/.kdev_ignore b/languages/cpp/app_templates/chello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/chello/Makefile.am b/languages/cpp/app_templates/chello/Makefile.am new file mode 100644 index 00000000..f7c9742a --- /dev/null +++ b/languages/cpp/app_templates/chello/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = main.c src-Makefile.am c-Makefile.am c-Makefile.cvs \ + configure.in chello.png app.kdevelop + +templateName = chello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} ${dataFiles} ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/chello/app.kdevelop b/languages/cpp/app_templates/chello/app.kdevelop new file mode 100644 index 00000000..521c9f89 --- /dev/null +++ b/languages/cpp/app_templates/chello/app.kdevelop @@ -0,0 +1,107 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C + + C + Code + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + true + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 %{CFLAGS} + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 %{CFLAGS} + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + libstdc++ + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/chello/c-Makefile.am b/languages/cpp/app_templates/chello/c-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/cpp/app_templates/chello/c-Makefile.am @@ -0,0 +1,5 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +SUBDIRS = src diff --git a/languages/cpp/app_templates/chello/c-Makefile.cvs b/languages/cpp/app_templates/chello/c-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/cpp/app_templates/chello/c-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/cpp/app_templates/chello/chello.kdevtemplate b/languages/cpp/app_templates/chello/chello.kdevtemplate new file mode 100644 index 00000000..8f2ea5dc --- /dev/null +++ b/languages/cpp/app_templates/chello/chello.kdevtemplate @@ -0,0 +1,253 @@ +# KDE Config File +[General] +Name=Simple Hello world program +Name[ca]=Simple programa Hello world +Name[da]=Simpelt Goddag verden program +Name[de]=Ein einfaches "Hello World"-Programm +Name[el]=Απλό πρόγραμμα Γεια σου Κόσμε +Name[es]=Programa «Hola mundo» sencillo +Name[et]=Lihtne "Tere, maailm" programm +Name[eu]="Kaixo mundua" programa sinplea +Name[fa]=برنامۀ سادۀ Hello world +Name[fr]=Programme « Bonjour monde » simple +Name[ga]=Ríomhchlár simplí "Hello World" +Name[gl]=Programa sinxelo Ola mundo +Name[hu]=Egyszerű Hello world program +Name[it]=Semplice programma di "Hello world" +Name[ja]=簡単な Hello world プログラム +Name[ms]=Program Hello World mudah +Name[nds]=En eenfach "Moin Welt"-Programm +Name[ne]=साधारण हेल्लो वोल्ड कार्यक्रम +Name[nl]=Eenvoudig 'Hello World' programma +Name[pl]=Prosty program witaj świecie +Name[pt]=Programa simples Olá Mundo +Name[pt_BR]=Programa simples Olá Mundo +Name[ru]=Простая программа Hello world +Name[sk]=Jednoduchý "Ahoj svet" program +Name[sl]=Preprost program Hello world +Name[sr]=Једноставан „Здраво свете“ програм +Name[sr@Latn]=Jednostavan „Zdravo svete“ program +Name[sv]=Enkelt Hello world-program +Name[tr]=Basit Merhaba dünya programı +Name[zh_CN]=简单的 Hello world 程序 +Name[zh_TW]=簡單的 Hello world 程式 +Icon=chello.png +Category=C +Comment=Generates a simple Hello world program in C +Comment[ca]=Genera un simple programa de Hello world en C +Comment[da]=Genererer et simpelt Goddag verden program i C +Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε C +Comment[es]=Genera un sencillo programa «Hola mundo» en C +Comment[et]=Lihtsa "Tere, maailm" programmi loomine C-s +Comment[eu]="Kaixo mundua" programa sinplea bat sortzen du C lengoaian +Comment[fa]=یک برنامۀ سادۀ Hello world در سی تولید می‌کند +Comment[fr]=Génère un programme « Bonjour monde » simple en C +Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" i C +Comment[gl]=Xera un programa sinxelo Ola mundo en C +Comment[hu]=Létrehoz egy egyszerű Hello world programot C nyelven +Comment[it]=Genera un semplice programma di "Hello world" in C +Comment[ja]=簡単な Hello world プログラムを C で記述します +Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C op +Comment[ne]=सी मा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudig Hello World programma in C +Comment[pl]=Tworzy prosty program 'Witaj świecie' w języku C +Comment[pt]=Gera um programa simples de Olá mundo em C +Comment[pt_BR]=Gera um programa simples de Olá mundo em C +Comment[ru]=Создание простого приложения Hello world на C +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C +Comment[sl]=Ustvari preprost program Hello world v C-ju +Comment[sr]=Прави једноставан „Здраво свете“ програм у C-у +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C-u +Comment[sv]=Skapar ett enkelt Hello world-program i C +Comment[tr]=C'de basit bir Merhaba Dünya programı yaratır. +Comment[zh_CN]=生成 C 语言的 Hello world 程序 +Comment[zh_TW]=產生 C 語言的 Hello world 程式 +FileTemplates=h,CStyle,c,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.c +Archive=chello.tar.gz + +[LIBS] +Type = value +ValueType=QString +Value= OPT_LIBS +Comment= Optional libraries to link to. +Comment[ca]= Biblioteques opcionals per enllaçar. +Comment[da]= Mulige biblioteker at linke til. +Comment[de]= Optionale Bibliotheken, die eingebunden werden sollen. +Comment[el]= Προαιρετικές βιβλιοθήκες για σύνδεση με αυτές. +Comment[es]=Bibliotecas opcionales para enlazar. +Comment[et]=Täiendavad lingitavad teegid. +Comment[eu]= Estekatzeko aukerako liburutegiak. +Comment[fa]= کتابخانه‌های اختیاری برای پیوند کردن. +Comment[fr]=Bibliothèques optionnelles à lier. +Comment[ga]= Comhadlanna roghnacha ar féidir nascadh leo. +Comment[gl]= Librerías opcionais a enlazar. +Comment[hu]=Linkelési programkönyvtárak (opcionális). +Comment[it]= librerie opzionali da collegare. +Comment[ja]=リンクする他のライブラリ +Comment[nds]= Optschonaal Bibliotheken, na de linkt warrn schall +Comment[ne]= लिङ्क सिर्जना गर्न वैकल्पिक लाइब्रेरी +Comment[nl]=Optionele bibliotheken om naar te linken +Comment[pl]= Opcjonalne biblioteki, z którymi ma być łączony. +Comment[pt]= Bibliotecas opcionais com as quais compilar. +Comment[pt_BR]= Bibliotecas opcionais com as quais compilar. +Comment[ru]=Дополнительные библиотеки для сборки. +Comment[sk]=Voliteľné knižnice pre linkovanie. +Comment[sl]=Dodatne knjižnice, do katerih se naj poveže. +Comment[sr]=Опционе библиотеке за повезивање. +Comment[sr@Latn]=Opcione biblioteke za povezivanje. +Comment[sv]= Valfria bibliotek att länka till. +Comment[tr]=Bağlanılacak isteğe bağlı kütüphaneler. +Comment[zh_CN]=可选的链接库。 +Comment[zh_TW]=要連結的函式庫 +Default= -lm + +[INCLUDES] +Type = value +ValueType=QString +Value= OPT_INCS +Comment= Optional include path. +Comment[ca]= Ruta opcional per a incloure. +Comment[da]= Mulig include-sti. +Comment[de]= Optionaler Include-Pfad. +Comment[el]= Προαιρετική διαδρομή ενσωμάτωσης. +Comment[es]=Ruta opcional para incluir. +Comment[et]=Täiendavate päisefailide asukoht. +Comment[eu]= Aukerako goiburuen bide-izena. +Comment[fa]=include path اختیاری. +Comment[fr]=Chemin d'inclusion optionnel. +Comment[ga]= Conair roghnach ceanntásca. +Comment[gl]= Ruta opcional de cabeceiras. +Comment[hu]=Include fájlok könyvtárai (opcionális). +Comment[it]= percorso opzionale di inclusione. +Comment[ja]=ヘッダファイルを読み込む他のパス +Comment[nds]= Optschonaal Koppdatei-Padd +Comment[ne]= मार्ग सहितको विकल्प +Comment[nl]=Optioneel Include-pad +Comment[pl]= Opcjonalna ścieżka do plików dołączanych. +Comment[pt]= Localização opcional dos ficheiros de inclusão. +Comment[pt_BR]= Localização opcional dos ficheiros de inclusão. +Comment[ru]=Дополнительные пути для заголовочных файлов. +Comment[sk]=Voliteľná cesta pre include. +Comment[sl]=Neobvezna pot za vstavke. +Comment[sr]=Опциона путања за укључивања. +Comment[sr@Latn]=Opciona putanja za uključivanja. +Comment[sv]= Valfri sökväg till deklarationsfiler. +Comment[tr]=İsteğe bağlı include yolu. +Comment[zh_CN]=可选的包含路径。 +Comment[zh_TW]=引入檔路徑 +Default= -I/usr/include + +[CFLAGS] +Type = value +ValueType=QString +Value= CFLAGS +Comment= Optional CFLAGS to define in the makefile. +Comment[ca]= CFLAGS opcionals per a definir en el fitxer de make. +Comment[da]= Mulige CFLAGS at definere i makefile. +Comment[de]= Optionale CFLAGS, die im Makefile definiert werden. +Comment[el]= Προαιρετικές CFLAGS για ορισμό μέσα στο makefile. +Comment[es]=CFLAGS opcionales a definir en el makefile. +Comment[et]=Täiendavad Makefile'is defineeritavad CFLAGS'id. +Comment[eu]= Aukerako makefile-ean definitzeko CFLAGS-ak. +Comment[fa]= CFLAGS اختیاری برای تعریف در makefile. +Comment[fr]=CFLAGS optionnels à définir dans le Makefile. +Comment[ga]= CFLAGS roghnacha le socrú sa makefile. +Comment[gl]= CFLAGS opcionais a definir no makefile. +Comment[hu]=A Makefile-hoz definiálható CFLAGS információ (opcionális). +Comment[it]= CFLAGS opzionale da definire nel makefile. +Comment[ja]=Makefile に定義する他の CFLAGS +Comment[nds]= Optschonaal CFLAGS, de in de "Make"-Datei fastleggt warrt. +Comment[ne]= मेकफाइलमा परिभाषित गर्न CFLAGS विकल्प +Comment[nl]=Optionele CFLAGS om te definiëren in het makefile. +Comment[pl]= Opcjonalna wartość zmiennej CFLAGS do zdefiniowania w pliku makefile. +Comment[pt]= CFLAGS opcionais a definir na Makefile. +Comment[pt_BR]= CFLAGS opcionais a definir na Makefile. +Comment[ru]=Дополнительные параметры CFLAGS для Makefile. +Comment[sk]=Voliteľné nastavenie CFLAGS v makefile. +Comment[sl]=Dodaten CFLAGS za definicijo v datoteki makefile. +Comment[sr]=Опциона CFLAGS дефинисана у справифајлу. +Comment[sr@Latn]=Opciona CFLAGS definisana u spravifajlu. +Comment[sv]= Valfria CFLAGS att definiera i byggfilen. +Comment[tr]=Makefile'da tanımlanacak isteğe bağlı CFLAGS değerleri +Comment[zh_CN]=在 Makefile 中定义的可选 CFLAGS。 +Comment[zh_TW]=makefile 中定義的 CFLAGS +Default= + +[MGS] +Type=message +Comment=A simple C project was created in %{dest}. +Comment[ca]=A simple projecte en C ha estat creat en %{dest}. +Comment[da]=Et simpelt C projekt blev oprette i %{dest}. +Comment[de]=Ein einfaches C-Project wurde in %{dest} erstellt. +Comment[el]=Ένα απλό έργο C δημιουργήθηκε στο %{dest}. +Comment[es]=Un sencillo proyecto de C ha sido creado en %{dest}. +Comment[et]=Lihtne C-projekt loodi asukohta %{dest}. +Comment[eu]=C proiektu sinple bat sortu da hemen: %{dest}. +Comment[fa]=یک پروژۀ سادۀ سی در %{dest} ایجاد شد. +Comment[fr]=Un projet en langage C simple a été créé dans %{dest}. +Comment[ga]=Cruthaíodh tionscadal simplí C i %{dest} +Comment[gl]=Creouse un proxecto sinxelo en C en %{dest}. +Comment[hu]=Létrejött egy egyszerű C-projekt itt: %{dest}. +Comment[it]=È stato creato un semplice progetto C in %{dest}. +Comment[ja]=簡単な C プロジェクトを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach C-Projekt opstellt. +Comment[ne]=एउटा साधारण सी परियोजना %{dest} मा सिर्जना गरियो +Comment[nl]=Een eenvoudig C-project is aangemaakt in %{dest}. +Comment[pl]=Prosty projekt w języku C został utworzony w %{dest}. +Comment[pt]=Foi criado um programa simples "Olá mundo" em C em %{dest}. +Comment[pt_BR]=Foi criado um programa simples "Olá mundo" em C em %{dest}. +Comment[ru]=Простое приложение "Hello world" на C создано в %{dest} +Comment[sk]=Jednoduchý C projekt bol vytvorený v %{dest}. +Comment[sl]=Preprost projekt v C-ju je bil ustvarjen v %{dest}. +Comment[sr]=Једноставан пројекат у C-у направљен је у %{dest}. +Comment[sr@Latn]=Jednostavan projekat u C-u napravljen je u %{dest}. +Comment[sv]=Ett enkelt C-projekt skapades i %{dest}. +Comment[tr]=Basit bir C projesi %{dest} içinde oluşturuldu. +Comment[zh_CN]=在 %{dest} 中创建了简单的 C 工程。 +Comment[zh_TW]=一個簡單的 C 專案已建立在 %{dest}。 +Archive=chello.tar.gz + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/c-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/c-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE4] +Type=install +Source=%{src}/configure.in +Dest=%{dest}/configure.in + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE6] +Type=install +Source=%{src}/main.c +Dest=%{dest}/src/%{APPNAMELC}.c + diff --git a/languages/cpp/app_templates/chello/chello.png b/languages/cpp/app_templates/chello/chello.png new file mode 100644 index 00000000..888d4f13 Binary files /dev/null and b/languages/cpp/app_templates/chello/chello.png differ diff --git a/languages/cpp/app_templates/chello/configure.in b/languages/cpp/app_templates/chello/configure.in new file mode 100644 index 00000000..3715e0c8 --- /dev/null +++ b/languages/cpp/app_templates/chello/configure.in @@ -0,0 +1,10 @@ +AC_INIT(configure.in) + +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) + +AC_LANG_C +AC_PROG_CC +AM_PROG_LIBTOOL + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/cpp/app_templates/chello/main.c b/languages/cpp/app_templates/chello/main.c new file mode 100644 index 00000000..3ac8c330 --- /dev/null +++ b/languages/cpp/app_templates/chello/main.c @@ -0,0 +1,15 @@ +%{C_TEMPLATE} + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +int main(int argc, char *argv[]) +{ + printf("Hello, world!\n"); + + return EXIT_SUCCESS; +} diff --git a/languages/cpp/app_templates/chello/src-Makefile.am b/languages/cpp/app_templates/chello/src-Makefile.am new file mode 100644 index 00000000..51e7609f --- /dev/null +++ b/languages/cpp/app_templates/chello/src-Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = %{APPNAMELC}.c + +# set the include path found by configure +INCLUDES= $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(all_libraries) diff --git a/languages/cpp/app_templates/chello_gba/.kdev_ignore b/languages/cpp/app_templates/chello_gba/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/chello_gba/Makefile.am b/languages/cpp/app_templates/chello_gba/Makefile.am new file mode 100644 index 00000000..2a72573e --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = main.c font.raw.c master.pal.c src-Makefile.am c-Makefile.am \ + c-Makefile.cvs configure.in chellogba.png app.kdevelop \ + main.h gba.h font.bmp README.devel +templateName = chellogba + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/chello_gba/README.devel b/languages/cpp/app_templates/chello_gba/README.devel new file mode 100644 index 00000000..a7cdcc75 --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/README.devel @@ -0,0 +1,30 @@ +***Description*** + +This is a small demo program for the Gameboy Advance. +It use a custom font to display strings in MODE 0 on Background 2, but contains only capitalized letters at the moment. +The tiles & color palette for the font were generated from the bitmap "font.bmp" +with following commandline. + +"gfx2gba -M -t8 -fsrc font.bmp" + +You can get a compiled version for Linux from http://gbadev.org/files/gfx2gba06.zip, +but you don't need it to run the program. + + +***Compiling and Running*** + +To compile the code please install the DevKitAdvance for Linux/Unix. It contains a gcc 3.x configured as a cross compiler +for the GBA platform. You can download a precompiled version from http://www.doc.ic.ac.uk/~tb100/ + +To build the program KDevelop use +"CC=arm-agb-elf-gcc CXX=arm-agb-elf-g++ ./configure --host=arm-gcc-elf --build=i386" +as default,but you can change that in the project options if you want. + +To start your binary you can use an emulator or buy a flash card (http://www.lik-sang.com). +KDevelop already contains a plugin to run your GBA program with the VisualBoy Advance emulator. +You can download the emulator from: http://vboy.emuhq.com/ + +Have fun! + +Please report bugs,wishes,problems.. to smeier@kdevelop.org (Sandy Meier) + diff --git a/languages/cpp/app_templates/chello_gba/app.kdevelop b/languages/cpp/app_templates/chello_gba/app.kdevelop new file mode 100644 index 00000000..0025fd02 --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/app.kdevelop @@ -0,0 +1,100 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C + + C + GBA + + + KDevDebugger + + + + + src/%{APPNAMELC} + + + true + + + + --host=arm-gcc-elf --build=i386 + -T lnkscript crt0.o + kdevgccoptions + kdevgppoptions + kdevg77options + arm-agb-elf-gcc + arm-agb-elf-g++ + -nostartfiles + + + + + src/%{APPNAMELC}.gba + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + libstdc++ + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/chello_gba/c-Makefile.am b/languages/cpp/app_templates/chello_gba/c-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/c-Makefile.am @@ -0,0 +1,5 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +SUBDIRS = src diff --git a/languages/cpp/app_templates/chello_gba/c-Makefile.cvs b/languages/cpp/app_templates/chello_gba/c-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/c-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/cpp/app_templates/chello_gba/chellogba.kdevtemplate b/languages/cpp/app_templates/chello_gba/chellogba.kdevtemplate new file mode 100644 index 00000000..7a3ba857 --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/chellogba.kdevtemplate @@ -0,0 +1,173 @@ +# KDE Config File +[General] +Name=Hello world program +Name[ca]=Programa Hello world +Name[da]=Goddag verden program +Name[de]="Hello World"-Programm +Name[el]=Πρόγραμμα Γεια σου Κόσμε +Name[es]=Programa «Hola mundo» +Name[et]="Tere,maailm" programm +Name[eu]="Kaixo mundua" programa +Name[fa]=برنامۀ Hello world +Name[fr]=Programme « Bonjour monde » +Name[ga]=Ríomhchlár "Hello world" +Name[gl]=Programa Ola mundo +Name[it]=Programma di "Hello world" +Name[ja]=Hello world プログラム +Name[nds]="Moin Welt"-Programm +Name[ne]=हेल्डो वोल्ड कार्यक्रम +Name[nl]=Hello World-programma +Name[pl]=Program 'Witaj świecie' +Name[pt]=Programa 'Olá mundo' +Name[pt_BR]=Programa 'Olá mundo' +Name[ru]=Программа Hello world +Name[sk]=Ahoj svet program +Name[sl]=Program Hello world +Name[sr]=Програм „Здраво свете“ +Name[sr@Latn]=Program „Zdravo svete“ +Name[sv]=Hello world-program +Name[tr]=Merhaba Dünya Programı +Name[zh_CN]=Hello world 程序 +Name[zh_TW]=Hello world 程式 +Icon=chellogba.png +Category=C/GBA +Comment=Generates a simple "Hello world" program for the Gameboy Advance. You will need the "devkitadvance" to compile it. See README.devel for more details. +Comment[ca]=Genera un simple programa de "Hello world" per a la Gameboy Advance. Necessitareu "devkitadvance" per a compilar-lo. Consulteu el README.devel per a més detalls. +Comment[da]=Genererer et simpelt "Goddag verden" program for Gameboy Advance. Du vil skulle bruge "devkitadvance" for at kompilere det. Se README.devel for flere detaljer. +Comment[de]=Erstellt ein einfaches "Hello world"-Programm für den Gameboy Advance. Sie benötigen zum Kompilieren das "devkitadvance". Weitere Einzelheiten finden Sie in der Datei README.devel. +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα "Γεια σου κόσμε" για το Gameboy Advance. Θα χρειαστείτε το "devkitadvance" για τη μεταγλώττισή του. Ανατρέξτε στο README.devel για περισσότερες πληροφορίες. +Comment[es]=Genera un sencillo programa «Hola mundo» para Gameboy Advance. Necesitará «devkitadvance» para compilarlo. Vea README.devel para más detalles. +Comment[et]=Lihtsa "Tere, maailm" programmi loomine Gameboy Advance'i jaoks. Kompileerimiseks on vajalik "devkitadvance". Täpsemalt räägib sellest fail README.devel. +Comment[eu]="Kaixo mundua" programa sinple bat sortzen du Gameboy Advance-erako. "devkitadvance" behar duzu konpilatzeko. Ikusi README.devel xehetasun gehiagorako. +Comment[fa]=یک برنامۀ سادۀ «Hello world» برای Gameboy Advance تولید می‌کند. برای ترجمۀ آن به »devkitadvance« نیاز دارید. برای جزئیات بیشتر، README.devel را ببینید. +Comment[fr]=Génère un programme « Bonjour monde » simple pour la Gameboy Advance. Vous aurez besoin de « devkitadvance » pour le compiler. Consultez le fichier README.devel pour plus de détails. +Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" le haghaidh an Gameboy Advance. Tá gá le "devkitadvance" chun é a thiomsú. Féach ar README.devel chun tuilleadh sonraí a fháil. +Comment[gl]=Xera un programa sinxelo "Ola mundo" para Gameboy Advance. Necesitará "devkitadvance" para compilalo. Consulte README.devel para máis detalles. +Comment[hu]=Létrehoz egy egyszerű Hello world programot a Gameboy Advance-hoz. Lefordításához szükség van a "devkitadvance" csomag telepítésére. További információ a README.devel fájlban található. +Comment[it]=Genera un semplice programma di "Hello world" per il Gameboy Advance. Serve il "devkitadvance" per compilarlo. Guarda un po' README.devel per ulteriori dettagli. +Comment[ja]=Gameboy Advance のための Hello world プログラムを作成します。コンパイルするには devkitadvance が必要です。詳しくは README.devel をご覧ください。 +Comment[nds]=Stellt en eenfach "Moin Welt"-Programm för "Gameboy Advance" op. För't Kompileren deit "devkitadvance" noot. Mehr Enkelheiten laat sik binnen "README.devel" finnen. +Comment[ne]=गेमब्याए एडभान्सका लागि साधारण "हेल्लो वोल्ड नमस्कार" उत्पन्न गर्दछ । यसलाई कम्पाइल गर्न तपाईँलाई "devkitadvance" आवश्यक पर्दछ । बढी जानकारीका लागि README.devel हेर्नुहोस् । +Comment[nl]=Genereert een eenvoudig "Hello World" programma voor de Gameboy Advance. U hebt "devkitadvance" nodig om het te kunnen compileren. Zie het bestand README.devel voor meer informatie. +Comment[pl]=Generuje prosty program "Witaj świecie" na konsolę Gameboy Advance. Do skompilowania go potrzebny jest "devkitadvance". Więcej informacji można znaleźć w pliku README.devel. +Comment[pt]=Gera um programa simples "Olá mundo" para o Gameboy Advance. Irá necessitar do "devkitadvance" para o compilar. Veja o README.devel para mais detalhes. +Comment[pt_BR]=Gera um programa simples "Olá mundo" para o Gameboy Advance. Irá necessitar do "devkitadvance" para o compilar. Veja o README.devel para mais detalhes. +Comment[ru]=Создание простой программы "Hello world" на Gameboy Advance. Вам необходима программа "devkitadvance" для её сборки. Прочтите файл README.devel. +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program pre Gameboy Advance.Budete potrebovať "devkitadvance" na to, aby ste ho skompilovali.Pozrite súbor README.devel pre viac detailov. +Comment[sl]=Ustvari preprost program »Pozdravljen svet« za Gameboy Advance. Za prevajanje boste potrebovali »devkitadvance«. Podrobnosti si lahko ogledate v README.devel. +Comment[sr]=Прави једноставан „Здраво свете“ програм за Gameboy Advance. Требаће вам „devkitadvance“ да бисте га превели. Погледајте README.devel за више детаља. +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program za Gameboy Advance. Trebaće vam „devkitadvance“ da biste ga preveli. Pogledajte README.devel za više detalja. +Comment[sv]=Skapar ett enkelt "Hello world"-program för Gameboy Advance. Du behöver "devkitadvance" för att kompilera det. Se filen README.devel för mer information. +Comment[tr]=Gameboy Advance için basit bir "Merhaba Dünya" programı üretir. Derlemek için "devkitadvance" paketine ihtiyacınız olacak. Daha fazla bilgi için README.devel dosyasına bakın. +Comment[zh_CN]=生成 Gameboy Advance 下的“Hello world”程序。您需要“devkitadvane”才能编译。请查看 README.devel 中的细节。 +Comment[zh_TW]=產生一個簡單的 Gameboy Advance 的 Hello world 程式。您需要 "devkitadvance" 來編譯。詳情請參考 README.devel。 +ShowFileAfterGeneration=README.devel +FileTemplates=h,CStyle,c,CStyle +ShowFilesAfterGeneration=%{dest}/src/main.c +Archive=chellogba.tar.gz + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/README.devel +Dest=%{dest}/README.devel + +[FILE3] +Type=install +Source=%{src}/c-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE4] +Type=install +Source=%{src}/c-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE5] +Type=install +Source=%{src}/configure.in +Dest=%{dest}/configure.in + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE6] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE7] +Type=install +Source=%{src}/main.c +Dest=%{dest}/src/main.c + +[FILE8] +Type=install +Source=%{src}/main.h +Dest=%{dest}/src/main.h + +[FILE9] +Type=install +Source=%{src}/gba.h +Dest=%{dest}/src/gba.h + +[FILE10] +Type=install +Source=%{src}/font.bmp +Dest=%{dest}/src/font.bmp + +[FILE11] +Type=install +Source=%{src}/font.raw.c +Dest=%{dest}/src/font.raw.c + +[FILE12] +Type=install +Source=%{src}/master.pal.c +Dest=%{dest}/src/master.pal.c + +[MSG] +Type=message +Comment=A Hello World program was created in %{dest} +Comment[ca]=A programa de Hello World ha estat creat en %{dest} +Comment[da]=Et Goddag verden program blev oprettet i %{dest} +Comment[de]=Ein "Hello World"-Programm wurde in %{dest} erstellt. +Comment[el]=Ένα πρόγραμμα Γεια σου Κόσμε δημιουργήθηκε στο %{dest} +Comment[es]=Un programa «Hola mundo» ha sido creado en %{dest} +Comment[et]="Tere, maailm" programm loodi asukohta %{dest} +Comment[eu]="Kaixo mundua" programa bat sortu da hemen: %{dest} +Comment[fa]=یک برنامۀ Hello World در %{dest} ایجاد شد +Comment[fr]=Un programme « Bonjour monde » a été créé dans %{dest} +Comment[ga]=Cruthaíodh ríomhchlár "Hello World" i %{dest} +Comment[gl]=Creouse un programa Ola mundo en %{dest} +Comment[hu]=Létrejött egy Hello World program itt: %{dest} +Comment[it]=È stato creato un programma di "Hello World" in %{dest} +Comment[ja]=Hello World プログラムを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en "Moin Welt"-Programm opstellt +Comment[ne]=एउटा हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो +Comment[nl]=Een Hello World-programma is aangemaakt in %{dest} +Comment[pl]=Program 'Witaj świecie' utworzony w %{dest}. +Comment[pt]=Foi criado um programa Olá Mundo em %{dest} +Comment[pt_BR]=Foi criado um programa Olá Mundo em %{dest} +Comment[ru]=Простое приложение Hello World создано в %{dest} +Comment[sk]=Ahoj svet program bol vytvorený v %{dest} +Comment[sl]=Program »Pozdravljen svet« je bil ustvarjen v %{dest} +Comment[sr]=„Здраво свете“ је направљен у %{dest} +Comment[sr@Latn]=„Zdravo svete“ je napravljen u %{dest} +Comment[sv]=Ett Hello World-program skapades i %{dest} +Comment[tr]=Bir Merhaba Dünya programı %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 Hello world 程序 +Comment[zh_TW]=一個 Hello World 程式已經建立在 %{dest} diff --git a/languages/cpp/app_templates/chello_gba/chellogba.png b/languages/cpp/app_templates/chello_gba/chellogba.png new file mode 100644 index 00000000..81bba90a Binary files /dev/null and b/languages/cpp/app_templates/chello_gba/chellogba.png differ diff --git a/languages/cpp/app_templates/chello_gba/configure.in b/languages/cpp/app_templates/chello_gba/configure.in new file mode 100644 index 00000000..3715e0c8 --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/configure.in @@ -0,0 +1,10 @@ +AC_INIT(configure.in) + +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) + +AC_LANG_C +AC_PROG_CC +AM_PROG_LIBTOOL + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/cpp/app_templates/chello_gba/font.bmp b/languages/cpp/app_templates/chello_gba/font.bmp new file mode 100644 index 00000000..28b8c669 Binary files /dev/null and b/languages/cpp/app_templates/chello_gba/font.bmp differ diff --git a/languages/cpp/app_templates/chello_gba/font.raw.c b/languages/cpp/app_templates/chello_gba/font.raw.c new file mode 100644 index 00000000..8efbf1dd --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/font.raw.c @@ -0,0 +1,123 @@ +const unsigned char font_Tiles[1920]={ +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, +0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, +0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, +0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, +0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, +0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, +0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, +0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, +0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + diff --git a/languages/cpp/app_templates/chello_gba/gba.h b/languages/cpp/app_templates/chello_gba/gba.h new file mode 100644 index 00000000..9e57c8f8 --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/gba.h @@ -0,0 +1,204 @@ +%{H_TEMPLATE} +// gba.h by eloist + +#ifndef GBA_HEADER +#define GBA_HEADER + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned long u32; + +typedef signed char s8; +typedef signed short s16; +typedef signed long s32; + +typedef unsigned char byte; +typedef unsigned short hword; +typedef unsigned long word; + +#define OAMmem (u32*)0x7000000 +#define VideoBuffer (u16*)0x6000000 +#define OAMdata (u16*)0x6100000 +#define BGPaletteMem (u16*)0x5000000 +#define OBJPaletteMem (u16*)0x5000200 + +#define REG_INTERUPT *(u32*)0x3007FFC +#define REG_DISPCNT *(u32*)0x4000000 +#define REG_DISPCNT_L *(u16*)0x4000000 +#define REG_DISPCNT_H *(u16*)0x4000002 +#define REG_DISPSTAT *(u16*)0x4000004 +#define REG_VCOUNT *(u16*)0x4000006 +#define REG_BG0CNT *(u16*)0x4000008 +#define REG_BG1CNT *(u16*)0x400000A +#define REG_BG2CNT *(u16*)0x400000C +#define REG_BG3CNT *(u16*)0x400000E +#define REG_BG0HOFS *(u16*)0x4000010 +#define REG_BG0VOFS *(u16*)0x4000012 +#define REG_BG1HOFS *(u16*)0x4000014 +#define REG_BG1VOFS *(u16*)0x4000016 +#define REG_BG2HOFS *(u16*)0x4000018 +#define REG_BG2VOFS *(u16*)0x400001A +#define REG_BG3HOFS *(u16*)0x400001C +#define REG_BG3VOFS *(u16*)0x400001E +#define REG_BG2PA *(u16*)0x4000020 +#define REG_BG2PB *(u16*)0x4000022 +#define REG_BG2PC *(u16*)0x4000024 +#define REG_BG2PD *(u16*)0x4000026 +#define REG_BG2X *(u32*)0x4000028 +#define REG_BG2X_L *(u16*)0x4000028 +#define REG_BG2X_H *(u16*)0x400002A +#define REG_BG2Y *(u32*)0x400002C +#define REG_BG2Y_L *(u16*)0x400002C +#define REG_BG2Y_H *(u16*)0x400002E +#define REG_BG3PA *(u16*)0x4000030 +#define REG_BG3PB *(u16*)0x4000032 +#define REG_BG3PC *(u16*)0x4000034 +#define REG_BG3PD *(u16*)0x4000036 +#define REG_BG3X *(u32*)0x4000038 +#define REG_BG3X_L *(u16*)0x4000038 +#define REG_BG3X_H *(u16*)0x400003A +#define REG_BG3Y *(u32*)0x400003C +#define REG_BG3Y_L *(u16*)0x400003C +#define REG_BG3Y_H *(u16*)0x400003E +#define REG_WIN0H *(u16*)0x4000040 +#define REG_WIN1H *(u16*)0x4000042 +#define REG_WIN0V *(u16*)0x4000044 +#define REG_WIN1V *(u16*)0x4000046 +#define REG_WININ *(u16*)0x4000048 +#define REG_WINOUT *(u16*)0x400004A +#define REG_MOSAIC *(u32*)0x400004C +#define REG_MOSAIC_L *(u32*)0x400004C +#define REG_MOSAIC_H *(u32*)0x400004E +#define REG_BLDMOD *(u16*)0x4000050 +#define REG_COLEV *(u16*)0x4000052 +#define REG_COLEY *(u16*)0x4000054 +#define REG_SG10 *(u32*)0x4000060 +#define REG_SG10_L *(u16*)0x4000060 +#define REG_SG10_H *(u16*)0x4000062 +#define REG_SG11 *(u16*)0x4000064 +#define REG_SG20 *(u16*)0x4000068 +#define REG_SG21 *(u16*)0x400006C +#define REG_SG30 *(u32*)0x4000070 +#define REG_SG30_L *(u16*)0x4000070 +#define REG_SG30_H *(u16*)0x4000072 +#define REG_SG31 *(u16*)0x4000074 +#define REG_SG40 *(u16*)0x4000078 +#define REG_SG41 *(u16*)0x400007C +#define REG_SGCNT0 *(u32*)0x4000080 +#define REG_SGCNT0_L *(u16*)0x4000080 +#define REG_SGCNT0_H *(u16*)0x4000082 +#define REG_SGCNT1 *(u16*)0x4000084 +#define REG_SGBIAS *(u16*)0x4000088 +#define REG_SGWR0 *(u32*)0x4000090 +#define REG_SGWR0_L *(u16*)0x4000090 +#define REG_SGWR0_H *(u16*)0x4000092 +#define REG_SGWR1 *(u32*)0x4000094 +#define REG_SGWR1_L *(u16*)0x4000094 +#define REG_SGWR1_H *(u16*)0x4000096 +#define REG_SGWR2 *(u32*)0x4000098 +#define REG_SGWR2_L *(u16*)0x4000098 +#define REG_SGWR2_H *(u16*)0x400009A +#define REG_SGWR3 *(u32*)0x400009C +#define REG_SGWR3_L *(u16*)0x400009C +#define REG_SGWR3_H *(u16*)0x400009E +#define REG_SGFIF0A *(u32*)0x40000A0 +#define REG_SGFIFOA_L *(u16*)0x40000A0 +#define REG_SGFIFOA_H *(u16*)0x40000A2 +#define REG_SGFIFOB *(u32*)0x40000A4 +#define REG_SGFIFOB_L *(u16*)0x40000A4 +#define REG_SGFIFOB_H *(u16*)0x40000A6 +#define REG_DM0SAD *(u32*)0x40000B0 +#define REG_DM0SAD_L *(u16*)0x40000B0 +#define REG_DM0SAD_H *(u16*)0x40000B2 +#define REG_DM0DAD *(u32*)0x40000B4 +#define REG_DM0DAD_L *(u16*)0x40000B4 +#define REG_DM0DAD_H *(u16*)0x40000B6 +#define REG_DM0CNT *(u32*)0x40000B8 +#define REG_DM0CNT_L *(u16*)0x40000B8 +#define REG_DM0CNT_H *(u16*)0x40000BA +#define REG_DM1SAD *(u32*)0x40000BC +#define REG_DM1SAD_L *(u16*)0x40000BC +#define REG_DM1SAD_H *(u16*)0x40000BE +#define REG_DM1DAD *(u32*)0x40000C0 +#define REG_DM1DAD_L *(u16*)0x40000C0 +#define REG_DM1DAD_H *(u16*)0x40000C2 +#define REG_DM1CNT *(u32*)0x40000C4 +#define REG_DM1CNT_L *(u16*)0x40000C4 +#define REG_DM1CNT_H *(u16*)0x40000C6 +#define REG_DM2SAD *(u32*)0x40000C8 +#define REG_DM2SAD_L *(u16*)0x40000C8 +#define REG_DM2SAD_H *(u16*)0x40000CA +#define REG_DM2DAD *(u32*)0x40000CC +#define REG_DM2DAD_L *(u16*)0x40000CC +#define REG_DM2DAD_H *(u16*)0x40000CE +#define REG_DM2CNT *(u32*)0x40000D0 +#define REG_DM2CNT_L *(u16*)0x40000D0 +#define REG_DM2CNT_H *(u16*)0x40000D2 +#define REG_DM3SAD *(u32*)0x40000D4 +#define REG_DM3SAD_L *(u16*)0x40000D4 +#define REG_DM3SAD_H *(u16*)0x40000D6 +#define REG_DM3DAD *(u32*)0x40000D8 +#define REG_DM3DAD_L *(u16*)0x40000D8 +#define REG_DM3DAD_H *(u16*)0x40000DA +#define REG_DM3CNT *(u32*)0x40000DC +#define REG_DM3CNT_L *(u16*)0x40000DC +#define REG_DM3CNT_H *(u16*)0x40000DE +#define REG_TM0D *(u16*)0x4000100 +#define REG_TM0CNT *(u16*)0x4000102 +#define REG_TM1D *(u16*)0x4000104 +#define REG_TM1CNT *(u16*)0x4000106 +#define REG_TM2D *(u16*)0x4000108 +#define REG_TM2CNT *(u16*)0x400010A +#define REG_TM3D *(u16*)0x400010C +#define REG_TM3CNT *(u16*)0x400010E +#define REG_SCD0 *(u16*)0x4000120 +#define REG_SCD1 *(u16*)0x4000122 +#define REG_SCD2 *(u16*)0x4000124 +#define REG_SCD3 *(u16*)0x4000126 +#define REG_SCCNT *(u32*)0x4000128 +#define REG_SCCNT_L *(u16*)0x4000128 +#define REG_SCCNT_H *(u16*)0x400012A +#define REG_P1 *(u16*)0x4000130 +#define REG_P1CNT *(u16*)0x4000132 +#define REG_R *(u16*)0x4000134 +#define REG_HS_CTRL *(u16*)0x4000140 +#define REG_JOYRE *(u32*)0x4000150 +#define REG_JOYRE_L *(u16*)0x4000150 +#define REG_JOYRE_H *(u16*)0x4000152 +#define REG_JOYTR *(u32*)0x4000154 +#define REG_JOYTR_L *(u16*)0x4000154 +#define REG_JOYTR_H *(u16*)0x4000156 +#define REG_JSTAT *(u32*)0x4000158 +#define REG_JSTAT_L *(u16*)0x4000158 +#define REG_JSTAT_H *(u16*)0x400015A +#define REG_IE *(u16*)0x4000200 +#define REG_IF *(u16*)0x4000202 +#define REG_WSCNT *(u16*)0x4000204 +#define REG_IME *(u16*)0x4000208 +#define REG_PAUSE *(u16*)0x4000300 + +///REG_DISPCNT Defines//// +#define BG0_ENABLE 0x100 //these are just the flags for enabling backgrounds and sprites +#define BG1_ENABLE 0x200 +#define BG2_ENABLE 0x400 +#define BG3_ENABLE 0x800 +#define OBJ_ENABLE 0x1000 +#define WIN0_ENABLE 0x2000 +#define WIN1_ENABLE 0x4000 +#define WINOBJ_ENABLE 0x8000 + + +#define OBJ_MAP_LINEAR 0x40 //I'll talk about this when i talk about hardware sprites +#define OBJ_MAP_2D 0x0 +#define BACK_BUFFER 0x10 //this is the flag that controlls wich buffer is being rendered + + +#define MODE0 0x0 //these are the modes +#define MODE1 0x1 +#define MODE2 0x2 +#define MODE3 0x3 +#define MODE4 0x4 +#define MODE5 0x5 + +#endif + diff --git a/languages/cpp/app_templates/chello_gba/main.c b/languages/cpp/app_templates/chello_gba/main.c new file mode 100644 index 00000000..354b4fd8 --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/main.c @@ -0,0 +1,50 @@ +%{CPP_TEMPLATE} + +#include "main.h" + +int main(){ + initTextMode(); + print("HELLO WORLD",9,9); + while(1){} //loop forever + +} + + +void print(char* text,u16 x,u16 y){ + u16 i=0; + u16* ScreenBase = (u16*)0x6004000; + ScreenBase = ScreenBase + x + y*32; + while ( *text != '\0' ){ + + *ScreenBase++ = (u16)*text-'A'+1; + i++; + text++; + } +} + +void initTextMode(){ + REG_DISPCNT = (MODE0 | BG2_ENABLE); //this sets the screen mode to mode 0 and enables background 2 + + // 256 colors and charscreenbase 0, screenbase 8 + // default size is 256x256 pixel + REG_BG2CNT = (1 << 7 | 0 << 2 | 8 << 8); + + + u16* palDest=(u16*)BGPaletteMem; //0x5000000 + u16* palSource = (u16*)Master_Palette; + // copy the palette info (256 colors a 15/16 Bit) into the desired address + u16 i=0; + for (;i<256;i++) { + *palDest++ = *palSource++; + } + + // copy the tiles to charbase 0, (0x6000000 start of the videobuffer) + u16* fontDest = (u16*)VideoBuffer; //this is the start of video memory + u16* fontSource = (u16*)font_Tiles; + i=0; + for(;i<1920;i=i+2){ + *fontDest++ = *fontSource++; + } +} + + diff --git a/languages/cpp/app_templates/chello_gba/main.h b/languages/cpp/app_templates/chello_gba/main.h new file mode 100644 index 00000000..c84f48bb --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/main.h @@ -0,0 +1,12 @@ +%{H_TEMPLATE} + +// gba.h has all the register definitions +#include "gba.h" + +extern u16 font_Tiles[]; // the letters as 8x8 tiles +extern u16 Master_Palette[]; // the color palette + +void print(char* text,u16 x,u16 y); +void initTextMode(); + + diff --git a/languages/cpp/app_templates/chello_gba/master.pal.c b/languages/cpp/app_templates/chello_gba/master.pal.c new file mode 100644 index 00000000..a24fde37 --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/master.pal.c @@ -0,0 +1,35 @@ +const unsigned short Master_Palette[256]={ +0x0000, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +}; + diff --git a/languages/cpp/app_templates/chello_gba/src-Makefile.am b/languages/cpp/app_templates/chello_gba/src-Makefile.am new file mode 100644 index 00000000..a41e883a --- /dev/null +++ b/languages/cpp/app_templates/chello_gba/src-Makefile.am @@ -0,0 +1,13 @@ +all: %{APPNAMELC}.gba + +%{APPNAMELC}.gba: %{APPNAMELC} + arm-agb-elf-objcopy -O binary %{APPNAMELC} %{APPNAMELC}.gba + +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = main.h main.c font.raw.c master.pal.c + +# set the include path found by configure +INCLUDES= $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(all_libraries) diff --git a/languages/cpp/app_templates/clanlib/.kdev_ignore b/languages/cpp/app_templates/clanlib/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/clanlib/Makefile.am b/languages/cpp/app_templates/clanlib/Makefile.am new file mode 100644 index 00000000..f4a650af --- /dev/null +++ b/languages/cpp/app_templates/clanlib/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = src-Makefile.am app-Makefile.am main.cpp app.kdevelop \ + app-configure.in app-autogen.sh +templateName = clanlib + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz $(templateName).png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/clanlib/app-Makefile.am b/languages/cpp/app_templates/clanlib/app-Makefile.am new file mode 100644 index 00000000..af437a64 --- /dev/null +++ b/languages/cpp/app_templates/clanlib/app-Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src diff --git a/languages/cpp/app_templates/clanlib/app-autogen.sh b/languages/cpp/app_templates/clanlib/app-autogen.sh new file mode 100644 index 00000000..2b285d79 --- /dev/null +++ b/languages/cpp/app_templates/clanlib/app-autogen.sh @@ -0,0 +1,2 @@ +#!/bin/bash +aclocal && autoconf && automake --add-missing --copy diff --git a/languages/cpp/app_templates/clanlib/app-configure.in b/languages/cpp/app_templates/clanlib/app-configure.in new file mode 100644 index 00000000..c1518570 --- /dev/null +++ b/languages/cpp/app_templates/clanlib/app-configure.in @@ -0,0 +1,22 @@ +AC_INIT() +AM_INIT_AUTOMAKE(%{APPNAMELC},%{VERSION}) + +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_MAKE_SET + + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +AC_CHECK_HEADER([ClanLib/application.h], [], + AC_MSG_ERROR([Couldn't find Clanlib headers.])) + +AC_CHECK_LIB(clanApp, main, , AC_ERROR([Couldn't find Clanlib libraries]), -lclanCore -lclanSignals -ldl) + +AC_LANG_RESTORE + + +AC_OUTPUT(Makefile src/Makefile) + diff --git a/languages/cpp/app_templates/clanlib/app.kdevelop b/languages/cpp/app_templates/clanlib/app.kdevelop new file mode 100644 index 00000000..c0d5c286 --- /dev/null +++ b/languages/cpp/app_templates/clanlib/app.kdevelop @@ -0,0 +1,106 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + ClanLib + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + true + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + libc + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/clanlib/clanlib.kdevtemplate b/languages/cpp/app_templates/clanlib/clanlib.kdevtemplate new file mode 100644 index 00000000..1e7b2677 --- /dev/null +++ b/languages/cpp/app_templates/clanlib/clanlib.kdevtemplate @@ -0,0 +1,138 @@ +# KDE Config File +[General] +Name=Simple ClanLib application +Name[ca]=Una simple aplicació de ClanLib +Name[da]=Simpelt ClanLib program +Name[de]=Eine einfache ClanLib-Anwendung +Name[el]=Μια απλή εφαρμογή ClanLib +Name[es]=Una sencilla aplicación de ClanLib +Name[et]=Lihtne ClanLib rakendus +Name[eu]=ClanLib aplikazio simple bat +Name[fa]=کاربرد سادۀ ClanLib +Name[fr]=Application ClanLib simple +Name[ga]=Feidhmchlár simplí ClanLib +Name[gl]=Aplicación sinxela ClanLib +Name[hu]=Egyszerű Clanlib-alkalmazás +Name[it]=semplice applicazione ClanLib +Name[ja]=簡単な ClanLib アプリケーション +Name[nds]=En eenfach ClanLib-Programm +Name[ne]=साधारण ClanLib अनुप्रयोग +Name[nl]=Eenvoudige ClanLib-toepassing +Name[pl]=Prosty program używający ClanLib +Name[pt]=Aplicação simples da ClanLib +Name[pt_BR]=Aplicação simples da ClanLib +Name[ru]=Простое приложение ClanLib +Name[sk]=Jednoduchá ClanLib aplikácia +Name[sl]=Preprost program ClanLib +Name[sr]=Једноставан ClanLib програм +Name[sr@Latn]=Jednostavan ClanLib program +Name[sv]=Enkelt ClanLib-program +Name[tr]=Basit ClanLib uygulaması +Name[zh_CN]=简单的 ClanLib 应用程序 +Name[zh_TW]=簡單的 ClanLib 應用程式 +Category=C++ +Icon=clanlib.png +Comment=Generates a simple ClanLib application. +Comment[ca]=Genera una simple aplicació de ClanLib. +Comment[da]=Genererer et simpelt ClanLib program +Comment[de]=Erstellt eine einfache ClanLib-Anwendung. +Comment[el]=Δημιουργεί μια απλή εφαρμογή ClanLib. +Comment[es]=Genera una sencilla aplicación de ClanLib. +Comment[et]=Lihtsa ClanLib'i rakenduse loomine. +Comment[eu]=ClanLib aplikazio simple bat sortzen du. +Comment[fa]=یک کاربرد سادۀ ClanLib تولید می‌کند. +Comment[fr]=Génère une application ClanLib simple. +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí ClanLib. +Comment[gl]=Xera una aplicación sinxela ClanLib. +Comment[hu]=Létrehoz egy egyszerű Clanlib-alkalmazást. +Comment[it]=Genera una semplice applicazione ClanLib. +Comment[ja]=簡単な ClanLib アプリケーションを作成します +Comment[nds]=Stellt en eenfach ClanLib-Programm op. +Comment[ne]=साधारण ClanLib अनुप्रयोग सिर्जना गर्दछ । +Comment[nl]=Genereert een eenvoudige ClanLib-toepassing +Comment[pl]=Generuje prosty program używający ClanLib. +Comment[pt]=Gera uma aplicação simples com o ClanLib. +Comment[pt_BR]=Gera uma aplicação simples com o ClanLib. +Comment[ru]=Создание простого приложения ClanLib. +Comment[sk]=Vygeneruje jednoduchú ClanLib aplikáciu. +Comment[sl]=Ustvari preprost program ClanLib. +Comment[sr]=Прави једноставан ClanLib програм. +Comment[sr@Latn]=Pravi jednostavan ClanLib program. +Comment[sv]=Skapar ett enkelt ClanLib-program. +Comment[tr]=Basit bir ClanLib uygulaması yaratır. +Comment[zh_CN]=生成简单的 ClanLib 应用程序。 +Comment[zh_TW]=產生簡單的 ClanLib 應用程式。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/main.cpp +Archive=clanlib.tar.gz + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/app-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/app-configure.in +Dest=%{dest}/configure.in + +[FILE4] +Type=install +Source=%{src}/app-autogen.sh +Dest=%{dest}/autogen.sh + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE6] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[MSG] +Type=message +Comment=A simple clanlib application was created in %{dest} +Comment[ca]=Una simple aplicació de clanlib ha estat creada en %{dest} +Comment[da]=Et simpelt clanlib program blev oprettet i %{dest} +Comment[de]=Eine einfache ClanLib-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια απλή εφαρμογή clanlib δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación de ClanLib sencilla ha sido creada en %{dest} +Comment[et]=Lihtne ClanLib'i rakendus loodi asukohta %{dest} +Comment[eu]=clanlib aplikazio simple bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد سادۀ clanlib در %{dest} ایجاد شد +Comment[fr]=Une application Clanlib simple a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár simplí clanlib i %{dest} +Comment[gl]=Creouse una apliación sinxela clanlib en %{dest} +Comment[hu]=Létrejött egy egyszerű Clanlib-alkalmazás itt: %{dest} +Comment[it]=È stata creata una semplice applicazione clanlib in %{dest} +Comment[ja]=簡単な clanlib アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach ClanLib-Programm opstellt +Comment[ne]=साधारण clanlib अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een voorbeeld ClanLib-toepassing is aangemaakt in %{dest} +Comment[pl]=Prosty program używający ClanLib został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação simples da ClanLib em %{dest} +Comment[pt_BR]=Foi criada uma aplicação simples da ClanLib em %{dest} +Comment[ru]=Простое приложение ClanLib создано в %{dest} +Comment[sk]=Jednoduchá ClanLib aplikácia bola vytvorená v %{dest} +Comment[sl]=Preprost program clanlib je bil ustvarjen v %{dest} +Comment[sr]=Једноставан clanlib програм је направљен у %{dest} +Comment[sr@Latn]=Jednostavan clanlib program je napravljen u %{dest} +Comment[sv]=Ett enkelt ClanLib-program skapades i %{dest} +Comment[zh_CN]=在 %{dest} 中创建了一个简单的 clanlib 程序 +Comment[zh_TW]=一個簡單的 clanlib 應用程式已經建立在 %{dest} diff --git a/languages/cpp/app_templates/clanlib/clanlib.png b/languages/cpp/app_templates/clanlib/clanlib.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/clanlib/clanlib.png differ diff --git a/languages/cpp/app_templates/clanlib/main.cpp b/languages/cpp/app_templates/clanlib/main.cpp new file mode 100644 index 00000000..962e1452 --- /dev/null +++ b/languages/cpp/app_templates/clanlib/main.cpp @@ -0,0 +1,29 @@ +%{CPP_TEMPLATE} + +#include +#include +#include +#include +#include + +class %{APPNAME}Application : public CL_ClanApplication +{ +public: + virtual int main(int argc, char** argv) + { + CL_SetupCore::init(); + CL_SetupDisplay::init(); + CL_SetupGL::init(); + CL_SetupSound::init(); + + // Code here + + CL_SetupSound::deinit(); + CL_SetupGL::deinit(); + CL_SetupDisplay::deinit(); + CL_SetupCore::deinit(); + + return 0; + } +} app; + diff --git a/languages/cpp/app_templates/clanlib/src-Makefile.am b/languages/cpp/app_templates/clanlib/src-Makefile.am new file mode 100644 index 00000000..085f4f76 --- /dev/null +++ b/languages/cpp/app_templates/clanlib/src-Makefile.am @@ -0,0 +1,4 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = main.cpp +%{APPNAMELC}_LDADD = -lclanCore -lclanApp -lclanDisplay -lclanGL -lclanSound -lclanSignals + diff --git a/languages/cpp/app_templates/cmakelibc/CMakeLists.txt b/languages/cpp/app_templates/cmakelibc/CMakeLists.txt new file mode 100644 index 00000000..fad51df5 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibc/CMakeLists.txt @@ -0,0 +1,7 @@ +PROJECT(%{APPNAMELC}) + +#if you don't want the full compiler output, remove the following line +SET(CMAKE_VERBOSE_MAKEFILE ON) + +SUBDIRS(src) + diff --git a/languages/cpp/app_templates/cmakelibc/CMakeLists.txt.src b/languages/cpp/app_templates/cmakelibc/CMakeLists.txt.src new file mode 100644 index 00000000..d2fabc7a --- /dev/null +++ b/languages/cpp/app_templates/cmakelibc/CMakeLists.txt.src @@ -0,0 +1,19 @@ +#this is just a basic CMakeLists.txt, for more information see the cmake manpage + +#add definitions, compiler switches, etc. +ADD_DEFINITIONS(-Wall -O2) + +#build a shared library +ADD_LIBRARY(%{APPNAMELC} SHARED %{APPNAMELC}.c) + +#for testing the shared library you probably need some test app too +ADD_EXECUTABLE(%{APPNAMELC}test %{APPNAMELC}test.c) + +#need to link to some other libraries ? just add them here +TARGET_LINK_LIBRARIES(%{APPNAMELC}test %{APPNAMELC}) + +#add an install target here +#INSTALL_FILES(...) +#INSTALL_PROGRAMS(...) +#INSTALL_TARGET(...) + diff --git a/languages/cpp/app_templates/cmakelibc/Makefile.am b/languages/cpp/app_templates/cmakelibc/Makefile.am new file mode 100644 index 00000000..c10e704a --- /dev/null +++ b/languages/cpp/app_templates/cmakelibc/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = test.c lib.h lib.c cmakelibc.png CMakeLists.txt CMakeLists.txt.src +templateName = cmakelibc + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/cmakelibc/cmakelibc b/languages/cpp/app_templates/cmakelibc/cmakelibc new file mode 100644 index 00000000..ae927b61 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibc/cmakelibc @@ -0,0 +1,7 @@ +# KDE Config File +[General] +Name=A shared library template +Icon=cmakelibc.png +Category=C/CMake based projects +Comment=Generates a shared library template including a test application in C. It compiles using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release. +ShowFilesAfterGeneration=src/%{APPNAMELC}.c diff --git a/languages/cpp/app_templates/cmakelibc/cmakelibc.kdevtemplate b/languages/cpp/app_templates/cmakelibc/cmakelibc.kdevtemplate new file mode 100644 index 00000000..cd3783f7 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibc/cmakelibc.kdevtemplate @@ -0,0 +1,139 @@ +# KDE Config File +[General] +Name=A shared library template +Name[ca]=Una plantilla de biblioteca compartida +Name[da]=En delt biblitekskabelon +Name[de]=Vorlage für eine Shared Library +Name[el]=Ένα πρότυπο κοινόχρηστης βιβλιοθήκης +Name[es]=Una plantilla de biblioteca compartida +Name[et]=Jagatud teegi mall +Name[eu]=Liburutegi partekatu baten txantiloia +Name[fa]=قالب کتابخانۀ مشترک +Name[fr]=Un modèle de bibliothèque partagée +Name[ga]=Teimpléad comhleabharlainne +Name[gl]=Plantilla de biblioteca compartida +Name[hu]=Osztott programkönyvtár-sablon +Name[it]=Un modello di libreria condivisa +Name[ja]=共有ライブラリのテンプレート +Name[nds]=Vörlaag för deelt Bibliotheek +Name[ne]=साझेदारी गरिएको लाइब्रेरी टेम्प्लेट +Name[nl]=Een gedeelde-bibliotheek-sjabloon +Name[pl]=Szablon współdzielonej biblioteki +Name[pt]=Um modelo de uma biblioteca dinâmica +Name[pt_BR]=Um modelo de uma biblioteca dinâmica +Name[ru]=Шаблон разделяемой библиотеки +Name[sk]=Šablóna pre zdieľanú knižnicu +Name[sl]=Predloga deljene knjižnice +Name[sr]=Шаблон дељене библиотеке +Name[sr@Latn]=Šablon deljene biblioteke +Name[sv]=En mall för ett delat bibliotek +Name[tr]=Bir paylaşılan kütüphane şablonu +Name[zh_CN]=共享库模板 +Name[zh_TW]=共享函式庫樣本 +Icon=cmakelibc.png +Category=C/CMake based projects +FileTemplates=h,CStyle,c,CStyle +Comment=Generates a shared library template including a test application in C. It compiles using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release. +Comment[ca]=Genera una plantilla de biblioteca compartida incloguen una aplicació de prova en C. Es compila usant l'eina de construcció CMake en comptes de la combinació automake/autoconf/libtool. Requereix cmake 2.1 (disponible en el cvs de cmake) o la propera versió 2.2. +Comment[da]=Genererer en delt skabelon for et bibliotek inklusive et testprogram i C. Det kompilerer ved brug af CMake's byggeværktøj i stedet for automake/autoconf/libtool kombinationen. Det kræver cmake 2.1 (tilgængelig fra cmake cvs) eller den fremtidige cmake 2.2 udgivelse. +Comment[de]=Erstellt eine Vorlage für eine Shared Library inklusive einer Testanwendung in C. Der Kompiliervorgang wird mit CMake anstelle der Kombination automake/autoconf/libtool durchgeführt und erfordert CMake 2.1 (das über das CVS-Archiv von CMake verfügbar ist) oder die kommende Version 2.2 von CMake. +Comment[el]=Δημιουργεί ένα πρότυπο κοινόχρηστης βιβλιοθήκης που περιλαμβάνει και μια εφαρμογή δοκιμής σε C. Μεταγλωττίζεται χρησιμοποιώντας το εργαλείο κατασκευής CMake στη θέση του συνδυασμού automake/autoconf/libtool. Χρειάζεται το cmake 2.1 (διαθέσιμο από το cmake cvs) ή την επερχόμενη έκδοση cmake 2.2. +Comment[es]=Genera una plantilla de biblioteca compartida incluyendo una aplicación de prueba en C. Se compila usando la herramienta CMake en lugar de la combinación automake/autoconf/libtool. Requiere cmake 2.1 (disponible en el cvs de cmake) o la próxima cmake 2.2. +Comment[et]=Jagatud teegi malli loomine, kaasa arvatud testrakendus C-s. See kompileeritakse CMake'i ehitamistööriistaga, mitte automake/autoconf/libtool'i kombinatsiooniga. Selleks on vajalik CMake 2.1 (saadaval CMake'i CVSis) või peatne CMake'i versioon 2.2. +Comment[eu]=Liburutegi partekatu baten txantiloia sortzen du C lengoaian idatzitako probarako aplikazio batekin. CMake tresna erabiliz konpilatzen du automake/autoconf/libtool taldea erabili ordez. cmake 2.1 behar du (cmake cvs-an eskuragarri) edo hurrengo cmake 2.2. +Comment[fa]=یک قالب کتابخانۀ مشترک شامل کاربرد آزمایشی در سی تولید می‌کند. با استفاده از ابزار ساختن CMake به جای ترکیب automake/autoconf/libtool، ترجمه می‌کند. به cmake 2.1 )از cmake cvs قابل دسترس است( یا نشر cmake 2.2 در آیندۀ نزدیک، نیاز دارد. +Comment[fr]=Génère un modèle de bibliothèque partagée comprenant une application de test en C. La compilation s'effectue à l'aide de l'outil de construction CMake au lieu de la combinaison automake / autoconf / libtool. Nécessite CMake 2.1 (disponible sur le CVS de CMake) ou la version 2.2 de CMake à venir. +Comment[ga]=Cruthaigh teimpléad comhleabharlainne le feidhmchlár tástála i C. Tiomsaítear é le huirlis tógála CMake in ionad automake/autoconf/libtool. Tá cmake 2.1 de dhíth (ar fáil ó cmake cvs) nó leagan 2.2 cmake atá le teacht. +Comment[gl]=Xera unha plantilla de biblioteca compartida e máis unha aplicación de proba en C. Compílase usando a ferramenta CMake no lugar da combinación automake/autoconf/libtool. Require cmake 2.1 (dispoñíbel no cvs de cmake) ou a próxima versión cmake 2.2. +Comment[hu]=Létrehoz egy alap osztott programkönyvtárat és egy hozzá tartozó tesztprogramot C nyelven. A fordítási környezet a CMake-re fog alapulni (az automake/autoconf/libtool kombináció helyett). A CMake 2.1 (elérhető a CMake CVS-ben) vagy a rövidesen megjelenő CMake 2.2 szükséges hozzá. +Comment[it]=Genera un modello di libreria condivisa includente un'applicazione test in C. Compila usando CMake invece della combinazione automake/autoconf/libtool. Richiede cmake 2.1 (disponibile dal CVS di cmake) o la versione a venire di cmake 2.2. +Comment[ja]=共有ライブラリのテンプレートを作成します。同時に C でテストアプリケーションも作成します。コンパイルには、automake/autoconf/libtool ではなく CMake (2.1 または 2.2) が必要です。 +Comment[nds]=Stellt en Vörlaag för en deelt Bibliotheek mit en Testprogramm in C op. Dat Kompileren bruukt ansteed vun de "automake/autoconf/libtool"-Kombinatschoon "CMake" in de Verschoon 2.1 (ut dat cmake-CVS) oder 2.2 (de tokamen Utgaav). +Comment[ne]=C मा परीक्षण अनुप्रयोग सहितको साझेदारी टेम्प्लेट उत्पन्न गर्दछ । यसले automake/autoconf/libtool संयोजनको सट्टामा CMake निर्माण उपकरण प्रयोग गरेर कम्पाइल गर्दछ । यसका लागि cmake 2.1 (cmake cvs बाट उपलब्ध हुन्छ) वा अब आउने cmake 2.2 उत्पादन आवश्यक पर्दछ । +Comment[nl]=Genereert een gedeelde-bibliotheek-sjabloon inclusief een testtoepassing in C. Het compileert met behulp van de CMake build tool in plaats van de combinatie automake/autoconf/libtool. Het vereist cmake 2.1 (beschikbaar in het cvs van cmake) of de aankomende cmake 2.2-uitgave. +Comment[pl]=Generuje szablon współdzielonej biblioteki zawierający także program testowy w języku C. Kompilacja odbywa sie za pomocą narzędzia CMake zamiast kombinacji automake/autoconf/libtool. Wymaga cmake 2.1 (dostępnego z cvs-u cmake) lub nadchodzącej wersji 2.2. +Comment[pt]=Gera um modelo de uma biblioteca dinâmica, que inclui uma aplicação de testes em C. Ele é compilado com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2. +Comment[pt_BR]=Gera um modelo de uma biblioteca dinâmica, que inclui uma aplicação de testes em C. Ele é compilado com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2. +Comment[ru]=Создание шаблона разделяемой библиотеки, включая тестовую программу на C. Для сборки потребуется CMake вместо комбинации automake/autoconf/libtool. Потребуется cmake 2.1 (из CVS cmake) или релиз cmake 2.2. +Comment[sk]=Vygeneruje šablónu pre zdieľanú knižnicu vrátane testovacej aplikácie v C.Kompiluje sa pomocou nástroja CMake namiesto kombinácie automake/autoconf/libtool.Vyžaduje cmake 2.1 (dostupné v cmake cvs) alebo nadchádzajúci cmake 2.2 release. +Comment[sl]=Ustvari predlogo za deljeno knjižnico in testni program v C. Za prevajanje se namesto kombinacije automake/autoconf/libtool uporabi orodje za gradnjo CMake. Potreben je CMake 2.1 ali CMake 2.2. +Comment[sr]=Прави шаблон дељене библиотеке, укључујући и пробни програм у C-у. Преводи се помоћу алата CMake уместо комбинације Automake/Autoconf/Libtool. Захтева CMake 2.1 (доступан у CVS-у CMake-а) или надолазеће издање CMake 2.2. +Comment[sr@Latn]=Pravi šablon deljene biblioteke, uključujući i probni program u C-u. Prevodi se pomoću alata CMake umesto kombinacije Automake/Autoconf/Libtool. Zahteva CMake 2.1 (dostupan u CVS-u CMake-a) ili nadolazeće izdanje CMake 2.2. +Comment[sv]=Skapar en mall för ett delat bibliotek inklusive ett testprogram i C. Det kompileras med byggverktyget CMake istället för kombinationen automake/autoconf/libtool. Det kräver cmake 2.1 (tillgängligt från cmake CVS-arkiv) eller den förestående utgåvan av cmake 2.2. +Comment[tr]=C'de bir test uygulaması içeren bir paylaşılan kütüphane uygulaması yaratır. automake/autoconf/libtool birleşimini değil, CMake aracını kullanarak derlenir. cmake 2.1( cmake cvs'inden edinilebilir) veya yakında gelecek olan 2.2 sürümüne ihtiyaç duyar. +Comment[zh_CN]=生成一个共享库模板,其中包含一个 C 的测试应用程序。该模板使用 CMake 编译工具编译,而不是使用 automake/autoconf/libtool 的组合。该模板需要 cmake 2.1 (可从 cmake cvs 中获得)或即将发布的 cmake 2.2 版本。 +Comment[zh_TW]=產生一個共享函式庫樣本,包括一個 C 的測試程式。它要用 CMake 建立工具來編譯,而不是用 automake/autoconf/libtool 等。它需要 cmake 2.1(可以從 cmake cvs 中取得),或是以後的版本。 +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.c +Archive=cmakelibc.tar.gz + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/CMakeLists.txt +Dest=%{dest}/CMakeLists.txt + +[FILE2] +Type=install +EscapeXML=true +Source=%{src}/CMakeLists.txt.src +Dest=%{dest}/src/CMakeLists.txt + +[FILE3] +Type=install +EscapeXML=true +Source=%{src}/test.c +Dest=%{dest}/src/%{APPNAMELC}test.c + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/lib.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE5] +Type=install +EscapeXML=true +Source=%{src}/lib.c +Dest=%{dest}/src/%{APPNAMELC}.c + +[CMAKE] +Type=finishcmd +Command=cmake ./ -GKDevelop3 +Directory=%{dest} + +[MSG] +Type=message +Comment=A CMake based shared library template was created in %{dest} +Comment[ca]=Una plantilla de biblioteca compartida basada en CMake ha estat creada en %{dest} +Comment[da]=En CMake baseret skabelon for et delt bibliotek blev oprettet i %{dest} +Comment[de]=Eine auf CMake basierende Vorlage für eine Shared Library wurde in %{dest} erstellt. +Comment[el]=Ένα πρότυπο κοινόχρηστης βιβλιοθήκης βασισμένο στο CMake δημιουργήθηκε στο %{dest} +Comment[es]=Una plantilla de biblioteca compartida basada en CMake ha sido creada en %{dest} +Comment[et]=Jagatud teegi mall CMake'i põhjal loodi asukohta %{dest} +Comment[eu]=CMake-en oinarritutako liburutegi partekatu baten txantiloia sortu da hemen: %{dest} +Comment[fa]=یک قالب کتابخانۀ مشترک بر مبنای CMake در %{dest} ایجاد شد +Comment[fr]=Un modèle de bibliothèque partagée basée sur CMake a été créé dans %{dest} +Comment[ga]=Cruthaíodh teimpléad comhleabharlainne bunaithe ar CMake i %{dest} +Comment[gl]=Creouse una plantilla de biblioteca compartida baseada en CMake en %{dest} +Comment[hu]=Létrejött egy CMake-alapú osztott programkönyvtár-sablon itt: %{dest} +Comment[it]=È stato creato un modello di librerie condivise basate su CMake in %{dest} +Comment[ja]=CMake ベースの共有ライブラリテンプレートを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op CMake opbuut Vörlaag för en deelt Bibliotheek opstellt +Comment[ne]=एउटा CMake आधारित साझेदारी लाइब्रेरी टेम्प्लेट %{dest} मा सिर्जना गरियो +Comment[nl]=Een op Cmake gebaseerde bibliotheeksjabloon is aangemaakt in %{dest} +Comment[pl]=Używający CMake szablon biblioteki współdzielonej został utworzony w %{dest} +Comment[pt]=Foi criado um modelo de uma biblioteca dinâmica do CMake em %{dest} +Comment[pt_BR]=Foi criado um modelo de uma biblioteca dinâmica do CMake em %{dest} +Comment[ru]=Основанный на CMake шаблон разделяемой библиотеки создан в %{dest} +Comment[sk]=Šablóna zdieľanej knižnice založenej na CMake bola vytvorená v %{dest} +Comment[sl]=Predloga deljene knjižnice, ki uporablja CMake, je bila ustvarjena v %{dest} +Comment[sr]=Шаблон дељене библиотеке на основу CMake-а направљен је у %{dest} +Comment[sr@Latn]=Šablon deljene biblioteke na osnovu CMake-a napravljen je u %{dest} +Comment[sv]=En CMake-baserad mall för ett delat bibliotek skapades i %{dest} +Comment[tr]=CMake tabanlı paylaşılan kütüphane şablonu %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了基于 CMake 的共享库 +Comment[zh_TW]=以 CMake 為基礎的共享函式庫樣本已建立在 %{dest} diff --git a/languages/cpp/app_templates/cmakelibc/cmakelibc.png b/languages/cpp/app_templates/cmakelibc/cmakelibc.png new file mode 100644 index 00000000..158d3ce7 Binary files /dev/null and b/languages/cpp/app_templates/cmakelibc/cmakelibc.png differ diff --git a/languages/cpp/app_templates/cmakelibc/lib.c b/languages/cpp/app_templates/cmakelibc/lib.c new file mode 100644 index 00000000..4d285882 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibc/lib.c @@ -0,0 +1,13 @@ + +#include +#include + +#include "%{APPNAMELC}.h" + + +void do_something() +{ + printf("Hello world !\n"); +} + + diff --git a/languages/cpp/app_templates/cmakelibc/lib.h b/languages/cpp/app_templates/cmakelibc/lib.h new file mode 100644 index 00000000..1b326544 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibc/lib.h @@ -0,0 +1,7 @@ +#ifndef %{APPNAMELC}_H +#define %{APPNAMELC}_H + +void do_something(); + + +#endif diff --git a/languages/cpp/app_templates/cmakelibc/test.c b/languages/cpp/app_templates/cmakelibc/test.c new file mode 100644 index 00000000..fb13e866 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibc/test.c @@ -0,0 +1,8 @@ + +#include "%{APPNAMELC}.h" + +int main(int argc, char** argv) +{ + do_something(); + return 0; +} diff --git a/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt new file mode 100644 index 00000000..8f172103 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt @@ -0,0 +1,8 @@ + +PROJECT(%{APPNAMELC}) + +#if you don't want the full compiler output, remove the following line + +SET(CMAKE_VERBOSE_MAKEFILE ON) + +SUBDIRS(src) diff --git a/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt.src b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt.src new file mode 100644 index 00000000..ee2bb832 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt.src @@ -0,0 +1,19 @@ +#this is just a basic CMakeLists.txt, for more information see the cmake manpage + +#add definitions, compiler switches, etc. +ADD_DEFINITIONS(-Wall -O2) + +#build a shared library +ADD_LIBRARY(%{APPNAMELC} SHARED %{APPNAMELC}.cpp) + +#for testing the shared library you probably need some test app too +ADD_EXECUTABLE(%{APPNAMELC}test %{APPNAMELC}test.cpp) + +#need to link to some other libraries ? just add them here +TARGET_LINK_LIBRARIES(%{APPNAMELC}test %{APPNAMELC}) + +#add an install target here +#INSTALL_FILES(...) +#INSTALL_PROGRAMS(...) +#INSTALL_TARGET(...) + diff --git a/languages/cpp/app_templates/cmakelibcpp/Makefile.am b/languages/cpp/app_templates/cmakelibcpp/Makefile.am new file mode 100644 index 00000000..395bb107 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibcpp/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = test.cpp lib.h lib.cpp cmakelibcpp.png CMakeLists.txt CMakeLists.txt.src +templateName = cmakelibcpp + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp new file mode 100644 index 00000000..c68119c5 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp @@ -0,0 +1,7 @@ +# KDE Config File +[General] +Name=A shared library template +Icon=cmakelibcpp.png +Category=C++/CMake based projects +Comment=Generates a shared library template including a test application in C++. It compiles using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release. +ShowFilesAfterGeneration=src/%{APPNAMELC}.cpp diff --git a/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.kdevtemplate b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.kdevtemplate new file mode 100644 index 00000000..e6e6ac44 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.kdevtemplate @@ -0,0 +1,139 @@ +# KDE Config File +[General] +Name=A shared library template +Name[ca]=Una plantilla de biblioteca compartida +Name[da]=En delt biblitekskabelon +Name[de]=Vorlage für eine Shared Library +Name[el]=Ένα πρότυπο κοινόχρηστης βιβλιοθήκης +Name[es]=Una plantilla de biblioteca compartida +Name[et]=Jagatud teegi mall +Name[eu]=Liburutegi partekatu baten txantiloia +Name[fa]=قالب کتابخانۀ مشترک +Name[fr]=Un modèle de bibliothèque partagée +Name[ga]=Teimpléad comhleabharlainne +Name[gl]=Plantilla de biblioteca compartida +Name[hu]=Osztott programkönyvtár-sablon +Name[it]=Un modello di libreria condivisa +Name[ja]=共有ライブラリのテンプレート +Name[nds]=Vörlaag för deelt Bibliotheek +Name[ne]=साझेदारी गरिएको लाइब्रेरी टेम्प्लेट +Name[nl]=Een gedeelde-bibliotheek-sjabloon +Name[pl]=Szablon współdzielonej biblioteki +Name[pt]=Um modelo de uma biblioteca dinâmica +Name[pt_BR]=Um modelo de uma biblioteca dinâmica +Name[ru]=Шаблон разделяемой библиотеки +Name[sk]=Šablóna pre zdieľanú knižnicu +Name[sl]=Predloga deljene knjižnice +Name[sr]=Шаблон дељене библиотеке +Name[sr@Latn]=Šablon deljene biblioteke +Name[sv]=En mall för ett delat bibliotek +Name[tr]=Bir paylaşılan kütüphane şablonu +Name[zh_CN]=共享库模板 +Name[zh_TW]=共享函式庫樣本 +Icon=cmakelibcpp.png +Category=C++/CMake based projects +FileTemplates=h,CStyle,cpp,CStyle +Comment=Generates a shared library template including a test application in C++. It compiles using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release. +Comment[ca]=Genera una plantilla de biblioteca compartida incloguen una aplicació de prova en C++. Es compila usant l'eina de construcció CMake en comptes de la combinació automake/autoconf/libtool. Requereix cmake 2.1 (disponible en el cvs de cmake) o la propera versió 2.2. +Comment[da]=Genererer skabelon for delt bibliotek inklusive et testprogram i C++. Det kompileres ved brug af CMake byggeværktøjet i stedet for automake/autoconf/libtool kombinationen. Det kræver cmake 2.1 (tilgængelig fra cmake cvs) eller den fremtidige cmake 2.2 udgivelse. +Comment[de]=Erstellt eine Vorlage für eine Shared Library inklusive einer Testanwendung in C++. Der Kompiliervorgang wird mit CMake anstelle der Kombination automake/autoconf/libtool durchgeführt und erfordert CMake 2.1 (das über das CVS-Archiv von CMake verfügbar ist) oder die kommende Version 2.2 von CMake. +Comment[el]=Δημιουργεί ένα πρότυπο κοινόχρηστης βιβλιοθήκης που περιλαμβάνει και μια εφαρμογή δοκιμής σε C++. Μεταγλωττίζεται χρησιμοποιώντας το εργαλείο κατασκευής CMake στη θέση του συνδυασμού automake/autoconf/libtool. Χρειάζεται το cmake 2.1 (διαθέσιμο από το cmake cvs) ή την επερχόμενη έκδοση cmake 2.2. +Comment[es]=Genera una plantilla de biblioteca compartida incluyendo una aplicación de prueba en C++. Se compila usando la herramienta CMake en lugar de la combinación automake/autoconf/libtool. Requiere cmake 2.1 (disponible en el cvs de cmake) o la próxima cmake 2.2. +Comment[et]=Jagatud teegi malli loomine, kaasa arvatud testrakendus C++-s. See kompileeritakse CMake'i ehitamistööriistaga, mitte automake/autoconf/libtool'i kombinatsiooniga. Selleks on vajalik CMake 2.1 (saadaval CMake'i CVSis) või peatne CMake'i versioon 2.2. +Comment[eu]=Liburutegi partekatu baten txantiloia sortzen du C++ lengoaian idatzitako probarako aplikazio batekin. CMake tresna erabiliz konpilatzen du automake/autoconf/libtool taldea erabili ordez. cmake 2.1 behar du (cmake cvs-an eskuragarri) edo hurrengo cmake 2.2. +Comment[fa]=یک قالب کتابخانۀ مشترک شامل کاربرد آزمایشی در C++ تولید می‌کند. با استفاده از ابزار ساختن CMake به جای ترکیب automake/autoconf/libtool، ترجمه می‌کند. به cmake 2.1 )از cmake cvs قابل دسترس است( یا نشر cmake 2.2 در آیندۀ نزدیک، نیاز دارد. +Comment[fr]=Génère un modèle de bibliothèque partagée incluant une application de test en C++. La compilation s'effectue à l'aide de l'outil de construction CMake au lieu de la combinaison automake / autoconf / libtool. Nécessite CMake 2.1 (disponible sur le CVS de CMake) ou la version 2.2 de CMake à venir. +Comment[ga]=Cruthaigh teimpléad comhleabharlainne le feidhmchlár tástála i C++. Tiomsaítear é le huirlis tógála CMake in ionad automake/autoconf/libtool. Tá cmake 2.1 de dhíth (ar fáil ó cmake cvs) nó leagan 2.2 cmake atá le teacht. +Comment[gl]=Xera unha plantilla de biblioteca compartida e máis unha aplicación de proba en C++. Compílase usando a ferramenta CMake no lugar da combinación automake/autoconf/libtool. Require cmake 2.1 (dispoñíbel no cvs de cmake) ou a próxima versión cmake 2.2. +Comment[hu]=Létrehoz egy alap osztott programkönyvtárat és egy hozzá tartozó tesztprogramot C++ nyelven. A fordítási környezet a CMake-re fog alapulni (az automake/autoconf/libtool kombináció helyett). A CMake 2.1 (elérhető a CMake CVS-ben) vagy a rövidesen megjelenő CMake 2.2 szükséges hozzá. +Comment[it]=Genera un modello di libreria condivisa che include una applicazione test in C++. Compila usando CMake invece della combinazione automake/autoconf/libtool. Richiede cmake 2.1 (disponibile dal CVS di cmake) o la versione a venire cmake 2.2. +Comment[ja]=共有ライブラリのテンプレートを作成します。同時に C++ でテストアプリケーションも作成します。コンパイルには、automake/autoconf/libtool ではなく CMake (2.1 または 2.2) が必要です。 +Comment[nds]=Stellt en Vörlaag för en deelt Bibliotheek mit en Testprogramm in C++ op. Dat Kompileren bruukt ansteed vun de "automake/autoconf/libtool"-Kombinatschoon "CMake" in de Verschoon 2.1 (ut dat cmake-CVS) oder 2.2 (de tokamen Utgaav). +Comment[ne]=C++ मा परीक्षण अनुप्रयोग सहितको साझेदारी टेम्प्लेट उत्पन्न गर्दछ । यसले automake/autoconf/libtool संयोजनको सट्टामा CMake निर्माण उपकरण प्रयोग गरेर कम्पाइल गर्दछ । यसका लागि cmake 2.1 (cmake cvs बाट उपलब्ध हुन्छ) वा अब आउने cmake 2.2 उत्पादन आवश्यक पर्दछ । +Comment[nl]=Genereert een gedeelde-bibliotheek-sjabloon inclusief een testtoepassing in C++. Het compileert met behulp van de CMake build tool in plaats van de combinatie automake/autoconf/libtool. Het vereist cmake 2.1 (uit het cvs van cmake) of de aankomende cmake 2.2-uitgave. +Comment[pl]=Generuje szablon współdzielonej biblioteki zawierający także program testowy w języku C++. Kompilacja odbywa sie za pomocą narzędzia CMake zamiast kombinacji automake/autoconf/libtool. Wymaga cmake 2.1 (dostępnego z cvs-u cmake) lub nadchodzącej wersji 2.2. +Comment[pt]=Gera um modelo de uma biblioteca dinâmica, que inclui uma aplicação de testes em C++. Ele é compilado com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2. +Comment[pt_BR]=Gera um modelo de uma biblioteca dinâmica, que inclui uma aplicação de testes em C++. Ele é compilado com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2. +Comment[ru]=Создание шаблона разделяемой библиотеки, включая тестовую программу на C++. Для сборки потребуется CMake вместо комбинации automake/autoconf/libtool. Потребуется cmake 2.1 (из CVS cmake) или релиз cmake 2.2. +Comment[sk]=Vygeneruje šablónu zdieľanej knižnice vrátane testovacej aplikácie v C++.Kompiluje sa pomocou nástroja CMake namiesto kombinácie automake/autoconf/libtool.Vyžaduje cmake 2.1 (dostupné v cmake cvs) alebo nadchádzajúci cmake 2.2 release. +Comment[sl]=Ustvari predlogo za deljeno knjižnico in testni program v C++. Za prevajanje se namesto kombinacije automake/autoconf/libtool uporabi orodje za gradnjo CMake. Potreben je CMake 2.1 ali CMake 2.2. +Comment[sr]=Прави шаблон дељене библиотеке укључујући и пробни програм у C++-у. Преводи се помоћу алата CMake уместо комбинације Automake/Autoconf/Libtool. Захтева CMake 2.1 (доступан у CVS-у CMake-а) или надолазеће издање CMake 2.2. +Comment[sr@Latn]=Pravi šablon deljene biblioteke uključujući i probni program u C++-u. Prevodi se pomoću alata CMake umesto kombinacije Automake/Autoconf/Libtool. Zahteva CMake 2.1 (dostupan u CVS-u CMake-a) ili nadolazeće izdanje CMake 2.2. +Comment[sv]=Skapar en mall för ett delat bibliotek inklusive ett testprogram i C++. Det kompileras med byggverktyget CMake istället för kombinationen automake/autoconf/libtool. Det kräver cmake 2.1 (tillgängligt från cmake CVS-arkiv) eller den förestående utgåvan av cmake 2.2. +Comment[tr]=C++'da bir test uygulaması içeren bir paylaşılan kütüphane uygulaması yaratır. automake/autoconf/libtool birleşimini değil, CMake aracını kullanarak derlenir. cmake 2.1( cmake cvs'inden edinilebilir) veya yakında gelecek olan 2.2 sürümüne ihtiyaç duyar. +Comment[zh_CN]=生成一个共享库模板,其中包含一个 C++ 的测试应用程序。该模板使用 CMake 编译工具编译,而不是使用 automake/autoconf/libtool 的组合。该模板需要 cmake 2.1 (可从 cmake cvs 中获得)或即将发布的 cmake 2.2 版本。 +Comment[zh_TW]=產生一個包括 C++ 測試程式的共享函式庫樣本。它要用 CMake 建立工具來編譯,而不是用 automake/autoconf/libtool 等。它需要 cmake 2.1(可以從 cmake cvs 中取得),或是以後的版本。 +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=cmakelibcpp.tar.gz + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/CMakeLists.txt +Dest=%{dest}/CMakeLists.txt + +[FILE2] +Type=install +EscapeXML=true +Source=%{src}/CMakeLists.txt.src +Dest=%{dest}/src/CMakeLists.txt + +[FILE3] +Type=install +EscapeXML=true +Source=%{src}/test.cpp +Dest=%{dest}/src/%{APPNAMELC}test.cpp + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/lib.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE5] +Type=install +EscapeXML=true +Source=%{src}/lib.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[CMAKE] +Type=finishcmd +Command=cmake ./ -GKDevelop3 +Directory=%{dest} + +[MSG] +Type=message +Comment=A CMake based shared library template was created in %{dest} +Comment[ca]=Una plantilla de biblioteca compartida basada en CMake ha estat creada en %{dest} +Comment[da]=En CMake baseret skabelon for et delt bibliotek blev oprettet i %{dest} +Comment[de]=Eine auf CMake basierende Vorlage für eine Shared Library wurde in %{dest} erstellt. +Comment[el]=Ένα πρότυπο κοινόχρηστης βιβλιοθήκης βασισμένο στο CMake δημιουργήθηκε στο %{dest} +Comment[es]=Una plantilla de biblioteca compartida basada en CMake ha sido creada en %{dest} +Comment[et]=Jagatud teegi mall CMake'i põhjal loodi asukohta %{dest} +Comment[eu]=CMake-en oinarritutako liburutegi partekatu baten txantiloia sortu da hemen: %{dest} +Comment[fa]=یک قالب کتابخانۀ مشترک بر مبنای CMake در %{dest} ایجاد شد +Comment[fr]=Un modèle de bibliothèque partagée basée sur CMake a été créé dans %{dest} +Comment[ga]=Cruthaíodh teimpléad comhleabharlainne bunaithe ar CMake i %{dest} +Comment[gl]=Creouse una plantilla de biblioteca compartida baseada en CMake en %{dest} +Comment[hu]=Létrejött egy CMake-alapú osztott programkönyvtár-sablon itt: %{dest} +Comment[it]=È stato creato un modello di librerie condivise basate su CMake in %{dest} +Comment[ja]=CMake ベースの共有ライブラリテンプレートを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op CMake opbuut Vörlaag för en deelt Bibliotheek opstellt +Comment[ne]=एउटा CMake आधारित साझेदारी लाइब्रेरी टेम्प्लेट %{dest} मा सिर्जना गरियो +Comment[nl]=Een op Cmake gebaseerde bibliotheeksjabloon is aangemaakt in %{dest} +Comment[pl]=Używający CMake szablon biblioteki współdzielonej został utworzony w %{dest} +Comment[pt]=Foi criado um modelo de uma biblioteca dinâmica do CMake em %{dest} +Comment[pt_BR]=Foi criado um modelo de uma biblioteca dinâmica do CMake em %{dest} +Comment[ru]=Основанный на CMake шаблон разделяемой библиотеки создан в %{dest} +Comment[sk]=Šablóna zdieľanej knižnice založenej na CMake bola vytvorená v %{dest} +Comment[sl]=Predloga deljene knjižnice, ki uporablja CMake, je bila ustvarjena v %{dest} +Comment[sr]=Шаблон дељене библиотеке на основу CMake-а направљен је у %{dest} +Comment[sr@Latn]=Šablon deljene biblioteke na osnovu CMake-a napravljen je u %{dest} +Comment[sv]=En CMake-baserad mall för ett delat bibliotek skapades i %{dest} +Comment[tr]=CMake tabanlı paylaşılan kütüphane şablonu %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了基于 CMake 的共享库 +Comment[zh_TW]=以 CMake 為基礎的共享函式庫樣本已建立在 %{dest} diff --git a/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.png b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.png new file mode 100644 index 00000000..158d3ce7 Binary files /dev/null and b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.png differ diff --git a/languages/cpp/app_templates/cmakelibcpp/lib.cpp b/languages/cpp/app_templates/cmakelibcpp/lib.cpp new file mode 100644 index 00000000..7dc4b57d --- /dev/null +++ b/languages/cpp/app_templates/cmakelibcpp/lib.cpp @@ -0,0 +1,17 @@ + +#include +#include + +#include "%{APPNAMELC}.h" + + +Foo::Foo() +{ +} + +void Foo::doSomething() +{ + printf("Hello world !\n"); +} + + diff --git a/languages/cpp/app_templates/cmakelibcpp/lib.h b/languages/cpp/app_templates/cmakelibcpp/lib.h new file mode 100644 index 00000000..5a434cdb --- /dev/null +++ b/languages/cpp/app_templates/cmakelibcpp/lib.h @@ -0,0 +1,12 @@ +#ifndef %{APPNAMELC}_H +#define %{APPNAMELC}_H + +class Foo +{ + public: + Foo(); + void doSomething(); +}; + + +#endif diff --git a/languages/cpp/app_templates/cmakelibcpp/test.cpp b/languages/cpp/app_templates/cmakelibcpp/test.cpp new file mode 100644 index 00000000..b2464709 --- /dev/null +++ b/languages/cpp/app_templates/cmakelibcpp/test.cpp @@ -0,0 +1,9 @@ + +#include "%{APPNAMELC}.h" + +int main(int argc, char** argv) +{ + Foo foo; + foo.doSomething(); + return 0; +} diff --git a/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt b/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt new file mode 100644 index 00000000..819d0a7e --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt @@ -0,0 +1,14 @@ + +PROJECT(%{APPNAMELC}) + +# at least cmake version 2.4.0 is required +CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0) + +# uncomment the following line if you require a special version of Qt +# and adjust it accordingly +# SET(QT_MIN_VERSION "3.0.0") + +# try to find Qt 3 +FIND_PACKAGE(Qt3 REQUIRED) + +ADD_SUBDIRECTORY(src) diff --git a/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt.src b/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt.src new file mode 100644 index 00000000..c4ce3e70 --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt.src @@ -0,0 +1,28 @@ +# this is just a basic CMakeLists.txt +# for more information see the cmake man page + +# add definitions, compiler switches, etc. +ADD_DEFINITIONS(${QT_DEFINITIONS} -Wall -O2 -g) + +# add the Qt include dir to the include path +INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR}) + +# list all source files in a variable +SET(%{APPNAMELC}_SRCS main.cpp %{APPNAMELC}.cpp) + +# specify the headers which have to be processed by moc +# and collect the results in the variable given above +QT_WRAP_CPP (%{APPNAMELC} %{APPNAMELC}_SRCS %{APPNAMELC}.h) + +# create tan executable from the list of source files +ADD_EXECUTABLE(%{APPNAMELC} ${%{APPNAMELC}_SRCS}) + +# link the application to the Qt libs +TARGET_LINK_LIBRARIES(%{APPNAMELC} ${QT_LIBRARIES} ) + +# create an install rule for the executable +INSTALL(TARGETS %{APPNAMELC} DESTINATION bin ) + +# if you need to install more things, take a look at the install() command +# in the cmake man page + diff --git a/languages/cpp/app_templates/cmakeqt3app/Makefile.am b/languages/cpp/app_templates/cmakeqt3app/Makefile.am new file mode 100644 index 00000000..c5fca50a --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = main.cpp cmakeqt3app.cpp cmakeqt3app.h cmakeqt3app.png \ + filesave.xpm fileopen.xpm fileprint.xpm CMakeLists.txt CMakeLists.txt.src + +templateName = cmakeqt3app + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app new file mode 100644 index 00000000..6ef2974f --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app @@ -0,0 +1,8 @@ +# QMake application +[General] +Name=Qt3 Application +Icon=cmakeqt3app.png +Category=C++/CMake based projects +Comment=Generate a CMake based Qt3 application +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/APPNAMELC.cpp diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.cpp b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.cpp new file mode 100644 index 00000000..841f88d4 --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.cpp @@ -0,0 +1,283 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "filesave.xpm" +#include "fileopen.xpm" +#include "fileprint.xpm" + +%{APPNAME}::%{APPNAME}() + : QMainWindow( 0, "%{APPNAME}", WDestructiveClose ) +{ + printer = new QPrinter; + QPixmap openIcon, saveIcon, printIcon; + + QToolBar * fileTools = new QToolBar( this, "file operations" ); + fileTools->setLabel( tr("File Operations") ); + + openIcon = QPixmap( fileopen ); + QToolButton * fileOpen + = new QToolButton( openIcon, tr("Open File"), QString::null, + this, SLOT(choose()), fileTools, "open file" ); + + saveIcon = QPixmap( filesave ); + QToolButton * fileSave + = new QToolButton( saveIcon, tr("Save File"), QString::null, + this, SLOT(save()), fileTools, "save file" ); + + printIcon = QPixmap( fileprint ); + QToolButton * filePrint + = new QToolButton( printIcon, tr("Print File"), QString::null, + this, SLOT(print()), fileTools, "print file" ); + + + (void)QWhatsThis::whatsThisButton( fileTools ); + + QString fileOpenText = tr("

" + "Click this button to open a new file.
" + "You can also select the Open command " + "from the File menu.

"); + + QWhatsThis::add( fileOpen, fileOpenText ); + + QMimeSourceFactory::defaultFactory()->setPixmap( "fileopen", openIcon ); + + QString fileSaveText = tr("

Click this button to save the file you " + "are editing. You will be prompted for a file name.\n" + "You can also select the Save command " + "from the File menu.

"); + + QWhatsThis::add( fileSave, fileSaveText ); + + QString filePrintText = tr("Click this button to print the file you " + "are editing.\n You can also select the Print " + "command from the File menu."); + + QWhatsThis::add( filePrint, filePrintText ); + + + QPopupMenu * file = new QPopupMenu( this ); + menuBar()->insertItem( tr("&File"), file ); + + + file->insertItem( tr("&New"), this, SLOT(newDoc()), CTRL+Key_N ); + + int id; + id = file->insertItem( openIcon, tr("&Open..."), + this, SLOT(choose()), CTRL+Key_O ); + file->setWhatsThis( id, fileOpenText ); + + id = file->insertItem( saveIcon, tr("&Save"), + this, SLOT(save()), CTRL+Key_S ); + file->setWhatsThis( id, fileSaveText ); + + id = file->insertItem( tr("Save &As..."), this, SLOT(saveAs()) ); + file->setWhatsThis( id, fileSaveText ); + + file->insertSeparator(); + + id = file->insertItem( printIcon, tr("&Print..."), + this, SLOT(print()), CTRL+Key_P ); + file->setWhatsThis( id, filePrintText ); + + file->insertSeparator(); + + file->insertItem( tr("&Close"), this, SLOT(close()), CTRL+Key_W ); + + file->insertItem( tr("&Quit"), qApp, SLOT( closeAllWindows() ), CTRL+Key_Q ); + + menuBar()->insertSeparator(); + + QPopupMenu * help = new QPopupMenu( this ); + menuBar()->insertItem( tr("&Help"), help ); + + help->insertItem( tr("&About"), this, SLOT(about()), Key_F1 ); + help->insertItem( tr("About &Qt"), this, SLOT(aboutQt()) ); + help->insertSeparator(); + help->insertItem( tr("What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1 ); + + e = new QTextEdit( this, "editor" ); + e->setFocus(); + setCentralWidget( e ); + statusBar()->message( tr("Ready"), 2000 ); + + resize( 450, 600 ); +} + + +%{APPNAME}::~%{APPNAME}() +{ + delete printer; +} + + + +void %{APPNAME}::newDoc() +{ + %{APPNAME} *ed = new %{APPNAME}; + ed->setCaption(tr("Qt Example - Application")); + ed->show(); +} + +void %{APPNAME}::choose() +{ + QString fn = QFileDialog::getOpenFileName( QString::null, QString::null, + this); + if ( !fn.isEmpty() ) + load( fn ); + else + statusBar()->message( tr("Loading aborted"), 2000 ); +} + + +void %{APPNAME}::load( const QString &fileName ) +{ + QFile f( fileName ); + if ( !f.open( IO_ReadOnly ) ) + return; + + QTextStream ts( &f ); + e->setText( ts.read() ); + e->setModified( FALSE ); + setCaption( fileName ); + statusBar()->message( tr("Loaded document %1").arg(fileName), 2000 ); +} + + +void %{APPNAME}::save() +{ + if ( filename.isEmpty() ) { + saveAs(); + return; + } + + QString text = e->text(); + QFile f( filename ); + if ( !f.open( IO_WriteOnly ) ) { + statusBar()->message( tr("Could not write to %1").arg(filename), + 2000 ); + return; + } + + QTextStream t( &f ); + t << text; + f.close(); + + e->setModified( FALSE ); + + setCaption( filename ); + + statusBar()->message( tr( "File %1 saved" ).arg( filename ), 2000 ); +} + + +void %{APPNAME}::saveAs() +{ + QString fn = QFileDialog::getSaveFileName( QString::null, QString::null, + this ); + if ( !fn.isEmpty() ) { + filename = fn; + save(); + } else { + statusBar()->message( tr("Saving aborted"), 2000 ); + } +} + + +void %{APPNAME}::print() +{ + // ###### Rewrite to use QSimpleRichText to print here as well + const int Margin = 10; + int pageNo = 1; + + if ( printer->setup(this) ) { // printer dialog + statusBar()->message( tr("Printing...") ); + QPainter p; + if( !p.begin( printer ) ) // paint on printer + return; + + p.setFont( e->font() ); + int yPos = 0; // y-position for each line + QFontMetrics fm = p.fontMetrics(); + QPaintDeviceMetrics metrics( printer ); // need width/height + // of printer surface + for( int i = 0 ; i < e->lines() ; i++ ) { + if ( Margin + yPos > metrics.height() - Margin ) { + QString msg( "Printing (page " ); + msg += QString::number( ++pageNo ); + msg += ")..."; + statusBar()->message( msg ); + printer->newPage(); // no more room on this page + yPos = 0; // back to top of page + } + p.drawText( Margin, Margin + yPos, + metrics.width(), fm.lineSpacing(), + ExpandTabs | DontClip, + e->text( i ) ); + yPos = yPos + fm.lineSpacing(); + } + p.end(); // send job to printer + statusBar()->message( tr("Printing completed"), 2000 ); + } else { + statusBar()->message( tr("Printing aborted"), 2000 ); + } +} + +void %{APPNAME}::closeEvent( QCloseEvent* ce ) +{ + if ( !e->isModified() ) { + ce->accept(); + return; + } + + switch( QMessageBox::information( this, tr("Qt Application Example"), + tr("Do you want to save the changes" + " to the document?"), + tr("Yes"), tr("No"), tr("Cancel"), + 0, 1 ) ) { + case 0: + save(); + ce->accept(); + break; + case 1: + ce->accept(); + break; + case 2: + default: // just for sanity + ce->ignore(); + break; + } +} + + +void %{APPNAME}::about() +{ + QMessageBox::about( this, tr("Qt Application Example"), + tr("This example demonstrates simple use of " + "QMainWindow,\nQMenuBar and QToolBar.")); +} + + +void %{APPNAME}::aboutQt() +{ + QMessageBox::aboutQt( this, tr("Qt Application Example") ); +} diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.h b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.h new file mode 100644 index 00000000..2d372da9 --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.h @@ -0,0 +1,39 @@ +%{H_TEMPLATE} + +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + +#include + +class QTextEdit; + +class %{APPNAME}: public QMainWindow +{ + Q_OBJECT + +public: + %{APPNAME}(); + ~%{APPNAME}(); + +protected: + void closeEvent( QCloseEvent* ); + +private slots: + void newDoc(); + void choose(); + void load( const QString &fileName ); + void save(); + void saveAs(); + void print(); + + void about(); + void aboutQt(); + +private: + QPrinter *printer; + QTextEdit *e; + QString filename; +}; + + +#endif diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.kdevtemplate b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.kdevtemplate new file mode 100644 index 00000000..ff69203c --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.kdevtemplate @@ -0,0 +1,126 @@ +# KDE Config File +[General] +Name=Qt3 Application +Name[br]=Meziant Qt3 +Name[ca]=Aplicació Qt3 +Name[da]=Qt3-Program +Name[de]=Qt3-Anwendung +Name[el]=Εφαρμογή Qt3 +Name[es]=Aplicación Qt3 +Name[et]=Qt3 rakendus +Name[fr]=Application Qt3 +Name[hu]=Qt3-alapú alkalmazások +Name[it]=Applicazione Qt3 +Name[ja]=Qt3 アプリケーション +Name[nds]=Qt3-Programm +Name[nl]=Qt3-toepassing +Name[pl]=Program Qt3 +Name[pt]=Aplicação do Qt3 +Name[pt_BR]=Aplicação do Qt3 +Name[ru]=Приложение Qt 3 +Name[sk]=Qt3 aplikácia +Name[sr]=Qt3 програм +Name[sr@Latn]=Qt3 program +Name[sv]=Qt3-program +Name[zh_TW]=Qt3 應用程式 +Icon=cmakeqt3app.png +Category=C++/CMake based projects +Comment=Generate a CMake based Qt3 application +Comment[ca]=Genera una aplicació Qt3 basada en CMake +Comment[da]=Opretter et CMake-baseret Qt3-program +Comment[de]=Erstellt eine auf CMake basierende Qt3-Anwendung +Comment[el]=Δημιουργία μιας εφαρμογής Qt3 με βάση το CMake +Comment[es]=Genera una aplicación Qt3 basada en CMake +Comment[et]=Qt3 rakenduse loomine CMake'i põhjal +Comment[fr]=Génère une application Qt3 basée sur CMake +Comment[hu]=Létrehoz egy CMake-alapú Qt3-alkalmazást +Comment[it]=Genera un'applicazione Qt3 basata su CMake +Comment[ja]=CMake ベースの Qt3 アプリケーションを作成 +Comment[nds]=Stellt en op CMake opbuut Qt3-Programm op +Comment[nl]=Genereer een CMake-gebaseerde Qt3-toepassing +Comment[pl]=Generuje program Qt3 używający CMake +Comment[pt]=Gera uma aplicação em Qt3 baseada no CMake +Comment[pt_BR]=Gera uma aplicação em Qt3 baseada no CMake +Comment[ru]=Создание основанного на CMake приложения Qt 3 +Comment[sk]=Vygeneruje Qt3 aplikáciu založenú na CMake +Comment[sr]=Прави Qt3 програм на основу CMake-а +Comment[sr@Latn]=Pravi Qt3 program na osnovu CMake-a +Comment[sv]=Skapar ett CMake-baserat Qt3-program +Comment[zh_TW]=產生使用 CMake 的 Qt3 應用程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=cmakeqt3app.tar.gz + +[FILE1] +Type=install +Source=%{src}/CMakeLists.txt +Dest=%{dest}/CMakeLists.txt + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE2] +Type=install +Source=%{src}/CMakeLists.txt.src +Dest=%{dest}/src/CMakeLists.txt + +[FILE3] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE4] +Type=install +Source=%{src}/cmakeqt3app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/cmakeqt3app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE6] +Type=install +Source=%{src}/fileopen.xpm +Dest=%{dest}/src/fileopen.xpm + +[FILE7] +Type=install +Source=%{src}/filesave.xpm +Dest=%{dest}/src/filesave.xpm + +[FILE8] +Type=install +Source=%{src}/fileprint.xpm +Dest=%{dest}/src/fileprint.xpm + +[CMAKE] +Type=finishcmd +Command=cmake ./ -GKDevelop3 +Directory=%{dest} + +[MSG] +Type=message +Comment=A CMake based Qt3 application was created in %{dest} +Comment[ca]=Una aplicació Qt3 basada en CMake ha estat creada en %{dest} +Comment[da]=Et CMake-baseret Qt3-program blev oprettet i %{dest} +Comment[de]=Eine auf CMake basierende Qt3-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή Qt3 βασισμένη στο Qmake δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación Qt3 basada en CMake ha sido creada en %{dest} +Comment[et]=Qt3 rakendus CMake'i põhjal loodi asukohta %{dest} +Comment[fr]=Une application Qt3 basée sur CMake a été créée dans %{dest} +Comment[hu]=Létrejött egy CMake-alapú Qt3-alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione Qt3 basata su CMake in %{dest} +Comment[ja]=CMake ベースの Qt3 アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op CMake opbuut Qt3-Programm opstellt +Comment[nl]=Een Cmake-gebaseerde Qt3-toepassing is aangemaakt in %{dest} +Comment[pl]=Program Qt3 oparty na CMake został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do Qt3 baseada no CMake em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do Qt3 baseada no CMake em %{dest} +Comment[ru]=Использующее CMake приложение Qt 3 создано в %{dest} +Comment[sk]=Qt3 aplikácia založená na CMake bola vytvorená v %{dest} +Comment[sr]=Qt3 програм на основу CMake-а направљен је у %{dest} +Comment[sr@Latn]=Qt3 program na osnovu CMake-a napravljen je u %{dest} +Comment[sv]=Ett CMake-baserat Qt3-program skapades i %{dest} +Comment[zh_TW]=一個以 Cmake 為基礎的 Qt3 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.png b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.png new file mode 100644 index 00000000..dda0a10b Binary files /dev/null and b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.png differ diff --git a/languages/cpp/app_templates/cmakeqt3app/fileopen.xpm b/languages/cpp/app_templates/cmakeqt3app/fileopen.xpm new file mode 100644 index 00000000..880417ee --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/fileopen.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static const char *fileopen[] = { +" 16 13 5 1", +". c #040404", +"# c #808304", +"a c None", +"b c #f3f704", +"c c #f3f7f3", +"aaaaaaaaa...aaaa", +"aaaaaaaa.aaa.a.a", +"aaaaaaaaaaaaa..a", +"a...aaaaaaaa...a", +".bcb.......aaaaa", +".cbcbcbcbc.aaaaa", +".bcbcbcbcb.aaaaa", +".cbcb...........", +".bcb.#########.a", +".cb.#########.aa", +".b.#########.aaa", +"..#########.aaaa", +"...........aaaaa" +}; diff --git a/languages/cpp/app_templates/cmakeqt3app/fileprint.xpm b/languages/cpp/app_templates/cmakeqt3app/fileprint.xpm new file mode 100644 index 00000000..6ada912f --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/fileprint.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static const char *fileprint[] = { +" 16 14 6 1", +". c #000000", +"# c #848284", +"a c #c6c3c6", +"b c #ffff00", +"c c #ffffff", +"d c None", +"ddddd.........dd", +"dddd.cccccccc.dd", +"dddd.c.....c.ddd", +"ddd.cccccccc.ddd", +"ddd.c.....c....d", +"dd.cccccccc.a.a.", +"d..........a.a..", +".aaaaaaaaaa.a.a.", +".............aa.", +".aaaaaa###aa.a.d", +".aaaaaabbbaa...d", +".............a.d", +"d.aaaaaaaaa.a.dd", +"dd...........ddd" +}; diff --git a/languages/cpp/app_templates/cmakeqt3app/filesave.xpm b/languages/cpp/app_templates/cmakeqt3app/filesave.xpm new file mode 100644 index 00000000..bd6870f4 --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/filesave.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static const char *filesave[] = { +" 14 14 4 1", +". c #040404", +"# c #808304", +"a c #bfc2bf", +"b c None", +"..............", +".#.aaaaaaaa.a.", +".#.aaaaaaaa...", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".##........##.", +".############.", +".##.........#.", +".##......aa.#.", +".##......aa.#.", +".##......aa.#.", +"b............." +}; diff --git a/languages/cpp/app_templates/cmakeqt3app/main.cpp b/languages/cpp/app_templates/cmakeqt3app/main.cpp new file mode 100644 index 00000000..bd26f19a --- /dev/null +++ b/languages/cpp/app_templates/cmakeqt3app/main.cpp @@ -0,0 +1,13 @@ +%{CPP_TEMPLATE} + +#include +#include "%{APPNAMELC}.h" + +int main( int argc, char ** argv ) { + QApplication a( argc, argv ); + %{APPNAME} * mw = new %{APPNAME}(); + mw->setCaption( "%{APPNAME}" ); + mw->show(); + a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); + return a.exec(); +} diff --git a/languages/cpp/app_templates/cmakesimple/CMakeLists.txt b/languages/cpp/app_templates/cmakesimple/CMakeLists.txt new file mode 100644 index 00000000..c8087165 --- /dev/null +++ b/languages/cpp/app_templates/cmakesimple/CMakeLists.txt @@ -0,0 +1,15 @@ + +PROJECT(%{APPNAMELC}) + +#if you don't want the full compiler output, remove the following line +SET(CMAKE_VERBOSE_MAKEFILE ON) + +#add definitions, compiler switches, etc. +ADD_DEFINITIONS(-Wall -O2) + +#list all source files here +ADD_EXECUTABLE(%{APPNAMELC} main.cpp) + +#need to link to some other libraries ? just add them here +#TARGET_LINK_LIBRARIES(%{APPNAMELC} png jpeg) + diff --git a/languages/cpp/app_templates/cmakesimple/Makefile.am b/languages/cpp/app_templates/cmakesimple/Makefile.am new file mode 100644 index 00000000..243ed01d --- /dev/null +++ b/languages/cpp/app_templates/cmakesimple/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = main.cpp cmakesimple.png CMakeLists.txt README +templateName = cmakesimple + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/cmakesimple/README b/languages/cpp/app_templates/cmakesimple/README new file mode 100644 index 00000000..1a96a1e8 --- /dev/null +++ b/languages/cpp/app_templates/cmakesimple/README @@ -0,0 +1,30 @@ +----------------------------------------------- +Simple C++ Hello World template based on cmake +QStart +Author: Anne-Marie Mahfouf +Date: 2006-12-06 +----------------------------------------------- + +This README file explains you basic things for starting with +this application template. + +----------------------------------------------- +* REQUIREMENTS * +- Qt version might be 3.3.4 or 3.3.5 +- kdelibs 3.5 and kdelibs headers 3.5 (devel package) in order to build this template. +- cmake (http://www.cmake.org/) version 2.1 or 2.2 in your PATH +----------------------------------------------- + +----------------------------------------------- +* Building and running * +- cmake will run after the template is loaded provided cmake is in your PATH. If not, you will see an error message in the terminal +and you will need to install cmake in your PATH. +- In the Build menu in KDevelop, click on Build Project (or use the F8 shortcut) in order to build your project. +- Run your project using the Build menu -> Execute Program. Note that default makes your program run in KDevelop integrated terminal. You can run your program in an external terminal by changing the project options (Project -> Project Options -> Run options and check at the bottom "Start in external terminal") +----------------------------------------------- + +----------------------------------------------- +* Useful link * + +CMake Documentation: http://www.cmake.org/HTML/Documentation.html + diff --git a/languages/cpp/app_templates/cmakesimple/cmakesimple b/languages/cpp/app_templates/cmakesimple/cmakesimple new file mode 100644 index 00000000..a0793d8f --- /dev/null +++ b/languages/cpp/app_templates/cmakesimple/cmakesimple @@ -0,0 +1,7 @@ +# KDE Config File +[General] +Name=Hello world program +Icon=cmakesimple.png +Category=C++/CMake based projects +Comment=Generates a simple Hello world program in C++ using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release. +ShowFilesAfterGeneration=main.cpp diff --git a/languages/cpp/app_templates/cmakesimple/cmakesimple.kdevtemplate b/languages/cpp/app_templates/cmakesimple/cmakesimple.kdevtemplate new file mode 100644 index 00000000..2e6032e8 --- /dev/null +++ b/languages/cpp/app_templates/cmakesimple/cmakesimple.kdevtemplate @@ -0,0 +1,112 @@ +# KDE Config File +[General] +Name=Hello world program +Name[ca]=Programa Hello world +Name[da]=Goddag verden program +Name[de]="Hello World"-Programm +Name[el]=Πρόγραμμα Γεια σου Κόσμε +Name[es]=Programa «Hola mundo» +Name[et]="Tere,maailm" programm +Name[eu]="Kaixo mundua" programa +Name[fa]=برنامۀ Hello world +Name[fr]=Programme « Bonjour monde » +Name[ga]=Ríomhchlár "Hello world" +Name[gl]=Programa Ola mundo +Name[it]=Programma di "Hello world" +Name[ja]=Hello world プログラム +Name[nds]="Moin Welt"-Programm +Name[ne]=हेल्डो वोल्ड कार्यक्रम +Name[nl]=Hello World-programma +Name[pl]=Program 'Witaj świecie' +Name[pt]=Programa 'Olá mundo' +Name[pt_BR]=Programa 'Olá mundo' +Name[ru]=Программа Hello world +Name[sk]=Ahoj svet program +Name[sl]=Program Hello world +Name[sr]=Програм „Здраво свете“ +Name[sr@Latn]=Program „Zdravo svete“ +Name[sv]=Hello world-program +Name[tr]=Merhaba Dünya Programı +Name[zh_CN]=Hello world 程序 +Name[zh_TW]=Hello world 程式 +Icon=cmakesimple.png +Category=C++/CMake based projects +Comment=Generates a simple Hello world program in C++ using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 or cmake 2.2. +Comment[ca]=Genera un simple programa de Hello world en C++ usant l'eina de construcció CMake en comptes de la combinació automake/autoconf/libtool. Requereix cmake 2.1 o cmake 2.2. +Comment[da]=Genererer et simpelt Goddag verden program i C++ ved brug af CMake byggeværktøjet i stedet for automake/autoconf/libtool kombinationen. Det kræver cmake 2.1eller cmake 2.2. +Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C++. Der Kompiliervorgang wird mit CMake anstelle der Kombination automake/autoconf/libtool durchgeführt und erfordert CMake 2.1 (das über das CVS-Archiv von CMake verfügbar ist) oder die kommende Version 2.2 von CMake. +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα 'Γεια σου Κόσμε' σε C++, χρησιμοποιώντας το εργαλείο κατασκευής CMake αντί του συνδυασμού automake/autoconf/libtool. Χρειάζεται το cmake 2.1 ή το cmake 2.2. +Comment[es]=Genera un sencillo programa «Hola mundo» en C++ usando la herramienta CMake en lugar de la combinación automake/autoconf/libtool. Requiere cmake 2.1 o cmake 2.2. +Comment[et]=Lihtsa "Tere, maailm" programmi loomine C++-s. See kompileeritakse CMake'i ehitamistööriistaga, mitte automake/autoconf/libtool'i kombinatsiooniga. Selleks on vajalik CMake 2.1 või 2.2. +Comment[fr]=Génère un programme « Bonjour monde » simple en C++ à l'aide de l'outil de construction CMake au lieu de la combinaison automake / autoconf / libtool. Nécessite cmake 2.1 (disponible sur le CVS de CMake) ou cmake 2.2. +Comment[hu]=Létrehoz egy egyszerű 'Hello world' programot C++ nyelven a CMake segítségével (az automake/autoconf/libtool kombináció helyett). CMake 2.1 vagy 2.2 szükséges hozzá. +Comment[it]=Genera un semplice programma di "Hello world" in C++ che usa CMake invece della combinazione automake/autoconf/libtool. Si richiede cmake 2.1 o la versione 2.2. +Comment[ja]=ビルドに automake/autoconf/libtool ではなく CMake を使った簡単な Hello World プログラムを C++ で作成します。CMake 2.1 または 2.2 が必要です。 +Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C++ op, mit "CMake" ansteed vun de "automake/autoconf/libtool"-Reeg. Nödig is Verschoon 2.1 oder 2.2 vun CMake. +Comment[nl]=Genereert een eenvoudig Hello World-programma in C++ met behulp van de CMake build tool in plaats van de combinatie automake/autoconf/libtool. Het vereist cmake 2.1 of cmake 2.2. +Comment[pl]=Generuje prosty program 'Witaj świecie' w języku C++. Kompilacja odbywa sie za pomocą narzędzia CMake zamiast kombinacji automake/autoconf/libtool. Wymaga cmake w wersji 2.1 lub 2.2. +Comment[pt]=Gera um programa simples Olá Mundo em C++, com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 ou do cmake 2.2. +Comment[pt_BR]=Gera um programa simples Olá Mundo em C++, com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 ou do cmake 2.2. +Comment[ru]=Создание простого приложения Hello world на C++. Для сборки потребуется CMake вместо комбинации automake/autoconf/libtool. Потребуется cmake версии 2.1 или 2.2. +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C++ s využitím nástroja CMake namiesto kombinácie automake/autoconf/libtool. Vyžaduje cmake 2.1 alebo cmake 2.2. +Comment[sr]=Прави једноставан „Здраво свете“ програм у C++-у користећи алат CMake уместо комбинације Automake/Autoconf/Libtool. Захтева CMake 2.1 или 2.2. +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C++-u koristeći alat CMake umesto kombinacije Automake/Autoconf/Libtool. Zahteva CMake 2.1 ili 2.2. +Comment[sv]=Skapar ett enkelt Hello world-program i C++ med användning av byggverktyget CMake istället för kombinationen automake/autoconf/libtool. Det kräver cmake 2.1 eller cmake 2.2. +Comment[zh_TW]=它產生一個簡單的 C++ Hello world 程式。它要用 CMake 建立工具來編譯,而不是用 automake/autoconf/libtool 等。它需要 cmake 2.1 或是 2.2 版以上。 +#FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/main.cpp,%{dest}/README +Archive=cmakesimple.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/CMakeLists.txt +Dest=%{dest}/CMakeLists.txt + +[FILE2] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/main.cpp + +[FILE3] +Type=install +Source=%{src}/README +Dest=%{dest}/README + +[CMAKE] +Type=finishcmd +Command=cmake ./ -GKDevelop3 +Directory=%{dest} + +[MSG] +Type=message +Comment=A CMake based hello world program was created in %{dest} +Comment[ca]=Un programa de hello world basat en CMake ha estat creat en %{dest} +Comment[da]=Et CMake-baseret Goddag verden program blev oprettet i %{dest} +Comment[de]=Ein auf CMake basierendes "Hello World"-Programm wurde in %{dest} erstellt. +Comment[el]=Ένα πρόγραμμα Γεια σου Κόσμε βασισμένο στο CMake δημιουργήθηκε στο %{dest} +Comment[es]=Un programa «Hola mundo» basado en CMake ha sido creado en %{dest} +Comment[et]="Tere, maailm" programm CMake'i põhjal loodi asukohta %{dest} +Comment[eu]=CMake-en oinarritutako "kaixo mundua" programa bat sortu da hemen: %{dest} +Comment[fa]=یک برنامۀ Hello World بر مبنای CMake در %{dest} ایجاد شد +Comment[fr]=Un programme « Bonjour monde » basé sur CMake a été créé dans %{dest} +Comment[ga]=Cruthaíodh ríomhchlár "Hello World" bunaithe ar CMake i %{dest} +Comment[gl]=Creouse un programa Ola mundo baseado en CMake en %{dest} +Comment[hu]=Létrejött egy CMake-alapú Hello world program itt: %{dest} +Comment[it]=È stato creato un programma di "hello world" basato su CMake in %{dest} +Comment[ja]=CMake ベースの hello world プログラムを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op CMake opbuut "Moin Welt"-Programm opstellt +Comment[ne]=CMake आधारित हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो +Comment[nl]=Een CMake-gebaseerd Hello World-programma is aangemaakt in %{dest} +Comment[pl]=Używający CMake program 'Witaj świecie' został utworzony w %{dest} +Comment[pt]=Foi criado um programa Olá Mundo baseado no CMake em %{dest} +Comment[pt_BR]=Foi criado um programa Olá Mundo baseado no CMake em %{dest} +Comment[ru]=Основанное на CMake приложение создано в %{dest} +Comment[sk]=Ahoj svet program založený na nástroji CMake bol vytvorený v %{dest} +Comment[sl]=Program hello world na osnovi CMake je bil ustvarjen v %{dest} +Comment[sr]=„Здраво свете“ на основу CMake-а направљен је у %{dest} +Comment[sr@Latn]=„Zdravo svete“ na osnovu CMake-a napravljen je u %{dest} +Comment[sv]=Ett CMake-baserat Hello world-program skapades i %{dest} +Comment[tr]=Bir CMake tabanlı Merhaba Dünya programı %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个基于 CMake 的 hello world 程序 +Comment[zh_TW]=以 CMake 為基礎的 hello world 程式已建立在 %{dest} diff --git a/languages/cpp/app_templates/cmakesimple/cmakesimple.png b/languages/cpp/app_templates/cmakesimple/cmakesimple.png new file mode 100644 index 00000000..d1a90c3a Binary files /dev/null and b/languages/cpp/app_templates/cmakesimple/cmakesimple.png differ diff --git a/languages/cpp/app_templates/cmakesimple/main.cpp b/languages/cpp/app_templates/cmakesimple/main.cpp new file mode 100644 index 00000000..296f9324 --- /dev/null +++ b/languages/cpp/app_templates/cmakesimple/main.cpp @@ -0,0 +1,14 @@ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +int main(int argc, char *argv[]) +{ + printf("Hello, world!\n"); + + return EXIT_SUCCESS; +} diff --git a/languages/cpp/app_templates/cmakesimplec/CMakeLists.txt b/languages/cpp/app_templates/cmakesimplec/CMakeLists.txt new file mode 100644 index 00000000..812fc007 --- /dev/null +++ b/languages/cpp/app_templates/cmakesimplec/CMakeLists.txt @@ -0,0 +1,14 @@ +PROJECT(%{APPNAMELC}) + +#if you don't want the full compiler output, remove the following line +SET(CMAKE_VERBOSE_MAKEFILE ON) + +#add definitions, compiler switches, etc. +ADD_DEFINITIONS(-Wall -O2) + +#list all source files here +ADD_EXECUTABLE(%{APPNAMELC} main.c) + +#need to link to some other libraries ? just add them here +#TARGET_LINK_LIBRARIES(%{APPNAMELC} png jpeg) + diff --git a/languages/cpp/app_templates/cmakesimplec/Makefile.am b/languages/cpp/app_templates/cmakesimplec/Makefile.am new file mode 100644 index 00000000..f5a1c3e7 --- /dev/null +++ b/languages/cpp/app_templates/cmakesimplec/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = main.c cmakesimplec.png CMakeLists.txt +templateName = cmakesimplec + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/cmakesimplec/cmakesimplec b/languages/cpp/app_templates/cmakesimplec/cmakesimplec new file mode 100644 index 00000000..c0bc6fe2 --- /dev/null +++ b/languages/cpp/app_templates/cmakesimplec/cmakesimplec @@ -0,0 +1,7 @@ +# KDE Config File +[General] +Name=Hello world program +Icon=cmakesimple.png +Category=C/CMake based projects +Comment=Generates a simple Hello world program in C using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release. +ShowFilesAfterGeneration=main.c diff --git a/languages/cpp/app_templates/cmakesimplec/cmakesimplec.kdevtemplate b/languages/cpp/app_templates/cmakesimplec/cmakesimplec.kdevtemplate new file mode 100644 index 00000000..3fc09047 --- /dev/null +++ b/languages/cpp/app_templates/cmakesimplec/cmakesimplec.kdevtemplate @@ -0,0 +1,115 @@ +# KDE Config File +[General] +Name=Hello world program +Name[ca]=Programa Hello world +Name[da]=Goddag verden program +Name[de]="Hello World"-Programm +Name[el]=Πρόγραμμα Γεια σου Κόσμε +Name[es]=Programa «Hola mundo» +Name[et]="Tere,maailm" programm +Name[eu]="Kaixo mundua" programa +Name[fa]=برنامۀ Hello world +Name[fr]=Programme « Bonjour monde » +Name[ga]=Ríomhchlár "Hello world" +Name[gl]=Programa Ola mundo +Name[it]=Programma di "Hello world" +Name[ja]=Hello world プログラム +Name[nds]="Moin Welt"-Programm +Name[ne]=हेल्डो वोल्ड कार्यक्रम +Name[nl]=Hello World-programma +Name[pl]=Program 'Witaj świecie' +Name[pt]=Programa 'Olá mundo' +Name[pt_BR]=Programa 'Olá mundo' +Name[ru]=Программа Hello world +Name[sk]=Ahoj svet program +Name[sl]=Program Hello world +Name[sr]=Програм „Здраво свете“ +Name[sr@Latn]=Program „Zdravo svete“ +Name[sv]=Hello world-program +Name[tr]=Merhaba Dünya Programı +Name[zh_CN]=Hello world 程序 +Name[zh_TW]=Hello world 程式 +Icon=cmakesimplec.png +Category=C/CMake based projects +Comment=Generates a simple Hello world program in C using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release. +Comment[ca]=Genera un simple programa de Hello world en C usant l'eina de construcció CMake en comptes de la combinació automake/autoconf/libtool. Requereix cmake 2.1 (disponible en el cvs de cmake) o la propera versió 2.2. +Comment[da]=Genererer et simpelt Goddag verden program i C ved brug af CMake byggeværktøjet i stedet for automake/autoconf/libtool kombinationen. Det kræver cmake 2.1 (tilgængelig fra cmake cvs) eller den fremtidige cmake 2.2 udgivelse. +Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C. Der Kompiliervorgang wird mit CMake anstelle der Kombination automake/autoconf/libtool durchgeführt und erfordert CMake 2.1 (das über das CVS-Archiv von CMake verfügbar ist) oder die kommende Version 2.2 von CMake. +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε C, χρησιμοποιώντας το εργαλείο κατασκευής CMake στη θέση του συνδυασμού automake/autoconf/libtool. Χρειάζεται το cmake 2.1 (διαθέσιμο από το cmake cvs) ή την επερχόμενη έκδοση cmake 2.2. +Comment[es]=Genera un sencillo programa «Hola mundo» en C usando la herramienta CMake en lugar de la combinación automake/autoconf/libtool. Requiere cmake 2.1 (disponible en el cvs de cmake) o la próxima cmake 2.2. +Comment[et]=Lihtsa "Tere, maailm" programmi loomine C-s. See kompileeritakse CMake'i ehitamistööriistaga, mitte automake/autoconf/libtool'i kombinatsiooniga. Selleks on vajalik CMake 2.1 (saadaval CMake'i CVSis) või peatne CMake'i versioon 2.2. +Comment[eu]="Kaixo mundua" programa sinple bat sortzen du C lengoaian. CMake tresna erabiliz konpilatzen du automake/autoconf/libtool taldea erabili ordez. cmake 2.1 behar du (cmake cvs-an eskuragarri) edo hurrengo cmake 2.2. +Comment[fa]=یک برنامۀ سادۀ Hello world در سی تولید می‌کند. با استفاده از ابزار ساختن CMake به جای ترکیب automake/autoconf/libtool، ترجمه می‌کند.به cmake 2.1 دارد )از cmake cvs قابل دسترس است( یا نشر cmake 2.2 در آیندۀ نزدیک، نیاز دارد. +Comment[fr]=Génère un programme « Bonjour monde » simple en C à l'aide de l'outil de construction CMake au lieu de la combinaison automake / autoconf / libtool. Nécessite cmake 2.1 (disponible sur le CVS de CMake) ou la version 2.2 de CMake à venir. +Comment[ga]=Cruthaigh ríomhchlár simplí "Hello World" i C a thiomsaítear le huirlis tógála CMake in ionad automake/autoconf/libtool. Tá cmake 2.1 de dhíth (ar fáil ó cmake cvs) nó leagan 2.2 cmake atá le teacht. +Comment[gl]=Xera un program sinxelo Ola mundo en C usando a ferramenta de compilación CMake no lugar da combinación automake/autoconf/libtool. Require cmake 2.1 (dispoñíbel no cvs de cmake) ou a próxima versión cmake 2.2. +Comment[hu]=Létrehoz egy egyszerű Hello world programot C nyelven a CMake fordítóeszköz segítségével (az automake/autoconf/libtool kombináció helyett). CMake 2.1 (a CMake CVS-ben elérhető) vagy a rövidesen megjelenő CMake 2.2 szükséges hozzá. +Comment[it]=Genera un semplice programma di "Hello world" in C che usa CMake invece della combinazione automake/autoconf/libtool. Si richiede cmake 2.1 (disponibile dal CVS di cmake) o la versione a venire cmake 2.2. +Comment[ja]=ビルドに automake/autoconf/libtool ではなく CMake を使った簡単な Hello World プログラムを C で作成します。CMake 2.1 または 2.2 が必要です。 +Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C op mit "CMake" in de Verschoon 2.1 (ut dat cmake-CVS) oder 2.2 (de tokamen Utgaav) ansteed vun de "automake/autoconf/libtool"-Kombinatschoon. +Comment[ne]= automake/autoconf/libtool संयोजनको सट्टामा CMake निर्माण उपकरण प्रयोग गरेर C मा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ । यसलाई cmake 2.1 (cmake cvs बाट उपलब्ध हुन्छ) वा आउदै गरेको cmake 2.2 उत्पादन आवश्यक हुन्छ । +Comment[nl]=Genereert een eenvoudig Hello World-programma in C met behulp van de CMake build tool in plaats van de combinatie automake/autoconf/libtool. Het vereist cmake 2.1 (uit het cvs van cmake) of de aankomende cmake 2.2-uitgave. +Comment[pl]=Generuje prosty program 'Witaj świecie' w języku C. Kompilacja odbywa sie za pomocą narzędzia CMake zamiast kombinacji automake/autoconf/libtool. Wymaga cmake 2.1 (dostępnego z cvs-u cmake) lub nadchodzącej wersji 2.2. +Comment[pt]=Gera um programa simples Olá Mundo em C, com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2. +Comment[pt_BR]=Gera um programa simples Olá Mundo em C, com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2. +Comment[ru]=Создание простого приложения Hello world на C. Для сборки потребуется CMake вместо комбинации automake/autoconf/libtool. Потребуется cmake 2.1 (из CVS cmake) или релиз cmake 2.2. +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C s využitím nástrojaCMake namiesto kombinácie automake/autoconf/libtool.Vyžaduje cmake 2.1 (dostupné v cmake cvs) alebo nadchádzajúci cmake 2.2 release. +Comment[sl]=Ustvari preprost program »Pozdravljen svet« v C. Za prevajanje se namesto kombinacije automake/autoconf/libtool uporabi orodje za gradnjo CMake. Potreben je CMake 2.1 ali CMake 2.2. +Comment[sr]=Прави једноставан „Здраво свете“ програм у C-у користећи алат CMake уместо комбинације Automake/Autoconf/Libtool. Захтева CMake 2.1 (доступан у CVS-у CMake-а) или надолазеће издање CMake 2.2. +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C-u koristeći alat CMake umesto kombinacije Automake/Autoconf/Libtool. Zahteva CMake 2.1 (dostupan u CVS-u CMake-a) ili nadolazeće izdanje CMake 2.2. +Comment[sv]=Skapar ett enkelt Hello world-program i C med användning av byggverktyget CMake istället för kombinationen automake/autoconf/libtool. Det kräver cmake 2.1 (tillgängligt från cmake CVS-arkiv) eller den förestående utgåvan av cmake 2.2. +Comment[tr]=automake/autoconf/libtool birleşimi yerine CMake aracını kullanarak C'de basit bir Merhaba Dünya programı yaratır. cmake 2.1( cmake cvs'inden edinilebilir) veya yakında gelecek olan 2.2 sürümüne ihtiyaç duyar. +Comment[zh_CN]=生成一个 C 的 Hello world 程序。该程序使用 CMake 编译工具编译,而不是使用 automake/autoconf/libtool 的组合。该程序需要 cmake 2.1 (可从 cmake cvs 中获得)或即将发布的 cmake 2.2 版本。 +Comment[zh_TW]=它產生一個簡單的 C 的 Hello world 程式。它要用 CMake 建立工具來編譯,而不是用 automake/autoconf/libtool 等。它需要 cmake 2.1(可以從 cmake cvs 中取得),或是以後的版本。 +#FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/main.c +Archive=cmakesimplec.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/CMakeLists.txt +Dest=%{dest}/CMakeLists.txt + +[FILE2] +Type=install +Source=%{src}/main.c +Dest=%{dest}/main.c + +[CMAKE] +Type=finishcmd +Command=cmake ./ -GKDevelop3 +Directory=%{dest} + +[MSG] +Type=message +Comment=A CMake based hello world program was created in %{dest} +Comment[ca]=Un programa de hello world basat en CMake ha estat creat en %{dest} +Comment[da]=Et CMake-baseret Goddag verden program blev oprettet i %{dest} +Comment[de]=Ein auf CMake basierendes "Hello World"-Programm wurde in %{dest} erstellt. +Comment[el]=Ένα πρόγραμμα Γεια σου Κόσμε βασισμένο στο CMake δημιουργήθηκε στο %{dest} +Comment[es]=Un programa «Hola mundo» basado en CMake ha sido creado en %{dest} +Comment[et]="Tere, maailm" programm CMake'i põhjal loodi asukohta %{dest} +Comment[eu]=CMake-en oinarritutako "kaixo mundua" programa bat sortu da hemen: %{dest} +Comment[fa]=یک برنامۀ Hello World بر مبنای CMake در %{dest} ایجاد شد +Comment[fr]=Un programme « Bonjour monde » basé sur CMake a été créé dans %{dest} +Comment[ga]=Cruthaíodh ríomhchlár "Hello World" bunaithe ar CMake i %{dest} +Comment[gl]=Creouse un programa Ola mundo baseado en CMake en %{dest} +Comment[hu]=Létrejött egy CMake-alapú Hello world program itt: %{dest} +Comment[it]=È stato creato un programma di "hello world" basato su CMake in %{dest} +Comment[ja]=CMake ベースの hello world プログラムを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op CMake opbuut "Moin Welt"-Programm opstellt +Comment[ne]=CMake आधारित हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो +Comment[nl]=Een CMake-gebaseerd Hello World-programma is aangemaakt in %{dest} +Comment[pl]=Używający CMake program 'Witaj świecie' został utworzony w %{dest} +Comment[pt]=Foi criado um programa Olá Mundo baseado no CMake em %{dest} +Comment[pt_BR]=Foi criado um programa Olá Mundo baseado no CMake em %{dest} +Comment[ru]=Основанное на CMake приложение создано в %{dest} +Comment[sk]=Ahoj svet program založený na nástroji CMake bol vytvorený v %{dest} +Comment[sl]=Program hello world na osnovi CMake je bil ustvarjen v %{dest} +Comment[sr]=„Здраво свете“ на основу CMake-а направљен је у %{dest} +Comment[sr@Latn]=„Zdravo svete“ na osnovu CMake-a napravljen je u %{dest} +Comment[sv]=Ett CMake-baserat Hello world-program skapades i %{dest} +Comment[tr]=Bir CMake tabanlı Merhaba Dünya programı %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个基于 CMake 的 hello world 程序 +Comment[zh_TW]=以 CMake 為基礎的 hello world 程式已建立在 %{dest} diff --git a/languages/cpp/app_templates/cmakesimplec/cmakesimplec.png b/languages/cpp/app_templates/cmakesimplec/cmakesimplec.png new file mode 100644 index 00000000..158d3ce7 Binary files /dev/null and b/languages/cpp/app_templates/cmakesimplec/cmakesimplec.png differ diff --git a/languages/cpp/app_templates/cmakesimplec/main.c b/languages/cpp/app_templates/cmakesimplec/main.c new file mode 100644 index 00000000..296f9324 --- /dev/null +++ b/languages/cpp/app_templates/cmakesimplec/main.c @@ -0,0 +1,14 @@ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +int main(int argc, char *argv[]) +{ + printf("Hello, world!\n"); + + return EXIT_SUCCESS; +} diff --git a/languages/cpp/app_templates/cpp.appwizard b/languages/cpp/app_templates/cpp.appwizard new file mode 100644 index 00000000..dc233269 --- /dev/null +++ b/languages/cpp/app_templates/cpp.appwizard @@ -0,0 +1,2 @@ +[General] +List=opiemenu,win32hello,cppcurseshello,gtk2mmapp,opienet,wxhello,cpphello,opietoday,clanlib,cppsdlhello,qmakeapp,qt4hello,qt4makeapp,cmakelibcpp,opieapp,qmakesimple,cmakesimple,generichello,opieapplet,qtopiaapp,gnome2mmapp,opieinput,win32gui,cmakeqt3app,qmakeempty,automakeempty,makefileempty,qtopia4app diff --git a/languages/cpp/app_templates/cppcurseshello/.kdev_ignore b/languages/cpp/app_templates/cppcurseshello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/cppcurseshello/Makefile.am b/languages/cpp/app_templates/cppcurseshello/Makefile.am new file mode 100644 index 00000000..3f6f64af --- /dev/null +++ b/languages/cpp/app_templates/cppcurseshello/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = main.cpp src-Makefile.am cpp-Makefile.am cpp-Makefile.cvs\ + app-configure.in app.kdevelop +templateName = cppcurseshello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/cppcurseshello/app-configure.in b/languages/cpp/app_templates/cppcurseshello/app-configure.in new file mode 100644 index 00000000..b7c83189 --- /dev/null +++ b/languages/cpp/app_templates/cppcurseshello/app-configure.in @@ -0,0 +1,21 @@ +AC_INIT() +AM_INIT_AUTOMAKE(%{APPNAMELC},%{VERSION}) + +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_MAKE_SET + + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +AC_CHECK_HEADER([ncurses.h], [], + AC_MSG_ERROR([Couldn't find ncurses headers.])) + +AC_CHECK_LIB(ncurses, refresh, , AC_ERROR([Couldn't find ncurses library]), -lncurses, -ldl) + +AC_LANG_RESTORE + + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/cpp/app_templates/cppcurseshello/app.kdevelop b/languages/cpp/app_templates/cppcurseshello/app.kdevelop new file mode 100644 index 00000000..c7498e39 --- /dev/null +++ b/languages/cpp/app_templates/cppcurseshello/app.kdevelop @@ -0,0 +1,105 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + true + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.am b/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.am @@ -0,0 +1,5 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +SUBDIRS = src diff --git a/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.cvs b/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.cvs new file mode 100644 index 00000000..935cee02 --- /dev/null +++ b/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.cvs @@ -0,0 +1,7 @@ +default: all + +all: + aclocal + automake + autoconf + diff --git a/languages/cpp/app_templates/cppcurseshello/cppcurseshello b/languages/cpp/app_templates/cppcurseshello/cppcurseshello new file mode 100644 index 00000000..40fa8bce --- /dev/null +++ b/languages/cpp/app_templates/cppcurseshello/cppcurseshello @@ -0,0 +1,10 @@ +# KDE Config File +[General] +Name=Simple ncurses Hello world program +Name[de]=Einfaches ncurses Hallo-Welt Programm +Icon= +Category=C++ +Comment=Generates a simple ncurses based Hello world program in C++ +Comment[de]=Erstellt ein einfaches Hallo Welt programm fr C++ basierend auf der ncurses Bibliothek +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/APPNAMELC.cpp diff --git a/languages/cpp/app_templates/cppcurseshello/cppcurseshello.kdevtemplate b/languages/cpp/app_templates/cppcurseshello/cppcurseshello.kdevtemplate new file mode 100644 index 00000000..451999a3 --- /dev/null +++ b/languages/cpp/app_templates/cppcurseshello/cppcurseshello.kdevtemplate @@ -0,0 +1,143 @@ +# KDE Config File +[General] +Name=Simple ncurses Hello world program +Name[ca]=Simple programa de Hello world per a ncurses +Name[da]=Simpelt ncurses Goddag verden program +Name[de]=Einfaches auf NCurses basierendes "Hello World"-Programm +Name[el]=Απλό ncurses πρόγραμμα Γεια σου κόσμε +Name[es]=Programa «Hola mundo» sencillo en ncurses +Name[et]=Lihtne "Tere, maailm" programm ncurses'i põhjal +Name[eu]=ncurses-en oinarritako "Kaixo mundua" programa sinple bat +Name[fa]=برنامۀ سادۀ ncurses Hello world +Name[fr]=Programme « Bonjour monde » simple en ncurses +Name[ga]=Ríomhchlár simplí "Hello World" le ncurses +Name[gl]=Programa sinxelo ncurses Ola mundo +Name[hu]=Egyszerű, Ncurses-alapú Hello world program +Name[it]=Semplice programma "Hello world" realizzato con ncurses +Name[ja]=ncurses を使った簡単な Hello World プログラム +Name[nds]=Eenfach ncurses-"Moin Welt"-Programm +Name[ne]=साधारण ncurses हेल्लो वोल्ड कार्यक्रम +Name[nl]=Een eenvoudig ncurses Hello World-programma +Name[pl]=Prosty program 'Witaj świecie' używający ncurses +Name[pt]=Programa simples Olá Mundo em ncurses +Name[pt_BR]=Programa simples Olá Mundo em ncurses +Name[ru]=Простое приложение Hello world на ncurses +Name[sk]=Jednoduchý "Ahoj svet" ncurses program +Name[sl]=Preprost program Hello world na osnovi ncurses +Name[sr]=Једноставан „Здраво свете“ програм за ncurses +Name[sr@Latn]=Jednostavan „Zdravo svete“ program za ncurses +Name[sv]=Enkelt ncurses Hello world-program +Name[tr]=Basit ncurses Merhaba Dünya programı +Name[zh_CN]=简单的 ncurses Hello world 程序 +Name[zh_TW]=簡單的 ncurses Hello world 程式 +Icon= +Category=C++ +Comment=Generates a simple ncurses based Hello world program in C++ +Comment[ca]=Genera un simple programa de Hello world en C++ i basat en ncurses +Comment[da]=Genererer et simpelt ncurses baseret Goddag verden program in C++ +Comment[de]=Erstellt ein einfaches, auf NCurses basierendes "Hello World"-Programm in C++ +Comment[el]=Δημιουργεί ένα απλό βασισμένο σε ncurses πρόγραμμα Γεια σου κόσμε σε C++ +Comment[es]=Genera un sencillo programa «Hola mundo» en C++ basado en ncurses +Comment[et]=Lihtsa "Tere, maailm" programmi loomine ncurses'i põhjal C++-s +Comment[eu]=ncurses-en oinarritako "Kaixo mundua" programa sinple bat C++ lengoaian +Comment[fa]=یک برنامۀ سادۀ Hello world در C++ بر مبنای ncurses تولید می‌کند +Comment[fr]=Génère un programme « Bonjour monde » simple basé sur ncurses en C++ +Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" bunaithe ar ncurses, i C++ +Comment[gl]=Xera un programa sinxelo Ola mundo baseado en ncurses en C++ +Comment[hu]=Létrehoz egy egyszerű, Ncurses-alapú Hello world programot C++-ban +Comment[it]=Genera un semplice programma di "Hello world" in C++ realizzato con ncurses +Comment[ja]=ncurses を使った簡単な Hello World プログラムを C++ で作成します +Comment[nds]=Stellt en eenfach op "ncurses" opbuut "Moin Welt"-Programm in C++ op +Comment[ne]=C++ मा हेल्लो वोल्ड कार्यक्रम आधारित साधारण ncurses उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudig ncurses-gebaseerd Hello World-programma in C++ +Comment[pl]=Generuje prosty program 'Witaj świecie' używający ncurses i języka C++. +Comment[pt]=Gera um programa simples Olá Mundo em C++, baseado no 'ncurses' +Comment[pt_BR]=Gera um programa simples Olá Mundo em C++, baseado no 'ncurses' +Comment[ru]=Создание простого приложения Hello world на ncurses и C++ +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" ncurses program v C++ +Comment[sl]=Ustvari preprost program Hello world na osnovi ncurses v C++ +Comment[sr]=Прави једноставан „Здраво свете“ програм на основу ncurses, у C++-у +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program na osnovu ncurses, u C++-u +Comment[sv]=Skapar ett enkelt ncurses-baserat Hello world-program i C++ +Comment[tr]=C++'da ncurses tabanlı basit bir Merhaba Dünya programı yaratır. +Comment[zh_CN]=生成一个基于 ncurses 的 C++ Hello world 程序 +Comment[zh_TW]=產生一個簡單的用 C++ 語言與 ncurses 函式庫的 Hello world 程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=cppcurseshello.tar.gz + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/cpp-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/cpp-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE4] +Type=install +Source=%{src}/app-configure.in +Dest=%{dest}/configure.in + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE6] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[MSG] +Type=message +Comment=A simple hello world program using ncurses was created in %{dest} +Comment[ca]=Un simple programa de hello world usant ncurses ha estat creat en %{dest} +Comment[da]=Et simpelt Goddag verden program ved brug af ncurses blev oprettet i %{dest} +Comment[de]=Ein einfaches "Hello World"-Programm unter Verwendung von NCurses wurde in %{dest} erstellt. +Comment[el]=Ένα απλό πρόγραμμα Γεια σου Κόσμε χρησιμοποιώντας το ncurses δημιουργήθηκε στο %{dest} +Comment[es]=Un sencillo programa «Hola mundo» que usa ncurses ha sido creado en %{dest} +Comment[et]=Lihtne "Tere, maailm" programm ncurses'i põhjas loodi asukohta %{dest} +Comment[eu]=ncurses-en oinarritako "Kaixo mundua" programa sinple bat sortu da hemen: %{dest} +Comment[fa]=یک برنامۀ سادۀ hello world با استفاده از ncurses در %{dest} ایجاد شد +Comment[fr]=Un programme « Bonjour monde » simple utilisant ncurses a été créé dans %{dest} +Comment[ga]=Cruthaíodh ríomhchlár simplí "Hello World" le ncurses i %{dest} +Comment[gl]=Creouse un programa sinxelo ola mundo usando ncurses en in %{dest} +Comment[hu]=Létrejött egy egyszerű, Ncurses-alapú Hello world program itt: %{dest} +Comment[it]=È stato creato un programma di "hello world" che usa ncurses in %{dest} +Comment[ja]=ncurses を使った簡単な Hello World プログラムを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm opstellt, dat "ncurses" bruukt +Comment[ne]=ncurses प्रयोग गरेर एउटा हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो +Comment[nl]=Een eenvoudig Hallo Wereld-programma gebruikmakend van ncurses is aangemaakt in %{dest} +Comment[pl]=Prosty program 'Witaj świecie' używający ncurses został utworzony w %{dest} +Comment[pt]=Foi criado um programa simples Olá Mundo que usa o ncurses em %{dest} +Comment[pt_BR]=Foi criado um programa simples Olá Mundo que usa o ncurses em %{dest} +Comment[ru]=Простое приложение Hello world на ncurses создано в %{dest} +Comment[sk]=Jednoduchý "Ahoj svet" ncurses program bol vytvorený v %{dest} +Comment[sl]=Preprost program Hello world na osnovi ncurses je bil ustvarjen v %{dest} +Comment[sr]=Једноставан „Здраво свете“ на основу ncurses направљен је у %{dest} +Comment[sr@Latn]=Jednostavan „Zdravo svete“ na osnovu ncurses napravljen je u %{dest} +Comment[sv]=Ett enkelt Hello world-program som använder ncurses skapades i %{dest} +Comment[tr]=ncurses kullanan basit bir merhaba dünya programı %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了一个使用 ncurses 的 hello world 程序 +Comment[zh_TW]=一個簡單的使用 ncurses 函式庫的 hello world 程式已建立在 %{dest} diff --git a/languages/cpp/app_templates/cppcurseshello/cppcurseshello.png b/languages/cpp/app_templates/cppcurseshello/cppcurseshello.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/cppcurseshello/cppcurseshello.png differ diff --git a/languages/cpp/app_templates/cppcurseshello/main.cpp b/languages/cpp/app_templates/cppcurseshello/main.cpp new file mode 100644 index 00000000..3e23a5df --- /dev/null +++ b/languages/cpp/app_templates/cppcurseshello/main.cpp @@ -0,0 +1,49 @@ +%{CPP_TEMPLATE} + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +void create_box(int y, int x, int w, int h) +{ + mvaddch(y, x, '+'); + mvaddch(y, x + w, '+'); + mvaddch(y + h, x, '+'); + mvaddch(y + h, x + w, '+'); + mvhline(y, x + 1, '-', w - 1); + mvhline(y + h, x + 1, '-', w - 1); + mvvline(y + 1, x, '|', h - 1); + mvvline(y + 1, x + w, '|', h - 1); +} + +int main() +{ + int startx, starty, height, width; + + initscr(); + start_color(); + cbreak(); + keypad(stdscr, TRUE); + noecho(); + + init_pair(1, COLOR_BLACK, COLOR_CYAN); + + height = 2; + width = 30; + starty = (LINES - height)/2; + startx = (COLS - width)/2; + + attron(COLOR_PAIR(1)); + + create_box(starty, startx, width, height); + mvprintw(starty, startx + 3, " Hello World! " ); + mvprintw(starty+1,startx+1," Type any char to exit "); + mvprintw(0,0,""); + refresh(); + getch(); + + endwin(); + return 0; +} diff --git a/languages/cpp/app_templates/cppcurseshello/src-Makefile.am b/languages/cpp/app_templates/cppcurseshello/src-Makefile.am new file mode 100644 index 00000000..23de27fb --- /dev/null +++ b/languages/cpp/app_templates/cppcurseshello/src-Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp + +# set the include path found by configure +INCLUDES= $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(all_libraries) diff --git a/languages/cpp/app_templates/cpphello/.kdev_ignore b/languages/cpp/app_templates/cpphello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/cpphello/Makefile.am b/languages/cpp/app_templates/cpphello/Makefile.am new file mode 100644 index 00000000..49bd1b67 --- /dev/null +++ b/languages/cpp/app_templates/cpphello/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = main.cpp src-Makefile.am cpp-Makefile.am cpp-Makefile.cvs \ + configure.in cpphello.png app.kdevelop +templateName = cpphello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/cpphello/app.kdevelop b/languages/cpp/app_templates/cpphello/app.kdevelop new file mode 100644 index 00000000..c7498e39 --- /dev/null +++ b/languages/cpp/app_templates/cpphello/app.kdevelop @@ -0,0 +1,105 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + true + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/cpphello/configure.in b/languages/cpp/app_templates/cpphello/configure.in new file mode 100644 index 00000000..612ce0d5 --- /dev/null +++ b/languages/cpp/app_templates/cpphello/configure.in @@ -0,0 +1,10 @@ +AC_INIT(configure.in) + +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) + +AC_LANG_CPLUSPLUS +AC_PROG_CXX +AM_PROG_LIBTOOL + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/cpp/app_templates/cpphello/cpp-Makefile.am b/languages/cpp/app_templates/cpphello/cpp-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/cpp/app_templates/cpphello/cpp-Makefile.am @@ -0,0 +1,5 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +SUBDIRS = src diff --git a/languages/cpp/app_templates/cpphello/cpp-Makefile.cvs b/languages/cpp/app_templates/cpphello/cpp-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/cpp/app_templates/cpphello/cpp-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/cpp/app_templates/cpphello/cpphello.kdevtemplate b/languages/cpp/app_templates/cpphello/cpphello.kdevtemplate new file mode 100644 index 00000000..0b5b9367 --- /dev/null +++ b/languages/cpp/app_templates/cpphello/cpphello.kdevtemplate @@ -0,0 +1,145 @@ +# KDE Config File +[General] +Name=Simple Hello world program +Name[ca]=Simple programa Hello world +Name[da]=Simpelt Goddag verden program +Name[de]=Ein einfaches "Hello World"-Programm +Name[el]=Απλό πρόγραμμα Γεια σου Κόσμε +Name[es]=Programa «Hola mundo» sencillo +Name[et]=Lihtne "Tere, maailm" programm +Name[eu]="Kaixo mundua" programa sinplea +Name[fa]=برنامۀ سادۀ Hello world +Name[fr]=Programme « Bonjour monde » simple +Name[ga]=Ríomhchlár simplí "Hello World" +Name[gl]=Programa sinxelo Ola mundo +Name[hu]=Egyszerű Hello world program +Name[it]=Semplice programma di "Hello world" +Name[ja]=簡単な Hello world プログラム +Name[ms]=Program Hello World mudah +Name[nds]=En eenfach "Moin Welt"-Programm +Name[ne]=साधारण हेल्लो वोल्ड कार्यक्रम +Name[nl]=Eenvoudig 'Hello World' programma +Name[pl]=Prosty program witaj świecie +Name[pt]=Programa simples Olá Mundo +Name[pt_BR]=Programa simples Olá Mundo +Name[ru]=Простая программа Hello world +Name[sk]=Jednoduchý "Ahoj svet" program +Name[sl]=Preprost program Hello world +Name[sr]=Једноставан „Здраво свете“ програм +Name[sr@Latn]=Jednostavan „Zdravo svete“ program +Name[sv]=Enkelt Hello world-program +Name[tr]=Basit Merhaba dünya programı +Name[zh_CN]=简单的 Hello world 程序 +Name[zh_TW]=簡單的 Hello world 程式 +Icon=cpphello.png +Category=C++ +Comment=Generates a simple Hello world program in C++ +Comment[ca]=Genera un simple programa de Hello world en C++ +Comment[da]=Genererer et simpelt Goddag verden program in C++ +Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C++ +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε C++ +Comment[es]=Genera un sencillo programa «Hola mundo» en C++ +Comment[et]=Lihtsa "Tere, maailm" programmi loomine C++-s +Comment[eu]="Kaixo mundua" programa sinple bat sortzen du C++ lengoaian +Comment[fa]=یک برنامۀ سادۀ Hello world در C++ تولید می‌کند +Comment[fr]=Génère un programme « Bonjour monde » simple en C++ +Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" i C++ +Comment[gl]=Xera un programa sinxelo Ola mundo en C++ +Comment[hu]=Létrehoz egy egyszerű Hello world programot C++-ban +Comment[it]=Genera un semplice programma di "Hello world" in C++ +Comment[ja]=簡単な Hello World プログラムを C++ で作成します +Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C++ op +Comment[ne]=C++ मा एउटा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudig Hello World-programma in C++ +Comment[pl]=Generuje prosty program 'Witaj świecie' w języku C++ +Comment[pt]=Gera um programa simples Olá Mundo em C++ +Comment[pt_BR]=Gera um programa simples Olá Mundo em C++ +Comment[ru]=Создание простого приложения Hello world на C++ +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C++ +Comment[sl]=Ustvari preprost program Hello world v C++ +Comment[sr]=Прави једноставан „Здраво свете“ програм у C++-у +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C++-u +Comment[sv]=Skapar ett enkelt Hello world-program i C++ +Comment[tr]=C++'da basit bir Merhaba Dünya programı yaratır. +Comment[zh_CN]=生成 C++ 的 Hello world 程序 +Comment[zh_TW]=產生一個簡單的 C++ 的 Hello world 程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=cpphello.tar.gz + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/cpp-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/cpp-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE4] +Type=install +Source=%{src}/configure.in +Dest=%{dest}/configure.in + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE6] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[MSG] +Type=message +Comment=A Simple Hello World program was created in %{dest} +Comment[ca]=Un simple programa de Hello World ha estat creat en %{dest} +Comment[da]=Et simpelt Goddag verden program blev oprettet i %{dest} +Comment[de]=Ein einfaches "Hello World"-Programm wurde in %{dest} erstellt. +Comment[el]=Ένα απλό πρόγραμμα Γεια σου Κόσμε δημιουργήθηκε στο %{dest} +Comment[es]=Un sencillo programa «Hola mundo» ha sido creado en %{dest} +Comment[et]=Lihtne "Tere, maailm" programm loodi asukohta %{dest} +Comment[eu]="Kaixo mundua" programa sinple bat sortu da hemen: %{dest} +Comment[fa]=یک برنامۀ سادۀ Hello World در %{dest} ایجاد شد +Comment[fr]=Un programme « Bonjour monde » simple a été créé dans %{dest} +Comment[ga]=Cruthaíodh ríomhchlár simplí "Hello World" i %{dest} +Comment[gl]=Creouse un programa sinxelo Ola mundo en %{dest} +Comment[hu]=Létrejött egy egyszerű Hello world program itt: %{dest} +Comment[it]=È stato creato un semplice programma di "Hello World" in %{dest} +Comment[ja]=簡単な Hello World プログラムを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm opstellt +Comment[ne]=एउटा साधारण हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो +Comment[nl]=Een eenvoudig Hello World-programma is aangemaakt in %{dest} +Comment[pl]=Prosty program 'Witaj świecie' został utworzony w %{dest} +Comment[pt]=Foi criado um programa simples Olá Mundo em %{dest} +Comment[pt_BR]=Foi criado um programa simples Olá Mundo em %{dest} +Comment[ru]=Простое приложение Hello world на C++ создано в %{dest} +Comment[sk]=Jednoduchý "Ahoj svet" program bol vytvorený v %{dest} +Comment[sl]=Preprost program Hello World je bil ustvarjen v %{dest} +Comment[sr]=Једноставан „Здраво свете“ програм направљен је у %{dest} +Comment[sr@Latn]=Jednostavan „Zdravo svete“ program napravljen je u %{dest} +Comment[sv]=Ett enkelt Hello world-program skapades i %{dest} +Comment[tr]=Basit bir Merhaba Dünya programı %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了 Hello world 程序 +Comment[zh_TW]=一個簡單的 Hello World 程式已建立於 %{dest} + diff --git a/languages/cpp/app_templates/cpphello/cpphello.png b/languages/cpp/app_templates/cpphello/cpphello.png new file mode 100644 index 00000000..519c007b Binary files /dev/null and b/languages/cpp/app_templates/cpphello/cpphello.png differ diff --git a/languages/cpp/app_templates/cpphello/main.cpp b/languages/cpp/app_templates/cpphello/main.cpp new file mode 100644 index 00000000..f97c8417 --- /dev/null +++ b/languages/cpp/app_templates/cpphello/main.cpp @@ -0,0 +1,17 @@ +%{CPP_TEMPLATE} + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +using namespace std; + +int main(int argc, char *argv[]) +{ + cout << "Hello, world!" << endl; + + return EXIT_SUCCESS; +} diff --git a/languages/cpp/app_templates/cpphello/src-Makefile.am b/languages/cpp/app_templates/cpphello/src-Makefile.am new file mode 100644 index 00000000..23de27fb --- /dev/null +++ b/languages/cpp/app_templates/cpphello/src-Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp + +# set the include path found by configure +INCLUDES= $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(all_libraries) diff --git a/languages/cpp/app_templates/cppsdlhello/.kdev_ignore b/languages/cpp/app_templates/cppsdlhello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/cppsdlhello/Makefile.am b/languages/cpp/app_templates/cppsdlhello/Makefile.am new file mode 100644 index 00000000..e17785a4 --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = main.cpp src-Makefile.am cpp-Makefile.am cpp-Makefile.cvs configure.in cppsdlhello.png app.kdevelop acinclude.m4 +templateName = cppsdlhello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/cppsdlhello/README b/languages/cpp/app_templates/cppsdlhello/README new file mode 100644 index 00000000..bc4e1d15 --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/README @@ -0,0 +1,11 @@ +This template configures KDevelop to be used with libSDL + +Got it working using this tutorial: +http://www.geekcomix.com/snh/files/docs/sdl-kdev/sdl-kdev-mini-how2.html +and not to forget -lSDL has to get passed to ld :) + +This was submitted via a whishlist: +http://bugs.kde.org/show_bug.cgi?id=53702 + +Thanks to: Mrten Woxberg < marwo264 (at) student.liu.se > +For supplying this template. diff --git a/languages/cpp/app_templates/cppsdlhello/acinclude.m4 b/languages/cpp/app_templates/cppsdlhello/acinclude.m4 new file mode 100644 index 00000000..9681a33a --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/acinclude.m4 @@ -0,0 +1,167 @@ +# Configure paths for SDLmm +# David Hedbor, 2000-07-22 +# stolen from SDL +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_SDLMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SDLmm, and define SDLMM_CXXFLAGS and SDLMM_LIBS +dnl +AC_DEFUN(AM_PATH_SDLMM, +[dnl +dnl Get the cflags and libraries from the ismap-config script +dnl +AC_ARG_WITH(sdlmm-prefix,[ --with-sdlmm-prefix=PFX Prefix where SDLmm is installed (optional)], + sdlmm_prefix="$withval", sdlmm_prefix="") +AC_ARG_WITH(sdlmm-exec-prefix,[ --with-sdlmm-exec-prefix=PFX Exec prefix where SDLmm is installed (optional)], + sdlmm_exec_prefix="$withval", sdlmm_exec_prefix="") +AC_ARG_ENABLE(sdlmmtest, [ --disable-sdlmmtest Do not try to compile and run a test SDLmm program], + , enable_sdlmmtest=yes) + + if test x$sdlmm_exec_prefix != x ; then + sdlmm_args="$sdlmm_args --exec-prefix=$sdlmm_exec_prefix" + if test x${SDLMM_CONFIG+set} != xset ; then + SDLMM_CONFIG=$sdlmm_exec_prefix/bin/sdlmm-config + fi + fi + if test x$sdlmm_prefix != x ; then + sdlmm_args="$sdlmm_args --prefix=$sdlmm_prefix" + if test x${SDLMM_CONFIG+set} != xset ; then + SDLMM_CONFIG=$sdlmm_prefix/bin/sdlmm-config + fi + fi + + AC_PATH_PROG(SDLMM_CONFIG, sdlmm-config, no) + min_sdlmm_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for SDLmm version >= $min_sdlmm_version) + no_sdlmm="" + if test "$SDLMM_CONFIG" = "no" ; then + no_sdlmm=yes + else + SDLMM_CXXFLAGS=`$SDLMM_CONFIG $sdlmmconf_args --cflags` + SDLMM_LIBS=`$SDLMM_CONFIG $sdlmmconf_args --libs` + + sdlmm_major_version=`$SDLMM_CONFIG $sdlmm_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdlmm_minor_version=`$SDLMM_CONFIG $sdlmm_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdlmm_micro_version=`$SDLMM_CONFIG $sdlmm_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdlmmtest" = "xyes" ; then + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS $SDLMM_CXXFLAGS" + LIBS="$LIBS $SDLMM_LIBS" +dnl +dnl Now check if the installed SDLmm is sufficiently new. (Also sanity +dnl checks the results of sdlmm-config to some extent +dnl + rm -f conf.sdlmmtest + AC_TRY_RUN([ +#include +#include +#include "SDLmm/sdlmm.h" +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((std::strlen (str) + 1) * sizeof(char)); + std::strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdlmmtest"); + */ + { FILE *fp = fopen("conf.sdlmmtest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdlmm_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdlmm_version"); + return 1; + } + + if (($sdlmm_major_version > major) || + (($sdlmm_major_version == major) && ($sdlmm_minor_version > minor)) || + (($sdlmm_major_version == major) && ($sdlmm_minor_version == minor) && ($sdlmm_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdlmm-config --version' returned %d.%d.%d, but the minimum version\n", $sdlmm_major_version, $sdlmm_minor_version, $sdlmm_micro_version); + printf("*** of SDLmm required is %d.%d.%d. If sdlmm-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdlmm-config was wrong, set the environment variable SDLMM_CONFIG\n"); + printf("*** to point to the correct copy of sdlmm-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_sdlmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdlmm" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SDLMM_CONFIG" = "no" ; then + echo "*** The sdlmm-config script installed by SDLmm could not be found" + echo "*** If SDLmm was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDLMM_CONFIG environment variable to the" + echo "*** full path to sdlmm-config." + else + if test -f conf.sdlmmtest ; then + : + else + echo "*** Could not run SDLmm test program, checking why..." + CXXFLAGS="$CXXFLAGS $SDLMM_CXXFLAGS" + LIBS="$LIBS $SDLMM_LIBS" + AC_TRY_LINK([ +#include +#include "sdlmm.h" +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDLmm or finding the wrong" + echo "*** version of SDLmm. If it is not finding SDLmm, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDLmm was incorrectly installed" + echo "*** or that you have moved SDLmm since it was installed. In the latter case, you" + echo "*** may want to edit the sdlmm-config script: $SDLMM_CONFIG" ]) + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDLMM_CXXFLAGS="" + SDLMM_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SDLMM_CXXFLAGS) + AC_SUBST(SDLMM_LIBS) + rm -f conf.sdlmmtest +]) diff --git a/languages/cpp/app_templates/cppsdlhello/app.kdevelop b/languages/cpp/app_templates/cppsdlhello/app.kdevelop new file mode 100644 index 00000000..fadfbadc --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/app.kdevelop @@ -0,0 +1,103 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + SDL + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + true + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + -lSDL + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/cppsdlhello/configure.in b/languages/cpp/app_templates/cppsdlhello/configure.in new file mode 100644 index 00000000..440c2e44 --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/configure.in @@ -0,0 +1,90 @@ +AC_INIT(configure.in) + +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) + +AC_LANG_CPLUSPLUS +AC_PROG_CXX +AM_PROG_LIBTOOL + +dnl KDE_FIND_PATH(programm-name, variable-name, list of directories, +dnl if-not-found, test-parameter) +AC_DEFUN(KDE_FIND_PATH, +[ + AC_MSG_CHECKING([for $1]) + if test -n "$$2"; then + kde_cv_path="$$2"; + else + kde_cache=`echo $1 | sed 'y%./+-%__p_%'` + + AC_CACHE_VAL(kde_cv_path_$kde_cache, + [ + kde_cv_path="NONE" + dirs="$3" + kde_save_IFS=$IFS + IFS=':' + for dir in $PATH; do + dirs="$dirs $dir" + done + IFS=$kde_save_IFS + + for dir in $dirs; do + if test -x "$dir/$1"; then + if test -n "$5" + then + evalstr="$dir/$1 $5 2>&1 " + if eval $evalstr; then + kde_cv_path="$dir/$1" + break + fi + else + kde_cv_path="$dir/$1" + break + fi + fi + done + + eval "kde_cv_path_$kde_cache=$kde_cv_path" + + ]) + + eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\"" + + fi + + if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then + AC_MSG_RESULT(not found) + $4 + else + AC_MSG_RESULT($kde_cv_path) + $2=$kde_cv_path + + fi +]) + +KDE_FIND_PATH(sdl-config, LIBSDL_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [ + AC_MSG_WARN([Could not find libsdl anywhere, check http://www.sdl.org]) +]) + +if test -n "$LIBSDL_CONFIG"; then + LIBSDL_LIBS="`$LIBSDL_CONFIG --libs`" + LIBSDL_RPATH= + for args in $LIBSDL_LIBS; do + case $args in + -L*) + LIBSDL_RPATH="$LIBSDL_RPATH $args" + ;; + esac + done + LIBSDL_RPATH=`echo $LIBSDL_RPATH | sed -e "s/-L/-R/g"` + LIBSDL_CFLAGS="`$LIBSDL_CONFIG --cflags`" + + AC_DEFINE_UNQUOTED(HAVE_LIBSDL, 1, [Defines if your system has the LIBSDL library]) +fi + + +AC_SUBST(LIBSDL_LIBS) +AC_SUBST(LIBSDL_CFLAGS) +AC_SUBST(LIBSDL_RPATH) + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.am b/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.am @@ -0,0 +1,5 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +SUBDIRS = src diff --git a/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.cvs b/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/cpp/app_templates/cppsdlhello/cppsdlhello b/languages/cpp/app_templates/cppsdlhello/cppsdlhello new file mode 100644 index 00000000..fd64358b --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/cppsdlhello @@ -0,0 +1,10 @@ +# KDE Config File +[General] +Name=Simple SDL program +Name[fr]=Un simple programme avec SDL +Icon=cppsdl.png +Category=C++ +Comment=Generates a simple SDL program in C++ +Comment[fr]=Gnre un simple programme de test avec la bibliothque SDL dans le language C++. +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/APPNAMELC.cpp diff --git a/languages/cpp/app_templates/cppsdlhello/cppsdlhello.kdevtemplate b/languages/cpp/app_templates/cppsdlhello/cppsdlhello.kdevtemplate new file mode 100644 index 00000000..ec4e94b3 --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/cppsdlhello.kdevtemplate @@ -0,0 +1,150 @@ +# KDE Config File +[General] +Name=Simple SDL program +Name[ca]=Simple programa per a SDL +Name[da]=Simpelt SDL-program +Name[de]=Einfaches SDL-Programm +Name[el]=Απλό πρόγραμμα SDL +Name[es]=Programa SDL sencillo +Name[et]=Lihtne SDL programm +Name[eu]=SDL programa sinplea +Name[fa]=برنامۀ سادۀ SDL +Name[fr]=Programme SDL simple +Name[ga]=Ríomhchlár simplí SDL +Name[gl]=Programa sinxelo SDL +Name[hu]=Egyszerű SDL-alkalmazás +Name[it]=Semplice programma SDL +Name[ja]=簡単な SDL プログラム +Name[nds]=Eenfach SDL-Programm +Name[ne]=साधारण SDL कार्यक्रम +Name[nl]=Eenvoudig SDL-programma +Name[pl]=Prosty program używający SDL +Name[pt]=Programa simples do SDL +Name[pt_BR]=Programa simples do SDL +Name[ru]=Простое приложение SDL +Name[sk]=Jednoduchý SDL program +Name[sl]=Preprost program SDL +Name[sr]=Једноставан SDL програм +Name[sr@Latn]=Jednostavan SDL program +Name[sv]=Enkelt SDL-program +Name[tg]=Барноманависии SDL +Name[tr]=Basit bir SDL Programı +Name[zh_CN]=简单的 SDL 程序 +Name[zh_TW]=簡單的 SDL 程式 +Icon=cppsdl.png +Category=C++ +Comment=Generates a simple SDL program in C++ +Comment[ca]=Genera un simple programa en SDL en C++ +Comment[da]=Genererer et simpelt SDL program i C++ +Comment[de]=Erstellt ein einfaches SDL-Programm in C++ +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα SDL σε C++ +Comment[es]=Genera un sencillo programa SDL en C++ +Comment[et]=Lihtsa SDL programmi loomise C++-s +Comment[eu]=SDL programa sinple bat sortzen du C++ lengoaian +Comment[fa]=یک برنامۀ سادۀ SDL در C++ تولید می‌کند +Comment[fr]=Génère un programme SDL simple en C++ +Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí SDL i C++ +Comment[gl]=Xera un programa sinxelo SDL en C++ +Comment[hu]=Létrehoz egy egyszerű SDL-alkalmazást C++-ban +Comment[it]=Genera un semplice programma SDL in C++ +Comment[ja]=簡単な SDL プログラムを C++ で作成します +Comment[nds]=Stellt en eenfach SDL-Programm in C++ op +Comment[ne]= C++ मा साधारण SDL कार्यक्रम उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudig SDL-programma in C++ +Comment[pl]=Generuje prosty program używający SDL w C++ +Comment[pt]=Gera um programa simples de SDL em C++ +Comment[pt_BR]=Gera um programa simples de SDL em C++ +Comment[ru]=Создание простого приложения SDL на C++ +Comment[sk]=Vygeneruje jednoduchý SDL program v C++ +Comment[sl]=Ustvari preprost program SDL v C++ +Comment[sr]=Прави једноставан SDL програм у C++-у +Comment[sr@Latn]=Pravi jednostavan SDL program u C++-u +Comment[sv]=Skapar ett enkelt SDL-program i C++ +Comment[tr]=C++'da basit bir SDL programı yaratır +Comment[zh_CN]=生成 C++ 的简单 SDL 程序 +Comment[zh_TW]=產生一個簡單的 C++ SDL 程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=cppsdlhello.tar.gz + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/cpp-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/cpp-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE4] +Type=install +Source=%{src}/configure.in +Dest=%{dest}/configure.in + +[FILE5] +Type=install +Source=%{src}/acinclude.m4 +Dest=%{dest}/acinclude.m4 + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE6] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE7] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + + +[MSG] +Type=message +Comment=A simple SDL program was created in %{dest} +Comment[ca]=Un simple programa en SDL ha estat creat en %{dest} +Comment[da]=Et simpelt SDL-program blev oprettet i %{dest} +Comment[de]=Ein einfaches SDL-Programm wurde in %{dest} erstellt. +Comment[el]=Ένα απλό πρόγραμμα SDL δημιουργήθηκε στο %{dest} +Comment[es]=Un sencillo programa SDL ha sido creado en %{dest} +Comment[et]=Lihtne SDL programm loodi asukohta %{dest} +Comment[eu]=SDL programa sinple bat soru da hemen: %{dest} +Comment[fa]=یک برنامۀ سادۀ SDL در %{dest} ایجاد شد +Comment[fr]=Un programme SDL simple a été créé dans %{dest} +Comment[ga]=Cruthaíodh ríomhchlár simplí SDL i %{dest} +Comment[gl]=Creouse un programa sinxelo SDL en %{dest} +Comment[hu]=Létrejött egy egyszerű SDL-alkalmazás itt: %{dest} +Comment[it]=È stato creato un semplice programma SDL in %{dest} +Comment[ja]=簡単な SDL プログラムを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach SDL-Programm opstellt +Comment[ne]=एउटा साधारण SDL कार्यक्रम %{dest} मा सिर्जना गरियो +Comment[nl]=Een eenvoudig SDL-programma is aangemaakt in %{dest} +Comment[pl]=Prosty program używający SDL został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação simples em SDL em %{dest} +Comment[pt_BR]=Foi criada uma aplicação simples em SDL em %{dest} +Comment[ru]=Простое приложение SDL создано в %{dest} +Comment[sk]=Jednoduchý SDL program bol vytvorený v %{dest} +Comment[sl]=Preprost program SDL je bil ustvarjen v %{dest} +Comment[sr]=Једноставан SDL програм направљен је у %{dest} +Comment[sr@Latn]=Jednostavan SDL program napravljen je u %{dest} +Comment[sv]=Ett enkelt SDL-program skapades i %{dest} +Comment[tr]=Basit bir SDL programı %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了简单的 SDL 程序 +Comment[zh_TW]=一個簡單的 SDL 程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/cppsdlhello/cppsdlhello.png b/languages/cpp/app_templates/cppsdlhello/cppsdlhello.png new file mode 100644 index 00000000..888d4f13 Binary files /dev/null and b/languages/cpp/app_templates/cppsdlhello/cppsdlhello.png differ diff --git a/languages/cpp/app_templates/cppsdlhello/main.cpp b/languages/cpp/app_templates/cppsdlhello/main.cpp new file mode 100644 index 00000000..89e3ba30 --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/main.cpp @@ -0,0 +1,29 @@ +%{CPP_TEMPLATE} + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include "SDL.h" + +using namespace std; + +int main(int argc, char *argv[]) +{ + cout <<"Initializing SDL." << endl; + /* Initializes Audio and the CDROM, add SDL_INIT_VIDEO for Video */ + if(SDL_Init(SDL_INIT_AUDIO | SDL_INIT_CDROM)< 0) { + cout <<"Could not initialize SDL:" << SDL_GetError() << endl; + SDL_Quit(); + } else { + cout << "Audio & CDROM initialized correctly" << endl;; + /* Trying to read number of CD devices on system */ + cout << "Drives available :" << SDL_CDNumDrives() << endl; + for(int i=0; i < SDL_CDNumDrives(); ++i) { + cout << "Drive " << i << "\"" << SDL_CDName(i) << "\""; + } + } + SDL_Quit(); +} diff --git a/languages/cpp/app_templates/cppsdlhello/src-Makefile.am b/languages/cpp/app_templates/cppsdlhello/src-Makefile.am new file mode 100644 index 00000000..3f9fd8bf --- /dev/null +++ b/languages/cpp/app_templates/cppsdlhello/src-Makefile.am @@ -0,0 +1,9 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp + +# set the include path found by configure +AM_CPPFLAGS = $(LIBSDL_CFLAGS) $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(all_libraries) $(LIBSDL_RPATH) +%{APPNAMELC}_LDADD = $(LIBSDL_LIBS) diff --git a/languages/cpp/app_templates/dcopservice/.kdev_ignore b/languages/cpp/app_templates/dcopservice/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/dcopservice/Makefile.am b/languages/cpp/app_templates/dcopservice/Makefile.am new file mode 100644 index 00000000..00875115 --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = dcopservice.desktop dcopservice.png dcopservice.h \ + src-Makefile.am main.cpp dcopservice.cpp dcopservice.kdevelop \ + subdirs +templateName = dcopservice + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/dcopservice/dcopservice b/languages/cpp/app_templates/dcopservice/dcopservice new file mode 100644 index 00000000..ff62f5ab --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/dcopservice @@ -0,0 +1,10 @@ +# KDE Config File +[General] +Name=KDE DCOP Service +Name[fr]=Un service DCOP pour KDE +Icon=kdcop.png +Category=C++/KDE +Comment=Generates a framework for a KDE dcop service and client access library. +Comment[fr]=Gnre un squelette de programme pour la gestion d'un service DCOP pour KDE et un programme d'accs au bibliothque. +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/APPNAMELC.cpp diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.cpp b/languages/cpp/app_templates/dcopservice/dcopservice.cpp new file mode 100644 index 00000000..a23da01b --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/dcopservice.cpp @@ -0,0 +1,49 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include + +%{APPNAME}::%{APPNAME}() : DCOPObject("serviceInterface") +{ + kdDebug() << "Starting new service... " << endl; + m_List = QStringList(); +} + +%{APPNAME}::~%{APPNAME}() +{ + kdDebug() << "Going away... " << endl; +} + +QString %{APPNAME}::string(int idx) +{ + return *m_List.at(idx); +} + +QStringList %{APPNAME}::list() +{ + return m_List; +} + +void %{APPNAME}::add(QString arg) +{ + kdDebug() << "Adding " << arg << " to the list" << endl; + m_List << arg; +} + +bool %{APPNAME}::remove(QString arg) +{ + QStringList::Iterator it = m_List.find(arg); + if (it != m_List.end()) + { + m_List.remove(it); + } + else + return false; + return true; +} + +bool %{APPNAME}::exit() +{ + kapp->quit(); +} diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.desktop b/languages/cpp/app_templates/dcopservice/dcopservice.desktop new file mode 100644 index 00000000..2ee5220f --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/dcopservice.desktop @@ -0,0 +1,43 @@ +[Desktop Entry] +Type=Service +Name=%{APPNAME} +Exec=%{APPNAMELC} +X-DCOP-ServiceType=Unique +X-KDE-StartupNotify=false +Comment=Template for dcop services +Comment[br]=Patrom evit servijoù dcop +Comment[ca]=Plantilla per als serveis dcop +Comment[cy]=Patrymlun ar gyfer gwasanaethau dcop +Comment[da]=Skabelon for DCOP-tjenester +Comment[de]=Vorlage für DCOP-Dienste +Comment[el]=Πρότυπο για υπηρεσίες dcop +Comment[es]=Plantilla para servicios DCOP +Comment[et]=DCOP-teenuste mall +Comment[eu]=DCOP zerbitzuentzako plantilla +Comment[fa]=قالب برای خدمات dcop +Comment[fr]=Modèle pour les services DCOP +Comment[ga]=Teimpléad i gcomhair seirbhísí DCOP +Comment[gl]=Modelo para servizos dcop +Comment[hi]=डीसीओपी सेवाओं के लिए टेम्प्लेट +Comment[hu]=Sablon DCOP-szolgáltatásokhoz +Comment[is]=Snið fyrir dcop þjónustur +Comment[it]=Modello per servizi dcop +Comment[ja]=dcop サービスのためのテンプレート +Comment[nds]=Vörlaag för DCOP-Deensten +Comment[ne]=dcop सेवाका लागि टेम्प्लेट +Comment[nl]=Sjabloon voor DCOP-services +Comment[pl]=Szablon dla usług dcop +Comment[pt]=Modelo para serviços dcop +Comment[pt_BR]=Modelo para serviços dcop +Comment[ru]=Шаблон для сервисов DCOP +Comment[sk]=Šablóna pre DCOP služby +Comment[sl]=Predloga za storitve DCOP +Comment[sr]=Шаблон за dcop сервисе +Comment[sr@Latn]=Šablon za dcop servise +Comment[sv]=Mall för DCOP-tjänster +Comment[ta]=டிகாப்சேவைக்கான மாதரி உரு +Comment[tg]=Қолиб барои хидмадгори DCOP +Comment[tr]=dcop hizmetleri için şablon +Comment[zh_CN]=dcop 服务模板 +Comment[zh_TW]=DCOP 服務樣本 + diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.h b/languages/cpp/app_templates/dcopservice/dcopservice.h new file mode 100644 index 00000000..4e9eda87 --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/dcopservice.h @@ -0,0 +1,35 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAME}_H +#define _%{APPNAME}_H + +#include +#include +#include + +class %{APPNAME} : public DCOPObject +{ + K_DCOP + + private: + QStringList m_List; + + public: + %{APPNAME}(); + + ~%{APPNAME}(); + + k_dcop: + QString string(int); + + QStringList list(); + + void add(QString); + + bool remove(QString); + + bool exit(); + + +}; +#endif diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.kdevelop b/languages/cpp/app_templates/dcopservice/dcopservice.kdevelop new file mode 100644 index 00000000..22681e00 --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/dcopservice.kdevelop @@ -0,0 +1,109 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + kioslave + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.kdevtemplate b/languages/cpp/app_templates/dcopservice/dcopservice.kdevtemplate new file mode 100644 index 00000000..dd950d6d --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/dcopservice.kdevtemplate @@ -0,0 +1,202 @@ +# KDE Config File +[General] +Name=KDE DCOP Service +Name[br]=Servij DCOP KDE +Name[ca]=Servei DCOP per al KDE +Name[da]=KDE DCOP-service +Name[de]=KDE-DCOP-Dienst +Name[el]=Υπηρεσία KDE DCOP +Name[es]=Servicio DCOP de KDE +Name[et]=KDE DCOP-teenus +Name[eu]=KDE-ren DCOP zerbitzua +Name[fa]=خدمت KDE DCOP +Name[fr]=Service DCOP KDE +Name[ga]=Seirbhís DCOP KDE +Name[gl]=Servicio DCOP de KDE +Name[hu]=KDE DCOP-szolgáltatás +Name[it]=Servizio DCOP di KDE +Name[ja]=KDE DCOP サービス +Name[nds]=KDE-DCOP-Deenst +Name[ne]=KDE DCOP सेवा +Name[nl]=KDE DCOP-service +Name[pl]=Usługa KDE DCOP +Name[pt]=Serviço de DCOP do KDE +Name[pt_BR]=Serviço de DCOP do KDE +Name[ru]=Сервис DCOP +Name[sk]=KDE DCOP služba +Name[sl]=Storitev DCOP za KDE +Name[sr]=KDE DCOP сервис +Name[sr@Latn]=KDE DCOP servis +Name[sv]=KDE:s DCOP-tjänst +Name[tg]=Хизмати KDE DCOP +Name[tr]=KDE DCOP Hizmeti +Name[zh_CN]=KDE DCOP 服务 +Name[zh_TW]=KDE DCOP 服務 +Icon=kdcop.png +Category=C++/KDE +Comment=Generates a framework for a KDE DCOP service and client access library. +Comment[ca]=Genera una infraestructura per a un servei DCOP de KDE i la biblioteca d'accés del client. +Comment[da]=Genererer et skelet for en KDE dcop-tjeneste og klientadgangsbibliotek. +Comment[de]=Erstellt das Grundgerüst für einen KDE-DCOP-Dienst und eine Bibliothek für den Client-Zugriff. +Comment[el]=Δημιουργεί ένα πλαίσιο για μια υπηρεσία KDE DCOP και μια βιβλιοθήκη πρόσβασης πελάτη. +Comment[es]=Genera una infraestructura para un servicio DCOP de KDE y una biblioteca de acceso cliente. +Comment[et]=KDE DCOP-teenuse raamistiku ja kliendi ligipääsu teegi loomine. +Comment[eu]=KDE-ren DCOP zerbitzu baterako lan-marko bat eta bezero liburutegi bat sortzen ditu. +Comment[fa]=چارچوبی برای خدمت KDE DCOP و کتابخانۀ دستیابی کارخواه تولید می‌کند. +Comment[fr]=Génère une infrastructure pour un service DCOP KDE et une bibliothèque d'accès client. +Comment[ga]=Cruthaigh creatlach do sheirbhís DCOP KDE agus leabharlann rochtana cliaint. +Comment[gl]=Xera un contorno de traballo para un servizo DCOP de KDE e unha biblioteca de acceso para clientes. +Comment[hu]=Létrehoz egy alap KDE DCOP-szolgáltatást és klienselérési programkönyvtárat. +Comment[it]=Genera l'infrastruttura per un servizio DCOP di KDE e una libreria per l'accesso da client. +Comment[ja]=KDE DCOP サービスとクライアントアクセスライブラリのためのフレームワークを作成します +Comment[nds]=Stellt en Rahmenwark för en KDE-DCOP-Deenst un en Clienttogriep-Bibliotheek op. +Comment[ne]=KDE DCOP सेवा र ग्राहक पहुँच लाइब्रेरीका लागि फ्रेमवर्क उत्पन्न गर्दछ । +Comment[nl]=Genereert een framework voor een KDE DCOP-service- en client-bibliotheek. +Comment[pl]=Generuje schemat dla usługi KDE DCOP i biblioteki dostępu użytkownika. +Comment[pt]=Gera a plataforma para um serviço de DCOP do KDE e a biblioteca de acesso dos clientes. +Comment[pt_BR]=Gera a plataforma para um serviço de DCOP do KDE e a biblioteca de acesso dos clientes. +Comment[ru]=Создание сервиса DCOP и библиотеки клиента. +Comment[sk]=Vygeneruje framework pre KDE DCOP službu a klientskú prístupovú knižnicu. +Comment[sr]=Прави једноставан радни оквир за KDE DCOP сервис и приступну библиотеку клијента. +Comment[sr@Latn]=Pravi jednostavan radni okvir za KDE DCOP servis i pristupnu biblioteku klijenta. +Comment[sv]=Skapar ett ramverk för en KDE DCOP-tjänst och klientåtkomstbibliotek. +Comment[tr]=Bir KDE DCOP hizmeti ve istemci erişim kütüphanesi için bir çatı yaratır. +Comment[zh_CN]=生成一个 KDE DCOP 服务和客户访问库的框架。 +Comment[zh_TW]=產生一個 KDE DCOP 服務的架構,以及客戶端存取的函式庫。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=dcopservice.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/dcopservice.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/dcopservice.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/dcopservice.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE14] +Type=install +Source=%{src}/dcopservice.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE15] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[MSG] +Type=message +Comment=A KDE DCOP Service was created in %{dest} +Comment[ca]=Un servei DCOP de KDE ha estat creada en %{dest} +Comment[da]=En KDE DCOP tjeneste blev oprettet i %{dest} +Comment[de]=Ein KDE-DCOP-Dienst wurde in %{dest} erstellt. +Comment[el]=Μια υπηρεσία KDE DCOP δημιουργήθηκε στο %{dest} +Comment[es]=Un servicio DCOP de KDE ha sido creado en %{dest} +Comment[et]=KDE DCOP-teenus loodi asukohta %{dest} +Comment[eu]=KDE-ren DCOP zerbitzu bat sortu da hemen: %{dest} +Comment[fa]=یک خدمت KDE DCOP در %{dest} ایجاد شد +Comment[fr]=Un service DCOP KDE a été créé dans %{dest} +Comment[ga]=Cruthaíodh Seirbhís DCOP KDE i %{dest} +Comment[gl]=Creouse un servizo DCOP de KDE en %{dest} +Comment[hu]=Létrejött egy KDE DCOP-szolgáltatás itt: %{dest} +Comment[it]=È stato creato un servizio DCOP di KDE in %{dest} +Comment[ja]=KDE DCOP サービスを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KDE-DCOP-Deenst opstellt +Comment[ne]=KDE DCOP सेवा %{dest} मा सिर्जना गरियो +Comment[nl]=Een DCOP-service is aangemaakt in %{dest} +Comment[pl]=Usługa KDE DCOP została utworzona w %{dest} +Comment[pt]=Foi criado um serviço de DCOP do KDE em %{dest} +Comment[pt_BR]=Foi criado um serviço de DCOP do KDE em %{dest} +Comment[ru]=Сервис DCOP создан в %{dest} +Comment[sk]=KDE DCOP služba bola vytvorená v %{dest} +Comment[sl]=Storitev DCOP za KDE je bila ustvarjena v %{dest} +Comment[sr]=KDE DCOP сервис направљен је у %{dest} +Comment[sr@Latn]=KDE DCOP servis napravljen je u %{dest} +Comment[sv]=En KDE DCOP-tjänst skapades i %{dest} +Comment[tr]=Bir KDE DCOP Hizmeti %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了一个 KDE DCOP 服务 +Comment[zh_TW]=KDE DCOP 服務已建立於 %{dest} diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.png b/languages/cpp/app_templates/dcopservice/dcopservice.png new file mode 100644 index 00000000..2cb4f1f3 Binary files /dev/null and b/languages/cpp/app_templates/dcopservice/dcopservice.png differ diff --git a/languages/cpp/app_templates/dcopservice/main.cpp b/languages/cpp/app_templates/dcopservice/main.cpp new file mode 100644 index 00000000..55509560 --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/main.cpp @@ -0,0 +1,47 @@ +%{CPP_TEMPLATE} + +#include +#include +#include +#include +#include +#include +#include "%{APPNAMELC}.h" + +static const char description[] = + I18N_NOOP("A KDE KPart Application"); + +static const char version[] = "0.1"; + +static KCmdLineOptions options[] = +{ + KCmdLineLastOption +}; + +int main (int argc, char *argv[]) +{ + KLocale::setMainCatalogue("kdelibs"); + KAboutData aboutdata("%{APPNAMELC}", I18N_NOOP("KDE"), + version, description, + KAboutData::License_GPL, "(C) %{YEAR}, %{AUTHOR}"); + aboutdata.addAuthor("%{AUTHOR}",I18N_NOOP("Developer"),"%{EMAIL}"); + + KCmdLineArgs::init( argc, argv, &aboutdata ); + KCmdLineArgs::addCmdLineOptions( options ); + KUniqueApplication::addCmdLineOptions(); + + if (!KUniqueApplication::start()) + { + kdDebug() << "%{APPNAMELC} is already running!" << endl; + return (0); + } + + KUniqueApplication app; + kdDebug() << "starting %{APPNAMELC} " << endl; + // This app is started automatically, no need for session management + app.disableSessionManagement(); + %{APPNAME} *service = new %{APPNAME}; + kdDebug() << "starting %{APPNAMELC} " << endl; + return app.exec(); + +} diff --git a/languages/cpp/app_templates/dcopservice/src-Makefile.am b/languages/cpp/app_templates/dcopservice/src-Makefile.am new file mode 100644 index 00000000..63b5b8ed --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/src-Makefile.am @@ -0,0 +1,17 @@ +bin_PROGRAMS = %{APPNAMELC} +INCLUDES = $(all_includes) +%{APPNAMELC}_LDFLAGS = $(all_libraries) $(KDE_RPATH) +%{APPNAMELC}_LDADD = $(LIB_KIO) +%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp %{APPNAMELC}.skel + + +noinst_HEADERS = %{APPNAMELC}.h + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + + +service_DATA = %{APPNAMELC}.desktop +servicedir = $(kde_servicesdir) diff --git a/languages/cpp/app_templates/dcopservice/subdirs b/languages/cpp/app_templates/dcopservice/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/dcopservice/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/generichello/.kdev_ignore b/languages/cpp/app_templates/generichello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/generichello/Makefile.am b/languages/cpp/app_templates/generichello/Makefile.am new file mode 100644 index 00000000..b558eecd --- /dev/null +++ b/languages/cpp/app_templates/generichello/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = main.cpp cpphello.png app.kdevelop app.prj +templateName = cppgenerichello + +# BELOW is not the GENERIC Template-Template; +# png-filename differs from archive file name + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz cpphello.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/generichello/app.kdevelop b/languages/cpp/app_templates/generichello/app.kdevelop new file mode 100644 index 00000000..c0b6cc1e --- /dev/null +++ b/languages/cpp/app_templates/generichello/app.kdevelop @@ -0,0 +1,61 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevGenericProject + C++ + + C++ + Code + + + + ShellScript + %{APPNAMELC}.prj + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + true + + + + optimized + GccOptions + GppOptions + G77Options + -O2 -g0 + + + --enable-debug=full + debug + GccOptions + GppOptions + G77Options + -O0 -g3 + + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/generichello/app.prj b/languages/cpp/app_templates/generichello/app.prj new file mode 100644 index 00000000..a1eeca82 --- /dev/null +++ b/languages/cpp/app_templates/generichello/app.prj @@ -0,0 +1,8 @@ + + + + + gcc -o %{APPNAMELC} %{APPNAMELC}.cpp + + + diff --git a/languages/cpp/app_templates/generichello/cpphello.png b/languages/cpp/app_templates/generichello/cpphello.png new file mode 100644 index 00000000..888d4f13 Binary files /dev/null and b/languages/cpp/app_templates/generichello/cpphello.png differ diff --git a/languages/cpp/app_templates/generichello/generichello.kdevtemplate b/languages/cpp/app_templates/generichello/generichello.kdevtemplate new file mode 100644 index 00000000..787140ff --- /dev/null +++ b/languages/cpp/app_templates/generichello/generichello.kdevtemplate @@ -0,0 +1,92 @@ +# KDE Config File +[General] +Name=C++ program (shell script build system) +Name[ca]=Programa C++ (sistema de construcció basat en scripts de shell) +Name[da]=C++ program (skalscript byggesystem) +Name[de]=C++-Programm (Shell-Skript basiertes Erstellungssystem) +Name[el]=Πρόγραμμα C++ (σύστημα κατασκευής σενάριο κελύφους) +Name[es]=Programa en C++ (con sistema de construcción basado en guión de órdenes) +Name[et]=C++ programm (shelliskripti ehitussüsteem) +Name[eu]=C++ programa (shell script-en bidez eraikia) +Name[fa]=برنامۀ ++C )سیستم ساخت دست‌نوشتۀ پوسته( +Name[fr]=Programme C++ (système de construction en script shell) +Name[ga]=Ríomhchlár C++ (córas tógála bunaithe ar scripteanna blaoisce +Name[gl]=Programa C++ (sistema de compilación shell script) +Name[hu]=C++-program (parancssoros fordítási szkripttel) +Name[it]=Programma C++ (sistema di compilazione con script di shell) +Name[ja]=C++ プログラム (シェルスクリプトベースのビルドシステム) +Name[nds]=C++-Programm (Konsoolskript-Opstellsystem) +Name[ne]=C++ कार्यक्रम (शेल स्क्रिप्ट निर्माण प्रणाली) +Name[nl]=C++-programma (shellscript build system) +Name[pl]=Program w C++ (system budowania za pomocą skryptów powłoki) +Name[pt]=Programa em C++ (sistema de compilação em 'shell script') +Name[pt_BR]=Programa em C++ (sistema de compilação em 'shell script') +Name[ru]=Приложение C++ (сборка на скриптах командной оболочки) +Name[sk]=C++ program (shell skript build system) +Name[sl]=Program v C++ (sistem grajenja lupinskega skripta) +Name[sr]=C++ програм (скрипта шкољке као систем за градњу) +Name[sr@Latn]=C++ program (skripta školjke kao sistem za gradnju) +Name[sv]=C++ program (skalskript byggsystem) +Name[tr]=C++ programı (kabuk betiği kurulum sistemi) +Name[zh_CN]=C++ 程序(Shell 脚本创建系统) +Name[zh_TW]=C++ 程式(shell 文稿建立系統) +Icon=cpphello.png +Category=C++/Generic +Comment=Generates a simple Hello world program in C++ +Comment[ca]=Genera un simple programa de Hello world en C++ +Comment[da]=Genererer et simpelt Goddag verden program in C++ +Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C++ +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε C++ +Comment[es]=Genera un sencillo programa «Hola mundo» en C++ +Comment[et]=Lihtsa "Tere, maailm" programmi loomine C++-s +Comment[eu]="Kaixo mundua" programa sinple bat sortzen du C++ lengoaian +Comment[fa]=یک برنامۀ سادۀ Hello world در C++ تولید می‌کند +Comment[fr]=Génère un programme « Bonjour monde » simple en C++ +Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" i C++ +Comment[gl]=Xera un programa sinxelo Ola mundo en C++ +Comment[hu]=Létrehoz egy egyszerű Hello world programot C++-ban +Comment[it]=Genera un semplice programma di "Hello world" in C++ +Comment[ja]=簡単な Hello World プログラムを C++ で作成します +Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C++ op +Comment[ne]=C++ मा एउटा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudig Hello World-programma in C++ +Comment[pl]=Generuje prosty program 'Witaj świecie' w języku C++ +Comment[pt]=Gera um programa simples Olá Mundo em C++ +Comment[pt_BR]=Gera um programa simples Olá Mundo em C++ +Comment[ru]=Создание простого приложения Hello world на C++ +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C++ +Comment[sl]=Ustvari preprost program Hello world v C++ +Comment[sr]=Прави једноставан „Здраво свете“ програм у C++-у +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C++-u +Comment[sv]=Skapar ett enkelt Hello world-program i C++ +Comment[tr]=C++'da basit bir Merhaba Dünya programı yaratır. +Comment[zh_CN]=生成 C++ 的 Hello world 程序 +Comment[zh_TW]=產生一個簡單的 C++ 的 Hello world 程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=generichello.tar.gz + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/app.prj +Dest=%{dest}/%{APPNAMELC}.prj + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE3] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + diff --git a/languages/cpp/app_templates/generichello/main.cpp b/languages/cpp/app_templates/generichello/main.cpp new file mode 100644 index 00000000..f97c8417 --- /dev/null +++ b/languages/cpp/app_templates/generichello/main.cpp @@ -0,0 +1,17 @@ +%{CPP_TEMPLATE} + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +using namespace std; + +int main(int argc, char *argv[]) +{ + cout << "Hello, world!" << endl; + + return EXIT_SUCCESS; +} diff --git a/languages/cpp/app_templates/gnome2mmapp/.kdev_ignore b/languages/cpp/app_templates/gnome2mmapp/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/gnome2mmapp/Makefile.am b/languages/cpp/app_templates/gnome2mmapp/Makefile.am new file mode 100644 index 00000000..f86ae76c --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/Makefile.am @@ -0,0 +1,21 @@ +dataFiles = acconfig.h autogen.sh gnome2mm.glade main_window.cc \ + main_window_glade.hh Makefile.am app-Makefile.am \ + configure.in gnome2mm.gladep main_window.hh \ + app.kdevelop gnome2mm.cc gnome2mmapp main_window_glade.cc\ + src-Makefile.am config.h gnome2mmapp.png + +templateName = gnome2mmapp + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/gnome2mmapp/acconfig.h b/languages/cpp/app_templates/gnome2mmapp/acconfig.h new file mode 100644 index 00000000..c7231ddc --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/acconfig.h @@ -0,0 +1,23 @@ +// generated 2004/4/12 12:12:12 EDT by amp8165@localhost.(none) +// using glademm V2.0.0 + +/* acconfig.h + * This file is in the public domain. + * + * Descriptive text for the C preprocessor macros that + * the distributed Autoconf macros can define. + * These entries are sometimes used by macros + * which glade-- uses. + */ +#undef PACKAGE +#undef VERSION +#undef ENABLE_NLS +#undef HAVE_CATGETS +#undef HAVE_GETTEXT +#undef HAVE_LC_MESSAGES +#undef HAVE_STPCPY +#undef HAVE_LIBSM +#undef PACKAGE_LOCALE_DIR +#undef GETTEXT_PACKAGE +#undef PACKAGE_DATA_DIR +#undef PACKAGE_SOURCE_DIR diff --git a/languages/cpp/app_templates/gnome2mmapp/app-Makefile.am b/languages/cpp/app_templates/gnome2mmapp/app-Makefile.am new file mode 100644 index 00000000..1d95370d --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/app-Makefile.am @@ -0,0 +1,4 @@ + +SUBDIRS = src + +EXTRA_DIST = AUTHORS TODO README configure diff --git a/languages/cpp/app_templates/gnome2mmapp/app.kdevelop b/languages/cpp/app_templates/gnome2mmapp/app.kdevelop new file mode 100644 index 00000000..8ccf488a --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/app.kdevelop @@ -0,0 +1,69 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + GNOME + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + -O0 -g3 + + + + + + + + + + + + + + + libtool + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/gnome2mmapp/autogen.sh b/languages/cpp/app_templates/gnome2mmapp/autogen.sh new file mode 100755 index 00000000..30e9875b --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/autogen.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. +# generated 2004/4/12 12:12:12 EDT by amp8165@localhost.(none) +# using glademm V2.0.0 +# I didn't want to put a copy of 'macros' in every generated package +# so I try to find them at autogen.sh time and copy them here. +# (Normally if you have access to a cvs repository a copy of macros is +# put into your directory at checkout time. E.g. cvs.gnome.org/gnome-common) +if [ ! -e macros ] +then + GLADE_MACROS=`which glade | sed -e 's-bin/glade-share/glade-'` + if [ -r $GLADE_MACROS/gnome/gnome.m4 ] + then + if cp --dereference /dev/null /dev/zero + then + cp -r --dereference $GLADE_MACROS/gnome macros + else + cp -r $GLADE_MACROS/gnome macros + fi + else + echo "I can't find glade's gnome m4 macros. Please copy them to ./macros and retry." + exit 2 + fi +fi + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +PKG_NAME="%{APPNAMELC}" + +(test -f $srcdir/configure.in \ +## put other tests here +) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +} + +export ACLOCAL_FLAGS="-I `pwd`/macros $ACLOCAL_FLAGS" +. $srcdir/macros/autogen.sh diff --git a/languages/cpp/app_templates/gnome2mmapp/config.h b/languages/cpp/app_templates/gnome2mmapp/config.h new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/gnome2mmapp/configure.in b/languages/cpp/app_templates/gnome2mmapp/configure.in new file mode 100644 index 00000000..d25f4fbd --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/configure.in @@ -0,0 +1,57 @@ +# generated 2004/4/12 12:12:12 EDT by amp8165@localhost.(none) +# using glademm V2.0.0 + +AC_INIT(configure.in) +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AM_CONFIG_HEADER(config.h) + +dnl Pick up the Gnome macros. +AM_ACLOCAL_INCLUDE(macros) +AM_MAINTAINER_MODE + +AC_ISC_POSIX +AC_PROG_CC +AM_PROG_CC_STDC +AC_HEADER_STDC +AC_PROG_CPP +AC_PROG_CXX +AC_PROG_CXXCPP +AM_PROG_LIBTOOL + +# GNOME--: +# (These macros are in the 'macros' directory) +# GNOME_INIT sets the GNOME_CONFIG variable, among other things: +GNOME_INIT +GNOME_COMMON_INIT +GNOME_COMPILE_WARNINGS +dnl ************************************************* +dnl gettext support +dnl ************************************************* + +GETTEXT_PACKAGE=gnome2mm +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE") + +dnl Add the languages which your application supports here. +ALL_LINGUAS="" +AM_GLIB_GNU_GETTEXT + +dnl Set PACKAGE_LOCALE_DIR in config.h. +if test "x${prefix}" = "xNONE"; then + AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale") +else + AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale") +fi + +AC_LANG_CPLUSPLUS + +AM_PATH_GNOMEMM(1.2.2,, AC_MSG_ERROR(Cannot find a matching GNOME-- library: Please install version 1.2.2 or newer)) + +# GNOME-CONFIG script knows about gnomemm: +# ('gnome-config' is installed by GNOME) +#GNOMEMM_CFLAGS="`$GNOME_CONFIG --cflags gnomemm gnomeui`" +#GNOMEMM_LIBS="`$GNOME_CONFIG --libs gnomemm gnomeui`" +#AC_SUBST(GNOMEMM_CFLAGS) +#AC_SUBST(GNOMEMM_LIBS) + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mm.cc b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.cc new file mode 100644 index 00000000..8a33b9ff --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.cc @@ -0,0 +1,22 @@ +%{CC_TEMPLATE} + +#include +#include +#include + +#include "main_window.hh" + +int main(int argc, char **argv) +{ +#if defined(ENABLE_NLS) + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + textdomain (GETTEXT_PACKAGE); +#endif //ENABLE_NLS + + Gnome::Main m(PACKAGE, VERSION, argc, argv); + + main_window *main_window = new class main_window(); + m.run(); + delete main_window; + return 0; +} diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mm.glade b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.glade new file mode 100644 index 00000000..4c0370aa --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.glade @@ -0,0 +1,24 @@ + + + + + + + + True + public + True + %{APPNAME} Project + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + + + + + + + + diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mm.gladep b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.gladep new file mode 100644 index 00000000..b7da0659 --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.gladep @@ -0,0 +1,8 @@ + + + + + Gnome2mm + gnome2mm + C++ + diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp new file mode 100644 index 00000000..8593bc68 --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp @@ -0,0 +1,8 @@ +# KDE Config File +[General] +Name=GNOME-- Application framework +Category=C++/GTK+ +Icon=gnome2mmapp.png +Comment=Generates a simple GNOME-- application. Gnomemm, Gtkmm >= 1.2.8 and < 1.3.0 should be installed. To edit glade file glade-- (http://home.wtal.de/petig/Gtk/) is required. +FileTemplates=hh,CStyle,cc,CStyle +ShowFilesAfterGeneration=src/APPNAMELC.cpp diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.kdevtemplate b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.kdevtemplate new file mode 100644 index 00000000..ec101c69 --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.kdevtemplate @@ -0,0 +1,186 @@ +# KDE Config File +[General] +Name=GNOME-- Application framework +Name[ca]=Infraestructura d'aplicació per a GNOME +Name[da]=GNOME-- Programskelet +Name[de]="GNOME--"-Anwendungsgrundgerüst +Name[el]=GNOME-- Πλαίσιο εφαρμογής +Name[es]=Infraestructura para aplicación GNOME-- +Name[et]=GNOME-- rakenduse raamistik +Name[eu]=GNOME-- Aplikazioen lan-markoa +Name[fa]=چارچوب کاربرد GNOME-- +Name[fr]=Infrastructure d'application GNOME-- +Name[ga]=Creatlach feidhmchláir GNOME-- +Name[gl]=Entorno de traballo para aplicación GNOME +Name[hu]=GNOME - Alkalmazás-keretrendszer +Name[it]=Infrastruttura per applicazioni GNOME-- +Name[ja]=GNOME-- アプリケーションフレームワーク +Name[nds]=Programmrahmenwark för "GNOME--" +Name[ne]=GNOME-- अनुप्रयोग फ्रेमवर्क +Name[nl]=GNOME-- Applicationframework +Name[pl]=GNOME-- Szablon programu +Name[pt]=Plataforma de aplicações GNOME-- +Name[pt_BR]=Plataforma de aplicações GNOME-- +Name[ru]=Приложение GNOME-- +Name[sk]=GNOME-- aplikačný framework +Name[sl]=Ogrodje programa za GNOME-- +Name[sr]=Радни оквир GNOME-- програма +Name[sr@Latn]=Radni okvir GNOME-- programa +Name[sv]=GNOME-- programramverk +Name[tr]=GNOME-- Uygulama Çatısı +Name[zh_CN]=GNOME-- 应用程序框架 +Name[zh_TW]=GNOME-- 應用程式框架 +Category=C++/GTK+ +Icon=gnome2mmapp.png +Comment=Generates a simple GNOME-- application. Gnomemm, Gtkmm >= 1.2.8 and < 1.3.0 should be installed. To edit glade file glade-- (http://home.wtal.de/petig/Gtk/) is required. +Comment[ca]=Genera una simple aplicació GNOME. Gnomemm, Gtkmm >= 1.2.8 i < 1.3.0 haurien d'estar instal·lats. Per editar el fitxer glade es requereix (http://home.wtal.de/petig/Gtk/). +Comment[da]=Genererer et simpelt GNOME-- program. Gnomemm, Gtkmm >= 1.2.8 og < 1.3.0 skal være installeret. For at redigere glade file glade-- kræves (http://home.wtal.de/petig/Gtk/). +Comment[de]=Erstellt eine einfache GNOME-Anwendung. Gnomemm, Gtkmm >= 1.2.8 und < 1.3.0 sollten installiert sein. Zum Bearbeiten der glade-Datei ist glade-- (http://home.wtal.de/petig/Gtk/) erforderlich. +Comment[el]=Δημιουργεί μια απλή εφαρμογή GNOME. Τα Gnomemm, Gtkmm >= 1.2.8 και < 1.3.0 πρέπει να είναι εγκατεστημένα. Για την επεξεργασία του αρχείου glade απαιτείται το glade (http://home.wtal.de/petig/Gtk/). +Comment[es]=Genera una sencilla aplicación GNOME--. Debe tener instalados Gnomemm, Gtkmm >= 1.2.8 y < 1.3.0. Para editar archivos glade se necesita glade-- (http://home.wtal.de/petig/Gtk/). +Comment[et]=Lihtsa GNOME-- rakenduse loomine. Paigaldatud peavad olema Gnomemm, Gtkmm >= 1.2.8 ja < 1.3.0. Glade-faili redigeerimiseks on vajalik glade-- (http://home.wtal.de/petig/Gtk/). +Comment[eu]=GNOME-- applicazio sinple bat sortzen du. Gnomemm, Gtkmm >= 1.2.8 and < 1.3.0 instalatu behar dira. Glade fitxategia editatzeko glade-- (http://home.wtal.de/petig/Gtk/) behar da. +Comment[fa]=یک کاربرد سادۀ GNOME-- تولید می‌کند. Gnomemm، Gtkmm >= ۱.۲.۸ و < ۱.۳.۰ باید نصب شده باشد. برای ویرایش پروندۀ glade، glade-- (http://home.wtal.de/petig/Gtk/) نیاز است. +Comment[fr]=Génère une application GNOME-- simple. Gnomemm et Gtkmm >= 1.2.8 et < 1.3.0 devront être installés. Pour modifier le fichier glade, glade-- (http://home.wtal.de/petig/Gtk/) est requis. +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí GNOME--. Ba chóir Gnomemm, Gtkmm >= 1.2.8 agus < 1.3.0 a bheith suiteáilte. Chun comhad glade a chur in eagar, tá glade-- (http://home.wtal.de/petig/Gtk/) de dhíth ort. +Comment[gl]=Xera una aplicación sinxela GNOME. Gnomemm, Gtkmm >= 1.2.8 e < 1.3.0 deben estar instalados. Para editar un arquivo glade é necesario glade-- (http://home.wtal.de/petig/Gtk/). +Comment[hu]=Létrehoz egy egyszerű GNOME--os -alkalmazást. A Gnomemm, a Gtkmm (>= 1.2.8 és < 1.3.0) szükséges hozzá. Glade-fájl szerkesztéséhez a glade-- (http://home.wtal.de/petig/Gtk/) is szükséges. +Comment[it]=Genera una semplice applicazione GNOME--. Gnomemm, Gtkmm >= 1.2.8 e < 1.3.0 dovrebbero essere installati. Si richiede glade per modificare i file di glade -- (http://home.wtal.de/petig/Gtk/). +Comment[ja]=簡単な GNOME-- アプリケーションを作成します。Gnomemm, Gtkmm >= 1.2.8 かつ < 1.3.0 が必要です。glade ファイルを編集するには glade-- (http://home.wtal.de/petig/Gtk/) が必要です。 +Comment[nds]=Stellt en eenfach "GNOME--"-Programm op. "Gnomemm", "Gtkmm" >= 1.2.8 un < 1.3.0 schöölt installeert wesen. För't Bewerken vun de glade-Datei deit "glade--" (http://home.wtal.de/petig/Gtk/) noot. +Comment[ne]=साधारण जिनोम-- अनुप्रयोग उत्पन्न गर्दछ । Gnomemm, Gtkmm >= 1.2.8 र < 1.3.0 स्थापना गर्नु पर्दछ । ग्लेड फाइल सम्पादन गर्नका लागि ग्लेड-- (http://home.wtal.de/petig/Gtk/) आवश्यक पर्दछ । +Comment[nl]=Genereert een eenvoudige GNOME-- toepassing. Gnomemm, Gtkmm >= 1.2.8 en < 1.3.0 dienen te zijn geïnstalleerd. Voor het bewerken van glade file is glade-- (http://home.wtal.de/petig/Gtk/) nodig. +Comment[pl]=Generuje prosty program dla środowiska GNOME--. Gnomemm i Gtkmm w wersji >= 1.2.8 i < 1.3.0 powinny być zainstalowane. Do edycji pliku glade konieczny jest program glade-- (http://home.wtal.de/petig/Gtk/). +Comment[pt]=Gera uma aplicação simples em GNOME--. Deverão estar instalados o Gnomemm, Gtkmm >= 1.2.8 e < 1.3.0. Para editar o ficheiro do Glade,, é necessário o glade-- (http://home.wtal.de/petig/Gtk/). +Comment[pt_BR]=Gera uma aplicação simples em GNOME--. Deverão estar instalados o Gnomemm, Gtkmm >= 1.2.8 e < 1.3.0. Para editar o ficheiro do Glade,, é necessário o glade-- (http://home.wtal.de/petig/Gtk/). +Comment[ru]=Создание простого приложения GNOME--. Требуются Gnomemm, Gtkmm >= 1.2.8 и < 1.3.0. Для редактирования файла glade нужна соответствующая программа (http://home.wtal.de/petig/Gtk/). +Comment[sk]=Vygeneruje jednoduchú GNOME-- aplikáciu. Vyžaduje nainštalovanéGnomemm, Gtkmm >= 1.2.8 a < 1.3.0. Na editovanie glade súboru he potrebnýglade-- (http://home.wtal.de/petig/Gtk/). +Comment[sr]=Прави једноставан GNOME-- програм. Gnomemm, Gtkmm >= 1.2.8 и < 1.3.0 требало би да су инсталирани. Да бисте уређивали glade фајл, неопходан је glade-- (http://home.wtal.de/petig/Gtk/). +Comment[sr@Latn]=Pravi jednostavan GNOME-- program. Gnomemm, Gtkmm >= 1.2.8 i < 1.3.0 trebalo bi da su instalirani. Da biste uređivali glade fajl, neophodan je glade-- (http://home.wtal.de/petig/Gtk/). +Comment[sv]=Skapar ett enkelt GNOME-- program. Gnomemm, Gtkmm >= 1.2.8 och < 1.3.0 måste vara installerat. För att redigera glade-filer krävs glade-- (http://home.wtal.de/petig/Gtk/). +Comment[tr]=Basit bir GNOME-- uygulaması yaratır. Gnomemm, Gtkmm>=1.28 ve <1.3.0 yüklü olmalıdır. Glade dosyasını düzenlemek için glade-- (http://home.wtal.de/petig/Gtk/) gereklidir. +Comment[zh_CN]=生成简单的 GNOME-- 应用程序。必须安装 Gnomemm、1.2.8 到 1.3.0 之间的 Gtkmm。要编辑 glade 文件,需要使用 glade-- (http://home.wtal.de/petig/Gtk/)。 +Comment[zh_TW]=產生一個簡單的 GNOME-- 應用程式。要先安裝 Gnomemm,Gtkmm 版本 >= 1.2.8 且 < 1.3.0。要編輯 glade 檔則要先安裝 glade-- (http://home.wtal.de/petig/Gtk/)。 +FileTemplates=hh,CStyle,cc,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=gnome2mmapp.tar.gz + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNOME2] +Type=include +File=%{kdevelop}/template-common/gnome2.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/app-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/configure.in +Dest=%{dest}/configure.in + +[FILE4] +Type=install +Source=%{src}/acconfig.h +Dest=%{dest}/acconfig.h + +[FILE5] +Type=install +Source=%{src}/config.h +Dest=%{dest}/config.h + +[FILE6] +Type=install +Source=%{src}/autogen.sh +Dest=%{dest}/autogen.sh + +[FILE7] +Type=install +Source=%{src}/gnome2mm.glade +Dest=%{dest}/%{APPNAMELC}.glade + +[FILE8] +Type=install +Source=%{src}/gnome2mm.gladep +Dest=%{dest}/%{APPNAMELC}.gladep + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE9] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE10] +Type=install +Source=%{src}/gnome2mm.cc +Dest=%{dest}/src/%{APPNAMELC}.cc + +[FILE11] +Type=install +Source=%{src}/main_window.hh +Dest=%{dest}/src/main_window.hh + +[FILE12] +Type=install +Source=%{src}/main_window.cc +Dest=%{dest}/src/main_window.cc + +[FILE13] +Type=install +Source=%{src}/main_window_glade.hh +Dest=%{dest}/src/main_window_glade.hh + +[FILE14] +Type=install +Source=%{src}/main_window_glade.cc +Dest=%{dest}/src/main_window_glade.cc + +[MSG] +Type=message +Comment=A GNOME-- application framework was created in %{dest} +Comment[ca]=Una infraestructura d'aplicació per a GNOME ha estat creada en %{dest} +Comment[da]=Et GNOME-- programskelet blev oprettet i %{dest} +Comment[de]=Ein GNOME-Anwendungsgerüst wurde in %{dest} erstellt. +Comment[el]=Ένα πλαίσιο εφαρμογής GNOME δημιουργήθηκε στο %{dest} +Comment[es]=Una infraestructura de aplicación GNOME-- ha sido creada en %{dest} +Comment[et]=GNOME-- rakenduse raamistik loodi asukohta %{dest} +Comment[eu]=GNOME-- applicazioen lan-marko bat sortu da hemen: %{dest} +Comment[fa]=یک چارچوب کاربرد GNOME-- در %{dest} ایجاد شد +Comment[fr]=Une infrastructure d'application GNOME-- a été créée dans %{dest} +Comment[ga]=Cruthaíodh creatlach feidhmchláir GNOME-- i %{dest} +Comment[gl]=Creouse un contorno de traballo para aplicación GNOME en %{dest} +Comment[hu]=Létrejött egy GNOME-s alkalmazás-keretrendszer itt: %{dest} +Comment[it]=È stato creata l'infrastruttura per un'applicazione GNOME in %{dest} +Comment[ja]=GNOME-- アプリケーションフレームワークを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Programmrahmenwark för "GNOME--" opstellt +Comment[ne]= जिनोम-- अनुप्रयोग फ्रेमवर्क %{dest} मा सिर्जना गरियो +Comment[nl]=Een GNOME-- applicationframework is aangemaakt in %{dest} +Comment[pl]=Szablon programu dla GNOME-- został utworzony w %{dest} +Comment[pt]=Foi criada a plataforma de uma aplicação GNOME-- em %{dest} +Comment[pt_BR]=Foi criada a plataforma de uma aplicação GNOME-- em %{dest} +Comment[ru]=Простое приложение GNOME-- создано в %{dest} +Comment[sk]=GNOME-- aplikačný framework bol vytvorený v %{dest} +Comment[sl]=Ogrodje programa za GNOME-- je bilo ustvarjeno v %{dest} +Comment[sr]=Радни оквир GNOME-- програма направљен је у %{dest} +Comment[sr@Latn]=Radni okvir GNOME-- programa napravljen je u %{dest} +Comment[sv]=Ett GNOME-- programramverk skapades i %{dest} +Comment[tr]=Bir GNOME-- uygulama çatısı %{dest} içinde yaratılmıştır. +Comment[zh_CN]=在 %{dest} 中创建了 GNOME-- 应用程序框架 +Comment[zh_TW]=GNOME-- 應用程式框架已建立於 %{dest} diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.png b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.png new file mode 100644 index 00000000..253a6229 Binary files /dev/null and b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.png differ diff --git a/languages/cpp/app_templates/gnome2mmapp/main_window.cc b/languages/cpp/app_templates/gnome2mmapp/main_window.cc new file mode 100644 index 00000000..4c73911b --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/main_window.cc @@ -0,0 +1,16 @@ +%{CC_TEMPLATE} + +// newer (non customized) versions of this file go to main_window.cc_new + +// This file is for your program, I won't touch it again! + +#include "config.h" +#include "main_window.hh" + +#include + +gint main_window::quit(GdkEventAny *ev) +{ + Gtk::Main::quit(); +} + diff --git a/languages/cpp/app_templates/gnome2mmapp/main_window.hh b/languages/cpp/app_templates/gnome2mmapp/main_window.hh new file mode 100644 index 00000000..ae93336b --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/main_window.hh @@ -0,0 +1,19 @@ +%{HH_TEMPLATE} + +// newer (non customized) versions of this file go to main_window.hh_new + +// you might replace +// class foo : public foo_glade { ... }; +// by +// typedef foo_glade foo; +// if you didn't make any modifications to the widget + +#ifndef _MAIN_WINDOW_HH +# include "main_window_glade.hh" +# define _MAIN_WINDOW_HH +class main_window : public main_window_glade +{ +protected: + virtual gint quit(GdkEventAny *ev); +}; +#endif diff --git a/languages/cpp/app_templates/gnome2mmapp/main_window_glade.cc b/languages/cpp/app_templates/gnome2mmapp/main_window_glade.cc new file mode 100644 index 00000000..bea6c857 --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/main_window_glade.cc @@ -0,0 +1,30 @@ +%{CC_TEMPLATE} + +// DO NOT EDIT THIS FILE ! It was created using +// glade-- /home/amp8165/Projects/gnome2mm/gnome2mm.glade +// for gtk 2.2.4 and gtkmm 1.2.10 +// +// Please modify the corresponding derived classes in ./src/main_window.cc + +#include "config.h" +#include +#include "main_window_glade.hh" +#include +#include + +main_window_glade::main_window_glade( +) : Gtk::Window(GTK_WINDOW_TOPLEVEL) +{ main_window = this; + + Gtk::AccelGroup *main_window_accgrp = Gtk::AccelGroup::create(); + gmm_data = new GlademmData(main_window_accgrp); + main_window->set_title(_("%{APPNAME} Project")); + main_window->set_modal(false); + main_window->add_accel_group(*(gmm_data->getAccelGroup())); + main_window->show(); + main_window->delete_event.connect(SigC::slot(this, &main_window_glade::quit)); +} + +main_window_glade::~main_window_glade() +{ delete gmm_data; +} diff --git a/languages/cpp/app_templates/gnome2mmapp/main_window_glade.hh b/languages/cpp/app_templates/gnome2mmapp/main_window_glade.hh new file mode 100644 index 00000000..97a9302f --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/main_window_glade.hh @@ -0,0 +1,49 @@ +%{HH_TEMPLATE} + +// DO NOT EDIT THIS FILE ! It was created using +// glade-- /home/amp8165/Projects/gnome2mm/gnome2mm.glade +// for gtk 2.2.4 and gtkmm 1.2.10 +// +// Please modify the corresponding derived classes in ./src/main_window.hh and./src/main_window.cc + +#ifndef _MAIN_WINDOW_GLADE_HH +# define _MAIN_WINDOW_GLADE_HH + + +#if !defined(GLADEMM_DATA) +#define GLADEMM_DATA +#include + +class GlademmData +{ + + Gtk::AccelGroup *accgrp; +public: + + GlademmData(Gtk::AccelGroup *ag) : accgrp(ag) + { + } + + Gtk::AccelGroup * getAccelGroup() + { return accgrp; + } +}; +#endif //GLADEMM_DATA + +#include + +class main_window_glade : public Gtk::Window +{ + + GlademmData *gmm_data; +public: + class Gtk::Window *main_window; +protected: + + main_window_glade(); + + ~main_window_glade(); + + virtual gint quit(GdkEventAny *ev) = 0; +}; +#endif diff --git a/languages/cpp/app_templates/gnome2mmapp/src-Makefile.am b/languages/cpp/app_templates/gnome2mmapp/src-Makefile.am new file mode 100644 index 00000000..fe5ec32c --- /dev/null +++ b/languages/cpp/app_templates/gnome2mmapp/src-Makefile.am @@ -0,0 +1,14 @@ +bin_PROGRAMS = %{APPNAMELC} + +%{APPNAMELC}_SOURCES = \ + %{APPNAMELC}.cc\ + main_window_glade.cc \ + main_window.cc + +noinst_HEADERS = \ + main_window_glade.hh \ + main_window.hh + +AM_CXXFLAGS = @CXXFLAGS@ @GNOMEMM_CFLAGS@ + +%{APPNAMELC}_LDADD = @LIBS@ @GNOMEMM_LIBS@ diff --git a/languages/cpp/app_templates/gtk2mmapp/.kdev_ignore b/languages/cpp/app_templates/gtk2mmapp/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/gtk2mmapp/Makefile.am b/languages/cpp/app_templates/gtk2mmapp/Makefile.am new file mode 100644 index 00000000..2069ade7 --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/Makefile.am @@ -0,0 +1,21 @@ +dataFiles = acconfig.h autogen.sh gtk2mm.glade main_window.cc \ + main_window_glade.hh Makefile.am app-Makefile.am \ + configure.in gtk2mm.gladep main_window.hh \ + app.kdevelop gtk2mm.cc main_window_glade.cc\ + src-Makefile.am config.h gtk2mmapp.png + +templateName = gtk2mmapp + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/gtk2mmapp/acconfig.h b/languages/cpp/app_templates/gtk2mmapp/acconfig.h new file mode 100644 index 00000000..a3f4402e --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/acconfig.h @@ -0,0 +1,10 @@ +/* acconfig.h + * This file is in the public domain. + * + * Descriptive text for the C preprocessor macros that + * the distributed Autoconf macros can define. + * These entries are sometimes used by macros + * which glade-- uses. + */ +#undef PACKAGE +#undef VERSION diff --git a/languages/cpp/app_templates/gtk2mmapp/app-Makefile.am b/languages/cpp/app_templates/gtk2mmapp/app-Makefile.am new file mode 100644 index 00000000..1d95370d --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/app-Makefile.am @@ -0,0 +1,4 @@ + +SUBDIRS = src + +EXTRA_DIST = AUTHORS TODO README configure diff --git a/languages/cpp/app_templates/gtk2mmapp/app.kdevelop b/languages/cpp/app_templates/gtk2mmapp/app.kdevelop new file mode 100644 index 00000000..47330ca2 --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/app.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + GTK + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnustep + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + libstdc++ + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + libtool + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/gtk2mmapp/autogen.sh b/languages/cpp/app_templates/gtk2mmapp/autogen.sh new file mode 100755 index 00000000..231521ba --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/autogen.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# generated 2004/4/12 11:58:47 EDT by amp8165@localhost.(none) +# using glademm V2.0.0 + +if test ! -f install-sh ; then touch install-sh ; fi + +MAKE=`which gnumake` +if test ! -x "$MAKE" ; then MAKE=`which gmake` ; fi +if test ! -x "$MAKE" ; then MAKE=`which make` ; fi +HAVE_GNU_MAKE=`$MAKE --version|grep -c "Free Software Foundation"` + +if test "$HAVE_GNU_MAKE" != "1"; then +echo Using non GNU Make at $MAKE +else +echo Found GNU Make at $MAKE ... good. +fi + +echo This script runs configure and make... +echo You did remember necessary arguments for configure, right? + +if test ! -x `which aclocal` +then echo you need autoconfig and automake to generate the Makefile +fi +if test ! -x `which automake` +then echo you need automake to generate the Makefile +fi + +libtoolize --force --copy +autoheader +aclocal +automake --add-missing --copy --gnu +autoconf +#./configure $* && $MAKE diff --git a/languages/cpp/app_templates/gtk2mmapp/config.h b/languages/cpp/app_templates/gtk2mmapp/config.h new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/gtk2mmapp/configure.in b/languages/cpp/app_templates/gtk2mmapp/configure.in new file mode 100644 index 00000000..cec72218 --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/configure.in @@ -0,0 +1,19 @@ + +AC_INIT(configure.in) +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AC_CONFIG_HEADER(config.h) + +AC_ISC_POSIX +AC_PROG_CC +AM_PROG_CC_STDC +AC_HEADER_STDC +AC_PROG_CPP +AC_PROG_CXX +AC_PROG_CXXCPP +AM_PROG_LIBTOOL + +AC_LANG_CPLUSPLUS + +PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 >= 2.8.0]) + +AC_OUTPUT(Makefile src/Makefile ) diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc new file mode 100644 index 00000000..9845fede --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc @@ -0,0 +1,15 @@ +%{CC_TEMPLATE} + +#include + +#include "main_window.hh" + +int main(int argc, char **argv) +{ + + Gtk::Main m(&argc, &argv); + + main_window main_window; + Gtk::Main::run(main_window); + return 0; +} diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade new file mode 100644 index 00000000..ef4f1b18 --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade @@ -0,0 +1,30 @@ + + + + + + + True + True + public + True + %{APPNAME} Project + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + + + + + + + + diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mm.gladep b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.gladep new file mode 100644 index 00000000..f09912ac --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.gladep @@ -0,0 +1,10 @@ + + + + + %{APPNAME} + %{APPNAMELC} + C++ + FALSE + FALSE + diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate b/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate new file mode 100644 index 00000000..6d52c9bd --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate @@ -0,0 +1,174 @@ +# KDE Config File +[General] +Name=Gtk-- Application framework +Name[ca]=Infraestructura d'aplicació per a Gtk-- +Name[da]=Gtk-- programskelet +Name[de]="Gtk--"-Anwendungsgrundgerüst +Name[el]=Gtk-- πλαίσιο εφαρμογής +Name[es]=Infraestructura de aplicación Gtk-- +Name[et]=Gtk-- rakenduse raamistik +Name[eu]=Gtk-- Applicazioen lan-markoa +Name[fa]=چارچوب کاربرد Gtk-- +Name[fr]=Infrastructure d'application Gtk-- +Name[ga]=Creatlach feidhmchláir Gtk-- +Name[hu]=Gtk-- - alkalmazás-keretrendszer +Name[it]=Infrastruttura per un'applicazione Gtk-- +Name[ja]=Gtk-- アプリケーションフレームワーク +Name[nds]="Gtk--"-Programmrahmenwark +Name[ne]=Gtk-- अनुप्रयोग फ्रेमवर्क +Name[nl]=Gtk-- Applicationframework +Name[pl]=Szablon programu Gtk-- +Name[pt]=Plataforma de aplicações em Gtk-- +Name[pt_BR]=Plataforma de aplicações em Gtk-- +Name[ru]=Приложение Gtk-- +Name[sk]=Gtk-- aplikačný framework +Name[sl]=Ogrodje programa za Gtk-- +Name[sr]=Радни оквир Gtk-- програма +Name[sr@Latn]=Radni okvir Gtk-- programa +Name[sv]=Gtk-- programramverk +Name[tr]=Gtk-- Uygulama Çatısı +Name[zh_CN]=Gtk-- 应用程序框架 +Name[zh_TW]=Gtk-- 應用程式框架 +Category=C++/GTK+ +Icon=gtk2mmapp.png +Comment=Generates a simple Gtk-- application. Gtkmm >= 2.8.0 should be installed. To edit glade file glade-- (http://home.wtal.de/petig/Gtk/) is required. +Comment[ca]=Genera una simple aplicació Gtk. Gtkmm >= 2.8.0 hauria d'estar instal·lat. Per editar el fitxer glade es requereix glade-- (http://home.wtal.de/petig/Gtk/). +Comment[da]=Genererer et simpelt Gtk-- program. Gtkmm >= 2.8.0 skal være installeret. For at redigere glade file glade-- kræves (http://home.wtal.de/petig/Gtk/). +Comment[de]=Erstellt eine einfache Gtk-Anwendung. Gtkmm >= 1.2.8 und < 1.3.0 sollte installiert sein. Zum Bearbeiten der glade-Datei ist glade-- (http://home.wtal.de/petig/Gtk/) erforderlich. +Comment[el]=Δημιουργεί μια απλή εφαρμογή Gtk. Το Gtkmm >= 2.8.0 πρέπει να είναι εγκατεστημένο. Για την επεξεργασία του αρχείου glade απαιτείται το glade (http://home.wtal.de/petig/Gtk/). +Comment[es]=Genera una sencilla aplicación Gtk--. Debe tener instalado Gtkmm >= 2.8.0. Para editar archivos glade se necesita glade-- (http://home.wtal.de/petig/Gtk/). +Comment[et]=Lihtsa Gtk-- rakenduse loomine. Paigaldatud peab olema Gtkmm >= 2.8.0. Glade-faili redigeerimiseks on vajalik glade-- (http://home.wtal.de/petig/Gtk/). +Comment[fr]=Génère une application Gtk-- simple. Gtkmm >= 2.8.0 devra être installé. Pour modifier le fichier glade, glade-- (http://home.wtal.de/petig/Gtk/) est requis. +Comment[hu]=Létrehoz egy egyszerű Gtk---alapú alkalmazást. Gtkmm >= 2.8.0 szükséges hozzá. Glade-fájl szerkesztéséhez glade-- (http://home.wtal.de/petig/Gtk/) szükséges. +Comment[it]=Genera una semplice applicazione Gtk--. Dovrebbe essere installato Gtkmm >= 2.8.0. Per modificare il file di glade bisogna avere glade-- installato (http://home.wtal.de/petig/Gtk/). +Comment[ja]=簡単な Gtk-- アプリケーションを作成します。Gtkmm >= 2.8.0 が必要です。Glade ファイルを編集するには glade (http://home.wtal.de/petig/Gtk/) が必要です。 +Comment[nds]=Stellt en eenfach "Gtk--"-Programm op. Gtkmm >= 2.8.0 schull installeert wesen. För't Bewerken vun de glade-Datei deit "glade--" (http://home.wtal.de/petig/Gtk/) noot. +Comment[nl]=Genereert een eenvoudige Gtk-- toepassing. Gtkmm >= 2.8.0 dient te zijn geïnstalleerd. Om het glade-bestand te kunnen bewerken hebt u glade-- (http://home.wtal.de/petig/Gtk/) nodig. +Comment[pl]=Generuje prosty program Gtk--. Powinno być zainstalowane Gtkmm w wersji >= 2.8.0. Do modyfikacji plików glade konieczne jest glade-- (http://home.wtal.de/petig/Gtk/). +Comment[pt]=Gera uma aplicação simples em Gtk--. Deverá estar instalado o Gtkmm >= 2.8.0. Para editar o ficheiro do Glade,, é necessário o glade-- (http://home.wtal.de/petig/Gtk/). +Comment[pt_BR]=Gera uma aplicação simples em Gtk--. Deverá estar instalado o Gtkmm >= 2.8.0. Para editar o ficheiro do Glade,, é necessário o glade-- (http://home.wtal.de/petig/Gtk/). +Comment[ru]=Создание простого приложения Gtk--. Требуется Gtkmm >= 1.2.8 и < 1.3.0. Для редактирования файла glade нужна соответствующая программа (http://home.wtal.de/petig/Gtk/). +Comment[sk]=Vygeneruje jednoduchú Gtk-- aplikáciu. Vyžaduje nainštalované Gtkmm >= 2.8.0. Na editovanie glade súboru he potrebný glade-- (http://home.wtal.de/petig/Gtk/). +Comment[sr]=Прави једноставан Gtk-- програм. Gtkmm >= 2.8.0 требало би да је инсталиран. Да бисте уређивали glade фајл, неопходан је glade-- (http://home.wtal.de/petig/Gtk/). +Comment[sr@Latn]=Pravi jednostavan Gtk-- program. Gtkmm >= 2.8.0 trebalo bi da je instaliran. Da biste uređivali glade fajl, neophodan je glade-- (http://home.wtal.de/petig/Gtk/). +Comment[sv]=Skapar ett enkelt Gtk-- program. Gtkmm >= 2.8.0 måste vara installerat. För att redigera glade-filer krävs glade-- (http://home.wtal.de/petig/Gtk/). +Comment[zh_TW]=產生一個簡單的 Gtk-- 應用程式。要先安裝 Gtkmm 版本 >= 2.8.0。要編輯 glade 檔則要先安裝 glade-- (http://home.wtal.de/petig/Gtk/)。 +FileTemplates=hh,CStyle,cc,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=gtk2mmapp.tar.gz + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/app-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/configure.in +Dest=%{dest}/configure.in + +[FILE4] +Type=install +Source=%{src}/acconfig.h +Dest=%{dest}/acconfig.h + +[FILE5] +Type=install +Source=%{src}/config.h +Dest=%{dest}/config.h + +[FILE6] +Type=install +Source=%{src}/autogen.sh +Dest=%{dest}/autogen.sh + +[FILE7] +Type=install +Source=%{src}/gtk2mm.glade +Dest=%{dest}/%{APPNAMELC}.glade + +[FILE8] +Type=install +Source=%{src}/gtk2mm.gladep +Dest=%{dest}/%{APPNAMELC}.gladep + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE9] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE10] +Type=install +Source=%{src}/gtk2mm.cc +Dest=%{dest}/src/%{APPNAMELC}.cc + +[FILE11] +Type=install +Source=%{src}/main_window.hh +Dest=%{dest}/src/main_window.hh + +[FILE12] +Type=install +Source=%{src}/main_window.cc +Dest=%{dest}/src/main_window.cc + +[FILE13] +Type=install +Source=%{src}/main_window_glade.hh +Dest=%{dest}/src/main_window_glade.hh + +[FILE14] +Type=install +Source=%{src}/main_window_glade.cc +Dest=%{dest}/src/main_window_glade.cc + +[MSG] +Type=message +Comment=A Gtk-- application framework was created in %{dest} +Comment[ca]=Una infraestructura d'aplicació Gtk-- ha estat creada en %{dest} +Comment[da]=Et Gtk-- programskelet blev oprettet i %{dest} +Comment[de]=Ein Gtk-Anwendungsgerüst wurde in %{dest} erstellt. +Comment[el]=Ένα πλαίσιο εφαρμογής Gtk δημιουργήθηκε στο %{dest} +Comment[es]=Una infraestructura de aplicación Gtk-- ha sido creada en %{dest} +Comment[et]=Gtk-- rakenduse raamistik loodi asukohta %{dest} +Comment[eu]=Gtk-- aplikazioen lan-marko bat sortu da hemen: %{dest} +Comment[fa]=یک چارچوب کاربرد Gtk-- در %{dest} ایجاد شد +Comment[fr]=Une infrastructure d'application Gtk-- a été créée dans %{dest} +Comment[ga]=Cruthaíodh creatlach feidhmchláir Gtk-- i %{dest} +Comment[gl]=Creouse un contorno de traballo para aplicación Gtk en %{dest} +Comment[hu]=Létrejött egy Gtk-s alkalmazás-keretrendszer itt: %{dest} +Comment[it]=È stata creata l'infrastruttura per un'applicazione Gtk-- in %{dest} +Comment[ja]=Gtk-- アプリケーションフレームワークを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en "Gtk-- "-Programmrahmenwark opstellt +Comment[ne]=Gtk-- अनुप्रयोग फ्रेमवर्क %{dest} मा सिर्जना गरियो +Comment[nl]=Een Gtk-- toepassing is aangemaakt in %{dest} +Comment[pl]=Szablon programu Gtk-- został utworzony w %{dest} +Comment[pt]=Foi criada a plataforma de uma aplicação Gtk-- em %{dest} +Comment[pt_BR]=Foi criada a plataforma de uma aplicação Gtk-- em %{dest} +Comment[ru]=Приложение Gtk-- создано в %{dest} +Comment[sk]=Gtk-- aplikačný framework bol vytvorený v %{dest} +Comment[sl]=Ogrodje za program v Gtk-- je bil ustvarjen v %{dest} +Comment[sr]=Радни оквир Gtk-- програма направљен је у %{dest} +Comment[sr@Latn]=Radni okvir Gtk-- programa napravljen je u %{dest} +Comment[sv]=Ett Gtk-- programramverk skapades i %{dest} +Comment[tr]=Bir Gtk-- uygulama çatısı %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 创建了一个 Gtk-- 应用程序框架 +Comment[zh_TW]=一個 Gtk-- 應用程式框架已建立於 %{dest} diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.png b/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.png new file mode 100644 index 00000000..253a6229 Binary files /dev/null and b/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.png differ diff --git a/languages/cpp/app_templates/gtk2mmapp/main_window.cc b/languages/cpp/app_templates/gtk2mmapp/main_window.cc new file mode 100644 index 00000000..ad36b327 --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/main_window.cc @@ -0,0 +1,12 @@ +%{CC_TEMPLATE} + +// newer (non customized) versions of this file go to main_window.cc_new + +// This file is for your program, I won't touch it again! + +#include "config.h" +#include "main_window.hh" + +bool main_window::quit(GdkEventAny *ev) +{ return 0; +} diff --git a/languages/cpp/app_templates/gtk2mmapp/main_window.hh b/languages/cpp/app_templates/gtk2mmapp/main_window.hh new file mode 100644 index 00000000..640e1461 --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/main_window.hh @@ -0,0 +1,19 @@ +%{HH_TEMPLATE} + +// newer (non customized) versions of this file go to main_window.hh_new + +// you might replace +// class foo : public foo_glade { ... }; +// by +// typedef foo_glade foo; +// if you didn't make any modifications to the widget + +#ifndef _MAIN_WINDOW_HH +# include "main_window_glade.hh" +# define _MAIN_WINDOW_HH +class main_window : public main_window_glade +{ + + bool quit(GdkEventAny *ev); +}; +#endif diff --git a/languages/cpp/app_templates/gtk2mmapp/main_window_glade.cc b/languages/cpp/app_templates/gtk2mmapp/main_window_glade.cc new file mode 100644 index 00000000..829855a8 --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/main_window_glade.cc @@ -0,0 +1,40 @@ +%{CC_TEMPLATE} + +// DO NOT EDIT THIS FILE ! It was created using glade-- +// for gtk 2.8.3 and gtkmm 2.8.0 +// +// Please modify the corresponding derived classes in ./src/main_window.cc + + +#if defined __GNUC__ && __GNUC__ < 3 +#error This program will crash if compiled with g++ 2.x +// see the dynamic_cast bug in the gtkmm FAQ +#endif // +#include "config.h" +#include +#if GTKMM_MAJOR_VERSION==2 && GTKMM_MINOR_VERSION>2 +#include +#define GMM_GTKMM_22_24(a,b) b +#else //gtkmm 2.2 +#define GMM_GTKMM_22_24(a,b) a +#endif // +#include "main_window_glade.hh" +#include +#include + +main_window_glade::main_window_glade( +) : Gtk::Window(Gtk::WINDOW_TOPLEVEL) +{ main_window = this; + gmm_data = new GlademmData(get_accel_group()); + main_window->set_title("%{APPNAME} Project"); + main_window->set_modal(false); + main_window->property_window_position().set_value(Gtk::WIN_POS_CENTER); + main_window->set_resizable(true); + main_window->property_destroy_with_parent().set_value(false); + main_window->show(); + main_window->signal_delete_event().connect(SigC::slot(*this, &main_window_glade::quit), false); +} + +main_window_glade::~main_window_glade() +{ delete gmm_data; +} diff --git a/languages/cpp/app_templates/gtk2mmapp/main_window_glade.hh b/languages/cpp/app_templates/gtk2mmapp/main_window_glade.hh new file mode 100644 index 00000000..3c0cc27a --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/main_window_glade.hh @@ -0,0 +1,48 @@ +%{HH_TEMPLATE} + +// DO NOT EDIT THIS FILE ! It was created using glade-- +// for gtk 2.8.3 and gtkmm 2.8.0 +// +// Please modify the corresponding derived classes in ./src/main_window.hh and./src/main_window.cc + +#ifndef _MAIN_WINDOW_GLADE_HH +# define _MAIN_WINDOW_GLADE_HH + + +#if !defined(GLADEMM_DATA) +#define GLADEMM_DATA +#include + +class GlademmData +{ + + Glib::RefPtr accgrp; +public: + + GlademmData(Glib::RefPtr ag) : accgrp(ag) + { + } + + Glib::RefPtr getAccelGroup() + { return accgrp; + } +}; +#endif //GLADEMM_DATA + +#include + +class main_window_glade : public Gtk::Window +{ + + GlademmData *gmm_data; +public: + class Gtk::Window * main_window; +protected: + + main_window_glade(); + + ~main_window_glade(); +private: + virtual bool quit(GdkEventAny *ev) = 0; +}; +#endif diff --git a/languages/cpp/app_templates/gtk2mmapp/src-Makefile.am b/languages/cpp/app_templates/gtk2mmapp/src-Makefile.am new file mode 100644 index 00000000..a8c856e9 --- /dev/null +++ b/languages/cpp/app_templates/gtk2mmapp/src-Makefile.am @@ -0,0 +1,14 @@ +bin_PROGRAMS = %{APPNAMELC} + +%{APPNAMELC}_SOURCES = \ + %{APPNAMELC}.cc\ + main_window_glade.cc \ + main_window.cc + +noinst_HEADERS = \ + main_window_glade.hh \ + main_window.hh + +AM_CXXFLAGS = @CXXFLAGS@ @GTKMM_CFLAGS@ + +%{APPNAMELC}_LDADD = @LIBS@ @GTKMM_LIBS@ diff --git a/languages/cpp/app_templates/kapp/.kdev_ignore b/languages/cpp/app_templates/kapp/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kapp/Makefile.am b/languages/cpp/app_templates/kapp/Makefile.am new file mode 100644 index 00000000..efe532d3 --- /dev/null +++ b/languages/cpp/app_templates/kapp/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = app.cpp app.h pref.cpp pref.h appview.cpp appview.h \ + appiface.h app_client.cpp main.cpp appui.rc src-Makefile.am \ + kapp.png app.kdevelop subdirs README + +templateName = kapp + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kapp/README b/languages/cpp/app_templates/kapp/README new file mode 100644 index 00000000..f04a5635 --- /dev/null +++ b/languages/cpp/app_templates/kapp/README @@ -0,0 +1,81 @@ +----------------------------------------------- +Kde application framework template quickstart +Author: Thomas Nagy +Date: 2004-03-22 +----------------------------------------------- + +This README file explains you basic things for starting with +this application template. + + +** Building and installing ** + +* Build the configure script by "make -f Makefile.cvs" + +* To clean, use "make clean", and to clean everything +(remove the makefiles, etc), use "make distclean" + +* To distribute your program, try "make dist". +This will make a compact tarball archive of your release with the +necessary scripts inside. + +* Modifying the auto-tools scripts +for automake scripts there is an excellent tutorial there : +http://developer.kde.org/documentation/other/makefile_am_howto.html + +* Simplify your life : install the project in your home directory for +testing purposes. +./configure --prefix=/home/user/dummyfolder/ +In the end when you finished the development you can +rm -rf /home/user/dummyfolder/ +without fear. + + +** Technologies ** + +* Build the menus of your application easily +kde applications now use an xml file (*ui.rc file) to build the menus. +This allow a great customization of the application. However, when +programming the menu is shown only after a "make install" + +For more details, consult : +http://devel-home.kde.org/~larrosa/tutorial/p9.html +http://developer.kde.org/documentation/tutorials/xmlui/preface.html + +* Use KConfig XT to create your configuration dialogs and make +them more maintainable. + +For more details, consult : +http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html + +* With KParts, you can embed other kde components in your program, or make your program +embeddable in other apps. For example, the kmplayer kpart can be called to play videos +in your app. + +For more details, consult : +http://www-106.ibm.com/developerworks/library/l-kparts/ +http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html +http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html + +* With dcop, you can control your app from other applications +Make sure to include K_DCOP and a kdcop: section in your .h file +http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html + + +** Documentation ** + +* For the translations : +1. Download a patched gettext which can be found at: + http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/ +2. Install that gettext in ~/bin/ +3. cd ~/yourproject, export PATH=~/bin:$PATH, export +KDEDIR=/where_your_KDE3_is +4. make -f admin/Makefile.common package-messages +5. make package-messages +6. Translate the po files (not the pot!!) with kbabel or xemacs + +* Do not forget to write the documentation for your kde app +edit the documentation template index.docbook in doc/ + + + diff --git a/languages/cpp/app_templates/kapp/app.cpp b/languages/cpp/app_templates/kapp/app.cpp new file mode 100644 index 00000000..5460bba9 --- /dev/null +++ b/languages/cpp/app_templates/kapp/app.cpp @@ -0,0 +1,247 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include "pref.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +%{APPNAME}::%{APPNAME}() + : KMainWindow( 0, "%{APPNAME}" ), + m_view(new %{APPNAME}View(this)), + m_printer(0) +{ + // accept dnd + setAcceptDrops(true); + + // tell the KMainWindow that this is indeed the main widget + setCentralWidget(m_view); + + // then, setup our actions + setupActions(); + + // and a status bar + statusBar()->show(); + + // Apply the create the main window and ask the mainwindow to + // automatically save settings if changed: window size, toolbar + // position, icon size, etc. Also to add actions for the statusbar + // toolbar, and keybindings if necessary. + setupGUI(); + + // allow the view to change the statusbar and caption + connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), + this, SLOT(changeStatusbar(const QString&))); + connect(m_view, SIGNAL(signalChangeCaption(const QString&)), + this, SLOT(changeCaption(const QString&))); + +} + +%{APPNAME}::~%{APPNAME}() +{ +} + +void %{APPNAME}::load(const KURL& url) +{ + QString target; + // the below code is what you should normally do. in this + // example case, we want the url to our own. you probably + // want to use this code instead for your app + + #if 0 + // download the contents + if (KIO::NetAccess::download(url, target)) + { + // set our caption + setCaption(url); + + // load in the file (target is always local) + loadFile(target); + + // and remove the temp file + KIO::NetAccess::removeTempFile(target); + } + #endif + + setCaption(url.prettyURL()); + m_view->openURL(url); +} + +void %{APPNAME}::setupActions() +{ + KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStdAction::open(this, SLOT(fileOpen()), actionCollection()); + KStdAction::save(this, SLOT(fileSave()), actionCollection()); + KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); + KStdAction::print(this, SLOT(filePrint()), actionCollection()); + KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + + KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + // this doesn't do anything useful. it's just here to illustrate + // how to insert a custom menu and menu item + KAction *custom = new KAction(i18n("Cus&tom Menuitem"), 0, + this, SLOT(optionsPreferences()), + actionCollection(), "custom_action"); +} + +void %{APPNAME}::saveProperties(KConfig *config) +{ + // the 'config' object points to the session managed + // config file. anything you write here will be available + // later when this app is restored + + if (!m_view->currentURL().isEmpty()) { +#if KDE_IS_VERSION(3,1,3) + config->writePathEntry("lastURL", m_view->currentURL()); +#else + config->writeEntry("lastURL", m_view->currentURL()); +#endif + } +} + +void %{APPNAME}::readProperties(KConfig *config) +{ + // the 'config' object points to the session managed + // config file. this function is automatically called whenever + // the app is being restored. read in here whatever you wrote + // in 'saveProperties' + + QString url = config->readPathEntry("lastURL"); + + if (!url.isEmpty()) + m_view->openURL(KURL(url)); +} + +void %{APPNAME}::dragEnterEvent(QDragEnterEvent *event) +{ + // accept uri drops only + event->accept(KURLDrag::canDecode(event)); +} + +void %{APPNAME}::dropEvent(QDropEvent *event) +{ + // this is a very simplistic implementation of a drop event. we + // will only accept a dropped URL. the Qt dnd code can do *much* + // much more, so please read the docs there + KURL::List urls; + + // see if we can decode a URI.. if not, just ignore it + if (KURLDrag::decode(event, urls) && !urls.isEmpty()) + { + // okay, we have a URI.. process it + const KURL &url = urls.first(); + + // load in the file + load(url); + } +} + +void %{APPNAME}::fileNew() +{ + // this slot is called whenever the File->New menu is selected, + // the New shortcut is pressed (usually CTRL+N) or the New toolbar + // button is clicked + + // create a new window + (new %{APPNAME})->show(); +} + +void %{APPNAME}::fileOpen() +{ + // this slot is called whenever the File->Open menu is selected, + // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar + // button is clicked +/* + // this brings up the generic open dialog + KURL url = KURLRequesterDlg::getURL(QString::null, this, i18n("Open Location") ); +*/ + // standard filedialog + KURL url = KFileDialog::getOpenURL(QString::null, QString::null, this, i18n("Open Location")); + if (!url.isEmpty()) + m_view->openURL(url); +} + +void %{APPNAME}::fileSave() +{ + // this slot is called whenever the File->Save menu is selected, + // the Save shortcut is pressed (usually CTRL+S) or the Save toolbar + // button is clicked + + // save the current file +} + +void %{APPNAME}::fileSaveAs() +{ + // this slot is called whenever the File->Save As menu is selected, + KURL file_url = KFileDialog::getSaveURL(); + if (!file_url.isEmpty() && file_url.isValid()) + { + // save your info, here + } +} + +void %{APPNAME}::filePrint() +{ + // this slot is called whenever the File->Print menu is selected, + // the Print shortcut is pressed (usually CTRL+P) or the Print toolbar + // button is clicked + if (!m_printer) m_printer = new KPrinter; + if (m_printer->setup(this)) + { + // setup the printer. with Qt, you always "print" to a + // QPainter.. whether the output medium is a pixmap, a screen, + // or paper + QPainter p; + p.begin(m_printer); + + // we let our view do the actual printing + QPaintDeviceMetrics metrics(m_printer); + m_view->print(&p, metrics.height(), metrics.width()); + + // and send the result to the printer + p.end(); + } +} + +void %{APPNAME}::optionsPreferences() +{ + // popup some sort of preference dialog, here + %{APPNAME}Preferences dlg; + if (dlg.exec()) + { + // redo your settings + } +} + +void %{APPNAME}::changeStatusbar(const QString& text) +{ + // display the text on the statusbar + statusBar()->message(text); +} + +void %{APPNAME}::changeCaption(const QString& text) +{ + // display the text on the caption + setCaption(text); +} +#include "%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/kapp/app.desktop b/languages/cpp/app_templates/kapp/app.desktop new file mode 100644 index 00000000..7389904a --- /dev/null +++ b/languages/cpp/app_templates/kapp/app.desktop @@ -0,0 +1,44 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} %i -caption "%c" +Icon=%{APPNAMELC} +Type=Application +X-DocPath=%{APPNAMELC}/%{APPNAMELC}.html +Comment=A KDE KPart Application +Comment[br]=Ur meziant Kpart evit KDE +Comment[ca]=Una aplicació KPart per al KDE +Comment[cy]=Cymhwysiad KPart KDE +Comment[da]=Et KDE KPart-program +Comment[de]=Eine auf der Komponententechnik KPart basierende KDE-Anwendung +Comment[el]=Μια εφαρμογή KPart του KDE +Comment[es]=Una aplicación KPart de KDE +Comment[et]=KDE KPart rakendus +Comment[eu]=KDE KPart aplikazio bat +Comment[fa]=یک کاربرد KDE KPart +Comment[fr]=Une application KPart pour KDE +Comment[ga]=Feidhmchlár KPart KDE +Comment[gl]=Unha aplicación KPart de KDE +Comment[hi]=एक केडीई के-पार्ट अनुप्रयोग +Comment[hu]=KPart-alapú KDE-alkalmazás +Comment[is]=KDE KPart forrit +Comment[it]=Applicazione KPart di KDE +Comment[ja]=KDE KPart アプリケーション +Comment[lt]=KDE KPart programa +Comment[nds]=En KPart-Deelprogramm för KDE +Comment[ne]=एउटा केडीई KPart अनुप्रयोग +Comment[nl]=Een KDE KPart-toepassing +Comment[pl]=Osadzalny element KPart KDE +Comment[pt]=Uma Aplicação KPart do KDE +Comment[pt_BR]=Um Aplicativo KPart do KDE +Comment[ru]=Приложение KPart для KDE +Comment[sk]=KDE KPart aplikácia +Comment[sl]=Program KPart za KDE +Comment[sr]=KDE KPart програм +Comment[sr@Latn]=KDE KPart program +Comment[sv]=Ett KDE Kpart-program +Comment[ta]=கெடி கெபார்ட் பயன்பாடு +Comment[tg]=Ба кор андохтани KPart барои KDE +Comment[tr]=Bir KDE KPart Uygulaması +Comment[zh_CN]=一个 KDE KPart 应用程序 +Comment[zh_TW]=KDE KPart 應用程式 +Terminal=false diff --git a/languages/cpp/app_templates/kapp/app.h b/languages/cpp/app_templates/kapp/app.h new file mode 100644 index 00000000..45c65f4b --- /dev/null +++ b/languages/cpp/app_templates/kapp/app.h @@ -0,0 +1,89 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "%{APPNAMELC}view.h" + +class KPrinter; +class KURL; + +/** + * This class serves as the main window for %{APPNAME}. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAME} : public KMainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); + + /** + * Use this method to load whatever file/URL you have + */ + void load(const KURL& url); + +protected: + /** + * Overridden virtuals for Qt drag 'n drop (XDND) + */ + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dropEvent(QDropEvent *event); + +protected: + /** + * This function is called when it is time for the app to save its + * properties for session management purposes. + */ + void saveProperties(KConfig *); + + /** + * This function is called when this app is restored. The KConfig + * object points to the session management config file that was saved + * with @ref saveProperties + */ + void readProperties(KConfig *); + + +private slots: + void fileNew(); + void fileOpen(); + void fileSave(); + void fileSaveAs(); + void filePrint(); + void optionsPreferences(); + + void changeStatusbar(const QString& text); + void changeCaption(const QString& text); + +private: + void setupAccel(); + void setupActions(); + +private: + %{APPNAME}View *m_view; + + KPrinter *m_printer; +}; + +#endif // _%{APPNAMEUC}_H_ + diff --git a/languages/cpp/app_templates/kapp/app.kdevelop b/languages/cpp/app_templates/kapp/app.kdevelop new file mode 100644 index 00000000..07cf3f0f --- /dev/null +++ b/languages/cpp/app_templates/kapp/app.kdevelop @@ -0,0 +1,168 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + . + false + + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + false + + + + + + + false + 1 + false + + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + true + false + false + true + + + false + true + + + + + + + + + + + + -f + + -dP + + -f + -u3 -p + + + + + + + false + + + .h + .cpp + true + + + + true + 2 + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kapp/app.kdevses b/languages/cpp/app_templates/kapp/app.kdevses new file mode 100644 index 00000000..dcd1c8c1 --- /dev/null +++ b/languages/cpp/app_templates/kapp/app.kdevses @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/languages/cpp/app_templates/kapp/app_client.cpp b/languages/cpp/app_templates/kapp/app_client.cpp new file mode 100644 index 00000000..5c062077 --- /dev/null +++ b/languages/cpp/app_templates/kapp/app_client.cpp @@ -0,0 +1,26 @@ +%{CPP_TEMPLATE} + +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + KApplication app(argc, argv, "%{APPNAMELC}_client", false); + + // get our DCOP client and attach so that we may use it + DCOPClient *client = app.dcopClient(); + client->attach(); + + // do a 'send' for now + QByteArray data; + QDataStream ds(data, IO_WriteOnly); + if (argc > 1) + ds << QString(argv[1]); + else + ds << QString("http://www.kde.org"); + client->send("%{APPNAMELC}", "%{APPNAME}Iface", "openURL(QString)", data); + + return app.exec(); +} diff --git a/languages/cpp/app_templates/kapp/appiface.h b/languages/cpp/app_templates/kapp/appiface.h new file mode 100644 index 00000000..4a24ae7f --- /dev/null +++ b/languages/cpp/app_templates/kapp/appiface.h @@ -0,0 +1,17 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}IFACE_H_ +#define _%{APPNAMEUC}IFACE_H_ + +#include + +class %{APPNAME}Iface : virtual public DCOPObject +{ + K_DCOP +public: + +k_dcop: + virtual void openURL(QString url) = 0; +}; + +#endif // _%{APPNAMEUC}IFACE_H_ diff --git a/languages/cpp/app_templates/kapp/appui.rc b/languages/cpp/app_templates/kapp/appui.rc new file mode 100644 index 00000000..ceb4f14e --- /dev/null +++ b/languages/cpp/app_templates/kapp/appui.rc @@ -0,0 +1,8 @@ + + + + C&ustom + + + + diff --git a/languages/cpp/app_templates/kapp/appview.cpp b/languages/cpp/app_templates/kapp/appview.cpp new file mode 100644 index 00000000..a57adbf3 --- /dev/null +++ b/languages/cpp/app_templates/kapp/appview.cpp @@ -0,0 +1,107 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}view.h" + +#include +#include + +#include + +#include +#include +#include +#include +#include + +%{APPNAME}View::%{APPNAME}View(QWidget *parent) + : QWidget(parent), + DCOPObject("%{APPNAME}Iface") +{ + // setup our layout manager to automatically add our widgets + QHBoxLayout *top_layout = new QHBoxLayout(this); + top_layout->setAutoAdd(true); + + // we want to look for all components that satisfy our needs. the + // trader will actually search through *all* registered KDE + // applications and components -- not just KParts. So we have to + // specify two things: a service type and a constraint + // + // the service type is like a mime type. we say that we want all + // applications and components that can handle HTML -- 'text/html' + // + // however, by itself, this will return such things as Netscape.. + // not what we wanted. so we constrain it by saying that the + // string 'KParts/ReadOnlyPart' must be found in the ServiceTypes + // field. with this, only components of the type we want will be + // returned. + KTrader::OfferList offers = KTrader::self()->query("text/html", "'KParts/ReadOnlyPart' in ServiceTypes"); + + KLibFactory *factory = 0; + // in theory, we only care about the first one.. but let's try all + // offers just in case the first can't be loaded for some reason + KTrader::OfferList::Iterator it(offers.begin()); + for( ; it != offers.end(); ++it) + { + KService::Ptr ptr = (*it); + + // we now know that our offer can handle HTML and is a part. + // since it is a part, it must also have a library... let's try to + // load that now + factory = KLibLoader::self()->factory( ptr->library() ); + if (factory) + { + m_html = static_cast(factory->create(this, ptr->name(), "KParts::ReadOnlyPart")); + break; + } + } + + // if our factory is invalid, then we never found our component + // and we might as well just exit now + if (!factory) + { + KMessageBox::error(this, i18n("Could not find a suitable HTML component")); + return; + } + + connect(m_html, SIGNAL(setWindowCaption(const QString&)), + this, SLOT(slotSetTitle(const QString&))); + connect(m_html, SIGNAL(setStatusBarText(const QString&)), + this, SLOT(slotOnURL(const QString&))); + +} + +%{APPNAME}View::~%{APPNAME}View() +{ +} + +void %{APPNAME}View::print(QPainter *p, int height, int width) +{ + // do the actual printing, here + // p->drawText(etc..) +} + +QString %{APPNAME}View::currentURL() +{ + return m_html->url().url(); +} + +void %{APPNAME}View::openURL(QString url) +{ + openURL(KURL(url)); +} + +void %{APPNAME}View::openURL(const KURL& url) +{ + m_html->openURL(url); +} + +void %{APPNAME}View::slotOnURL(const QString& url) +{ + emit signalChangeStatusbar(url); +} + +void %{APPNAME}View::slotSetTitle(const QString& title) +{ + emit signalChangeCaption(title); +} +#include "%{APPNAMELC}view.moc" diff --git a/languages/cpp/app_templates/kapp/appview.h b/languages/cpp/app_templates/kapp/appview.h new file mode 100644 index 00000000..ae0c6b6d --- /dev/null +++ b/languages/cpp/app_templates/kapp/appview.h @@ -0,0 +1,77 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}VIEW_H_ +#define _%{APPNAMEUC}VIEW_H_ + +#include +#include +#include <%{APPNAMELC}iface.h> + +class QPainter; +class KURL; + +/** + * This is the main view class for %{APPNAME}. Most of the non-menu, + * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go + * here. + * + * This %{APPNAMELC} uses an HTML component as an example. + * + * @short Main view + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAME}View : public QWidget, public %{APPNAME}Iface +{ + Q_OBJECT +public: + /** + * Default constructor + */ + %{APPNAME}View(QWidget *parent); + + /** + * Destructor + */ + virtual ~%{APPNAME}View(); + + /** + * Random 'get' function + */ + QString currentURL(); + + /** + * Random 'set' function accessed by DCOP + */ + virtual void openURL(QString url); + + /** + * Random 'set' function + */ + virtual void openURL(const KURL& url); + + /** + * Print this view to any medium -- paper or not + */ + void print(QPainter *, int height, int width); + +signals: + /** + * Use this signal to change the content of the statusbar + */ + void signalChangeStatusbar(const QString& text); + + /** + * Use this signal to change the content of the caption + */ + void signalChangeCaption(const QString& text); + +private slots: + void slotOnURL(const QString& url); + void slotSetTitle(const QString& title); + +private: + KParts::ReadOnlyPart *m_html; +}; + +#endif // _%{APPNAMEUC}VIEW_H_ diff --git a/languages/cpp/app_templates/kapp/kapp.kdevtemplate b/languages/cpp/app_templates/kapp/kapp.kdevtemplate new file mode 100644 index 00000000..7865c973 --- /dev/null +++ b/languages/cpp/app_templates/kapp/kapp.kdevtemplate @@ -0,0 +1,253 @@ +# KDE Config File +[General] +Name=Application framework +Name[ca]=Infraestructura d'aplicacions +Name[da]=Programskelet +Name[de]=Anwendungsgrundgerüst +Name[el]=Πλαίσιο εφαρμογής +Name[es]=Infraestructura de aplicación +Name[et]=Rakenduse raamistik +Name[eu]=Aplikazioen lan-markoa +Name[fa]=چارچوب کاربرد +Name[fr]=Infrastructure d'application +Name[ga]=Creatlach feidhmchláir +Name[gl]=Entorno de traballo para aplicación +Name[hu]=Alkalmazás-keretrendszer +Name[it]=Infrastruttura applicativa +Name[ja]=アプリケーションフレームワーク +Name[nds]=Programmrahmenwark +Name[ne]=अनुप्रयोग फ्रेमवर्क +Name[nl]=Applicationframework +Name[pl]=Szablon programu +Name[pt]=Plataforma de aplicações +Name[pt_BR]=Plataforma de aplicações +Name[ru]=Приложение KDE +Name[sk]=Aplikačný framework +Name[sl]=Ogrodje programa +Name[sr]=Радни оквир програма +Name[sr@Latn]=Radni okvir programa +Name[sv]=Programramverk +Name[tr]=Uygulama Çatısı +Name[zh_CN]=应用程序框架 +Name[zh_TW]=應用程式框架 +Icon=kapp.png +Category=C++/KDE +Comment=Generates a simple KDE application with one toplevel window, menus and toolbars. A DCOP interface is also provided, so that your application can provide a scripting interface +Comment[ca]=Genera una simple aplicació per al KDE amb una finestra principal, menús i barres d'eines. També es proveeix la interfície DCOP, de manera que la vostra aplicació podrà proveir d'una interfície per a scripts +Comment[da]=Genererer et simpelt KDE program med et vindue på topniveau, menuer og værktøjslinjer. Der sørges også for en DCOP-grænseflade, så dit program kan sørge for en script-grænseflade +Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Toplevel-Fenster, Menüs und Werkzeugleisten. Dazu kommt eine DCOP-Schnittstelle, so dass Ihre Anwendung eine Schnittstelle für Skripte anbieten kann. +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα ανώτερο παράθυρο, μενού και γραμμές εργαλείων. Μια διασύνδεση DCOP προσφέρεται επίσης, έτσι ώστε η εφαρμογή σας να προσφέρει ένα περιβάλλον γραφής σεναρίων +Comment[es]=Genera una sencilla aplicación de KDE con una ventana de nivel superior, menús y barras de herramientas. También se proporciona una interfaz DCOP para que su aplicación pueda proporcionar una interfaz para guiones de órdenes. +Comment[et]=Lihtsa KDE rakenduse loomine ühe tipptaseme akna, menüüde ja tööriistaribadega. Lisatakse ka DCOP-liides, mis võimaldab pakkuda rakenduses ka skriptikeelte tuge. +Comment[eu]=KDE aplikazio sinple bat sortzen du menu eta tresna-barradun goi-mailako lehio batekin. DCOP interfaze bat ere eskeintzen zaio aplikazioari, zure aplikazioak script interfaze bat izan dezan +Comment[fa]=یک کاربرد سادۀ KDE با یک پنجرۀ سطح بالا، گزینگان و میله ابزارها تولید می‌کند. همچنین یک واسط DCOP فراهم است. بنابراین، کاربرد شما یک واسط دست‌نوشته‌ای را می‌تواند فراهم کند +Comment[fr]=Génère une application KDE simple comprenant une fenêtre de premier niveau, des menus et des barres d'outils. Une interface DCOP est également prévue, afin que votre application puisse offrir une interface de scriptage +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le príomhfhuinneog amháin, roghchláir agus barraí uirlisí. Soláthraítear comhéadan DCOP freisin, d'fhonn is féidir comhéadan scriptithe a chur ar fáil +Comment[gl]=Xera unha aplicación KDE sinxela cunha xanela principal, menús e barras de ferramentas. Tamén se proporciona unha interface DCOP de modo que a súa aplicación poida proveer unha interface de scripting. +Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy főablakkal, menükkel és eszköztárakkal. DCOP-felület is létre lesz hozva, ezért az alkalmazás szkriptelési felületet is biztosíthat. +Comment[it]=Genera una semplice applicazione KDE con una finestra toplevel, menu e barre degli strumenti. È anche fornita un'interfaccia DCOP così l'applicazione avrà un'interfaccia per lo scripting +Comment[ja]=簡単な KDE アプリケーションを作成します。アプリケーションには、トップレベルのウィンドウ、メニュー、ツールバーがあります。スクリプト化をサポートするために DCOP のインターフェースも用意してあります。 +Comment[nds]=Stellt en eenfach KDE-Programm mit een böverst Finster, Menüs un Warktüüchbalkens op. Ok warrt noch en DCOP-Koppelsteed praatstellt, so dat Dien Programm en Skriptkoppelsteed anbeden kann +Comment[ne]=एउटा उच्चतह सञ्झ्याल, मेनु र उपकरणपट्टीसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ । DCOP पनि प्रदान गरिन्छ, जसले गर्दा तपाईँको अनुप्रयोगले स्क्रिप्टिङ इन्टरफेस प्रदान गर्न सक्दछ +Comment[nl]=Genereert een eenvoudige KDE-toepassing met één toplevel window, menu's en toolbars. Er wordt ook een DCOP-interface aangeleverd, zodat uw toepassing een scripting interface kan aanleveren. +Comment[pl]=Generuje prosty program dla KDE z oknem, menu i paskami narzędzi. Dostępny jest także interfejs DCOP, więc Twoje programy mogą zawierać interfejs do skryptów +Comment[pt]=Gera uma aplicação simples do KDE com uma janela de topo, menus e barras de ferramentas. Também é oferecida uma interface de DCOP, para que a sua aplicação possa fornecer uma interface de programação +Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela de topo, menus e barras de ferramentas. Também é oferecida uma interface de DCOP, para que a sua aplicação possa fornecer uma interface de programação +Comment[ru]=Создание простого приложения KDE с окном, меню и панелями инструментов. Кроме того, в нём содержится интерфейс DCOP для автоматизации работы с помощью пользовательских скриптов +Comment[sk]=Vygenruje jednoduchú KDE aplikáciu s jedným oknom, menu apanelom nástrojov. Taktiež bude poskytnuté DCOP rozhranie, takže aj aplikáciamôže poskytnúť skriptovacie rozhranie +Comment[sr]=Прави једноставан KDE програм, са једним прозором највишег нивоа, менијима и тракама са алатом. Дат је и DCOP интерфејс, тако да ваш програм може да омогући скриптовање +Comment[sr@Latn]=Pravi jednostavan KDE program, sa jednim prozorom najvišeg nivoa, menijima i trakama sa alatom. Dat je i DCOP interfejs, tako da vaš program može da omogući skriptovanje +Comment[sv]=Skapar ett enkelt KDE-program med ett toppnivåfönster, menyer och verktygsrader. Ett DCOP-gränssnitt tillhandahålls också, så att programmet kan tillhandahålla ett skriptgränssnitt. +Comment[tr]=Bir üst seviye penceresi, menüleri ve araç çubukları olan basit bir KDE uygulaması yaratır. Bir DCOP arayüzü sağlanır, böylece uygulama bir betik arayüzü sağlayabilir. +Comment[zh_CN]=生成一个带一个顶层窗口、菜单和工具栏的简单 KDE 应用程序。另外还提供了 DCOP 接口,这样您的应用也可同时提供脚本接口。 +Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含頂層視窗、選單與工具列。另外提供一個 DCOP 介面,讓您的應用程式可以提供文稿介面。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}view.cpp,%{dest}/src/README +Archive=kapp.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE10] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE11] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE12] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE13] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE14] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE15] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE16] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE17] +Type=install +Source=%{src}/appview.cpp +Dest=%{dest}/src/%{APPNAMELC}view.cpp + +[FILE18] +Type=install +Source=%{src}/appview.h +Dest=%{dest}/src/%{APPNAMELC}view.h + +[FILE19] +Type=install +Source=%{src}/appiface.h +Dest=%{dest}/src/%{APPNAMELC}iface.h + +[FILE20] +Type=install +Source=%{src}/app_client.cpp +Dest=%{dest}/src/%{APPNAMELC}_client.cpp + +[FILE21] +Type=install +Source=%{src}/pref.cpp +Dest=%{dest}/src/pref.cpp + +[FILE22] +Type=install +Source=%{src}/pref.h +Dest=%{dest}/src/pref.h + +[FILE23] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE24] +Type=install +EscapeXML=true +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}ui.rc + +[FILE25] +Type=install +Source=%{src}/README +Dest=%{dest}/src/README + +[MSG] +Type=message +Comment=A KDE Application was created at %{dest} +Comment[ca]=Una aplicació per al KDE ha estat creada a %{dest} +Comment[da]=Et KDE program blev oprettet i %{dest} +Comment[de]=Eine KDE-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή KDE δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación de KDE ha sido creada en %{dest} +Comment[et]=KDE rakendus loodi asukohta %{dest} +Comment[eu]=A KDE aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد KDE در %{dest} فراهم شد +Comment[fr]=Une application KDE a été créée dans %{dest} +Comment[ga]=Cruthaíodh Feidhmchlár KDE ag %{dest} +Comment[gl]=Creouse unha aplicación KDE en %{dest} +Comment[hu]=Létrejött egy KDE-s alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KDE in %{dest} +Comment[ja]=KDE アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KDE-Programm opstellt +Comment[ne]=KDE अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een KDE-toepassing is aangemaakt in %{dest} +Comment[pl]=Program dla KDE został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KDE em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KDE em %{dest} +Comment[ru]=Приложение KDE создано в %{dest} +Comment[sk]=KDE aplikácia bola vytvorená v %{dest} +Comment[sl]=Program za KDE je bil ustvarjen v %{dest} +Comment[sr]=KDE програм је направљен у %{dest} +Comment[sr@Latn]=KDE program je napravljen u %{dest} +Comment[sv]=Ett KDE-program skapades i %{dest} +Comment[tr]=Bir KDE Uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 KDE 应用程序 +Comment[zh_TW]=一個 KDE 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kapp/kapp.png b/languages/cpp/app_templates/kapp/kapp.png new file mode 100644 index 00000000..a421a664 Binary files /dev/null and b/languages/cpp/app_templates/kapp/kapp.png differ diff --git a/languages/cpp/app_templates/kapp/main.cpp b/languages/cpp/app_templates/kapp/main.cpp new file mode 100644 index 00000000..60c161e8 --- /dev/null +++ b/languages/cpp/app_templates/kapp/main.cpp @@ -0,0 +1,61 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE Application"); + +static const char version[] = "%{VERSION}"; + +static KCmdLineOptions options[] = +{ + { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + KApplication app; + + // register ourselves as a dcop client + app.dcopClient()->registerAs(app.name(), false); + + // see if we are starting with session management + if (app.isRestored()) + { + RESTORE(%{APPNAME}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->count() == 0) + { + %{APPNAME} *widget = new %{APPNAME}; + widget->show(); + } + else + { + int i = 0; + for (; i < args->count(); i++) + { + %{APPNAME} *widget = new %{APPNAME}; + widget->show(); + widget->load(args->url(i)); + } + } + args->clear(); + } + + return app.exec(); +} diff --git a/languages/cpp/app_templates/kapp/pref.cpp b/languages/cpp/app_templates/kapp/pref.cpp new file mode 100644 index 00000000..ee647b1c --- /dev/null +++ b/languages/cpp/app_templates/kapp/pref.cpp @@ -0,0 +1,42 @@ +%{CPP_TEMPLATE} + +#include "pref.h" + +#include + +#include +#include + +%{APPNAME}Preferences::%{APPNAME}Preferences() + : KDialogBase(TreeList, i18n("%{APPNAME} Preferences"), + Help|Default|Ok|Apply|Cancel, Ok) +{ + // this is the base class for your preferences dialog. it is now + // a Treelist dialog.. but there are a number of other + // possibilities (including Tab, Swallow, and just Plain) + QFrame *frame; + frame = addPage(i18n("First Page"), i18n("Page One Options")); + m_pageOne = new %{APPNAME}PrefPageOne(frame); + + frame = addPage(i18n("Second Page"), i18n("Page Two Options")); + m_pageTwo = new %{APPNAME}PrefPageTwo(frame); +} + +%{APPNAME}PrefPageOne::%{APPNAME}PrefPageOne(QWidget *parent) + : QFrame(parent) +{ + QHBoxLayout *layout = new QHBoxLayout(this); + layout->setAutoAdd(true); + + new QLabel(i18n("Add something here"), this); +} + +%{APPNAME}PrefPageTwo::%{APPNAME}PrefPageTwo(QWidget *parent) + : QFrame(parent) +{ + QHBoxLayout *layout = new QHBoxLayout(this); + layout->setAutoAdd(true); + + new QLabel(i18n("Add something here"), this); +} +#include "pref.moc" diff --git a/languages/cpp/app_templates/kapp/pref.h b/languages/cpp/app_templates/kapp/pref.h new file mode 100644 index 00000000..11aec821 --- /dev/null +++ b/languages/cpp/app_templates/kapp/pref.h @@ -0,0 +1,37 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}PREF_H_ +#define _%{APPNAMEUC}PREF_H_ + +#include +#include + +class %{APPNAME}PrefPageOne; +class %{APPNAME}PrefPageTwo; + +class %{APPNAME}Preferences : public KDialogBase +{ + Q_OBJECT +public: + %{APPNAME}Preferences(); + +private: + %{APPNAME}PrefPageOne *m_pageOne; + %{APPNAME}PrefPageTwo *m_pageTwo; +}; + +class %{APPNAME}PrefPageOne : public QFrame +{ + Q_OBJECT +public: + %{APPNAME}PrefPageOne(QWidget *parent = 0); +}; + +class %{APPNAME}PrefPageTwo : public QFrame +{ + Q_OBJECT +public: + %{APPNAME}PrefPageTwo(QWidget *parent = 0); +}; + +#endif // _%{APPNAMEUC}PREF_H_ diff --git a/languages/cpp/app_templates/kapp/src-Makefile.am b/languages/cpp/app_templates/kapp/src-Makefile.am new file mode 100644 index 00000000..51cb1973 --- /dev/null +++ b/languages/cpp/app_templates/kapp/src-Makefile.am @@ -0,0 +1,43 @@ +## Makefile.am for %{APPNAMELC} + +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = %{APPNAMELC} %{APPNAMELC}_client + +# set the include path for X, qt and KDE +INCLUDES = $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries) + +# the libraries to link against. +%{APPNAMELC}_LDADD = $(LIB_KFILE) $(LIB_KDEPRINT) + +# which sources should be compiled for %{APPNAMELC} +%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp %{APPNAMELC}view.cpp \ + pref.cpp %{APPNAMELC}iface.skel + +# these are the headers for your project +noinst_HEADERS = %{APPNAMELC}.h %{APPNAMELC}view.h pref.h + +# client stuff +%{APPNAMELC}_client_LDFLAGS = $(KDE_RPATH) $(all_libraries) +%{APPNAMELC}_client_LDADD = $(LIB_KDECORE) +%{APPNAMELC}_client_SOURCES = %{APPNAMELC}_client.cpp + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + +KDE_ICON = AUTO + +# this is where the kdelnk file will go +kdelnkdir = $(kde_appsdir)/Utilities +kdelnk_DATA = %{APPNAMELC}.desktop + +# this is where the XML-GUI resource file goes +rcdir = $(kde_datadir)/%{APPNAMELC} +rc_DATA = %{APPNAMELC}ui.rc diff --git a/languages/cpp/app_templates/kapp/subdirs b/languages/cpp/app_templates/kapp/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kapp/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kateplugin/.kdev_ignore b/languages/cpp/app_templates/kateplugin/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kateplugin/Makefile.am b/languages/cpp/app_templates/kateplugin/Makefile.am new file mode 100644 index 00000000..62da4d60 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin/Makefile.am @@ -0,0 +1,19 @@ +templateName = kateplugin +dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h\ + plugin_app.rc hi16-action-plugin.png \ + hi22-action-plugin.png kateplugin.png \ + plugin.kdevelop subdirs plugin.desktop + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kateplugin/hi16-action-plugin.png b/languages/cpp/app_templates/kateplugin/hi16-action-plugin.png new file mode 100644 index 00000000..e2d7bab8 Binary files /dev/null and b/languages/cpp/app_templates/kateplugin/hi16-action-plugin.png differ diff --git a/languages/cpp/app_templates/kateplugin/hi22-action-plugin.png b/languages/cpp/app_templates/kateplugin/hi22-action-plugin.png new file mode 100644 index 00000000..4082bf10 Binary files /dev/null and b/languages/cpp/app_templates/kateplugin/hi22-action-plugin.png differ diff --git a/languages/cpp/app_templates/kateplugin/kateplugin.kdevtemplate b/languages/cpp/app_templates/kateplugin/kateplugin.kdevtemplate new file mode 100644 index 00000000..767a0a57 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin/kateplugin.kdevtemplate @@ -0,0 +1,213 @@ +# KDE Config File +[General] +Name=Kate plugin +Name[br]=Lugent Kate +Name[ca]=Connector per a Kate +Name[de]=Kate-Modul +Name[el]=Πρόσθετο Kate +Name[es]=Complemento para Kate +Name[eu]=Kate plugina +Name[fa]=وصلۀ Kate +Name[fr]=Module externe pour Kate +Name[ga]=Breiseán Kate +Name[gl]=Extensión para Kate +Name[hu]=Kate-bővítőmodul +Name[it]=Plugin per Kate +Name[ja]=Kate プラグイン +Name[nds]=Kate-Moduul +Name[ne]=केट प्लगइन +Name[nl]=Kate-plugin +Name[pl]=Wtyczka do Kate +Name[pt]='Plugin' do Kate +Name[pt_BR]='Plugin' do Kate +Name[ru]=Модуль Kate +Name[sk]=Kate modul +Name[sl]=Vstavek za Kate +Name[sr]=Прикључак за Kate +Name[sr@Latn]=Priključak za Kate +Name[sv]=Kate-insticksprogram +Name[tr]=Kate eklentisi +Name[zh_CN]=Kate 插件 +Name[zh_TW]=Kate 外掛程式 +Icon=kateplugin.png +Category=C++/KDE +Comment=Generates a plugin for Kate the text editor. +Comment[ca]=Genera un connector per a l'editor de text Kate. +Comment[da]=Genererer et plugin for teksteditoren kate +Comment[de]=Erstellt ein Modul für den Texteditor Kate +Comment[el]=Δημιουργεί ένα πρόσθετο για το Kate τον επεξεργαστή κειμένου. +Comment[es]=Genera un complemento para el editor de texto Kate. +Comment[et]=Plugina loomine tekstiredaktorile Kate. +Comment[eu]=Plugin bat sortzen du Kate testu-editorearentzat. +Comment[fa]=وصله‌ای برای ویرایشگر متن Kate تولید می‌کند. +Comment[fr]=Génère un module externe pour l'éditeur de texte Kate. +Comment[ga]=Cruthaíonn sé seo breiseán le haghaidh eagarthóir téacs Kate. +Comment[gl]=Xera unha extensión para o editor de textos Kate. +Comment[hu]=Létrehoz egy bővítőmodult a Kate szövegszerkesztőhöz. +Comment[it]=Genera un plugin per l'editor di testo Kate. +Comment[ja]=Kate テキストエディタのためのプラグインを作成します +Comment[nds]=Stellt en Moduul för den Texteditor "Kate" op. +Comment[ne]=केट पाठ सम्पादकका लागि प्लगइन उत्पन्न गर्दछ । +Comment[nl]=Genereert een plugin voor de Kate-teksteditor +Comment[pl]=Generuje wtyczkę do edytora tekstu Kate +Comment[pt]=Gera um 'plugin' para o Kate, o editor de texto. +Comment[pt_BR]=Gera um 'plugin' para o Kate, o editor de texto. +Comment[ru]=Создание модуля для текстового редактора Kate. +Comment[sk]=Vygeneruje modul pre textový editor Kate. +Comment[sl]=Ustvari vstavek za urejevalnik besedil Kate. +Comment[sr]=Прави прикључак за уређивач текста Kate. +Comment[sr@Latn]=Pravi priključak za uređivač teksta Kate. +Comment[sv]=Skapar ett insticksprogram för texteditorn Kate. +Comment[tr]=Kate metin düzenleyicisi için bir eklenti yaratır. +Comment[zh_CN]=生成 Kate 文本编辑器的插件。 +Comment[zh_TW]=產生一個 Kate 文字編輯器的外掛程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}.cpp +Archive=kateplugin.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/plugin.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/plugin.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE13] +Type=install +Source=%{src}/plugin_app.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp + +[FILE14] +Type=install +Source=%{src}/plugin_app.h +Dest=%{dest}/src/plugin_%{APPNAMELC}.h + +[FILE15] +Type=install +EscapeXML=true +Source=%{src}/plugin_app.rc +Dest=%{dest}/src/plugin_%{APPNAMELC}.rc + +[FILE16] +Type=install +Source=%{src}/hi16-action-plugin.png +Dest=%{dest}/src/hi16-action-plugin.png +Process=false + +[FILE17] +Type=install +Source=%{src}/hi22-action-plugin.png +Dest=%{dest}/src/hi32-action-plugin.png +Process=false + +[MSG] +Type=message +Comment=A plugin for Kate was created at %{dest} +Comment[ca]=Un connector per a Kate ha estat creat a %{dest} +Comment[da]=Et plugin for Kate blev oprettet på %{dest} +Comment[de]=Ein Modul für Kate wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο για το Kate δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento para Kate ha sido creado en %{dest} +Comment[et]=Kate plugin loodi asukohta %{dest} +Comment[eu]=Kate plugin bat sortu da hemen: %{dest} +Comment[fa]=وصله‌ای برای Kate در %{dest} ایجاد شد +Comment[fr]=Un module externe pour Kate a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán Kate ag %{dest} +Comment[gl]=Creouse unha extensión para Kate en %{dest} +Comment[hu]=Létrejött egy Kate-bővítőmodul itt: %{dest} +Comment[it]=È stato creato un plugin per Kate in %{dest} +Comment[ja]=Kate のプラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Moduul för "Kate" opstellt +Comment[ne]=केटका लागि प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een plugin voor Kate is aangemaakt in %{dest} +Comment[pl]=Wtyczka dla Kate została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' para o Kate em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' para o Kate em %{dest} +Comment[ru]=Модуль Kate создан в %{dest} +Comment[sk]=Modul pre Kate bol vytvorený v %{dest} +Comment[sl]=Vstavek za Kate je bil ustvarjen v %{dest} +Comment[sr]=Прикључак за Kate направљен је у %{dest} +Comment[sr@Latn]=Priključak za Kate napravljen je u %{dest} +Comment[sv]=Ett insticksprogram för Kate skapades i %{dest} +Comment[tr]=Kate için bir eklenti %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 Kate 的插件 +Comment[zh_TW]=一個 Kate 外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kateplugin/kateplugin.png b/languages/cpp/app_templates/kateplugin/kateplugin.png new file mode 100644 index 00000000..b442a706 Binary files /dev/null and b/languages/cpp/app_templates/kateplugin/kateplugin.png differ diff --git a/languages/cpp/app_templates/kateplugin/plugin.desktop b/languages/cpp/app_templates/kateplugin/plugin.desktop new file mode 100644 index 00000000..761ac763 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin/plugin.desktop @@ -0,0 +1,76 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=lib%{APPNAMELC}plugin +X-Kate-Version=2.2 +Name=My First Kate Plugin +Name[br]=Ma lugent Kate kentañ +Name[ca]=El meu primer connector per a Kate +Name[cy]=F'ategyn cyntaf Kate +Name[da]=Mit første Kate plugin +Name[de]=Mein erstes Kate-Modul +Name[el]=Το πρώτο μου πρόσθετο για το Kate +Name[es]=Mi primer complemento para Kate +Name[et]=Minu esimene Kate plugin +Name[eu]=Nire lehenengo Kate plugina +Name[fa]=اولین وصلۀ Kate من +Name[fr]=Mon premier module externe pour Kate +Name[ga]=Mo Chéad Bhreiseán Kate +Name[gl]=A miña primeira extensión para Kate +Name[hu]=Mintapélda Kate-bővítőmodulra +Name[it]=Il mio primo plugin di Kate +Name[ja]=はじめての Kate プラグイン +Name[ms]=Plugin Kate Pertama Saya +Name[nds]=Mien eerst Kate-Moduul +Name[ne]=मेरो पहिलो केट प्लगइन +Name[nl]=Mijn eerste Kate-plugin +Name[pl]=Moja pierwsza wtyczka do Kate +Name[pt]=O Meu Primeiro 'Plugin' para o Kate +Name[pt_BR]=Meu Primeiro Plug-in do Kate +Name[ru]=Мой первый модуль к Kate +Name[sk]=Môj prvý Kate modul +Name[sl]=Moj prvi vstavek za Kate +Name[sr]=Мој први прикључак за Kate +Name[sr@Latn]=Moj prvi priključak za Kate +Name[sv]=Mitt första insticksprogram för Kate +Name[tr]=İlk Kate Eklentim +Name[zh_CN]=我的第一个 Kate 插件 +Name[zh_TW]=我的第一個 Kate 外掛程式 +Comment=Your short description about the plugin goes here +Comment[ca]=Aquí va la descripció curta referent al connector +Comment[cy]=Mae eich disgrifiad byr am yr ategyn yn mynd yma +Comment[da]=Din korte beskrivelse af plugin skal være her +Comment[de]=Hierhin gehört eine kurze Beschreibung des Moduls +Comment[el]=Η σύντομη περιγραφή σας σχετικά με το πρόσθετο πηγαίνει εδώ +Comment[es]=Aquí va la descripción corta sobre el complemento +Comment[et]=Sinu plugina lühikirjeldus +Comment[eu]=Hemen dihoa plugin-aren buruzko zure deskribapen motza +Comment[fa]=توصیف کوتاه شما در مورد وصله در اینجا می‌آید +Comment[fr]=Une courte description de votre module externe s'insère ici +Comment[ga]=Cuir do chur síos gearr ar an mbreiseán anseo +Comment[gl]=A súa descrición breve sobre a extensión vai aquí. +Comment[hi]=प्लगइन के बारे में आपका छोटा सा वर्णन यहाँ जाएगा +Comment[hu]=Itt lehet egy rövid leírást adni a bővítőmodulról +Comment[is]=Hér ætti að vera smá lýsing á viðbótinni +Comment[it]=La tua breve descrizione sui plugin va qui +Comment[ja]=プラグインに関する短い説明をここに記述します。 +Comment[lt]=Čia turėtų būti trumpas priedo aprašymas +Comment[ms]=Huraian ringkas anda tentang plugin anda di sini +Comment[nds]=Hier kannst Du en kort Moduulbeschrieven ingeven +Comment[ne]=प्लगइनका बारेमा तपाईँको छोटो भनाइ यस्तो छ +Comment[nl]=Hier kunt u een korte omschrijving opgeven +Comment[pl]=Tu powinien się pojawić krótki opis wtyczki +Comment[pt]=Aqui deverá colocar uma descrição do 'plugin' +Comment[pt_BR]=Sua descrição sumária sobre o plug-in vai aqui +Comment[ru]=Здесь располагается краткое описание модуля +Comment[sk]=Sem vložte krátky popis modulu +Comment[sl]=Tukaj je kratek opis o vstavku +Comment[sr]=Овде иде ваш кратак опис прикључка +Comment[sr@Latn]=Ovde ide vaš kratak opis priključka +Comment[sv]=En kort beskrivningen av vad insticksprogrammet gör +Comment[ta]=உங்கள் சொருகின் சிறு விவரம் இங்கிருக்கும் +Comment[tg]=Дар инҷо тасвири кӯтоҳи модул ҷойгир аст +Comment[tr]=Eklenti hakkında kısa bir tanımı buraya yazın. +Comment[zh_CN]=关于这个插件的简短描述 +Comment[zh_TW]=您對此外掛程式的描述寫在這裡 +author=%{AUTHOR}, %{EMAIL} diff --git a/languages/cpp/app_templates/kateplugin/plugin.kdevelop b/languages/cpp/app_templates/kateplugin/plugin.kdevelop new file mode 100644 index 00000000..9f0b4ede --- /dev/null +++ b/languages/cpp/app_templates/kateplugin/plugin.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + src/lib%{APPNAMELC}plugin.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kateplugin/plugin_app.cpp b/languages/cpp/app_templates/kateplugin/plugin_app.cpp new file mode 100644 index 00000000..9fd4a694 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin/plugin_app.cpp @@ -0,0 +1,89 @@ +%{CPP_TEMPLATE} + +#include "plugin_%{APPNAMELC}.h" + +#include +#include +#include + +class PluginView : public KXMLGUIClient +{ + friend class KatePlugin%{APPNAME}; + + public: + Kate::MainWindow *win; +}; + +extern "C" +{ + void* init_lib%{APPNAMELC}plugin() + { + KGlobal::locale()->insertCatalogue("kate%{APPNAMELC}"); + return new KatePluginFactory; + } +} + +KatePluginFactory::KatePluginFactory() +{ + s_instance = new KInstance( "kate" ); +} + +KatePluginFactory::~KatePluginFactory() +{ + delete s_instance; +} + +QObject* KatePluginFactory::createObject( QObject* parent, const char* name, const char*, const QStringList & ) +{ + return new KatePlugin%{APPNAME}( parent, name ); +} + +KInstance* KatePluginFactory::s_instance = 0L; + +KatePlugin%{APPNAME}::KatePlugin%{APPNAME}( QObject* parent, const char* name ) + : Kate::Plugin ( (Kate::Application*)parent, name ) +{ +} + +KatePlugin%{APPNAME}::~KatePlugin%{APPNAME}() +{ +} + +void KatePlugin%{APPNAME}::addView(Kate::MainWindow *win) +{ + /// @todo doesn't this have to be deleted? + PluginView *view = new PluginView (); + + (void) new KAction ( i18n("Insert Hello World"), 0, this, + SLOT( slotInsertHello() ), view->actionCollection(), + "edit_insert_%{APPNAMELC}" ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile("plugins/%{APPNAMELC}/plugin_%{APPNAMELC}.rc"); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} +void KatePlugin%{APPNAME}::removeView(Kate::MainWindow *win) +{ + for (uint z=0; z < m_views.count(); z++) + if (m_views.at(z)->win == win) + { + PluginView *view = m_views.at(z); + m_views.remove (view); + win->guiFactory()->removeClient (view); + delete view; + } +} + +void KatePlugin%{APPNAME}::slotInsertHello() +{ + Kate::View *kv = application()->activeMainWindow()->viewManager()->activeView(); + + if (kv) + kv->insertText ("Hello World"); +} + +#include "plugin_%{APPNAMELC}.moc" + diff --git a/languages/cpp/app_templates/kateplugin/plugin_app.h b/languages/cpp/app_templates/kateplugin/plugin_app.h new file mode 100644 index 00000000..8cc5b237 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin/plugin_app.h @@ -0,0 +1,49 @@ +%{H_TEMPLATE} + +#ifndef _PLUGIN_%{APPNAMEUC}_H_ +#define _PLUGIN_%{APPNAMEUC}_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +class KatePluginFactory : public KLibFactory +{ + Q_OBJECT + + public: + KatePluginFactory(); + virtual ~KatePluginFactory(); + + virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, const char* name = "QObject", const QStringList &args = QStringList() ); + + private: + static KInstance* s_instance; +}; + +class KatePlugin%{APPNAME} : public Kate::Plugin, Kate::PluginViewInterface +{ + Q_OBJECT + + public: + KatePlugin%{APPNAME}( QObject* parent = 0, const char* name = 0 ); + virtual ~KatePlugin%{APPNAME}(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + public slots: + void slotInsertHello(); + + private: + QPtrList m_views; +}; + +#endif // _PLUGIN_%{APPNAMEUC}_H_ diff --git a/languages/cpp/app_templates/kateplugin/plugin_app.rc b/languages/cpp/app_templates/kateplugin/plugin_app.rc new file mode 100644 index 00000000..fe98416f --- /dev/null +++ b/languages/cpp/app_templates/kateplugin/plugin_app.rc @@ -0,0 +1,11 @@ + + + + &Tools + + + + + + + diff --git a/languages/cpp/app_templates/kateplugin/src-Makefile.am b/languages/cpp/app_templates/kateplugin/src-Makefile.am new file mode 100644 index 00000000..88ba33a8 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin/src-Makefile.am @@ -0,0 +1,20 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +KDE_ICON = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = lib%{APPNAMELC}plugin.la + +lib%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp +lib%{APPNAMELC}plugin_la_LIBADD = -lkateinterfaces +lib%{APPNAMELC}plugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +pluginsdir = $(kde_datadir)/kate/plugins/%{APPNAMELC} +plugins_DATA = plugin_%{APPNAMELC}.rc + +kde_services_DATA = %{APPNAMELC}.desktop + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/kateplugin/subdirs b/languages/cpp/app_templates/kateplugin/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kateplugin2/.kdev_ignore b/languages/cpp/app_templates/kateplugin2/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kateplugin2/Makefile.am b/languages/cpp/app_templates/kateplugin2/Makefile.am new file mode 100644 index 00000000..29aea978 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h \ + plugin_app.rc hi16-action-plugin.png hi22-action-plugin.png \ + kateplugin2.png plugin.kdevelop subdirs plugin.desktop + +templateName = kateplugin2 + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png b/languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png new file mode 100644 index 00000000..e2d7bab8 Binary files /dev/null and b/languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png differ diff --git a/languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png b/languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png new file mode 100644 index 00000000..4082bf10 Binary files /dev/null and b/languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png differ diff --git a/languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate b/languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate new file mode 100644 index 00000000..b98ab94f --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate @@ -0,0 +1,214 @@ +# KDE Config File +[General] +Name=Kate plugin with config page +Name[ca]=Connector per a Kate amb pàgina de configuració +Name[da]=Kate plugin med indstillingsside +Name[de]=Kate-Modul mit Einstellungsseite +Name[el]=Πρόσθετο Kate με σελίδα ρύθμισης +Name[es]=Complemento para Kate con página de configuración +Name[et]=Kate plugin seadistustedialoogiga +Name[eu]=Konfigurazio orridun Kate plugina +Name[fa]=وصلۀ Kate با صفحۀ پیکربندی +Name[fr]=Module externe pour Kate comprenant une page de configuration +Name[ga]=Breiseán Kate le leathanach cumraíochta +Name[gl]=Extensión para Kate con páxina de configuración +Name[hu]=Kate-bővítőmodul beállítólappal +Name[it]=Plugin per Kate con pagina di configurazione +Name[ja]=設定ページのある Kate プラグイン +Name[nds]=Kate-Moduul mit Instellensiet +Name[ne]=कन्फिग पृष्ठसँग केट प्लगइन +Name[nl]=Kate-plugin met config page +Name[pl]=Wtyczka do Kate ze stroną konfiguracyjną +Name[pt]='Plugin' do Kate com página de configuração +Name[pt_BR]='Plugin' do Kate com página de configuração +Name[ru]=Модуль Kate с диалогом настройки +Name[sk]=Kate modul s konfiguračnou stránkou +Name[sl]=Vstavek z nastavitveno stranjo za Kate +Name[sr]=Прикључак за Kate са страном за подешавања +Name[sr@Latn]=Priključak za Kate sa stranom za podešavanja +Name[sv]=Kate-insticksprogram med inställningssida +Name[tr]=Ayar sayfası olan bir Kate eklentisi +Name[zh_CN]=带配置页的 Kate 插件 +Name[zh_TW]=Kate 外掛程式,內含設定頁面 +Icon=kateplugin2.png +Category=C++/KDE +Comment=Generates a plugin with config page for Kate the text editor. +Comment[ca]=Genera un connector amb pàgina de configuració per a l'editor de text Kate. +Comment[da]=Generere et plugin med indstillingsside for teksteditoren Kate. +Comment[de]=Erstellt ein Modul mit Konfigurationsseite für den Texteditor Kate. +Comment[el]=Δημιουργεί ένα πρόσθετο με σελίδα ρύθμισης για το Kate τον επεξεργαστή κειμένου. +Comment[es]=Genera un complemento con página de configuración para el editor de texto Kate. +Comment[et]=Seadistustedialoogiga plugina loomine tekstiredaktorile Kate. +Comment[eu]=Konfigurazio orridun Kate plugin bat sortzen du. +Comment[fa]=وصله‌ای با صفحۀ پیکربندی ویرایشگر متن Kate تولید می‌کند. +Comment[fr]=Génère un module externe comprenant une page de configuration pour l'éditeur de texte Kate. +Comment[ga]=Cruthaíodh breiseán le leathanach cumraíochta le haghaidh eagarthóra téacs Kate. +Comment[gl]=Xera unha extensión con páxina de configuración para o editor de textos Kate. +Comment[hu]=Létrehoz egy bővítőmodult beállítólappal a Kate szövegszerkesztőhöz. +Comment[it]=Genera un plugin con pagina di configurazione per l'editor di testo Kate. +Comment[ja]=テキストエディタ Kate のための設定ページのあるプラグインを作成します。 +Comment[nds]=Stellt en Moduul mit Instellensiet för den Texteditor "Kate" op. +Comment[ne]=केट पाठ सम्पादकका लागि कन्फिग पृष्ठसँग प्लगइन उत्पन्न गर्दछ । +Comment[nl]=Genereert een plugin met een config page voor de Kate-teksteditor +Comment[pl]=Generuje wtyczke wraz ze stroną konfiguracyjną do edytora tekstu Kate. +Comment[pt]=Gera um 'plugin' com uma página de configuração para o Kate, o editor de texto. +Comment[pt_BR]=Gera um 'plugin' com uma página de configuração para o Kate, o editor de texto. +Comment[ru]=Создание модуля для текстового редактора Kate с диалогом настройки. +Comment[sk]=Vygeneruje modul s konfiguračnou stránkou pre textový editor Kate. +Comment[sl]=Ustvari vstavek z nastavitveno stranjo za urejevalnik besedil Kate. +Comment[sr]=Прави прикључак са страном за подешавање за уређивач текста Kate. +Comment[sr@Latn]=Pravi priključak sa stranom za podešavanje za uređivač teksta Kate. +Comment[sv]=Skapar ett insticksprogram för texteditorn Kate med en inställningssida. +Comment[tr]=Kate metin düzenleyicisi için ayar sayfası olan bir eklenti yaratır. +Comment[zh_CN]=生成带配置页的 Kate 文本编辑器插件。 +Comment[zh_TW]=產生一個 Kate 文字編輯器的外掛程式,內含設定頁面。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}.cpp +Archive=kateplugin2.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/plugin.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/plugin.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE13] +Type=install +Source=%{src}/plugin_app.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp + +[FILE14] +Type=install +Source=%{src}/plugin_app.h +Dest=%{dest}/src/plugin_%{APPNAMELC}.h + +[FILE15] +Type=install +EscapeXML=true +Source=%{src}/plugin_app.rc +Dest=%{dest}/src/plugin_%{APPNAMELC}.rc + +[FILE16] +Type=install +Source=%{src}/hi16-action-plugin.png +Dest=%{dest}/src/hi16-action-plugin.png +Process=false + +[FILE17] +Type=install +Source=%{src}/hi22-action-plugin.png +Dest=%{dest}/src/hi32-action-plugin.png +Process=false + +[MSG] +Type=message +Comment=A plugin for Kate with a config page was created in %{dest} +Comment[ca]=Un connector per a Kate amb pàgina de configuració ha estat creat en %{dest} +Comment[da]=Et plugin for Kate med en indstillingsside blev oprettet i %{dest} +Comment[de]=Ein Modul für Kate mit Konfigurationsseite wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο για το Kate με μια σελίδα ρύθμισης δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento para Kate con una página de configuración ha sido creado en %{dest} +Comment[et]=Seadistustedialoogiga Kate plugin loodi asukohta %{dest} +Comment[eu]=Konfigurazio orridun Kate plugin bat sortu da hemen:%{dest} +Comment[fa]=وصله‌ای برای Kate با یک صفحۀ پیکربندی در %{dest} ایجاد شد +Comment[fr]=Un module externe pour Kate comprenant une page de configuration a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán Kate le leathanach cumraíochta i %{dest} +Comment[gl]=Creouse unha extensión para Kate con páxina de configuración en %{dest} +Comment[hu]=Létrejött egy Kate-bővítőmodul (beállítólappal) itt: %{dest} +Comment[it]=È stato creato un plugin per Kate con pagina di configurazione in %{dest} +Comment[ja]=設定ページのある Kate プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Moduul för Kate mit Instellensiet opstellt +Comment[ne]=कन्फिग पृष्ठसँग केटका लागि प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een plugin voor Kate met een config page is aangemaakt in %{dest} +Comment[pl]=Wtyczka do Kate wraz ze stroną konfiguracyjną została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' para o Kate, com uma página de configuração, em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' para o Kate, com uma página de configuração, em %{dest} +Comment[ru]=Модуль Kate с диалогом настройки создан в %{dest} +Comment[sk]=Modul pre Kate s konfiguračnou stránkou bol vytvorený v %{dest} +Comment[sl]=Vstavek z nastavitveno stranjo za Kate je bil ustvarjen v %{dest} +Comment[sr]=Прикључак за Kate са страном за подешавања направљен је у %{dest} +Comment[sr@Latn]=Priključak za Kate sa stranom za podešavanja napravljen je u %{dest} +Comment[sv]=Ett insticksprogram för Kate med en inställningssida skapades i %{dest} +Comment[tr]=Kate için ayar sayfası olan bir eklenti %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个带配置页的 Kate 插件 +Comment[zh_TW]=一個內含設定頁面的 Kate 外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kateplugin2/kateplugin2.png b/languages/cpp/app_templates/kateplugin2/kateplugin2.png new file mode 100644 index 00000000..b442a706 Binary files /dev/null and b/languages/cpp/app_templates/kateplugin2/kateplugin2.png differ diff --git a/languages/cpp/app_templates/kateplugin2/plugin.desktop b/languages/cpp/app_templates/kateplugin2/plugin.desktop new file mode 100644 index 00000000..761ac763 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin.desktop @@ -0,0 +1,76 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=lib%{APPNAMELC}plugin +X-Kate-Version=2.2 +Name=My First Kate Plugin +Name[br]=Ma lugent Kate kentañ +Name[ca]=El meu primer connector per a Kate +Name[cy]=F'ategyn cyntaf Kate +Name[da]=Mit første Kate plugin +Name[de]=Mein erstes Kate-Modul +Name[el]=Το πρώτο μου πρόσθετο για το Kate +Name[es]=Mi primer complemento para Kate +Name[et]=Minu esimene Kate plugin +Name[eu]=Nire lehenengo Kate plugina +Name[fa]=اولین وصلۀ Kate من +Name[fr]=Mon premier module externe pour Kate +Name[ga]=Mo Chéad Bhreiseán Kate +Name[gl]=A miña primeira extensión para Kate +Name[hu]=Mintapélda Kate-bővítőmodulra +Name[it]=Il mio primo plugin di Kate +Name[ja]=はじめての Kate プラグイン +Name[ms]=Plugin Kate Pertama Saya +Name[nds]=Mien eerst Kate-Moduul +Name[ne]=मेरो पहिलो केट प्लगइन +Name[nl]=Mijn eerste Kate-plugin +Name[pl]=Moja pierwsza wtyczka do Kate +Name[pt]=O Meu Primeiro 'Plugin' para o Kate +Name[pt_BR]=Meu Primeiro Plug-in do Kate +Name[ru]=Мой первый модуль к Kate +Name[sk]=Môj prvý Kate modul +Name[sl]=Moj prvi vstavek za Kate +Name[sr]=Мој први прикључак за Kate +Name[sr@Latn]=Moj prvi priključak za Kate +Name[sv]=Mitt första insticksprogram för Kate +Name[tr]=İlk Kate Eklentim +Name[zh_CN]=我的第一个 Kate 插件 +Name[zh_TW]=我的第一個 Kate 外掛程式 +Comment=Your short description about the plugin goes here +Comment[ca]=Aquí va la descripció curta referent al connector +Comment[cy]=Mae eich disgrifiad byr am yr ategyn yn mynd yma +Comment[da]=Din korte beskrivelse af plugin skal være her +Comment[de]=Hierhin gehört eine kurze Beschreibung des Moduls +Comment[el]=Η σύντομη περιγραφή σας σχετικά με το πρόσθετο πηγαίνει εδώ +Comment[es]=Aquí va la descripción corta sobre el complemento +Comment[et]=Sinu plugina lühikirjeldus +Comment[eu]=Hemen dihoa plugin-aren buruzko zure deskribapen motza +Comment[fa]=توصیف کوتاه شما در مورد وصله در اینجا می‌آید +Comment[fr]=Une courte description de votre module externe s'insère ici +Comment[ga]=Cuir do chur síos gearr ar an mbreiseán anseo +Comment[gl]=A súa descrición breve sobre a extensión vai aquí. +Comment[hi]=प्लगइन के बारे में आपका छोटा सा वर्णन यहाँ जाएगा +Comment[hu]=Itt lehet egy rövid leírást adni a bővítőmodulról +Comment[is]=Hér ætti að vera smá lýsing á viðbótinni +Comment[it]=La tua breve descrizione sui plugin va qui +Comment[ja]=プラグインに関する短い説明をここに記述します。 +Comment[lt]=Čia turėtų būti trumpas priedo aprašymas +Comment[ms]=Huraian ringkas anda tentang plugin anda di sini +Comment[nds]=Hier kannst Du en kort Moduulbeschrieven ingeven +Comment[ne]=प्लगइनका बारेमा तपाईँको छोटो भनाइ यस्तो छ +Comment[nl]=Hier kunt u een korte omschrijving opgeven +Comment[pl]=Tu powinien się pojawić krótki opis wtyczki +Comment[pt]=Aqui deverá colocar uma descrição do 'plugin' +Comment[pt_BR]=Sua descrição sumária sobre o plug-in vai aqui +Comment[ru]=Здесь располагается краткое описание модуля +Comment[sk]=Sem vložte krátky popis modulu +Comment[sl]=Tukaj je kratek opis o vstavku +Comment[sr]=Овде иде ваш кратак опис прикључка +Comment[sr@Latn]=Ovde ide vaš kratak opis priključka +Comment[sv]=En kort beskrivningen av vad insticksprogrammet gör +Comment[ta]=உங்கள் சொருகின் சிறு விவரம் இங்கிருக்கும் +Comment[tg]=Дар инҷо тасвири кӯтоҳи модул ҷойгир аст +Comment[tr]=Eklenti hakkında kısa bir tanımı buraya yazın. +Comment[zh_CN]=关于这个插件的简短描述 +Comment[zh_TW]=您對此外掛程式的描述寫在這裡 +author=%{AUTHOR}, %{EMAIL} diff --git a/languages/cpp/app_templates/kateplugin2/plugin.kdevelop b/languages/cpp/app_templates/kateplugin2/plugin.kdevelop new file mode 100644 index 00000000..cbed4cac --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin.kdevelop @@ -0,0 +1,114 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + src/lib%{APPNAMELC}plugin.la + + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kateplugin2/plugin_app.cpp b/languages/cpp/app_templates/kateplugin2/plugin_app.cpp new file mode 100644 index 00000000..99d78eff --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin_app.cpp @@ -0,0 +1,140 @@ +%{CPP_TEMPLATE} + +#include "plugin_%{APPNAMELC}.h" + +#include +#include +#include +#include + +#include +#include + +class PluginView : public KXMLGUIClient +{ + friend class KatePlugin%{APPNAME}; + +public: + Kate::MainWindow *win; +}; + +extern "C" +{ + void* init_lib%{APPNAMELC}plugin() + { + KGlobal::locale()->insertCatalogue("kate%{APPNAMELC}"); + return new KatePluginFactory; + } +} + +KatePluginFactory::KatePluginFactory() +{ + s_instance = new KInstance( "kate" ); +} + +KatePluginFactory::~KatePluginFactory() +{ + delete s_instance; +} + +QObject* KatePluginFactory::createObject( QObject* parent, const char* name, const char*, const QStringList & ) +{ + return new KatePlugin%{APPNAME}( parent, name ); +} + +KInstance* KatePluginFactory::s_instance = 0L; + +KatePlugin%{APPNAME}::KatePlugin%{APPNAME}( QObject* parent, const char* name ) + : Kate::Plugin ( (Kate::Application*)parent, name ) +{ +} + +KatePlugin%{APPNAME}::~KatePlugin%{APPNAME}() +{ +} + +void KatePlugin%{APPNAME}::addView(Kate::MainWindow *win) +{ + /// @todo doesn't this have to be deleted? + PluginView *view = new PluginView (); + + (void) new KAction ( i18n("Insert Hello World"), 0, this, + SLOT( slotInsertHello() ), view->actionCollection(), + "edit_insert_%{APPNAMELC}" ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile("plugins/%{APPNAMELC}/plugin_%{APPNAMELC}.rc"); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} + +void KatePlugin%{APPNAME}::removeView(Kate::MainWindow *win) +{ + for (uint z=0; z < m_views.count(); z++) + if (m_views.at(z)->win == win) + { + PluginView *view = m_views.at(z); + m_views.remove (view); + win->guiFactory()->removeClient (view); + delete view; + } +} + +void KatePlugin%{APPNAME}::slotInsertHello() +{ + Kate::View *kv = application()->activeMainWindow()->viewManager()->activeView(); + + if (kv) + kv->insertText ("Hello World"); +} + +Kate::PluginConfigPage* KatePlugin%{APPNAME}::configPage (uint, QWidget *w, const char* name) +{ + %{APPNAME}ConfigPage* p = new %{APPNAME}ConfigPage(this, w); + initConfigPage( p ); + connect( p, SIGNAL(configPageApplyRequest(%{APPNAME}ConfigPage*)), this, SLOT(slotApplyConfig(%{APPNAME}ConfigPage*)) ); + return (Kate::PluginConfigPage*)p; +} + +void KatePlugin%{APPNAME}::initConfigPage( %{APPNAME}ConfigPage* p ) +{ + // TODO: initialize %{APPNAME}ConfigPage here + // NOTE: KatePlugin%{APPNAME} is friend of %{APPNAME}ConfigPage +} + +void KatePlugin%{APPNAME}::slotApplyConfig( %{APPNAME}ConfigPage* p ) +{ + // TODO: save %{APPNAME}ConfigPage here + // NOTE: KatePlugin%{APPNAME} is friend of %{APPNAME}ConfigPage +} + + +/** + * %{APPNAME}ConfigPage + */ +%{APPNAME}ConfigPage::%{APPNAME}ConfigPage (QObject* parent /*= 0L*/, QWidget *parentWidget /*= 0L*/) + : Kate::PluginConfigPage( parentWidget ) +{ + QVBoxLayout* lo = new QVBoxLayout( this, 0, 0, "config_page_layout" ); + lo->setSpacing(KDialogBase::spacingHint()); + + QLabel* lab = new QLabel("KatePlugin%{APPNAME}'s config page", this); + + lo->addWidget(lab); + + // TODO: add connection to emit SLOT( changed() ) +} + +%{APPNAME}ConfigPage::~%{APPNAME}ConfigPage() +{ +} + +void %{APPNAME}ConfigPage::apply() +{ + emit configPageApplyRequest( this ); +} + +#include "plugin_%{APPNAMELC}.moc" + diff --git a/languages/cpp/app_templates/kateplugin2/plugin_app.h b/languages/cpp/app_templates/kateplugin2/plugin_app.h new file mode 100644 index 00000000..e4f97d00 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin_app.h @@ -0,0 +1,91 @@ +%{H_TEMPLATE} + +#ifndef _PLUGIN_%{APPNAMEUC}_H_ +#define _PLUGIN_%{APPNAMEUC}_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +class %{APPNAME}ConfigPage; + +class KatePluginFactory : public KLibFactory +{ + Q_OBJECT + +public: + KatePluginFactory(); + virtual ~KatePluginFactory(); + + virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, const char* name = "QObject", const QStringList &args = QStringList() ); + +private: + static KInstance* s_instance; +}; + +class KatePlugin%{APPNAME} : public Kate::Plugin, Kate::PluginViewInterface, Kate::PluginConfigInterfaceExtension +{ + Q_OBJECT + +public: + KatePlugin%{APPNAME}( QObject* parent = 0, const char* name = 0 ); + virtual ~KatePlugin%{APPNAME}(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + /** overwrite some functions */ + uint configPages () const { return 1; } + Kate::PluginConfigPage *configPage (uint , QWidget *w, const char *name=0); + QString configPageName(uint) const { return i18n("%{APPNAME}"); }; + QString configPageFullName(uint) const { return i18n("Configure KatePlugin%{APPNAME}"); }; + QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const { return 0L; }; + +public slots: + void slotInsertHello(); + void slotApplyConfig(%{APPNAME}ConfigPage*); + +private: + void initConfigPage( %{APPNAME}ConfigPage* ); + +private: + QPtrList m_views; +}; + + +class %{APPNAME}ConfigPage : public Kate::PluginConfigPage +{ + Q_OBJECT + friend class KatePlugin%{APPNAME}; + +public: + %{APPNAME}ConfigPage (QObject* parent = 0L, QWidget *parentWidget = 0L); + ~%{APPNAME}ConfigPage (); + + /** Reimplemented from Kate::PluginConfigPage; just emits configPageApplyRequest( this ). */ + virtual void apply(); + + virtual void reset () { ; }; + virtual void defaults () { ; }; + +signals: + /** Ask the plugin to set initial values */ + void configPageApplyRequest( %{APPNAME}ConfigPage* ); + /** Ask the plugin to apply changes */ + void configPageInitRequest( %{APPNAME}ConfigPage* ); + +private: // variables + +}; + +#endif // _PLUGIN_%{APPNAMEUC}_H_ + diff --git a/languages/cpp/app_templates/kateplugin2/plugin_app.rc b/languages/cpp/app_templates/kateplugin2/plugin_app.rc new file mode 100644 index 00000000..fe98416f --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin_app.rc @@ -0,0 +1,11 @@ + + + + &Tools + + + + + + + diff --git a/languages/cpp/app_templates/kateplugin2/src-Makefile.am b/languages/cpp/app_templates/kateplugin2/src-Makefile.am new file mode 100644 index 00000000..2dbd9367 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/src-Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +KDE_ICON = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = lib%{APPNAMELC}plugin.la + +lib%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp +lib%{APPNAMELC}plugin_la_LIBADD = -lkateinterfaces +lib%{APPNAMELC}plugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +pluginsdir = $(kde_datadir)/kate/plugins/%{APPNAMELC} +plugins_DATA = plugin_%{APPNAMELC}.rc + +kde_services_DATA = %{APPNAMELC}.desktop + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + diff --git a/languages/cpp/app_templates/kateplugin2/subdirs b/languages/cpp/app_templates/kateplugin2/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kcmodule/.kdev_ignore b/languages/cpp/app_templates/kcmodule/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kcmodule/Makefile.am b/languages/cpp/app_templates/kcmodule/Makefile.am new file mode 100644 index 00000000..66173b12 --- /dev/null +++ b/languages/cpp/app_templates/kcmodule/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = module.cpp module.h module.desktop module.kdevelop \ + src-Makefile.am kcmodule.png subdirs +templateName = kcmodule + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kcmodule/kcmodule.kdevtemplate b/languages/cpp/app_templates/kcmodule/kcmodule.kdevtemplate new file mode 100644 index 00000000..c551eeb5 --- /dev/null +++ b/languages/cpp/app_templates/kcmodule/kcmodule.kdevtemplate @@ -0,0 +1,197 @@ +# KDE Config File +[General] +Name=Control Center module +Name[ca]=Mòdul per al Centre de control +Name[da]=Kontrolcenter-modul +Name[de]=Kontrollzentrum-Modul +Name[el]=Άρθρωμα κέντρου ελέγχου +Name[en_GB]=Control Centre module +Name[es]=Módulo para el Centro de control +Name[et]=Juhtimiskeskuse moodul +Name[eu]=Kontrol-gunearen modulua +Name[fa]=پیمانۀ مرکز کنترل +Name[fr]=Module du centre de configuration +Name[ga]=Modúl Lárionad Rialaithe +Name[gl]=Módulo para Centro de control +Name[hu]=KControl-beállítómodul +Name[it]=Modulo del Centro di controllo +Name[ja]=コントロールセンターモジュール +Name[nds]=Kuntrullzentrum-Moduul +Name[ne]=नियन्त्रण केन्द्र मोड्युल +Name[nl]=Configuratiemodule +Name[pl]=Moduł Centrum Sterowania +Name[pt]=Módulo do Centro de Controlo +Name[pt_BR]=Módulo do Centro de Controlo +Name[ru]=Модуль Центра управления +Name[sk]=Control Center modul +Name[sl]=Modul nadzornega središča +Name[sr]=Модул Контролног центра +Name[sr@Latn]=Modul Kontrolnog centra +Name[sv]=Modul i inställningscentralen +Name[tr]=Kontrol Merkezi Birimi +Name[zh_CN]=控制中心模块 +Name[zh_TW]=控制中心模組 +Icon=kcmodule.png +Category=C++/KDE +Comment=Generates a framework for a module which can be embedded into the KDE Control Center. +Comment[ca]=Genera una infraestructura per a un mòdul que es pugui encastar al Centre de control de KDE. +Comment[da]=Genererer et skelet for et modul som kan indlejres i KDE's kontrolcenter. +Comment[de]=Erstellt das Gerüst für ein Modul, das in das KDE-Kontrollzentrum integriert werden kann. +Comment[el]=Δημιουργεί ένα πλαίσιο για ένα άρθρωμα το οποίο μπορεί να ενσωματωθεί το κέντρο ελέγχου του KDE. +Comment[en_GB]=Generates a framework for a module which can be embedded into the KDE Control Centre. +Comment[es]=Genera una infraestructura para un módulo que se puede empotrar en el Centro de control de KDE. +Comment[et]=Mooduli raamistiku loomine, mida saab põimida KDE juhtimiskeskusse. +Comment[eu]=KDE-ren kontrol-gunean kapsula daitekeen modulu baten lan-marko bat sortzen du. +Comment[fa]=چارچوبی برای پیمانه‌ای که در مرکز کنترل KDE می‌تواند نهفته شود، تولید می‌کند. +Comment[fr]=Génère une infrastructure pour un module qui peut être intégré dans le centre de configuration de KDE. +Comment[ga]=Cruthaigh creatlach de mhodúl is féidir leabú i Lárionad Rialaithe KDE. +Comment[gl]=Xera un contorno de traballo para un módulo que pode incrustarse no Centro de control de KDE. +Comment[hu]=Létrehoz egy kiindulási KDE vezérlőpult-beállítómodult +Comment[it]=Genera l'infrastruttura per un modulo che può essere integrato nel Centro di controllo di KDE. +Comment[ja]=KDE のコントロールセンターに取り込めるモジュールのフレームワークを作成します。 +Comment[nds]=Stellt en Rahmenwark för en Moduul op, dat sik na dat KDE-Kuntrullzentrum inbetten lett. +Comment[ne]=केडीई नियन्त्रण केन्द्रमा सम्मिलित गर्न सकिने मोड्युलका लागि फ्रेमवर्क उत्पन्न गर्दछ । +Comment[nl]=Genereert een framework voor een module die kan worden ingebed in het configuratiecentrum van KDE. +Comment[pl]=Generuje szablon modułu, który może zostać włączony w Centrum Sterowania KDE. +Comment[pt]=Gera a plataforma para um módulo que possa ser incorporado no Centro de Controlo do KDE. +Comment[pt_BR]=Gera a plataforma para um módulo que possa ser incorporado no Centro de Controlo do KDE. +Comment[ru]=Создание модуля для Центра управления KDE. +Comment[sk]=Vygeneruje framework pre modul, ktorý môže byť vložený do KDE Control Center. +Comment[sr]=Прави радни оквир за модул који се може уградити у Контролни центар KDE-а. +Comment[sr@Latn]=Pravi radni okvir za modul koji se može ugraditi u Kontrolni centar KDE-a. +Comment[sv]=Skapar ett ramverk för en modul som kan inbäddas i KDE:s inställningscentral. +Comment[tr]=KDE Kontrol Merkezine gömülebilen bir birim için bir çatı yaratır. +Comment[zh_CN]=生成一个可嵌入 KDE 控制中心的模块框架。 +Comment[zh_TW]=產生一個可以嵌入 KDE 控制中心的模組框架。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=kcmodule.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/module.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir3] +Type=mkdir +Dir=%{dest}/po + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir4] +Type=mkdir +Dir=%{dest}/src + +[FILE9] +Type=install +Source=%{src}/module.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/module.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/module.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE14] +Type=install +Source=%{src}/module.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[MSG] +Type=message +Comment=A control center module was created in %{dest} +Comment[ca]=A mòdul per al centre de control ha estat creat en %{dest} +Comment[da]=Et kontrolcenter-modul blev oprettet i %{dest} +Comment[de]=Ein Kontrollzentrum-Modul wurde in %{dest} erstellt. +Comment[el]=Ένα άρθρωμα κέντρου ελέγχου δημιουργήθηκε στο %{dest} +Comment[en_GB]=A control centre module was created in %{dest} +Comment[es]=Un módulo para el Centro de control ha sido creado en %{dest} +Comment[et]=Juhtimiskeskuse moodul loodi asukohta %{dest} +Comment[eu]=Kontrol-gunearen modulu bat sortu da hemen: {dest} +Comment[fa]=یک پیمانۀ مرکز کنترل در %{dest} ایجاد شد +Comment[fr]=Un module du centre de configuration a été créé dans %{dest} +Comment[ga]=Cruthaíodh modúl lárionad rialaithe i %{dest} +Comment[gl]=Creouse un módulo para o centro de control en %{dest} +Comment[hu]=Létrejött egy KControl-beállítómodul itt: %{dest} +Comment[it]=È stato creato un modulo del Centro di controllo in %{dest} +Comment[ja]=コントロールセンターのモジュールを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Kuntrullzentrum-Moduul opstellt +Comment[ne]=नियन्त्रण केन्द्र मोड्युल %{dest} मा सिर्जना गरियो +Comment[nl]=Een configuratiemodule is aangemaakt in %{dest} +Comment[pl]=Moduł Centrum Sterowania został utworzony w %{dest} +Comment[pt]=Foi criado um módulo do Centro de Controlo em %{dest} +Comment[pt_BR]=Foi criado um módulo do Centro de Controlo em %{dest} +Comment[ru]=Модуль Центра управления KDE создан в %{dest} +Comment[sk]=Control center modul bol vytvorený v %{dest} +Comment[sl]=Modul nadzornega središča je bil ustvarjen v %{dest} +Comment[sr]=Модул Контролног центра направљен је у %{dest} +Comment[sr@Latn]=Modul Kontrolnog centra napravljen je u %{dest} +Comment[sv]=En modul i inställningscentralen skapades i %{dest} +Comment[zh_CN]=在 %{dest} 中创建了一个控制中心模块 +Comment[zh_TW]=一個控制中心模組已建立於 %{dest} diff --git a/languages/cpp/app_templates/kcmodule/kcmodule.png b/languages/cpp/app_templates/kcmodule/kcmodule.png new file mode 100644 index 00000000..dbab73a3 Binary files /dev/null and b/languages/cpp/app_templates/kcmodule/kcmodule.png differ diff --git a/languages/cpp/app_templates/kcmodule/module.cpp b/languages/cpp/app_templates/kcmodule/module.cpp new file mode 100644 index 00000000..69e87692 --- /dev/null +++ b/languages/cpp/app_templates/kcmodule/module.cpp @@ -0,0 +1,66 @@ +%{CPP_TEMPLATE} + +#include + +#include +#include +#include + +#include "%{APPNAMELC}.h" + +typedef KGenericFactory<%{APPNAME}, QWidget> %{APPNAME}Factory; +K_EXPORT_COMPONENT_FACTORY( kcm_%{APPNAME}, %{APPNAME}Factory("kcm%{APPNAMELC}")) + +%{APPNAME}::%{APPNAME}(QWidget *parent, const char *name, const QStringList&) + : KCModule(parent, name), myAboutData(0) +{ + // place widgets here + load(); +}; + + +%{APPNAME}::~%{APPNAME}() +{ +} + + +void %{APPNAME}::load() +{ + // insert your loading code here... +} + + +void %{APPNAME}::defaults() +{ + // insert your default settings code here... + emit changed(true); +} + + +void %{APPNAME}::save() +{ + // insert your saving code here... + emit changed(true); +} + + +int %{APPNAME}::buttons() +{ + return KCModule::Default|KCModule::Apply|KCModule::Help; +} + + +void %{APPNAME}::configChanged() +{ + // insert your saving code here... + emit changed(true); +} + + +QString %{APPNAME}::quickHelp() const +{ + return i18n("Helpful information about the %{APPNAMELC} module."); +} + + +#include "%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/kcmodule/module.desktop b/languages/cpp/app_templates/kcmodule/module.desktop new file mode 100644 index 00000000..662b3b2f --- /dev/null +++ b/languages/cpp/app_templates/kcmodule/module.desktop @@ -0,0 +1,81 @@ +[Desktop Entry] +Exec=kcmshell %{APPNAMELC} +Icon=misc +Type=Application + +X-KDE-ModuleType=Library +X-KDE-Library=%{APPNAMELC} +X-KDE-HasReadOnlyMode=false +X-KDE-ParentApp=kcontrol + + + +[Desktop Entry] +Comment=%{APPNAME} - a kcontrol module +Comment[br]=%{APPNAME} - ur mollad kcontrol +Comment[ca]=%{APPNAME} - un mòdul per a kcontrol +Comment[da]=%{APPNAME} - et kcontrol-modul +Comment[de]=%{APPNAME} - ein KControl-Modul +Comment[el]=%{APPNAME} - ένα άρθρωμα kcontrol +Comment[es]=%{APPNAME} - un módulo de kcontrol +Comment[et]=%{APPNAME} - KDE juhtimiskeskuse moodul +Comment[eu]=%{APPNAME} - kcontrol modulu bat +Comment[fa]=%{APPNAME} - یک پیمانۀ kcontrol +Comment[fr]=%{APPNAME} - un module kcontrol +Comment[ga]=%{APPNAME} - modúl kcontrol +Comment[gl]=%{APPNAME} - un módulo de kcontrol +Comment[hu]=%{APPNAME} - beállítómodul +Comment[it]=%{APPNAME} - un modulo per kcontrol +Comment[ja]=%{APPNAME} kcontrol モジュール +Comment[nds]=%{APPNAME} - en KControl-Moduul +Comment[ne]=%{APPNAME} - एउटा केडीई नियन्त्रण मोड्युल +Comment[nl]=%{APPNAME} - een kcontrol module +Comment[pl]=Moduł Centrum Sterowania dla %{APPNAME} +Comment[pt]=%{APPNAME} - um módulo do kcontrol +Comment[pt_BR]=%{APPNAME} - um módulo do kcontrol +Comment[ru]=%{APPNAME} - модуль kcontrol +Comment[sk]=%{APPNAME} - a kcontrol modul +Comment[sl]=%{APPNAME} - modul za kcontrol +Comment[sr]=%{APPNAME} — модул за kcontrol +Comment[sr@Latn]=%{APPNAME} — modul za kcontrol +Comment[sv]=%{APPNAME} - en modul i Inställningscentralen +Comment[ta]=%{APPNAME} - ஒரு கேகன்ட்ரோல் கூறு +Comment[tg]=%{APPNAME} - модули kcontrol +Comment[tr]=%{APPNAME} - bir kcontrol birimi +Comment[zh_CN]=%{APPNAME} - 一个 KDE 控制中心模块 +Comment[zh_TW]=%{APPNAME} - KDE 控制中心模組 +Keywords=%{APPNAME},%{APPNAMELC} +Name=The %{APPNAME} Applet +Name[br]=An arloadig %{APPNAME} +Name[ca]=La miniaplicació %{APPNAME} +Name[da]=%{APPNAME}-appletten +Name[de]=Das Miniprogramm %{APPNAME} +Name[el]=Η μικροεφαρμογή %{APPNAME} +Name[es]=Applet %{APPNAME} +Name[et]=%{APPNAME} aplett +Name[eu]=%{APPNAME} applet-a +Name[fa]=برنامک %{APPNAME} +Name[fr]=L'applet %{APPNAME} +Name[ga]=An Feidhmchláirín %{APPNAME} +Name[gl]=Applet %{APPNAME} +Name[hu]=%{APPNAME} kisalkalmazás +Name[it]=L'applet %{APPNAME} +Name[ja]=%{APPNAME} アプレット +Name[nds]=Dat Lüttprogramm %{APPNAME} +Name[ne]= %{APPNAME} एप्लेट +Name[nl]=De %{APPNAME}-applet +Name[pl]=Aplet %{APPNAME} +Name[pt]='Applet' %{APPNAME} +Name[pt_BR]=O Mini-Aplicativo %{APPNAME} +Name[ru]=Аплет %{APPNAME} +Name[sk]=%{APPNAME} applet +Name[sl]=Vstavek za %{APPNAME} +Name[sr]=%{APPNAME} аплет +Name[sr@Latn]=%{APPNAME} aplet +Name[sv]=Miniprogram %{APPNAME} +Name[tr]=%{APPNAME} Küçük Uygulaması +Name[zh_CN]=%{APPNAME} 小程序 +Name[zh_TW]=%{APPNAME} 小程式 + + +Categories=Qt;KDE;X-KDE-settings-components; diff --git a/languages/cpp/app_templates/kcmodule/module.h b/languages/cpp/app_templates/kcmodule/module.h new file mode 100644 index 00000000..cebf0f48 --- /dev/null +++ b/languages/cpp/app_templates/kcmodule/module.h @@ -0,0 +1,32 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#include +#include + +class %{APPNAME}: public KCModule +{ + Q_OBJECT + +public: + %{APPNAME}( QWidget *parent=0, const char *name=0, const QStringList& = QStringList() ); + ~%{APPNAME}(); + + virtual void load(); + virtual void save(); + virtual void defaults(); + virtual int buttons(); + virtual QString quickHelp() const; + virtual const KAboutData *aboutData()const + { return myAboutData; }; + +public slots: + void configChanged(); + +private: + KAboutData *myAboutData; +}; + +#endif diff --git a/languages/cpp/app_templates/kcmodule/module.kdevelop b/languages/cpp/app_templates/kcmodule/module.kdevelop new file mode 100644 index 00000000..76412de2 --- /dev/null +++ b/languages/cpp/app_templates/kcmodule/module.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + src/%{APPNAMELC} + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kcmodule/src-Makefile.am b/languages/cpp/app_templates/kcmodule/src-Makefile.am new file mode 100644 index 00000000..e5d30776 --- /dev/null +++ b/languages/cpp/app_templates/kcmodule/src-Makefile.am @@ -0,0 +1,17 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = kcm_%{APPNAMELC}.la + +kcm_%{APPNAMELC}_la_SOURCES = %{APPNAMELC}.cpp +kcm_%{APPNAMELC}_la_LIBADD = $(LIB_KDEUI) +kcm_%{APPNAMELC}_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined + + +xdg_apps_DATA = %{APPNAMELC}.desktop + + +messages: rc.cpp + $(EXTRACTRC) `find -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kcm%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/kcmodule/subdirs b/languages/cpp/app_templates/kcmodule/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kcmodule/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kconfig35/Makefile.am b/languages/cpp/app_templates/kconfig35/Makefile.am new file mode 100644 index 00000000..f5f8132d --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \ + subdirs app.desktop kxt35.png appview.h appview.cpp appview_base.ui \ + prefs-base.ui prefs.cpp prefs.h app.kcfg settings.kcfgc README \ + src-configure.in.in +templateName= kconfig35 + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/kconfig35/README b/languages/cpp/app_templates/kconfig35/README new file mode 100644 index 00000000..527ce518 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/README @@ -0,0 +1,90 @@ +----------------------------------------------- +Kde templates quickstart +Author: Thomas Nagy +Date: 2004-03-22 +----------------------------------------------- + +This README file explains you basic things for starting with +this application template. + +----------------------------------------------- +--NOTE--: you need kdelibs 3.5 and kdelibs headers 3.5 (devel package) in order to build this template. +Qt version might be 3.3.4 or 3.3.5 +----------------------------------------------- + +** Building and installing ** + +* Build the configure script by "make -f Makefile.cvs" + +* To clean, use "make clean", and to clean everything +(remove the makefiles, etc), use "make distclean" + +* To distribute your program, try "make dist". +This will make a compact tarball archive of your release with the +necessary scripts inside. + +* Modifying the auto-tools scripts +for automake scripts there is an excellent tutorial there : +http://developer.kde.org/documentation/other/makefile_am_howto.html + +* Simplify your life : install the project in your home directory for +testing purposes. +./configure --prefix=/home/user/dummyfolder/ +In the end when you finished the development you can +rm -rf /home/user/dummyfolder/ +without fear. + + +** Technologies ** + +* Build the menus of your application easily +kde applications now use an xml file (*ui.rc file) to build the menus. +This allow a great customization of the application. However, when +programming the menu is shown only after a "make install" + +For more details, consult : +http://devel-home.kde.org/~larrosa/tutorial/p9.html +http://developer.kde.org/documentation/tutorials/xmlui/preface.html + +* Use KConfig XT to create your configuration dialogs and make +them more maintainable. + +For that, you will need to write two simple configuration files +in the src directory : .kcfg and a .kcfgc +The configure.in.in will need to be modified : change the line #MIN_CONFIG(3.0.0) +into #MIN_CONFIG(3.2.0) + +Take an example on the many apps found in the kdegames source package and consult : +http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html + +* With KParts, you can embed other kde components in your program, or make your program +embeddable in other apps. For example, the kmplayer kpart can be called to play videos +in your app. + +For more details, consult : +http://www-106.ibm.com/developerworks/library/l-kparts/ +http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html +http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html + +* With dcop, you can control your app from other applications +Make sure to include K_DCOP and a kdcop: section in your .h file +http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html + + +** Documentation ** + +* For the translations : +1. Download a patched gettext which can be found at: + http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/ +2. Install that gettext in ~/bin/ +3. cd ~/yourproject, export PATH=~/bin:$PATH, export +KDEDIR=/where_your_KDE3_is +4. make -f admin/Makefile.common package-messages +5. make package-messages +6. Translate the po files (not the pot!!) with kbabel or xemacs + +* Do not forget to write the documentation for your kde app +edit the documentation template index.docbook in doc/ + + + diff --git a/languages/cpp/app_templates/kconfig35/app.cpp b/languages/cpp/app_templates/kconfig35/app.cpp new file mode 100644 index 00000000..e32e28b5 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/app.cpp @@ -0,0 +1,105 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include "settings.h" +#include "prefs.h" + +#include + +#include +#include +#include +#include +#include +#include + +%{APPNAMELC}::%{APPNAMELC}() + : KMainWindow( 0, "%{APPNAMELC}" ), + m_view(new %{APPNAMELC}View(this)), + m_printer(0) +{ + // accept dnd + setAcceptDrops(true); + + // tell the KMainWindow that this is indeed the main widget + setCentralWidget(m_view); + // and a status bar + statusBar()->show(); + // then, setup our actions + setupActions(); + + // apply the saved mainwindow settings, if any, and ask the mainwindow + // to automatically save settings if changed: window size, toolbar + // position, icon size, etc. + setAutoSaveSettings(); + + // allow the view to change the statusbar and caption + connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), + this, SLOT(changeStatusbar(const QString&))); + connect(m_view, SIGNAL(signalChangeCaption(const QString&)), + this, SLOT(changeCaption(const QString&))); + +} + +%{APPNAMELC}::~%{APPNAMELC}() +{ +} + +void %{APPNAMELC}::setupActions() +{ + KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + + KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + // custom menu and menu item + KAction *custom = new KAction(i18n("Swi&tch Colors"), 0, + m_view, SLOT(switchColors()), + actionCollection(), "switch_action"); + + setupGUI(); +} + +void %{APPNAMELC}::newToolbarConfig() +{ + // this slot is called when user clicks "Ok" or "Apply" in the toolbar editor. + // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.) + setupGUI(); +} + +void %{APPNAMELC}::optionsPreferences() +{ + // The preference dialog is derived from prefs-base.ui which is subclassed into Prefs + // + // compare the names of the widgets in the .ui file + // to the names of the variables in the .kcfg file + KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow); + dialog->addPage(new Prefs(), i18n("General"), "package_settings"); + connect(dialog, SIGNAL(settingsChanged()), m_view, SLOT(settingsChanged())); + dialog->show(); +} + +void %{APPNAMELC}::changeCaption(const QString& text) +{ + // display the text on the caption + setCaption(text); +} + +void %{APPNAMELC}::changeStatusbar(const QString& text) +{ + // display the text on the statusbar + statusBar()->message(text); +} + +void %{APPNAMELC}::fileNew() +{ + // this slot is called whenever the File->New menu is selected, + // the New shortcut is pressed (usually CTRL+N) or the New toolbar + // button is clicked + + // create a new window + (new %{APPNAMELC})->show(); +} + +#include "%{APPNAMELC}.moc" + diff --git a/languages/cpp/app_templates/kconfig35/app.desktop b/languages/cpp/app_templates/kconfig35/app.desktop new file mode 100644 index 00000000..8b36e6e0 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/app.desktop @@ -0,0 +1,40 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} +Icon=%{APPNAMELC} +Type=Application +Comment=A simple KDE Application +Comment[br]=Ur meziant eeun evit KDE +Comment[ca]=Una simple aplicació per al KDE +Comment[da]=Et simpelt KDE program +Comment[de]=Eine einfache KDE-Anwendung +Comment[el]=Μια απλή εφαρμογή του KDE +Comment[es]=Una aplicación de KDE sencilla +Comment[et]=Lihtne KDE rakendus +Comment[eu]=KDE aplikazio simple bat +Comment[fa]=یک کاربرد سادۀ KDE +Comment[fr]=Une application simple pour KDE +Comment[ga]=Feidhmchlár Simplí KDE +Comment[gl]=Unha aplicación KDE sinxela +Comment[hi]=एक सादा केडीई अनुप्रयोग +Comment[hu]=Egyszerű KDE-alkalmazás +Comment[is]=Einfalt KDE forrit +Comment[it]=Una semplice applicazione KDE +Comment[ja]=簡単な KDE アプリケーション +Comment[nds]=En eenfach KDE-Programm +Comment[ne]=एउटा साधारण केडीई अनुप्रयोग +Comment[nl]=Een eenvoudige KDE-toepassing +Comment[pl]=Prosty program KDE +Comment[pt]=Uma aplicação simples do KDE +Comment[pt_BR]=Um simples Aplicativo do KDE +Comment[ru]=Простое приложение KDE +Comment[sk]=Jednoduchá KDE aplikácia +Comment[sl]=Preprost program za KDE +Comment[sr]=Једноставан KDE програм +Comment[sr@Latn]=Jednostavan KDE program +Comment[sv]=Ett enkelt KDE-program +Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு +Comment[tg]=Гузориши оддиKDE +Comment[tr]=Basit bir KDE Uygulaması +Comment[zh_CN]=一个简单的 KDE 应用程序 +Comment[zh_TW]=簡單的 KDE 應用程式 diff --git a/languages/cpp/app_templates/kconfig35/app.h b/languages/cpp/app_templates/kconfig35/app.h new file mode 100644 index 00000000..abfd6c09 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/app.h @@ -0,0 +1,60 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "%{APPNAMELC}view.h" + +class KPrinter; +class KURL; + +/** + * This class serves as the main window for %{APPNAME}. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAMELC} : public KMainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAMELC}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAMELC}(); + +private slots: + + void fileNew(); + void optionsPreferences(); + void newToolbarConfig(); + + void changeStatusbar(const QString& text); + void changeCaption(const QString& text); + +private: + + void setupActions(); + +private: + %{APPNAMELC}View *m_view; + + KPrinter *m_printer; +}; + +#endif // _%{APPNAMEUC}_H_ + diff --git a/languages/cpp/app_templates/kconfig35/app.kcfg b/languages/cpp/app_templates/kconfig35/app.kcfg new file mode 100644 index 00000000..686f25f2 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/app.kcfg @@ -0,0 +1,21 @@ + + + + + + + black + + + + yellow + + + + 2 + + + diff --git a/languages/cpp/app_templates/kconfig35/app.kdevelop b/languages/cpp/app_templates/kconfig35/app.kdevelop new file mode 100644 index 00000000..07cf3f0f --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/app.kdevelop @@ -0,0 +1,168 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + . + false + + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + false + + + + + + + false + 1 + false + + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + true + false + false + true + + + false + true + + + + + + + + + + + + -f + + -dP + + -f + -u3 -p + + + + + + + false + + + .h + .cpp + true + + + + true + 2 + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kconfig35/appui.rc b/languages/cpp/app_templates/kconfig35/appui.rc new file mode 100644 index 00000000..06549878 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/appui.rc @@ -0,0 +1,8 @@ + + + + &Move + + + + diff --git a/languages/cpp/app_templates/kconfig35/appview.cpp b/languages/cpp/app_templates/kconfig35/appview.cpp new file mode 100644 index 00000000..35e23682 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/appview.cpp @@ -0,0 +1,41 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}view.h" +#include "settings.h" + +#include +#include + +%{APPNAMELC}View::%{APPNAMELC}View(QWidget *parent) + : %{APPNAMELC}view_base(parent) +{ + settingsChanged(); +} + +%{APPNAMELC}View::~%{APPNAMELC}View() +{ + +} + +void %{APPNAMELC}View::switchColors() +{ + // switch the foreground/background colors of the label + QColor color = Settings::col_background(); + Settings::setCol_background( Settings::col_foreground() ); + Settings::setCol_foreground( color ); + + settingsChanged(); +} + +void %{APPNAMELC}View::settingsChanged() +{ + sillyLabel->setPaletteBackgroundColor( Settings::col_background() ); + sillyLabel->setPaletteForegroundColor( Settings::col_foreground() ); + + // i18n : internationalization + sillyLabel->setText( i18n("This project is %1 days old").arg(Settings::val_time()) ); + emit signalChangeStatusbar( i18n("Settings changed") ); +} + +#include "%{APPNAMELC}view.moc" + diff --git a/languages/cpp/app_templates/kconfig35/appview.h b/languages/cpp/app_templates/kconfig35/appview.h new file mode 100644 index 00000000..45a10de7 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/appview.h @@ -0,0 +1,52 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}VIEW_H_ +#define _%{APPNAMEUC}VIEW_H_ + +#include + +#include "%{APPNAMELC}view_base.h" + +class QPainter; +class KURL; + +/** + * This is the main view class for %{APPNAME}. Most of the non-menu, + * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go + * here. + * + * @short Main view + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAMELC}View : public %{APPNAMELC}view_base +{ + Q_OBJECT +public: + /** + * Default constructor + */ + %{APPNAMELC}View(QWidget *parent); + + /** + * Destructor + */ + virtual ~%{APPNAMELC}View(); + +signals: + /** + * Use this signal to change the content of the statusbar + */ + void signalChangeStatusbar(const QString& text); + + /** + * Use this signal to change the content of the caption + */ + void signalChangeCaption(const QString& text); + +private slots: + void switchColors(); + void settingsChanged(); +}; + +#endif // _%{APPNAMEUC}VIEW_H_ diff --git a/languages/cpp/app_templates/kconfig35/appview_base.ui b/languages/cpp/app_templates/kconfig35/appview_base.ui new file mode 100644 index 00000000..626d95df --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/appview_base.ui @@ -0,0 +1,33 @@ + +%{APPNAMELC}view_base + + +%{APPNAMELC}view_base + + + +0 +0 +268 +164 + + + +%{APPNAMELC}_base + + + +unnamed + + + +sillyLabel + + +hello, world + + + + + + diff --git a/languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate b/languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate new file mode 100644 index 00000000..0aa709f4 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate @@ -0,0 +1,245 @@ +# KDE Config File +[General] +Name=KConfig XT for KDE 3.5 +Name[ca]=KConfig XT per a KDE 3.5 +Name[de]=KConfigXT-Anwendung für KDE 3.5 +Name[el]=Εφαρμογή KConfig XT για το KDE 3.5 +Name[es]=KConfig XT para KDE 3.5 +Name[et]=KConfig XT KDE 3.5 jaoks +Name[fr]=Application KConfig XT pour KDE 3.5 +Name[hu]=KConfig XT a KDE 3.5-höz +Name[it]=KConfig XT per KDE 3.5 +Name[ja]=KDE 3.5 用 KConfig XT +Name[nds]=KConfig-XT-Programm för KDE 3.5 +Name[nl]=KConfig XT voor KDE 3.5 +Name[pl]=Program KConfig XT dla KDE 3.5 +Name[pt]=Aplicação do KConfig XT para o KDE 3.5 +Name[pt_BR]=Aplicação do KConfig XT para o KDE 3.5 +Name[ru]=Приложение KDE 3.5 с KConfig XT +Name[sk]=KConfig XT pre KDE 3.5 +Name[sr]=KConfig XT програм за KDE 3.5 +Name[sr@Latn]=KConfig XT program za KDE 3.5 +Name[sv]=KConfig XT för KDE 3.5 +Name[zh_TW]=KDE 3.5 的 KConfig XT 應用程式 +Category=C++/KDE +Icon=kxt.png +Comment=Generates a simple KDE application with one widget and a configuration dialog compatible with KDE 3.5 only +Comment[ca]=Genera una simple aplicació per al KDE amb un estri i un diàleg de configuració compatible només amb KDE 3.5. +Comment[da]=Genererer et simpelt KDE-program med en kontrol og en indstillingsdialog der kun er kompatibelt med KDE 3.5 +Comment[de]=Erstellt eine einfache KDE-Anwendung für KDE 3.5 mit einem Widget und einem Einstellungsdialog. +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό, ένα διάλογο ρύθμισης συμβατό μόνο με το KDE 3.5 +Comment[en_GB]=Generates a simple KDE application with one widget and a configuration dialogue compatible with KDE 3.5 only +Comment[es]=Genera una sencilla aplicación para KDE con un widget y un diálogo de configuración compatible solo con KDE 3.5 +Comment[et]=Lihtsa KDE rakenduse loomine ühe vidina ja vaid KDE 3.5-ga ühilduva seadistustedialoogiga. +Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique et une boîte de dialogue de configuration compatible avec KDE 3.5 uniquement +Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy grafikus elemmel és egy beállítóablakkal, csak a KDE 3.5-tel kompatibilis +Comment[it]=Genera una semplice applicazione KDE con un elemento grafico e una finestra di configurazione compatibile solo con KDE 3.5 +Comment[ja]=一つのウィジェットと設定ダイアログを含む簡単な KDE アプリケーションを作成します (KDE 3.5 用) +Comment[nds]=Stellt en eenfach KDE-Programm mit een Element un en Instelldialoog op, de bloots mit KDE 3.5 kompatibel is. +Comment[nl]=Genereert een eenvoudige KDE-toepassing met één widget en een configuratiedialoog die alleen met KDE 3.5 compatible is +Comment[pl]=Generuje prosty program KDE z jednym widżetem i oknem konfiguracyjnym zgodnym z KDE 3.5 +Comment[pt]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração, apenas para o KDE 3.5 +Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração, apenas para o KDE 3.5 +Comment[ru]=Создание простого приложения KDE с одним виджетом и диалогом конфигурации, совместимое только с KDE 3.5. +Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom a konfiguračným dialógom kompatibilnú len s KDE 3.5 +Comment[sr]=Прави једноставан KDE програм са једном контролом и дијалогом за подешавање, компатибилан само са KDE-ом 3.5 +Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom i dijalogom za podešavanje, kompatibilan samo sa KDE-om 3.5 +Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent och en inställningsdialogruta, som bara fungerar med KDE 3.5 +Comment[zh_TW]=產生一個簡單的 KDE 3.5 上的應用程式,內含一個元件與一個設定對話框。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp,%{dest}/README +Archive=kconfig35.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE10] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png + +[FILE11] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE12] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE13] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE14] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE15] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE16] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE17] +Type=install +EscapeXML=true +Source=%{src}/appview_base.ui +Dest=%{dest}/src/%{APPNAMELC}view_base.ui + +[FILE18] +Type=install +Source=%{src}/appview.cpp +Dest=%{dest}/src/%{APPNAMELC}view.cpp + +[FILE19] +Type=install +Source=%{src}/appview.h +Dest=%{dest}/src/%{APPNAMELC}view.h + +[FILE20] +Type=install +EscapeXML=true +Source=%{src}/prefs-base.ui +Dest=%{dest}/src/prefs-base.ui + +[FILE21] +Type=install +Source=%{src}/prefs.cpp +Dest=%{dest}/src/prefs.cpp + +[FILE22] +Type=install +Source=%{src}/prefs.h +Dest=%{dest}/src/prefs.h + +[FILE23] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE24] +Type=install +EscapeXML=true +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}ui.rc + +[FILE25] +Type=install +Source=%{src}/README +Dest=%{dest}/README + +[FILE26] +Type=install +Source=%{src}/app.kcfg +Dest=%{dest}/src/%{APPNAMELC}.kcfg + +[FILE27] +Type=install +Source=%{src}/settings.kcfgc +Dest=%{dest}/src/settings.kcfgc + +[FILE28] +Type=install +Source=%{src}/src-configure.in.in +Dest=%{dest}/configure.in.in + +[MSG] +Type=message +Comment=A KDE 3.5 KConfig XT application was created in %{dest} +Comment[ca]=Una aplicació KConfig XT per al KDE ha estat creada en %{dest} +Comment[da]=Et KDE 3.5 KConfig XT-program blev oprettet i %{dest} +Comment[de]=Eine KConfig-XT-Anwendung für KDE 3.5 wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή KConfig XT του KDE 3.5 δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación KConfig XT para KDE 3.5 ha sido creada en %{dest} +Comment[et]=KDE 3.5 KConfig XT rakendus loodi asukohta %{dest} +Comment[fr]=Une application KConfig XT pour KDE 3.5 a été créée dans %{dest} +Comment[hu]=Létrejött egy KConfig XT-alapú KDE 3.5-alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KConfig XT per KDE 3.5 in %{dest} +Comment[ja]=KDE 3.5 用 KConfig XT アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KConfig-XT-Programm för KDE 3.5 opstellt +Comment[nl]=Een KDE 3.5 KConfig XT-toepassing is aangemaakt in %{dest} +Comment[pl]=Program KConfig XT dla KDE 3.5 został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KConfig XT para o KDE 3.5 em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KConfig XT para o KDE 3.5 em %{dest} +Comment[ru]=Приложение KDE с KConfig XT создано в %{dest} +Comment[sk]=KConfig XT pre KDE 3.5 bola vytvorená v %{dest} +Comment[sr]=KConfig XT програм за KDE 3.5 направљен је у %{dest} +Comment[sr@Latn]=KConfig XT program za KDE 3.5 napravljen je u %{dest} +Comment[sv]=Ett KDE 3.5 KConfig XT-program skapades i %{dest} +Comment[zh_TW]=一個 KDE 3.5 上的 KConfig XT 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kconfig35/kconfig35.png b/languages/cpp/app_templates/kconfig35/kconfig35.png new file mode 100644 index 00000000..a3866883 Binary files /dev/null and b/languages/cpp/app_templates/kconfig35/kconfig35.png differ diff --git a/languages/cpp/app_templates/kconfig35/kxt35.png b/languages/cpp/app_templates/kconfig35/kxt35.png new file mode 100644 index 00000000..a3866883 Binary files /dev/null and b/languages/cpp/app_templates/kconfig35/kxt35.png differ diff --git a/languages/cpp/app_templates/kconfig35/main.cpp b/languages/cpp/app_templates/kconfig35/main.cpp new file mode 100644 index 00000000..66f038c9 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/main.cpp @@ -0,0 +1,57 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE Application"); + +static const char version[] = "%{VERSION}"; + +static KCmdLineOptions options[] = +{ + { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + KApplication app; + + // see if we are starting with session management + if (app.isRestored()) + { + RESTORE(%{APPNAMELC}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->count() == 0) + { + %{APPNAMELC} *widget = new %{APPNAMELC}; + widget->show(); + } + else + { + int i = 0; + for (; i < args->count(); i++) + { + %{APPNAMELC} *widget = new %{APPNAMELC}; + widget->show(); + } + } + args->clear(); + } + + return app.exec(); +} + diff --git a/languages/cpp/app_templates/kconfig35/prefs-base.ui b/languages/cpp/app_templates/kconfig35/prefs-base.ui new file mode 100644 index 00000000..5c0fc860 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/prefs-base.ui @@ -0,0 +1,127 @@ + +Prefs_base + + + Prefs_base + + + + 0 + 0 + 282 + 156 + + + + + unnamed + + + + textLabel2_2 + + + Background color: + + + + + kcfg_col_background + + + + + + + + textLabel1 + + + Project age: + + + + + textLabel2 + + + Foreground color: + + + + + kcfg_col_foreground + + + + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 41 + 20 + + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 41 + 20 + + + + + + kcfg_val_time + + + 1 + + + 2 + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 41 + 20 + + + + + + + + kcolorbutton.h + + diff --git a/languages/cpp/app_templates/kconfig35/prefs.cpp b/languages/cpp/app_templates/kconfig35/prefs.cpp new file mode 100644 index 00000000..e7a46ddf --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/prefs.cpp @@ -0,0 +1,12 @@ +%{CPP_TEMPLATE} + +#include "prefs.h" +#include + +Prefs::Prefs() + : Prefs_base() +{ +// debugging : +// kdWarning()<<"creating a pref dialog"< rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + +KDE_ICON = AUTO + +# this is where the kdelnk file will go +kdelnkdir = $(kde_appsdir)/Utilities +kdelnk_DATA = %{APPNAMELC}.desktop + +# this is where the XML-GUI resource file goes +rcdir = $(kde_datadir)/%{APPNAMELC} +rc_DATA = %{APPNAMELC}ui.rc diff --git a/languages/cpp/app_templates/kconfig35/src-configure.in.in b/languages/cpp/app_templates/kconfig35/src-configure.in.in new file mode 100644 index 00000000..61d4a7fd --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/src-configure.in.in @@ -0,0 +1,7 @@ + +#MIN_CONFIG(3.2.0) + +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + diff --git a/languages/cpp/app_templates/kconfig35/subdirs b/languages/cpp/app_templates/kconfig35/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kconfig35/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kde4app/CMakeLists.txt b/languages/cpp/app_templates/kde4app/CMakeLists.txt new file mode 100644 index 00000000..2544a271 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/CMakeLists.txt @@ -0,0 +1,31 @@ +project(%{APPNAME}) +find_package(KDE4 REQUIRED) +include (KDE4Defaults) +include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} ) + +set(%{APPNAMELC}_SRCS + %{APPNAMELC}.cpp + main.cpp + %{APPNAMELC}view.cpp + ) + +#kde4_automoc(${%{APPNAMELC}_SRCS}) + +kde4_add_ui_files(%{APPNAMELC}_SRCS %{APPNAMELC}view_base.ui prefs_base.ui) + +kde4_add_kcfg_files(%{APPNAMELC}_SRCS settings.kcfgc ) + +kde4_add_executable(%{APPNAMELC} ${%{APPNAMELC}_SRCS}) + +target_link_libraries(%{APPNAMELC} ${KDE4_KDEUI_LIBS} ) + +install(TARGETS %{APPNAMELC} DESTINATION ${BIN_INSTALL_DIR} ) + + +########### install files ############### + +install( FILES %{APPNAMELC}.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) +install( FILES %{APPNAMELC}.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) +install( FILES %{APPNAMELC}ui.rc DESTINATION ${DATA_INSTALL_DIR}/%{APPNAMELC} ) + + diff --git a/languages/cpp/app_templates/kde4app/Makefile.am b/languages/cpp/app_templates/kde4app/Makefile.am new file mode 100644 index 00000000..2b39fcb4 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = kapp4.cpp kapp4.h prefs_base.ui kapp4view.cpp kapp4view.h kapp4view_base.ui \ + main.cpp kde4appui.rc CMakeLists.txt kapp4.desktop kapp4.kcfg settings.kcfgc \ + kde4app.png README kde4app.kdevelop kde4app.kdevelop.filelist + +templateName = kde4app + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/kde4app/README b/languages/cpp/app_templates/kde4app/README new file mode 100644 index 00000000..a5f3a307 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/README @@ -0,0 +1,15 @@ +!!!!!ATTENTION!!!!! + +Before starting the build you may need to setup the KDE4 environment variables. +To do this open Project->Project Options and then look at the "Run" and the "Make" +pages. Each of these two has an environment variables widget in which you have +to fill in the right values for the variables already listed. + +After setting up the variables you'll also need to run cmake inside the build +directory. This can not be done by kdevelop as a KDE4 environment is needed +when running cmake to find KDE4. Open the integrated konsole and change to the build +subdirectory. Then setup a KDE4 environment and run "cmake ../". + +More information how to setup a KDE4 development environment can be found on +http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts + diff --git a/languages/cpp/app_templates/kde4app/kapp4.cpp b/languages/cpp/app_templates/kde4app/kapp4.cpp new file mode 100644 index 00000000..c11a58d1 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4.cpp @@ -0,0 +1,90 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include "%{APPNAMELC}view.h" +#include "settings.h" + +#include +#include + +#include +#include + +#include +#include +#include + +#include + +%{APPNAME}::%{APPNAME}() + : KXmlGuiWindow(), + m_view(new %{APPNAME}View(this)), + m_printer(0) +{ + // accept dnd + setAcceptDrops(true); + + // tell the KXmlGuiWindow that this is indeed the main widget + setCentralWidget(m_view); + + // then, setup our actions + setupActions(); + + // add a status bar + statusBar()->show(); + + // a call to KXmlGuiWindow::setupGUI() populates the GUI + // with actions, using KXMLGUI. + // It also applies the saved mainwindow settings, if any, and ask the + // mainwindow to automatically save settings if changed: window size, + // toolbar position, icon size, etc. + setupGUI(); +} + +%{APPNAME}::~%{APPNAME}() +{ +} + +void %{APPNAME}::setupActions() +{ + KStandardAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStandardAction::quit(qApp, SLOT(quit()), actionCollection()); + + KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + // custom menu and menu item - the slot is in the class %{APPNAME}View + KAction *custom = new KAction(KIcon("colorize"), i18n("Swi&tch Colors"), this); + actionCollection()->addAction( QLatin1String("switch_action"), custom ); + connect(custom, SIGNAL(triggered(bool)), m_view, SLOT(switchColors())); +} + +void %{APPNAME}::fileNew() +{ + // this slot is called whenever the File->New menu is selected, + // the New shortcut is pressed (usually CTRL+N) or the New toolbar + // button is clicked + + // create a new window + (new %{APPNAME})->show(); +} + +void %{APPNAME}::optionsPreferences() +{ + // The preference dialog is derived from prefs_base.ui + // + // compare the names of the widgets in the .ui file + // to the names of the variables in the .kcfg file + //avoid to have 2 dialogs shown + if ( KConfigDialog::showDialog( "settings" ) ) { + return; + } + KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self()); + QWidget *generalSettingsDlg = new QWidget; + ui_prefs_base.setupUi(generalSettingsDlg); + dialog->addPage(generalSettingsDlg, i18n("General"), "package_setting"); + connect(dialog, SIGNAL(settingsChanged(QString)), m_view, SLOT(settingsChanged())); + dialog->setAttribute( Qt::WA_DeleteOnClose ); + dialog->show(); +} + +#include "%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/kde4app/kapp4.desktop b/languages/cpp/app_templates/kde4app/kapp4.desktop new file mode 100644 index 00000000..008fad44 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4.desktop @@ -0,0 +1,30 @@ +[Desktop Entry] +Name=KApp4 +Name[nds]=KProg4 +Name[sv]=KDE 4-program +Name[zh_TW]=KApp4 程式 +Exec=kapp4 %i -caption "%c" +Icon=kapp4 +Type=Application +X-DocPath=kapp4/kapp4.html +GenericName=A KDE4 Application +GenericName[ca]=Una aplicació del KDE4 +GenericName[da]=Et KDE4-program +GenericName[de]=Eine KDE 4-Anwendung +GenericName[el]=Μία εφαρμογή του KDE4 +GenericName[es]=Una aplicación para KDE4 +GenericName[et]=KDE4 rakendus +GenericName[hu]=KDE4-alapú alkalmazás +GenericName[it]=Applicazione KDE4 +GenericName[nds]=En KDE4-Programm +GenericName[nl]=Een KDE4-programma +GenericName[pl]=Program dla KDE4 +GenericName[pt]=Uma Aplicação do KDE4 +GenericName[pt_BR]=Uma Aplicação do KDE4 +GenericName[ru]=Приложение KDE 4 +GenericName[sk]=KDE4 aplikácia +GenericName[sr]=KDE4 програм +GenericName[sr@Latn]=KDE4 program +GenericName[sv]=Ett KDE 4-program +GenericName[zh_TW]=KDE4 應用程式 +Terminal=false diff --git a/languages/cpp/app_templates/kde4app/kapp4.h b/languages/cpp/app_templates/kde4app/kapp4.h new file mode 100644 index 00000000..fb059fde --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4.h @@ -0,0 +1,53 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + + +#include + +#include "ui_prefs_base.h" + +class %{APPNAME}View; +class KPrinter; +class KToggleAction; +class KUrl; + +/** + * This class serves as the main window for %{APPNAME}. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + * @author Andreas Pakulat + * @version 0.1 + */ +class %{APPNAME} : public KXmlGuiWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); + +private slots: + void fileNew(); + void optionsPreferences(); + +private: + void setupActions(); + +private: + Ui::prefs_base ui_prefs_base ; + %{APPNAME}View *m_view; + + KPrinter *m_printer; + KToggleAction *m_toolbarAction; + KToggleAction *m_statusbarAction; +}; + +#endif // _%{APPNAMELC}_H_ diff --git a/languages/cpp/app_templates/kde4app/kapp4.kcfg b/languages/cpp/app_templates/kde4app/kapp4.kcfg new file mode 100644 index 00000000..6040f769 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4.kcfg @@ -0,0 +1,21 @@ + + + + + + + black + + + + yellow + + + + 2 + + + diff --git a/languages/cpp/app_templates/kde4app/kapp4view.cpp b/languages/cpp/app_templates/kde4app/kapp4view.cpp new file mode 100644 index 00000000..256f6bcb --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4view.cpp @@ -0,0 +1,42 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}view.h" +#include "settings.h" + +#include +#include + +%{APPNAME}View::%{APPNAME}View(QWidget *) +{ + ui_%{APPNAMELC}view_base.setupUi(this); + settingsChanged(); + setAutoFillBackground(true); +} + +%{APPNAME}View::~%{APPNAME}View() +{ + +} + +void %{APPNAME}View::switchColors() +{ + // switch the foreground/background colors of the label + QColor color = Settings::col_background(); + Settings::setCol_background( Settings::col_foreground() ); + Settings::setCol_foreground( color ); + + settingsChanged(); +} + +void %{APPNAME}View::settingsChanged() +{ + QPalette pal; + pal.setColor( QPalette::Window, Settings::col_background()); + pal.setColor( QPalette::WindowText, Settings::col_foreground()); + ui_%{APPNAMELC}view_base.kcfg_sillyLabel->setPalette( pal ); + + // i18n : internationalization + ui_%{APPNAMELC}view_base.kcfg_sillyLabel->setText( i18n("This project is %1 days old",Settings::val_time()) ); + emit signalChangeStatusbar( i18n("Settings changed") ); +} + +#include "%{APPNAMELC}view.moc" diff --git a/languages/cpp/app_templates/kde4app/kapp4view.h b/languages/cpp/app_templates/kde4app/kapp4view.h new file mode 100644 index 00000000..ab08445f --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4view.h @@ -0,0 +1,55 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMELC}VIEW_H +#define %{APPNAMELC}VIEW_H + +#include + +#include "ui_%{APPNAMELC}view_base.h" + +class QPainter; +class KUrl; + +/** + * This is the main view class for %{APPNAME}. Most of the non-menu, + * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go + * here. + * + * @short Main view + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ + +class %{APPNAME}View : public QWidget, public Ui::%{APPNAMELC}view_base +{ + Q_OBJECT +public: + /** + * Default constructor + */ + %{APPNAME}View(QWidget *parent); + + /** + * Destructor + */ + virtual ~%{APPNAME}View(); + +private: + Ui::%{APPNAMELC}view_base ui_%{APPNAMELC}view_base; + +signals: + /** + * Use this signal to change the content of the statusbar + */ + void signalChangeStatusbar(const QString& text); + + /** + * Use this signal to change the content of the caption + */ + void signalChangeCaption(const QString& text); + +private slots: + void switchColors(); + void settingsChanged(); +}; + +#endif // %{APPNAME}VIEW_H diff --git a/languages/cpp/app_templates/kde4app/kapp4view_base.ui b/languages/cpp/app_templates/kde4app/kapp4view_base.ui new file mode 100644 index 00000000..eb6a254a --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kapp4view_base.ui @@ -0,0 +1,213 @@ + +%{APPNAMELC}view_base + + + + 0 + 0 + 315 + 233 + + + + %{APPNAMELC}_base + + + true + + + + 11 + + + 11 + + + 11 + + + 11 + + + 6 + + + 6 + + + + + + + + + + 255 + 255 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 119 + 119 + 119 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + Sans Serif + 12 + + + + true + + + hello, world + + + true + + + Qt::AlignCenter + + + false + + + + + + + qPixmapFromMimeSource + + + diff --git a/languages/cpp/app_templates/kde4app/kde4app.kdevelop b/languages/cpp/app_templates/kde4app/kde4app.kdevelop new file mode 100644 index 00000000..d36a9536 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app.kdevelop @@ -0,0 +1,205 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevCustomProject + C++ + + C++ + Code + Qt + KDE + + %{APPNAMELC} + . + false + + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + true + false + false + true + + + false + true + + + + + + + + + + + + -f + + -dP + + -f + -u3 -p + + + + + + + false + + + .h + .cpp + true + + + + + %{dest}/build/%{APPNAMELC} + + false + false + + + + + + + + + false + false + + true + %{dest} + executable + + + make + %{dest}/build + + + false + 1 + 0 + false + make + + + default + + + + + + + + + + + + + *.h + *.cpp + CMakeLists.txt + *.desktop + *.kcfg* + *.ui + Doxyfile + *.dox + *.rc + *.cmake + + + 0 + + + + default + + + + + + build + + + + + true + 4 + 4 + ExternalDesigner + /usr/bin/designer-qt4 + /usr/lib/qt4 + + + + true + 2 + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist b/languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist new file mode 100644 index 00000000..5235563f --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist @@ -0,0 +1,13 @@ +# KDevelop Custom Project File List +CMakeLists.txt +main.cpp +prefs_base.ui +settings.kcfgc +%{APPNAMELC}.cpp +%{APPNAMELC}.desktop +%{APPNAMELC}.h +%{APPNAMELC}.kcfg +%{APPNAMELC}ui.rc +%{APPNAMELC}view.cpp +%{APPNAMELC}view.h +%{APPNAMELC}view_base.ui diff --git a/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate b/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate new file mode 100644 index 00000000..2a7269fd --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate @@ -0,0 +1,155 @@ +# KDE Config File +[General] +Name=KDE4 Application framework +Name[ca]=Entorn de treball d'aplicacions pel KDE4 +Name[da]=KDE4 program-framework +Name[de]=KDE 4-Anwendungsgrundgerüst +Name[el]=Πλαίσιο εφαρμογής του KDE4 +Name[es]=Infraestructura de aplicación para KDE4 +Name[et]=KDE4 rakenduse raamistik +Name[hu]=Keretrendszer KDE4-alapú alkalmazáshoz +Name[it]=Infrastruttura per applicazioni KDE4 +Name[nds]=KDE4-Programmrahmenwark +Name[nl]=KDE4-programmaframewerk +Name[pl]=Szablon programu dla KDE4 +Name[pt]=Plataforma de aplicações do KDE4 +Name[pt_BR]=Plataforma de aplicações do KDE4 +Name[ru]=Инструментарий для создания приложений KDE 4 +Name[sk]=KDE4 aplikačný framework +Name[sr]=Радни оквир KDE4 програма +Name[sr@Latn]=Radni okvir KDE4 programa +Name[sv]=KDE 4-programramverk +Name[zh_TW]=KDE4 應用程式框架 +Icon=kde4app.png +Category=C++/KDE4 +Comment=Generates a simple KDE4 application with one toplevel window, menus and toolbars. +Comment[ca]=Genera una aplicació senzilla per al KDE4 amb una finestra principal, menús i barres d'eines. +Comment[da]=Genererer et simpelt KDE4-program med et vindue på topniveau, menuer og værktøjslinjer. +Comment[de]=Erstellt eine einfache KDE 4-Anwendung mit einem Toplevel-Fenster, Menüs und Werkzeugleisten. +Comment[el]=Δημιουργεί μια απλή εφαρμογή του KDE4 με ένα ανώτερο παράθυρο, μενού, και γραμμές εργαλείων. +Comment[es]=Genera una sencilla aplicación para KDE4 con una ventana principal, menús y barras de herramientas. +Comment[et]=Lihtsa KDE4 rakenduse loomine ühe tipptaseme akna, menüüde ja tööriistaribadega. +Comment[hu]=Létrehoz egy egyszerű KDE4-alkalmazást egy főablakkal, menükkel és eszköztárakkal. +Comment[it]=Genera una semplice applicazione KDE4 con una finestra toplevel, menu e barre degli strumenti. +Comment[nds]=Stellt en eenfach KDE4-Programm mit een böverst Finster, Menüs un Warktüüchbalkens op. +Comment[nl]=Genereert een eenvoudig KDE4-programma met een topniveauvenster, menu's en werkbalken. +Comment[pl]=Generuje prosty program dla KDE4 posiadający okno, menu i paski narzędzi. +Comment[pt]=Gera uma aplicação para KDE4 simples, com uma janela de topo, menus e barras de ferramentas. +Comment[pt_BR]=Gera uma aplicação para KDE4 simples, com uma janela de topo, menus e barras de ferramentas. +Comment[ru]=Создание простого приложения KDE 4 с одним окном верхнего уровня, меню и панелями инструментов. +Comment[sk]=Vygeneruje jednoduchú KDE4 aplikáciu s jedným oknom, menu a panelom nástrojov. +Comment[sr]=Прави једноставан KDE4 програм са једним прозором највишег нивоа, менијима и тракама са алатом. +Comment[sr@Latn]=Pravi jednostavan KDE4 program sa jednim prozorom najvišeg nivoa, menijima i trakama sa alatom. +Comment[sv]=Skapar ett enkelt KDE 4-program med ett toppnivåfönster, menyer och verktygsrader. +Comment[zh_TW]=產生一個簡單的 KDE4 應用程式,內含頂層視窗、選單與工具列。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/README +Archive=kde4app.tar.gz + +[FILE1] +Type=install +Source=%{src}/CMakeLists.txt +Dest=%{dest}/CMakeLists.txt + +[FILE2] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/main.cpp + +[FILE3] +Type=install +Source=%{src}/kapp4.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE4] +Type=install +Source=%{src}/kapp4.h +Dest=%{dest}/%{APPNAMELC}.h + +[FILE5] +Type=install +Source=%{src}/kapp4view.cpp +Dest=%{dest}/%{APPNAMELC}view.cpp + + +[FILE6] +Type=install +Source=%{src}/kapp4view.h +Dest=%{dest}/%{APPNAMELC}view.h + + +[FILE7] +Type=install +Source=%{src}/kde4appui.rc +Dest=%{dest}/%{APPNAMELC}ui.rc + + +[FILE8] +Type=install +Source=%{src}/kapp4view_base.ui +Dest=%{dest}/%{APPNAMELC}view_base.ui + + +[FILE9] +Type=install +Source=%{src}/kapp4.desktop +Dest=%{dest}/%{APPNAMELC}.desktop + +[FILE10] +Type=install +Source=%{src}/kapp4.kcfg +Dest=%{dest}/%{APPNAMELC}.kcfg + + +[FILE11] +Type=install +Source=%{src}/prefs_base.ui +Dest=%{dest}/prefs_base.ui + + +[FILE12] +Type=install +Source=%{src}/settings.kcfgc +Dest=%{dest}/settings.kcfgc + +[FILE13] +Type=install +Source=%{src}/README +Dest=%{dest}/README + +[FILE14] +Type=install +Source=%{src}/kde4app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE15] +Type=install +Source=%{src}/kde4app.kdevelop.filelist +Dest=%{dest}/%{APPNAMELC}.kdevelop.filelist + +[MKDIR1] +Type=mkdir +Dir=%{dest}/build + +[MSG] +Type=message +Comment=A KDE4 Application was created at %{dest} +Comment[ca]=S'ha creat una aplicació per al KDE4 a %{dest} +Comment[da]=Et KDE4-program blev oprettet i %{dest} +Comment[de]=Eine KDE 4-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή KDE4 δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación para KDE4 ha sido creada en %{dest} +Comment[et]=KDE4 rakendus loodi asukohta %{dest} +Comment[hu]=Létrejött egy KDE4-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KDE4 in %{dest} +Comment[nds]=In %{dest} wöör en KDE4-Programm opstellt +Comment[nl]=Een KDE4-toepassing is aangemaakt in %{dest} +Comment[pl]=Program dla KDE4 został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KDE4 em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KDE4 em %{dest} +Comment[ru]=Приложение KDE 4 создано в %{dest} +Comment[sk]=KDE4 aplikácia bola vytvorená v %{dest} +Comment[sr]=KDE4 програм је направљен у %{dest} +Comment[sr@Latn]=KDE4 program je napravljen u %{dest} +Comment[sv]=Ett KDE 4-program skapades i %{dest} +Comment[zh_TW]=一個 KDE4 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kde4app/kde4app.png b/languages/cpp/app_templates/kde4app/kde4app.png new file mode 100644 index 00000000..a421a664 Binary files /dev/null and b/languages/cpp/app_templates/kde4app/kde4app.png differ diff --git a/languages/cpp/app_templates/kde4app/kde4appui.rc b/languages/cpp/app_templates/kde4app/kde4appui.rc new file mode 100644 index 00000000..406bccc6 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/kde4appui.rc @@ -0,0 +1,8 @@ + + + + &Move + + + + diff --git a/languages/cpp/app_templates/kde4app/main.cpp b/languages/cpp/app_templates/kde4app/main.cpp new file mode 100644 index 00000000..2bb5b6bf --- /dev/null +++ b/languages/cpp/app_templates/kde4app/main.cpp @@ -0,0 +1,55 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE 4 Application"); + +static const char version[] = "%{VERSION}"; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", 0, ki18n("%{APPNAME}"), version, ki18n(description), + KAboutData::License_%{LICENSE}, ki18n("(C) %{YEAR} %{AUTHOR}"), KLocalizedString(), 0, "%{EMAIL}"); + about.addAuthor( ki18n("%{AUTHOR}"), KLocalizedString(), "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + + KCmdLineOptions options; + options.add("+[URL]", ki18n( "Document to open" )); + KCmdLineArgs::addCmdLineOptions(options); + KApplication app; + + %{APPNAME} *widget = new %{APPNAME}; + + // see if we are starting with session management + if (app.isSessionRestored()) + { + RESTORE(%{APPNAME}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->count() == 0) + { + //%{APPNAMELC} *widget = new %{APPNAMELC}; + widget->show(); + } + else + { + int i = 0; + for (; i < args->count(); i++) + { + //%{APPNAMELC} *widget = new %{APPNAMELC}; + widget->show(); + } + } + args->clear(); + } + + return app.exec(); +} diff --git a/languages/cpp/app_templates/kde4app/prefs_base.ui b/languages/cpp/app_templates/kde4app/prefs_base.ui new file mode 100644 index 00000000..ea400f02 --- /dev/null +++ b/languages/cpp/app_templates/kde4app/prefs_base.ui @@ -0,0 +1,155 @@ + + prefs_base + + + + 0 + 0 + 282 + 156 + + + + + + + Background color: + + + false + + + + + + + Choose a new background color + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change the <span style=" font-weight:600;">background</span> color by clicking here and choose the new <span style=" color:#ff0000;">color</span> in the <span style=" font-style:italic;">color dialog</span>.</p></body></html> + + + + + + + + + + Project age: + + + false + + + + + + + Foreground color: + + + false + + + + + + + Choose a new foreground color + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change the <span style=" font-weight:600;">foreground</span> color by clicking here and choose the new <span style=" color:#ff0000;">color</span> in the <span style=" font-style:italic;">color dialog</span>.</p></body></html> + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 41 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 41 + 20 + + + + + + + + Set the project age (in days) + + + Change the project age (in days) by choosing a new number of days. + + + 1 + + + 2 + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 41 + 20 + + + + + + + + qPixmapFromMimeSource + + + KColorButton + QPushButton +
kcolorbutton.h
+
+
+ + kcolorbutton.h + + + +
diff --git a/languages/cpp/app_templates/kde4app/settings.kcfgc b/languages/cpp/app_templates/kde4app/settings.kcfgc new file mode 100644 index 00000000..384510cd --- /dev/null +++ b/languages/cpp/app_templates/kde4app/settings.kcfgc @@ -0,0 +1,6 @@ +# Code generation options for kconfig_compiler +File=%{APPNAMELC}.kcfg +ClassName=Settings +Singleton=true +Mutators=col_background,col_foreground +# will create the necessary code for setting those variables diff --git a/languages/cpp/app_templates/kdecpp.appwizard b/languages/cpp/app_templates/kdecpp.appwizard new file mode 100644 index 00000000..aa36123a --- /dev/null +++ b/languages/cpp/app_templates/kdecpp.appwizard @@ -0,0 +1,2 @@ +[General] +List=kdedcop,kioslave,kxt,kdevlang,kmake,kapp,kconfig35,kdevlang,kdevpart,kateplugin,kdevpart2,kopart,noatunui,kateplugin2,kfileplugin,konqnavpanel,noatunvisual,dcopservice,khello,kpartapp,khello2,kpartplugin,kcmodule,kicker,kscreensaver,kscons_kxt,kscons_kmdi diff --git a/languages/cpp/app_templates/kdedcop/.kdev_ignore b/languages/cpp/app_templates/kdedcop/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kdedcop/Makefile.am b/languages/cpp/app_templates/kdedcop/Makefile.am new file mode 100644 index 00000000..87697fcd --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = app.cpp app.h app_iface.h app.kdevelop main.cpp mainclass.cpp \ + mainclass.h kdedcop.png src-Makefile.am subdirs + +templateName = kdedcop + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kdedcop/app.cpp b/languages/cpp/app_templates/kdedcop/app.cpp new file mode 100644 index 00000000..e295253a --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/app.cpp @@ -0,0 +1,21 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" + +#include + +#include +#include + +%{APPNAME}::%{APPNAME}() + : KMainWindow( 0, "%{APPNAME}" ) +{ + m_mainClass = new MainClass(); +} + +%{APPNAME}::~%{APPNAME}() +{ + if (m_mainClass) delete m_mainClass; +} + +#include "%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/kdedcop/app.h b/languages/cpp/app_templates/kdedcop/app.h new file mode 100644 index 00000000..b908b62c --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/app.h @@ -0,0 +1,36 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "mainclass.h" + +/** + * @short Application Main Window + * @author %{AUTHOR} <%{EMAIL}> + * @version 0.1 + */ +class %{APPNAME} : public KMainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); +private: + MainClass *m_mainClass; +}; + +#endif // _%{APPNAMEUC}_H_ diff --git a/languages/cpp/app_templates/kdedcop/app.kdevelop b/languages/cpp/app_templates/kdedcop/app.kdevelop new file mode 100644 index 00000000..496a3838 --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/app.kdevelop @@ -0,0 +1,116 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + DCOP + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kdedcop/app_iface.h b/languages/cpp/app_templates/kdedcop/app_iface.h new file mode 100644 index 00000000..57bfb059 --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/app_iface.h @@ -0,0 +1,19 @@ +%{H_TEMPLATE} + +#include + +class DCOPDemoIface : virtual public DCOPObject +{ + K_DCOP + k_dcop: + + + // Here you should place your DCOP interface. + // Below are four example methods. + virtual QString strVal() const = 0; + virtual int intVal() const = 0; + + virtual void setIntVal( int num ) = 0; + virtual void setStrVal( const QString &str ) = 0; + +}; diff --git a/languages/cpp/app_templates/kdedcop/kdedcop.kdevtemplate b/languages/cpp/app_templates/kdedcop/kdedcop.kdevtemplate new file mode 100644 index 00000000..99f6e28d --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/kdedcop.kdevtemplate @@ -0,0 +1,227 @@ +# KDE Config File +[General] +Name=Simple DCOP server +Name[ca]=Simple servidor DCOP +Name[da]=Simpel DCOP-server +Name[de]=Einfacher DCOP-Server +Name[el]=Απλός εξυπηρετητής DCOP +Name[es]=Sencillo servidor DCOP +Name[et]=Lihtne DCOP-server +Name[eu]=DCOP zerbitzari sinple bat +Name[fa]=کارساز سادۀ DCOP +Name[fr]=Serveur DCOP simple +Name[ga]=Freastalaí simplí DCOP +Name[gl]=Servidor sinxelo DCOP +Name[hu]=Egyszerű DCOP-kiszolgáló +Name[it]=Semplice server DCOP +Name[ja]=簡単な DCOP サーバ +Name[nds]=Eenfach DCOP-Server +Name[ne]=साधारण DCOP सर्भर +Name[nl]=Eenvoudige DCOP-server +Name[pl]=Prosty serwer DCOP +Name[pt]=Servidor de DCOP simples +Name[pt_BR]=Servidor de DCOP simples +Name[ru]=Сервер DCOP +Name[sk]=Jednoduchý DCOP server +Name[sl]=Preprost strežnik DCOP +Name[sr]=Једноставан DCOP сервер +Name[sr@Latn]=Jednostavan DCOP server +Name[sv]=Enkel DCOP-server +Name[tr]=Basit DCOP Sunucusu +Name[zh_CN]=简单的 DCOP 服务器 +Name[zh_TW]=簡單的 DCOP 伺服器 +Icon=kdedcop.png +Category=C++/KDE +Comment=Generates a basic KDE DCOP server. This is an ideal starting point for a DCOP server that does not require a GUI interface. +Comment[ca]=Genera un servidor bàsic DCOP per al KDE. Aquest és un idoni punt de partida per a un servidor DCOP que no requereixi d'una IGU. +Comment[da]=Genererer en basal KDE DCOP-server. Dette er et ideelt startpunkt for en DCOP-server der ikke kræver en GUI-grænseflade. +Comment[de]=Erstellt einen einfachen KDE-DCOP-Server. Dies ist ein idealer Ausgangspunkt für einen DCOP-Server, der keine Benutzeroberfläche erfordert. +Comment[el]=Δημιουργεί ένα βασικό εξυπηρετητή KDE DCOP. Αυτό είναι ένα ιδανικό σημείο αρχής για έναν εξυπηρετητή DCOP ο οποίος δε χρειάζεται ένα γραφικό περιβάλλον. +Comment[es]=Genera un servidor básico DCOP para KDE. Es un punto de comienzo ideal para un servidor DCOP que no requiera una interfaz gráfica. +Comment[et]=Lihtsa KDE DCOP-serveri loomine. See on ideaalne algus DCOP-serverile, mis ei eelda graafilist kasutajaliidest. +Comment[eu]=DCOP zerbitzari sinple bat sortzen du. Hau GUI interfazerik behar ez duen DCOP zerbitzari baterako hasierako puntu aparta da. +Comment[fa]=یک کارساز پایۀ KDE DCOP تولید می‌کند. این یک نقطۀ شروع دلخواه برای یک کارساز DCOP است، که نیازی به یک واسط ونک ندارد. +Comment[fr]=Génère un serveur DCOP KDE de base. C'est un bon point de départ pour un serveur DCOP qui ne requiert pas d'interface graphique. +Comment[gl]=Xera un servidor básico DCOP para KDE. Este é un punto de comezo ideal para un servidor DCOP que non require unha interface GUI. +Comment[hu]=Létrehoz egy egyszerű KDE DCOP-os kiszolgálót. Jó kiindulópont grafikus felület nélküli DCOP-kiszolgáló készítéséhez. +Comment[it]=Genera un semplice server DCOP per KDE. È un punto di partenza ideale per un server DCOP che non richiede un'interfaccia GUI. +Comment[ja]=基本的な KDE DCOP サーバを作成します。GUI を必要としない DCOP サーバの理想的な開始点です。 +Comment[nds]=Stellt en eenfach DCOP-Server op. Dat is en goot Anfang för en DCOP-Server ahn Böversiet. +Comment[ne]=आधारभूत KDE DCOP सर्भर उत्पन्न गर्दछ । यो DCOP सर्भरका लागि उपयुक्त सुरुआत बिन्दु हो जसलाई जी यू आई इन्टरफेस आवश्यक पर्दैन । +Comment[nl]=Genereert een basis KDE DCOP-server. Dit is een ideaal startpunt voor een DCOP-server die geen GUI-interface vereist. +Comment[pl]=Generuje prosty serwer KDE DCOP. Dobry punkt startu dla serwera DCOP, który nie potrzebuje interfejsu graficznego. +Comment[pt]=Gera um servidor básico de DCOP para o KDE. Este é um ponto de partida ideal para um servidor de DCOP que não necessite de uma interface gráfica. +Comment[pt_BR]=Gera um servidor básico de DCOP para o KDE. Este é um ponto de partida ideal para um servidor de DCOP que não necessite de uma interface gráfica. +Comment[ru]=Создание простого сервера DCOP. Идеальная стартовая точка для разработки сервера DCOP без графического интерфейса. +Comment[sk]=Vygeneruje základný KDE DCOP server. Toto je ideálny štartovací bod pre DCOP server, ktorý nepotrebuje GUI rozhranie. +Comment[sl]=Ustvari osnovni strežnik DCOP za KDE. To je idealno začetno mesto za strežnik DCOP, ki ne potrebuje grafičnega vmesnika. +Comment[sr]=Прави основан KDE DCOP сервер. Ово је идеална почетна тачка за DCOP сервер који не захтева GUI. +Comment[sr@Latn]=Pravi osnovan KDE DCOP server. Ovo je idealna početna tačka za DCOP server koji ne zahteva GUI. +Comment[sv]=Skapar en grundläggande KDE DCOP-server. Detta är en idealisk utgångspunkt för en DCOP-server som inte kräver ett grafiskt användargränssnitt. +Comment[tr]=Basit bir KDE DCOP sunucusu yaratır. Bu grafik arayüz gerektirmeyen bir DCOP sunucusuna başlamak için uygun bir noktadır. +Comment[zh_CN]=生成简单的 KDE DCOP 服务器。这是不需要图形界面的 DCOP 服务器的良好开端。 +Comment[zh_TW]=產生一個基本的 KDE DCOP 伺服器。這個是開發一個不需使用者介面的 DCOP 伺服器的一個好起點。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/main.cpp +Archive=kdedcop.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE10] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE11] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE12] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE13] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE14] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE15] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE16] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE17] +Type=install +Source=%{src}/mainclass.cpp +Dest=%{dest}/src/mainclass.cpp + +[FILE18] +Type=install +Source=%{src}/mainclass.h +Dest=%{dest}/src/mainclass.h + +[FILE19] +Type=install +Source=%{src}/app_iface.h +Dest=%{dest}/src/%{APPNAMELC}_iface.h + +[FILE20] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[MSG] +Type=message +Comment=A simple DCOP server was created in %{dest} +Comment[ca]=Un simple servidor DCOP ha estat creat en %{dest} +Comment[da]=En simpel DCOP-server blev oprettet i %{dest} +Comment[de]=Ein einfacher DCOP-Server wurde in %{dest} erstellt. +Comment[el]=Ένας απλός εξυπηρετητής DCOP δημιουργήθηκε στο %{dest} +Comment[es]=Un sencillo servidor DCOP ha sido creado en %{dest} +Comment[et]=Lihtne DCOP-server loodi asukohta %{dest} +Comment[eu]=DCOP zerbitzari sinple bat sortu da hemen: %{dest} +Comment[fa]=یک کارساز سادۀ DCOP در %{dest} ایجاد شد +Comment[fr]=Un serveur DCOP simple a été créé dans %{dest} +Comment[ga]=Cruthaíodh freastalaí simplí DCOP i %{dest} +Comment[gl]=Creouse un servidor DCOP sinxelo en %{dest} +Comment[hu]=Létrejött egy egyszerű DCOP-kiszolgáló itt: %{dest} +Comment[it]=È stato creato un semplice server DCOP in %{dest} +Comment[ja]=簡単な DCOP サーバを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach DCOP-Server opstellt +Comment[ne]=साधारण DCOP सर्भर %{dest} मा सिर्जना गरियो +Comment[nl]=Een eenvoudige DCOP-server is aangemaakt in %{dest} +Comment[pl]=Prosty serwer DCOP został utworzony w %{dest} +Comment[pt]=Foi criado um servidor de DCOP simples em %{dest} +Comment[pt_BR]=Foi criado um servidor de DCOP simples em %{dest} +Comment[ru]=Простой сервер DCOP создан в %{dest} +Comment[sk]=Jednoduchý DCOP server bol vytvorený v %{dest} +Comment[sl]=Preprost strežnik DCOP je bil ustvarjen v %{dest} +Comment[sr]=Једноставан DCOP сервер направљен је у %{dest} +Comment[sr@Latn]=Jednostavan DCOP server napravljen je u %{dest} +Comment[sv]=En enkel DCOP-server skapades i %{dest} +Comment[tr]=Basit bir DCOP sunucusu %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了简单的 DCOP 服务器 +Comment[zh_TW]=一個簡單的 DCOP 伺服器已建立於 %{dest} diff --git a/languages/cpp/app_templates/kdedcop/kdedcop.png b/languages/cpp/app_templates/kdedcop/kdedcop.png new file mode 100644 index 00000000..1d25362b Binary files /dev/null and b/languages/cpp/app_templates/kdedcop/kdedcop.png differ diff --git a/languages/cpp/app_templates/kdedcop/main.cpp b/languages/cpp/app_templates/kdedcop/main.cpp new file mode 100644 index 00000000..5bfcf8ae --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/main.cpp @@ -0,0 +1,52 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE KPart Application"); + +static const char version[] = "0.1"; + +static KCmdLineOptions options[] = +{ +// { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions( options ); + KApplication app; + %{APPNAME} *mainWin = 0; + + if (app.isRestored()) + { + RESTORE(%{APPNAME}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + + /// @todo do something with the command line args here + + mainWin = new %{APPNAME}(); + app.setMainWidget( mainWin ); + mainWin->show(); + + args->clear(); + } + + int ret = app.exec(); + + delete mainWin; + return ret; +} diff --git a/languages/cpp/app_templates/kdedcop/mainclass.cpp b/languages/cpp/app_templates/kdedcop/mainclass.cpp new file mode 100644 index 00000000..8f334114 --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/mainclass.cpp @@ -0,0 +1,31 @@ +%{CPP_TEMPLATE} + +#include "mainclass.h" + + +MainClass::MainClass() + : DCOPDemoIface(), + DCOPObject("mainclass"), /* this is the object name DCOP will expose */ + m_intValue(0) +{ +} + +MainClass::~MainClass() +{ +} + +void MainClass::setStrVal(const QString & str) { + m_strValue = str; +} + +void MainClass::setIntVal(int val) { + m_intValue = val; +} + +QString MainClass::strVal() const { + return m_strValue; +} + +int MainClass::intVal() const { + return m_intValue; +} diff --git a/languages/cpp/app_templates/kdedcop/mainclass.h b/languages/cpp/app_templates/kdedcop/mainclass.h new file mode 100644 index 00000000..ca37f2ad --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/mainclass.h @@ -0,0 +1,32 @@ +%{H_TEMPLATE} + +#ifndef MAINCLASS_H +#define MAINCLASS_H + +#include "%{APPNAMELC}_iface.h" + +/** + * + * @author %{AUTHOR} + **/ +class MainClass : virtual public DCOPDemoIface +{ +public: + MainClass(); + + ~MainClass(); + + + // Here is the implementation of the example DCOP interface methods. + virtual void setStrVal(const QString &); + virtual void setIntVal(int); + virtual QString strVal() const; + virtual int intVal() const; + +private: + QString m_strValue; + int m_intValue; + +}; + +#endif diff --git a/languages/cpp/app_templates/kdedcop/src-Makefile.am b/languages/cpp/app_templates/kdedcop/src-Makefile.am new file mode 100644 index 00000000..dc26ec93 --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/src-Makefile.am @@ -0,0 +1,23 @@ +## Makefile.am for %{APPNAMELC} + +# set the include path for X, qt and KDE +INCLUDES = $(all_includes) + +# these are the headers for your project +noinst_HEADERS = %{APPNAMELC}.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = %{APPNAMELC} + +# the application source, library search path, and link libraries +%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp %{APPNAMELC}_iface.skel mainclass.cpp +%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries) +%{APPNAMELC}_LDADD = $(LIB_KDEUI) diff --git a/languages/cpp/app_templates/kdedcop/subdirs b/languages/cpp/app_templates/kdedcop/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kdedcop/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kdevlang/.kdev_ignore b/languages/cpp/app_templates/kdevlang/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kdevlang/Makefile.am b/languages/cpp/app_templates/kdevlang/Makefile.am new file mode 100644 index 00000000..972dd511 --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = src-Makefile.am kdevlang_part.cpp kdevlang_part.h kdevlang.rc \ + kdevlang.desktop app.kdevelop kdevlang-configure.in.in README.dox +templateName = kdevlang + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kdevlang/README.dox b/languages/cpp/app_templates/kdevlang/README.dox new file mode 100644 index 00000000..86968add --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/README.dox @@ -0,0 +1,55 @@ +/** \class %{APPNAME} +Put a brief description here, the brief description ends at the first dot. +Put a more detailed description of your part in these lines. It can span +over several lines. You can even use some html commands in these lines like: +This is code, html links link text, +and images. + +\authors %{AUTHOR} +\authors 2nd author full name +... +\authors nth author full name + +\maintainer %{AUTHOR} +\maintainer 2nd maintainer full name +... +\maintainer nth maintainer full name + +\feature Describe the first feature +\feature Describe the second feature +... +\feature Describe the last feature + +\bug bugs in +YOUR_COMPONENT_NAME at Bugzilla database +\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet. +.. +\bug Describe a the nth bug that you know of, but probably hasn't been reported yet. + +\requirement Describe a the 1st requirement of your part. +\requirement Describe a the 2nd requirement of your part. +... +\requirement Describe a the nth requirement of your part. + +\todo Describe a the 1st TODO of your part. +\todo Describe a the 2nd TODO of your part. +... +\todo Describe a the nth TODO of your part. + +\faq First frequenly asked question about your part ? Answer. +\faq Second frequenly asked question about your part ? Answer. +... +\faq Last frequenly asked question about your part ? Answer. + +\note First note text. +\note Second note text. +... +\note Last note text. + +\warning First warning text. +\warning Second warning text. +... +\warning Last warning text. + +*/ diff --git a/languages/cpp/app_templates/kdevlang/app.kdevelop b/languages/cpp/app_templates/kdevlang/app.kdevelop new file mode 100644 index 00000000..7a0e573b --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/app.kdevelop @@ -0,0 +1,115 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + KDevelop + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/%{APPNAMELC} + + + src/%{APPNAMELC} + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kdevlang/kdevlang-configure.in.in b/languages/cpp/app_templates/kdevlang/kdevlang-configure.in.in new file mode 100644 index 00000000..78ed2275 --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/kdevlang-configure.in.in @@ -0,0 +1,10 @@ +#MIN_CONFIG(3.0.0) + +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + +KDE_CHECK_HEADERS([kdevelop/kdevcore.h]) +KDE_CHECK_LIB([kdevelop],main, + [LIBKDEVELOP="-lkdevelop"]) +AC_SUBST(LIBKDEVELOP) diff --git a/languages/cpp/app_templates/kdevlang/kdevlang.desktop b/languages/cpp/app_templates/kdevlang/kdevlang.desktop new file mode 100644 index 00000000..d8f320a3 --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/kdevlang.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=%{APPNAME} +Comment[pt]=%{APPNAME$} +Name=KDev%{APPNAME} +Name[nds]=KDev%{ProgNaam} +Name[sv]=KDevelop %{APPNAME} +Name[ta]=கெடெவ்%{APPNAME} +Icon=kdevelop +ServiceTypes=KDevelop/LanguageSupport +X-KDevelop-Language=ChangeMe +X-KDE-Library=libkdev%{APPNAMELC} +X-KDevelop-Version=3 diff --git a/languages/cpp/app_templates/kdevlang/kdevlang.kdevtemplate b/languages/cpp/app_templates/kdevlang/kdevlang.kdevtemplate new file mode 100644 index 00000000..c3ad93bf --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/kdevlang.kdevtemplate @@ -0,0 +1,157 @@ +# KDE Config File +[General] +Name=KDevelop Language Support Plugin (Standalone build) +Name[ca]=Connector per al suport de llenguatge a KDevelop (de construcció aïllada) +Name[da]=KDevelop plugin for sprogstøttet (alenestående bygning) +Name[de]=KDevelop-Modul für Sprachunterstützung (Unabhängige Erstellung) +Name[el]=Πρόσθετο υποστήριξης γλώσσας του KDevelop (αυτόνομη κατασκευή) +Name[es]=Complemento de implementación de lenguaje para KDevelop (construcción independiente) +Name[et]=KDevelopi keeletoetuse plugin (autonoomne) +Name[eu]=KDevelop-en lengoaien euskarrien interfazea (eraikuntza autonomoak) +Name[fa]=وصلۀ پشتیبانی زبان KDevelop )ساخت خوداتکا( +Name[fr]=Module externe de prise en charge de langage de KDevelop (construction autonome) +Name[ga]=Breiseán Tacaíochta Teanga le haghaidh KDevelop (Tógáil Shaorsheasaimh) +Name[gl]=Extensión de soporte de linguaxes para KDevelop (compilación independente) +Name[hu]=KDevelop nyelvtámogató modul (önálló) +Name[it]=Plugin di supporto per linguaggio di KDevelop (compilazione indipendente) +Name[ja]=KDevelop 言語サポートプラグイン (スタンダローンビルド) +Name[nds]=KDevelop-Moduul för Spraakünnerstütten (Enkelprogramm) +Name[ne]=केडीई विकास भाषा समर्थन प्लगइन (स्ट्यान्डअलोन निर्माण) +Name[nl]=KDEvelop Taalondersteuning Plugin (Standalone build) +Name[pl]=Wtyczka KDevelopa do obsługi języka (budowana oddzielnie) +Name[pt]='Plugin' de Suporte a Linguagens do KDevelop (compilação autónoma) +Name[pt_BR]='Plugin' de Suporte a Linguagens do KDevelop (compilação autónoma) +Name[ru]=Интерфейс языковой поддержки для KDevelop (внешний) +Name[sk]=KDevelop modul pre jazykovú podporu (samostatný build) +Name[sl]=Vstavek jezikovne podpore za KDevelop (samostojna izgradnja) +Name[sr]=KDevelop-ов интерфејс за језичку подршку (самостална градња) +Name[sr@Latn]=KDevelop-ov interfejs za jezičku podršku (samostalna gradnja) +Name[sv]=KDevelop-insticksprogram för språkstöd (att bygga fristående) +Name[tr]=KDevelop Dil Desteği Eklentisi (Kendi başına çalışabilen kurulum) +Name[zh_CN]=KDevelop 语言支持插件(独立编译) +Name[zh_TW]=KDevelop 語言支援外掛程式(單獨建立) +Category=C++/KDevelop/ +Comment=This generates a language support plugin for KDevelop, to be built outside of the KDevelop source tree. +Comment[ca]=Genera un connector per al suport de llenguatge a KDevelop, per a que es construeixi fora de l'arbre de fonts de KDevelop. +Comment[da]=Dette genererer en sprogstøtte-plugin for KDevelop, der skal bygges udenfor KDevelop's kildetræ. +Comment[de]=Hiermit wird ein Sprachunterstützungsmodul für KDevelop generiert, das außerhalb des Quelltextbaumes von KDevelop erstellt wird. +Comment[el]=Αυτό δημιουργεί ένα πρόσθετο υποστήριξης γλώσσας για το KDevelop, για την κατασκευή του έξω από το δέντρο πηγαίου κώδικα του KDevelop. +Comment[es]=Genera un complemento de implementación de lenguaje para KDevelop, para ser construido fuera del árbol de código fuente de KDevelop. +Comment[et]=KDevelopi keeletoetuse plugina loomine, mida saab ehitada väljaspool KDevelopi lähtekoodipuud. +Comment[eu]=Honek KDevelop-en lengoai-euskarrirako plugin bat sortzen du, KDevelop-en iturburu zuhaitzetik at eraikitzeko. +Comment[fa]=یک وصلۀ پشتیبان برای KDevelop تولید می‌کند، تا در بیرون درخت منبع KDevelop ساخته شود. +Comment[fr]=Génère un module externe de prise en charge de langage pour KDevelop, à construire en dehors de l'arborescence des sources de KDevelop. +Comment[gl]=Isto xera unha extensión de soporte de linguaxes para KDevelop que se compilará fóra da árbore de código de KDevelop. +Comment[hu]=Létrehoz egy nyelvtámogató modult a KDevelophoz, mely a KDevelopos forráskönyvtáron kívül fordítható le. +Comment[it]=Genera un plugin di supporto per linguaggio per KDevelop, deve essere compilato fuori dell'albero sorgente di KDevelop. +Comment[nds]=Dit stellt en Spraakünnerstütten-Moduul för KDevelop op, dat buten den KDevelop-Bornboom kompileert warrt. +Comment[ne]=यसले केडीई विकासका लागि केडीई विकास स्रोत ट्रीको बाहिर निर्माण गर्न, भाषा समर्थन प्लगइन उत्पन्न गर्दछ । +Comment[nl]=Dit genereert een taalondersteuningsplugin voor KDEvelop, welke buiten de KDevelop sourcetree wordt gebouwd. +Comment[pl]=Generuje wtyczkę do obsługi języka w KDevelopie. Wtyczka jest budowana poza drzewem źródłowym KDevelopa. +Comment[pt]=Isto gera um 'plugin' de suporte de linguagens para o KDevelop, que possa ser compilado fora da árvore de código do KDevelop. +Comment[pt_BR]=Isto gera um 'plugin' de suporte de linguagens para o KDevelop, que possa ser compilado fora da árvore de código do KDevelop. +Comment[ru]=Создание интерфейса языковой поддержки для KDevelop со сборкой вне исходного кода KDevelop. +Comment[sk]=Vygeneruje modul pre jazykovú podporu pre KDevelop, tak aby ho bolo možné kompilovať mimo zdrojového stromu KDevelop. +Comment[sr]=Ово прави прикључак за језичку подршку за KDevelop, који се гради ван KDevelop-овог изворног стабла. +Comment[sr@Latn]=Ovo pravi priključak za jezičku podršku za KDevelop, koji se gradi van KDevelop-ovog izvornog stabla. +Comment[sv]=Detta skapar ett KDevelop-insticksprogram för språkstöd, att bygga utanför KDevelops källkodsträd. +Comment[tr]=Bu KDevelop için, KDevelop kaynak ağacının dışında olacak, bir dil desteği eklentisi yaratır. +Comment[zh_CN]=这将生成 KDevelop 的语言支持插件,可以在 KDevelop 源代码树之外编译。 +Comment[zh_TW]=產生一個 KDevelop 語言支援外掛程式,建立在 KDevelop 程式源碼樹之外。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}_part.cpp +Archive=kdevlang.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE5] +Type=install +Source=%{src}/kdevlang-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE6] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE7] +Type=install +Source=%{src}/kdevlang_part.cpp +Dest=%{dest}/src/%{APPNAMELC}_part.cpp + +[FILE8] +Type=install +Source=%{src}/kdevlang_part.h +Dest=%{dest}/src/%{APPNAMELC}_part.h + +[FILE9] +Type=install +EscapeXML=true +Source=%{src}/kdevlang.rc +Dest=%{dest}/src/kdev%{APPNAMELC}.rc + +[FILE10] +Type=install +Source=%{src}/kdevlang.desktop +Dest=%{dest}/src/kdev%{APPNAMELC}.desktop + +[FILE11] +Type=install +Source=%{src}/README.dox +Dest=%{dest}/src/README.dox + +[MSG] +Type=message +Comment=A language plugin for KDevelop for standalone build was created in %{dest} +Comment[ca]=Un connector per a llenguatge a KDevelop i de construcció aïllada ha estat creat en %{dest} +Comment[da]=Et sprog-plugin for KDevelop for alenestående bygning blev oprettet i %{dest} +Comment[de]=Ein Sprachunterstützungsmodul für KDevelop (unabhängige Erstellung) wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο γλώσσας για το KDevelop για αυτόνομη κατασκευή δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento de lenguaje para KDevelop de construcción independiente ha sido creado en %{dest} +Comment[et]=KDevelopi autonoomne keeleplugin loodi asukohta %{dest} +Comment[eu]=KDevelop-en hizkuntza plugin autonomo bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ زبان برای KDevelop جهت ساخت خوداتکا در %{dest} ایجاد شد +Comment[fr]=Un module externe de langage pour KDevelop à construire de façon autonome a été créé dans %{dest} +Comment[gl]=Creouse unha extensión de linguaxe para KDevelop a compilar de forma independente en %{dest} +Comment[hu]=Létrejött egy KDevelopos nyelvtámogató modul (önálló lefordításra) itt: %{dest} +Comment[it]=È stato creato un plugin di linguaggio per KDevelop per compilazione indipendente %{dest} +Comment[nds]=In %{dest} wöör en Spraakünnerstütten-Moduul för KDevelop (Enkelprogramm) opstellt +Comment[ne]=स्ट्यान्डअलोन निर्माण गर्न केडीई विकासका लागि भाषा प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een taalplugin voor KDevelop voor standalone build is aangemaakt in %{dest} +Comment[pl]=Wtyczka języka dla KDevelopa do budowy oddzielnie została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' de linguagens de compilação autónoma para o KDevelop em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' de linguagens de compilação autónoma para o KDevelop em %{dest} +Comment[ru]=Внешний интерфейс языковой поддержки для KDevelop создан в %{dest} +Comment[sk]=Modul pre jazykovú podporu pre KDevelop bol vutvorený v %{dest} +Comment[sr]=Језички прикључак за KDevelop за самосталну градњу направљен је у %{dest} +Comment[sr@Latn]=Jezički priključak za KDevelop za samostalnu gradnju napravljen je u %{dest} +Comment[sv]=Ett KDevelop-insticksprogram för språkstöd att bygga fristående skapades i %{dest} +Comment[tr]=Kendi başına çalışabilen bir KDevelop dil eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个独立编译的 KDevelop 语言插件 +Comment[zh_TW]=一個單獨建立的 KDevelop 語言外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kdevlang/kdevlang.png b/languages/cpp/app_templates/kdevlang/kdevlang.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/kdevlang/kdevlang.png differ diff --git a/languages/cpp/app_templates/kdevlang/kdevlang.rc b/languages/cpp/app_templates/kdevlang/kdevlang.rc new file mode 100644 index 00000000..b4e153fa --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/kdevlang.rc @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/languages/cpp/app_templates/kdevlang/kdevlang_part.cpp b/languages/cpp/app_templates/kdevlang/kdevlang_part.cpp new file mode 100644 index 00000000..9d5cadcf --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/kdevlang_part.cpp @@ -0,0 +1,154 @@ +%{CPP_TEMPLATE} + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//#include "%{APPNAMELC}_widget.h" +#include "%{APPNAMELC}_part.h" + +typedef KGenericFactory<%{APPNAME}Part> %{APPNAME}Factory; +K_EXPORT_COMPONENT_FACTORY( libkdev%{APPNAMELC}, %{APPNAME}Factory( "kdev%{APPNAMELC}" ) ); +static const KDevPluginInfo data("kdev%{APPNAMELC}"); + +%{APPNAME}Part::%{APPNAME}Part(QObject *parent, const char *name, const QStringList& ) +: KDevLanguageSupport(&data, parent, name ? name : "%{APPNAME}Part" ) +{ + setInstance(%{APPNAME}Factory::instance()); + setXMLFile("kdevlang_%{APPNAMELC}.rc"); + + + m_build = new KAction( i18n("&Run"), "exec",Key_F9,this, SLOT(slotRun()),actionCollection(), "build_execute" ); + + kdDebug() << "Creating %{APPNAMELC} Part" << endl; + + connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)), + this, SLOT(projectConfigWidget(KDialogBase*)) ); + connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) ); + connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) ); + connect( partController(), SIGNAL(savedFile(const KURL&)), this, SLOT(savedFile(const KURL&)) ); + connect(partController(), SIGNAL(activePartChanged(KParts::Part*)), + this, SLOT(slotActivePartChanged(KParts::Part *))); +} + + +%{APPNAME}Part::~%{APPNAME}Part() +{ + delete m_build; +} + +KDevLanguageSupport::Features %{APPNAME}Part::features() +{ + return Features(Variables | Functions); +} +KMimeType::List %{APPNAME}Part::mimeTypes() +{ + KMimeType::List list; + + KMimeType::Ptr mime = KMimeType::mimeType( "application/x-shellscript" ); + if( mime ) + list << mime; + + return list; +} +void %{APPNAME}Part::slotRun() +{ + // Execute the application here. +} +void %{APPNAME}Part::projectConfigWidget(KDialogBase *dlg) +{ + Q_UNUSED( dlg ); + // Create your config dialog here. +} +void %{APPNAME}Part::projectOpened() +{ + kdDebug(9014) << "projectOpened()" << endl; + + connect( project(), SIGNAL(addedFilesToProject(const QStringList &)), + this, SLOT(addedFilesToProject(const QStringList &)) ); + connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)), + this, SLOT(removedFilesFromProject(const QStringList &)) ); + + // We want to parse only after all components have been + // properly initialized + QTimer::singleShot(0, this, SLOT(parse())); +} +void %{APPNAME}Part::projectClosed() +{ + +} +void %{APPNAME}Part::savedFile(const KURL &fileName) +{ + + + if (project()->allFiles().contains(fileName.path().mid ( project()->projectDirectory().length() + 1 ))) + { + kdDebug(9014) << "parse file " << fileName.path() << endl; + emit addedSourceInfo( fileName.path() ); + } +} +void %{APPNAME}Part::addedFilesToProject(const QStringList &fileList) +{ + kdDebug(9014) << "addedFilesToProject()" << endl; + + QStringList::ConstIterator it; + + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + ( *it ) << endl; + } + + emit updatedSourceInfo(); +} +void %{APPNAME}Part::removedFilesFromProject(const QStringList &fileList) +{ + + + QStringList::ConstIterator it; + + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + QString fileName = project()->projectDirectory() + "/" + ( *it ); + if( codeModel()->hasFile(fileName) ) + { + kdDebug(9014) << "removed " << fileName << endl; + emit aboutToRemoveSourceInfo( fileName ); + codeModel()->removeFile( codeModel()->fileByName(fileName) ); + } + } + +} +void %{APPNAME}Part::parse() +{ + kdDebug(9014) << "initialParse()" << endl; + + if (project()) + { + kapp->setOverrideCursor(waitCursor); + QStringList files = project()->allFiles(); + for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) + { + kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl; + } + emit updatedSourceInfo(); + kapp->restoreOverrideCursor(); + } else { + kdDebug(9014) << "No project" << endl; + } +} +void %{APPNAME}Part::slotActivePartChanged(KParts::Part *part) +{ + kdDebug() << "Changeing active part..." << endl; +} + +#include "%{APPNAMELC}_part.moc" diff --git a/languages/cpp/app_templates/kdevlang/kdevlang_part.h b/languages/cpp/app_templates/kdevlang/kdevlang_part.h new file mode 100644 index 00000000..25721d64 --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/kdevlang_part.h @@ -0,0 +1,43 @@ +%{H_TEMPLATE} + +#ifndef __KDEVPART_%{APPNAMEUC}_H__ +#define __KDEVPART_%{APPNAMEUC}_H__ + + +#include +#include +#include +#include +#include + +class KAction; + +/* + Please read the README.dox file for more info about this part + */ +class %{APPNAME}Part : public KDevLanguageSupport +{ + Q_OBJECT + public: + %{APPNAME}Part(QObject *parent, const char *name, const QStringList &); + ~%{APPNAME}Part(); + protected: + virtual Features features(); + virtual KMimeType::List mimeTypes(); + + private slots: + void slotRun(); + void projectConfigWidget(KDialogBase *dlg); + void projectOpened(); + void projectClosed(); + void savedFile(const KURL &fileName); + void addedFilesToProject(const QStringList &fileList); + void removedFilesFromProject(const QStringList &fileList); + void parse(); + void slotActivePartChanged(KParts::Part *part); + private: + KAction *m_build; +}; + + +#endif diff --git a/languages/cpp/app_templates/kdevlang/src-Makefile.am b/languages/cpp/app_templates/kdevlang/src-Makefile.am new file mode 100644 index 00000000..325352ad --- /dev/null +++ b/languages/cpp/app_templates/kdevlang/src-Makefile.am @@ -0,0 +1,14 @@ +AM_CPPFLAGS = -I$(kde_includes)/kdevelop/interfaces -I$(kde_includes)/kdevelop/util -I$(kde_includes)/kinterfacedesigner $(all_includes) + +kde_module_LTLIBRARIES = libkdev%{APPNAMELC}.la +libkdev%{APPNAMELC}_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libkdev%{APPNAMELC}_la_LIBADD = -lkdevelop +libkdev%{APPNAMELC}_la_SOURCES = %{APPNAMELC}_part.cpp + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdev%{APPNAMELC}.desktop + +rcdir = $(kde_datadir)/kdev%{APPNAMELC} +rc_DATA = kdev%{APPNAMELC}.rc diff --git a/languages/cpp/app_templates/kdevpart/.kdev_ignore b/languages/cpp/app_templates/kdevpart/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kdevpart/Makefile.am b/languages/cpp/app_templates/kdevpart/Makefile.am new file mode 100644 index 00000000..d1541685 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = src-Makefile.am kdevpart_part.cpp kdevpart_part.h \ + kdevpart_widget.h kdevpart_widget.cpp kdevpart_part.rc \ + kdevpart.desktop app.kdevelop README.dox globalconfigbase.ui globalconfig.h \ + globalconfig.cpp projectconfigbase.ui projectconfig.h projectconfig.cpp +templateName = kdevpart + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kdevpart/README.dox b/languages/cpp/app_templates/kdevpart/README.dox new file mode 100644 index 00000000..86968add --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/README.dox @@ -0,0 +1,55 @@ +/** \class %{APPNAME} +Put a brief description here, the brief description ends at the first dot. +Put a more detailed description of your part in these lines. It can span +over several lines. You can even use some html commands in these lines like: +This is code, html links link text, +and images. + +\authors %{AUTHOR} +\authors 2nd author full name +... +\authors nth author full name + +\maintainer %{AUTHOR} +\maintainer 2nd maintainer full name +... +\maintainer nth maintainer full name + +\feature Describe the first feature +\feature Describe the second feature +... +\feature Describe the last feature + +\bug bugs in +YOUR_COMPONENT_NAME at Bugzilla database +\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet. +.. +\bug Describe a the nth bug that you know of, but probably hasn't been reported yet. + +\requirement Describe a the 1st requirement of your part. +\requirement Describe a the 2nd requirement of your part. +... +\requirement Describe a the nth requirement of your part. + +\todo Describe a the 1st TODO of your part. +\todo Describe a the 2nd TODO of your part. +... +\todo Describe a the nth TODO of your part. + +\faq First frequenly asked question about your part ? Answer. +\faq Second frequenly asked question about your part ? Answer. +... +\faq Last frequenly asked question about your part ? Answer. + +\note First note text. +\note Second note text. +... +\note Last note text. + +\warning First warning text. +\warning Second warning text. +... +\warning Last warning text. + +*/ diff --git a/languages/cpp/app_templates/kdevpart/app.kdevelop b/languages/cpp/app_templates/kdevpart/app.kdevelop new file mode 100644 index 00000000..29beaf21 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/app.kdevelop @@ -0,0 +1,116 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + KDevelop + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kdevpart/globalconfig.cpp b/languages/cpp/app_templates/kdevpart/globalconfig.cpp new file mode 100644 index 00000000..12396fec --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/globalconfig.cpp @@ -0,0 +1,15 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}globalconfig.h" + +#include "%{APPNAMELC}part.h" + +%{APPNAME}GlobalConfig::%{APPNAME}GlobalConfig(%{APPNAME}Part *part, QWidget *parent, const char *name) + : %{APPNAME}GlobalConfigBase(parent, name), m_part(part) +{ +} + +void %{APPNAME}GlobalConfig::accept() +{ +} + +#include "%{APPNAMELC}globalconfig.moc" diff --git a/languages/cpp/app_templates/kdevpart/globalconfig.h b/languages/cpp/app_templates/kdevpart/globalconfig.h new file mode 100644 index 00000000..1b321cd2 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/globalconfig.h @@ -0,0 +1,22 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMEUC}_GLOBAL_CONFIG_H +#define %{APPNAMEUC}_GLOBAL_CONFIG_H + +#include "%{APPNAMELC}globalconfigbase.h" + +class %{APPNAME}Part; + +class %{APPNAME}GlobalConfig: public %{APPNAME}GlobalConfigBase +{ + Q_OBJECT +public: + %{APPNAME}GlobalConfig(%{APPNAME}Part *part, QWidget *parent = 0, const char *name = 0); + +public slots: + void accept(); + +private: + %{APPNAME}Part *m_part; +}; + +#endif diff --git a/languages/cpp/app_templates/kdevpart/globalconfigbase.ui b/languages/cpp/app_templates/kdevpart/globalconfigbase.ui new file mode 100644 index 00000000..c16bd90d --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/globalconfigbase.ui @@ -0,0 +1,20 @@ + +%{APPNAME}GlobalConfigBase + + + %{APPNAME}GlobalConfigBase + + + + 0 + 0 + 600 + 480 + + + + %{APPNAME} + + + + diff --git a/languages/cpp/app_templates/kdevpart/kdevpart.desktop b/languages/cpp/app_templates/kdevpart/kdevpart.desktop new file mode 100644 index 00000000..eb61eef9 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/kdevpart.desktop @@ -0,0 +1,83 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Name=KDev%{APPNAME} +Name[nds]=KDev%{ProgNaam} +Name[sv]=KDevelop %{APPNAME} +Name[ta]=கெடெவ்%{APPNAME} +GenericName=%{APPNAME} Plugin +GenericName[br]=Lugent %{APPNAME} +GenericName[ca]=Connector per a %{APPNAME} +GenericName[da]=%{APPNAME} plugin +GenericName[de]=%{APPNAME}-Modul +GenericName[el]=Πρόσθετο %{APPNAME} +GenericName[es]=Complemento %{APPNAME} +GenericName[et]=%{APPNAME} plugin +GenericName[eu]=%{APPNAME} plugina +GenericName[fa]=وصلۀ %{APPNAME} +GenericName[fr]=Module externe pour %{APPNAME} +GenericName[ga]=Breiseán %{APPNAME} +GenericName[gl]=Extensión %{APPNAME} +GenericName[hu]=%{APPNAME}-bővítőmodul +GenericName[it]=Plugin %{APPNAME} +GenericName[ja]=%{APPNAME} プラグイン +GenericName[nds]=%{APPNAME}-Moduul +GenericName[ne]=%{APPNAME} प्लगइन +GenericName[nl]=%{APPNAME}-plugin +GenericName[pl]=Wtyczka %{APPNAME} +GenericName[pt]='Plugin' %{APPNAME} +GenericName[pt_BR]=Plug-in do %{APPNAME} +GenericName[ru]=Модуль %{APPNAME} +GenericName[sk]=%{APPNAME} modul +GenericName[sl]=Vstavek za %{APPNAME} +GenericName[sr]=%{APPNAME} прикључак +GenericName[sr@Latn]=%{APPNAME} priključak +GenericName[sv]=%{APPNAME} insticksprogram +GenericName[tr]=%{APPNAME} Eklentisi +GenericName[zh_CN]=%{APPNAME} 插件 +GenericName[zh_TW]=%{APPNAME} 外掛程式 +Comment=%{APPNAME} Description +Comment[br]=Deskrivadur %{APPNAME} +Comment[ca]=Descripció per a %{APPNAME} +Comment[da]=%{APPNAME} beskrivelse +Comment[de]=%{APPNAME} Beschreibung +Comment[el]=Περιγραφή %{APPNAME} +Comment[es]=Descripción de %{APPNAME} +Comment[et]=%{APPNAME} kirjeldus +Comment[eu]=%{APPNAME} deskribapena +Comment[fa]=توصیف %{APPNAME} +Comment[fr]=Description pour %{APPNAME} +Comment[ga]=Cur Síos %{APPNAME} +Comment[gl]=Descripción de %{APPNAME} +Comment[hu]=%{APPNAME} leírása +Comment[it]=Descrizione %{APPNAME} +Comment[ja]=%{APPNAME} 概説 +Comment[nds]=%{APPNAME}-Beschrieven +Comment[ne]=%{APPNAME} वर्णन +Comment[nl]=%{APPNAME} omschrijving +Comment[pl]=Opis %{APPNAME} +Comment[pt]=Descrição de %{APPNAME$} +Comment[pt_BR]=Descrição do %{APPNAME} +Comment[ru]=Описание %{APPNAME} +Comment[sk]=%{APPNAME} popis +Comment[sl]=Opis za %{APPNAME} +Comment[sr]=Опис за %{APPNAME} +Comment[sr@Latn]=Opis za %{APPNAME} +Comment[sv]=%{APPNAME} beskrivning +Comment[tr]=%{APPNAME} Tanımı +Comment[zh_CN]=%{APPNAME} 描述 +Comment[zh_TW]=%{APPNAME} 描述 +Icon=kdevelop +ServiceTypes=KDevelop/Plugin + +X-KDevelop-Plugin-Version=1 +X-KDevelop-Plugin-Homepage= +X-KDevelop-Plugin-BugsEmailAddress=%{EMAIL} +X-KDevelop-Plugin-Copyright=(C) by %{AUTHOR} + +X-KDevelop-Args= + +X-KDevelop-Scope=%{SCOPE} +X-KDE-Library=libkdev%{APPNAMELC} +X-KDevelop-Version=3 +X-KDevelop-Properties=%{PROPS} diff --git a/languages/cpp/app_templates/kdevpart/kdevpart.kdevtemplate b/languages/cpp/app_templates/kdevpart/kdevpart.kdevtemplate new file mode 100644 index 00000000..bc7becbf --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/kdevpart.kdevtemplate @@ -0,0 +1,242 @@ +# KDE Config File +[General] +Name=KDevelop Plugin (KDevelop source tree build) +Name[ca]=Connector per a KDevelop (de construcció a l'arbre de fonts de KDevelop) +Name[da]=KDevelop Plugin (KDevelop kildetræ bygning) +Name[de]=KDevelop-Modul (Erstellung im KDevelop-Quelltextbaum) +Name[el]=Πρόσθετο KDevelop (κατασκευή με το δέντρο πηγαίου κώδικα του KDevelop) +Name[es]=Complemento para KDevelop (construcción en árbol de código fuente de KDevelop) +Name[et]=KDevelopi plugin (Kdevelopi lähtekoodipuus) +Name[eu]=KDevelop plugina (KDevelop-en iturburu zuhaitzean erakitzeko) +Name[fa]=وصلۀ KDevelop )ساخت درخت منبع KDevelop( +Name[fr]=Module externe de KDevelop (construction dans l'arborescence des sources de KDevelop) +Name[gl]=Extensión para KDevelop (compilación na árbore de código de KDevelop) +Name[hu]=KDevelop-bővítőmodul (KDevelopos forráskönyvtáron belül) +Name[it]=Plugin di KDevelop (compila l'albero sorgente di KDevelop) +Name[ja]=KDevelop プラグイン (KDevelop ソースツリービルド) +Name[nds]=KDevelop-Moduul (KDevelop-Bornboomprogramm) +Name[ne]=केडीई विकास प्लगइन (केडीई विकास स्रोत ट्री निर्माण) +Name[nl]=KDevelop-plugin (KDevelop source tree build) +Name[pl]=Wtyczka KDevelopa (budowa w drzewie źródłowym KDevelopa) +Name[pt]='Plugin' do KDevelop (compilação na árvore de código do KDevelop) +Name[pt_BR]='Plugin' do KDevelop (compilação na árvore de código do KDevelop) +Name[ru]=Модуль KDevelop (в исходном коде KDevelop) +Name[sk]=KDevelop modul (KDevelop zdrojový strom build) +Name[sr]=Прикључак за KDevelop (градња у изворном стаблу KDevelop-а) +Name[sr@Latn]=Priključak za KDevelop (gradnja u izvornom stablu KDevelop-a) +Name[sv]=KDevelop-insticksprogram (att bygga i KDevelops källkodsträd) +Name[tr]=KDevelop Eklentisi (KDevelop kaynak ağacı kurulumu) +Name[zh_CN]=KDevelop 插件(KDevelop 源代码树编译) +Name[zh_TW]=KDevelop 外掛程式(KDevelop 程式源碼樹內建立) +Category=C++/KDevelop/ +Comment=This generates a plugin for KDevelop, for building within the KDevelop source tree +Comment[ca]=Genera un connector per a KDevelop, per a que es construeixi en l'arbre de fonts de KDevelop +Comment[da]=Dette genererer et plugin for KDevelop, til at bygges indenfor KDevelop's kildetræ +Comment[de]=Hiermit wird ein Modul für KDevelop erstellt, dessen Erstellung innerhalb des Quelltextbaumes von KDevelop erfolgt. +Comment[el]=Αυτό δημιουργεί ένα πρόσθετο για το KDevelop, για κατασκευή του μέσα στο δέντρο πηγαίου κώδικα του KDevelop +Comment[es]=Genera un complemento para KDevelop, para ser construido en el árbol de código fuente de KDevelop +Comment[et]=KDevelopi plugina loomine, mis ehitatakse KDevelopi lähtekoodipuus. +Comment[eu]=Honek KDevelop-erako plugin bat sortzen du, KDevelop-en iturburu-zuhaitzean eraikitzeko +Comment[fa]=وصله‌ای برای KDevelop، برای ساختن در درخت منبع KDevelop تولید می‌کند +Comment[fr]=Génère un module externe pour KDevelop, à construire dans l'arborescence des sources de KDevelop +Comment[gl]=Isto xera unha extensión para KDevelop que se compilará dentro da árbore de código de KDevelop +Comment[hu]=Létrehoz egy KDevelop-bővítőmodult, mely a KDevelopos forráskönyvtáron belül fordítható le +Comment[it]=Genera un plugin per KDevelop, per compilarlo assieme all'albero sorgente di KDevelop +Comment[nds]=Dit stellt en KDevelop-Moduul för't Kompileren binnen den KDevelop-Bornboom op +Comment[ne]=यसले केडीई विकास स्रोत ट्री भित्र निर्माण गर्न, केडीई विकासका लागि प्लगइन उत्पन्न गर्दछ +Comment[nl]=Dit genereert een plugin voor KDevelop, om te bouwen binnen de KDevelop sourcetree +Comment[pl]=Generuje wtyczkę do KDevelopa, która jest budowana w jego drzewie źródłowym +Comment[pt]=Isto gera um 'plugin' para o KDevelop, para uma compilação dentro da árvore de código do KDevelop +Comment[pt_BR]=Isto gera um 'plugin' para o KDevelop, para uma compilação dentro da árvore de código do KDevelop +Comment[ru]=Создание модуля KDevelop в исходном коде KDevelop +Comment[sk]=Vygeneruje modul pre KDevelop, ktorý sa bude kompilovať v rámci KDevelop zdrojového stromu +Comment[sr]=Ово прави прикључак за KDevelop, за градњу у оквиру KDevelop-овог изворног стабла +Comment[sr@Latn]=Ovo pravi priključak za KDevelop, za gradnju u okviru KDevelop-ovog izvornog stabla +Comment[sv]=Det här skapar ett insticksprogram för KDevelop, att byggas inne i KDevelops källkodsträd. +Comment[tr]=Bu KDevelop için, KDevelop kaynak ağacınında olacak, bir eklenti yaratır. +Comment[zh_CN]=这将生成 KDevelop 的插件,该插件需要与 KDevelop 源代码树一起编译 +Comment[zh_TW]=產生一個 KDevelop 外掛程式,建立於 KDevelop 程式源碼樹內。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}part.cpp +Archive=kdevpart.tar.gz + +[SCOPE] +Type = value +ValueType=QString +Value= SCOPE +Comment= The scope of a plugin (Global, Project, Core) +Comment[ca]= L'àmbit d'un connector (Global, Project, Core) +Comment[da]= Et plugins omfang (Globalt, Projekt, Kerne) +Comment[de]= Gültigkeitsbereich eines Moduls (Global, Projekt, Kern) +Comment[el]= Η εμβέλεια ενός πρόσθετου (Καθολική, Έργο, Πυρήνας) +Comment[es]=El alcance de un complemento (global, proyecto, núcleo) +Comment[et]=Plugina skoop (globaalne, projekt, tuum) +Comment[eu]= Pluginaren barrutia (Globala, Projektua, Nukleoa) +Comment[fa]=دامنۀ یک وصله )سراسری، پروژه، هسته( +Comment[fr]= La portée d'un module externe (globale, projet, core) +Comment[ga]= Scóip an bhreiseáin (Comhchoiteann, Tionscadal, Ceartlár) +Comment[gl]=Ámbito da extensión (Global, Proxecto, Núcleo) +Comment[hu]=A modul hatóköre (globális, projektszintű, alap) +Comment[it]=Il contesto di un plugin (Globale, Progetto, Core) +Comment[nds]= Dat Rebeet vun en Moduul (Globaal, Projekt, Karn) +Comment[ne]= प्लगइनको क्षेत्र (विश्वव्यापी, परियोजना, कोर) +Comment[nl]=Het bereik van een plugin (globaal, project, core) +Comment[pl]=Przynależność wtyczki (globalna, projekt, część główna) +Comment[pt]=O âmbito de um 'plugin' (Global, Projecto, Núcleo) +Comment[pt_BR]=O âmbito de um 'plugin' (Global, Projecto, Núcleo) +Comment[ru]=Тип модуля (Global, Project, Core) +Comment[sk]=Rozsah module (globálny, projektový, jadrový) +Comment[sr]=Опсег прикључка (глобални, пројекат, језгро) +Comment[sr@Latn]=Opseg priključka (globalni, projekat, jezgro) +Comment[sv]=Insticksprogrammets omfattning (Global, Projekt, Kärna) +Comment[tr]=Bir eklentinin alanı (Genel, Proje, İç) +Comment[zh_CN]=插件的范围(全局、工程、核心) +Comment[zh_TW]=外掛程式的範圍(全域、專案、核心) +Default= Global + +[PROPS] +Type = value +ValueType=QString +Value= PROPS +Comment= The list of supported KDevelop properties +Comment[ca]= La llista de propietats suportades del KDevelop +Comment[da]= Listen af understøttede KDevelop-egenskaber +Comment[de]= Die Liste der unterstützten KDevelop-Eigenschaften +Comment[el]= Η λίστα των υποστηριζόμενων ιδιοτήτων του KDevelop +Comment[es]=La lista de propiedades de KDevelop soportadas +Comment[et]= KDevelopi toetatud omaduste nimekiri +Comment[eu]= Onartzen diren KDevelop-en propietateen zerrenda +Comment[fa]=فهرست ویژگیهای پشتیبانی‌شدۀ KDevelop +Comment[fr]= La liste des propriétés de KDevelop prises en charge +Comment[ga]= Liosta d'airíonna KDevelop a dtacaítear leo +Comment[gl]=Lista das propiedades de KDevelop soportadas +Comment[hu]=A támogatott KDevelop-tulajdonságok +Comment[it]=Lista delle proprietà supportate da KDevelop +Comment[nds]= De List mit ünnerstütt KDevelop-Egenschappen +Comment[ne]= केडीई विकास समर्थन गर्ने गुणको सूची +Comment[nl]=De lijst met ondersteunde KDevelop-properties +Comment[pl]= Lista obsługiwanych właściwości KDevelopa +Comment[pt]= A lista de propriedades do KDevelop suportadas +Comment[pt_BR]= A lista de propriedades do KDevelop suportadas +Comment[ru]=Список поддерживаемых типов модулей для KDevelop +Comment[sk]=Zoznam podporovaných vlastností KDevelop +Comment[sl]=Seznam podprtih lastnosti KDevelop +Comment[sr]=Листа подржаних KDevelop-ових својстава +Comment[sr@Latn]=Lista podržanih KDevelop-ovih svojstava +Comment[sv]=Listan med egenskaper i KDevelop som stöds +Comment[tr]=Desteklenen KDevelop özellikleri +Comment[zh_CN]=列出支持的 KDevelop 属性 +Comment[zh_TW]=支援的 KDevelop 屬性列表 +Default= + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/kdevpart_part.cpp +Dest=%{dest}/%{APPNAMELC}part.cpp + +[FILE4] +Type=install +Source=%{src}/kdevpart_part.h +Dest=%{dest}/%{APPNAMELC}part.h + +[FILE5] +Type=install +Source=%{src}/kdevpart_widget.cpp +Dest=%{dest}/%{APPNAMELC}widget.cpp + +[FILE6] +Type=install +Source=%{src}/kdevpart_widget.h +Dest=%{dest}/%{APPNAMELC}widget.h + +[FILE7] +Type=install +EscapeXML=true +Source=%{src}/kdevpart_part.rc +Dest=%{dest}/kdev%{APPNAMELC}.rc + +[FILE71] +Type=install +EscapeXML=true +Source=%{src}/globalconfigbase.ui +Dest=%{dest}/%{APPNAMELC}globalconfigbase.ui + +[FILE711] +Type=install +Source=%{src}/globalconfig.h +Dest=%{dest}/%{APPNAMELC}globalconfig.h + +[FILE712] +Type=install +Source=%{src}/globalconfig.cpp +Dest=%{dest}/%{APPNAMELC}globalconfig.cpp + +[FILE72] +Type=install +EscapeXML=true +Source=%{src}/projectconfigbase.ui +Dest=%{dest}/%{APPNAMELC}projectconfigbase.ui + +[FILE721] +Type=install +Source=%{src}/projectconfig.h +Dest=%{dest}/%{APPNAMELC}projectconfig.h + +[FILE722] +Type=install +Source=%{src}/projectconfig.cpp +Dest=%{dest}/%{APPNAMELC}projectconfig.cpp + +[FILE8] +Type=install +Source=%{src}/kdevpart.desktop +Dest=%{dest}/kdev%{APPNAMELC}.desktop + +[FILE9] +Type=install +Source=%{src}/README.dox +Dest=%{dest}/README.dox + +[MSG] +Type=message +Comment=A KDevelop plugin was created in %{dest} +Comment[ca]=Un connector per a KDevelop ha estat creat en %{dest} +Comment[da]=Et KDevelop plugin blev oprettet i %{dest} +Comment[de]=Ein KDevelop-Modul wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο του KDevelop δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento para KDevelop ha sido creado en %{dest} +Comment[et]=KDevelopi plugin loodi asukohta %{dest} +Comment[eu]=KDevelop plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ KDevelop در %{dest} ایجاد شد +Comment[fr]=Un module externe pour KDevelop a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán KDevelop i %{dest} +Comment[gl]=Creouse unha extensión para KDevelop en %{dest} +Comment[hu]=Létrejött egy KDevelop-bővítőmodul itt: %{dest} +Comment[it]=È stato creato un plugin per KDevelop in %{dest} +Comment[ja]=KDevelop プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KDevelop-Moduul opstellt +Comment[ne]=केडीई विकास प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Er is een KDevelop-plugin aangemaakt in %{dest} +Comment[pl]=Wtyczka do KDevelopa została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' do KDevelop em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' do KDevelop em %{dest} +Comment[ru]=Модуль KDevelop создан в %{dest} +Comment[sk]=KDevelop modul bol vytvorený v %{dest} +Comment[sl]=Vstavek za KDevelop je bil ustvarjen v %{dest} +Comment[sr]=Прикључак за KDevelop направљен је у %{dest} +Comment[sr@Latn]=Priključak za KDevelop napravljen je u %{dest} +Comment[sv]=Ett insticksprogram för KDevelop skapades i %{dest} +Comment[tr]=Bir KDevelop eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了 KDevelop 插件 +Comment[zh_TW]=一個 KDevelop 外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kdevpart/kdevpart.png b/languages/cpp/app_templates/kdevpart/kdevpart.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/kdevpart/kdevpart.png differ diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_part.cpp b/languages/cpp/app_templates/kdevpart/kdevpart_part.cpp new file mode 100644 index 00000000..dd86843d --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/kdevpart_part.cpp @@ -0,0 +1,183 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}part.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "%{APPNAMELC}widget.h" +#include "%{APPNAMELC}globalconfig.h" +#include "%{APPNAMELC}projectconfig.h" + +typedef KDevGenericFactory<%{APPNAME}Part> %{APPNAME}Factory; +KDevPluginInfo data("kdev%{APPNAMELC}"); +K_EXPORT_COMPONENT_FACTORY( libkdev%{APPNAMELC}, %{APPNAME}Factory( data ) ); + +#define GLOBALDOC_OPTIONS 1 +#define PROJECTDOC_OPTIONS 2 + +%{APPNAME}Part::%{APPNAME}Part(QObject *parent, const char *name, const QStringList &/*args*/) + : KDevPlugin(&data, parent, name ? name : "%{APPNAME}Part") +{ + setInstance(%{APPNAME}Factory::instance()); + setXMLFile("kdev%{APPNAMELC}.rc"); + + m_widget = new %{APPNAME}Widget(this); + m_widget->setCaption("widget caption"); + m_widget->setIcon(SmallIcon(info()->icon())); + + QWhatsThis::add(m_widget, i18n("WHAT DOES THIS PART DO?")); + + // now you decide what should happen to the widget. Take a look at kdevcore.h + // or at other plugins how to embed it. + + // if you want to embed your widget as an outputview, simply uncomment + // the following line. + // mainWindow()->embedOutputView( m_widget, "name that should appear", "enter a tooltip" ); + + // if you want to embed your widget as a selectview (at the left), simply uncomment + // the following line. + // mainWindow()->embedSelectView( m_widget, "name that should appear", "enter a tooltip" ); + + // if you want to embed your widget as a selectview (at the right), simply uncomment + // the following line. + // mainWindow()->embedSelectViewRight( m_widget, "name that should appear", "enter a tooltip" ); + + setupActions(); + + m_configProxy = new ConfigWidgetProxy(core()); + m_configProxy->createGlobalConfigPage(i18n("%{APPNAME}"), GLOBALDOC_OPTIONS, info()->icon()); + m_configProxy->createProjectConfigPage(i18n("%{APPNAME}"), PROJECTDOC_OPTIONS, info()->icon()); + connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )), + this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int))); + + connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), + this, SLOT(contextMenu(QPopupMenu *, const Context *))); + connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened())); + connect(core(), SIGNAL(projectClosed()), this, SLOT(projectClosed())); + + + QTimer::singleShot(0, this, SLOT(init())); +} + +%{APPNAME}Part::~%{APPNAME}Part() +{ +// if you embed a widget, you need to tell the mainwindow when you remove it +// if ( m_widget ) +// { +// mainWindow()->removeView( m_widget ); +// } + delete m_widget; + delete m_configProxy; +} + +void %{APPNAME}Part::init() +{ +// delayed initialization stuff goes here +} + +void %{APPNAME}Part::setupActions() +{ +// create XMLGUI actions here + action = new KAction(i18n("&Do Something..."), 0, + this, SLOT(doSomething()), actionCollection(), "plugin_action" ); + action->setToolTip(i18n("Do something")); + action->setWhatsThis(i18n("Do something

Describe here what does this action do.")); +} + +void %{APPNAME}Part::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo) +{ +// create configuraton dialogs here + switch (pageNo) + { + case GLOBALDOC_OPTIONS: + { + %{APPNAME}GlobalConfig *w = new %{APPNAME}GlobalConfig(this, page, "global config"); + connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); + break; + } + case PROJECTDOC_OPTIONS: + { + %{APPNAME}ProjectConfig *w = new %{APPNAME}ProjectConfig(this, page, "project config"); + connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); + break; + } + } +} + +void %{APPNAME}Part::contextMenu(QPopupMenu *popup, const Context *context) +{ +// put actions into the context menu here + if (context->hasType(Context::EditorContext)) + { + // editor context menu + const EditorContext *econtext = static_cast(context); + + // use context and plug actions here + action->plug(popup); + + // or create menu items on the fly + // int id = -1; + // id = popup->insertItem(i18n("Do Something Here"), + // this, SLOT(doSomething()) ); + // popup->setWhatsThis(id, i18n("Do something here

Describe here what does this action do." + } + else if (context->hasType(Context::FileContext)) + { + // file context menu + const FileContext *fcontext = static_cast(context); + + //use context and plug actions here + } + else if (context->hasType(Context::ProjectModelItemContext)) + { + // project tree context menu + const ProjectModelItemContext *pcontext = static_cast(context); + + // use context and plug actions here + } + else if (context->hasType(Context::CodeModelItemContext)) + { + // class tree context menu + const CodeModelItemContext *mcontext = static_cast(context); + + // use context and plug actions here + } + else if (context->hasType(Context::DocumentationContext)) + { + // documentation viewer context menu + const DocumentationContext *dcontext = static_cast(context); + + // use context and plug actions here + } +} + +void %{APPNAME}Part::projectOpened() +{ +// do something when the project is opened +} + +void %{APPNAME}Part::projectClosed() +{ +// do something when the project is closed +} + +void %{APPNAME}Part::doSomething() +{ +// do something useful here instead of showing the message box + KMessageBox::information(m_widget, i18n("This action does nothing."), i18n("%{APPNAME} Plugin")); +} + +#include "%{APPNAMELC}part.moc" diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_part.h b/languages/cpp/app_templates/kdevpart/kdevpart_part.h new file mode 100644 index 00000000..168b8a40 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/kdevpart_part.h @@ -0,0 +1,45 @@ +%{H_TEMPLATE} +#ifndef KDEV%{APPNAMEUC}_H +#define KDEV%{APPNAMEUC}_H + +#include + +#include + +class QPopupMenu; +class KAction; +class KDialogBase; +class Context; +class ConfigWidgetProxy; +class %{APPNAME}Widget; + +/** +Please read the README.dox file for more info about this part +*/ +class %{APPNAME}Part: public KDevPlugin +{ + Q_OBJECT +public: + %{APPNAME}Part(QObject *parent, const char *name, const QStringList &args); + ~%{APPNAME}Part(); + +private slots: + void init(); + + void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo); + void contextMenu(QPopupMenu *popup, const Context *context); + void projectOpened(); + void projectClosed(); + + void doSomething(); + +private: + void setupActions(); + + KAction *action; + + QGuardedPtr<%{APPNAME}Widget> m_widget; + ConfigWidgetProxy *m_configProxy; +}; + +#endif diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_part.rc b/languages/cpp/app_templates/kdevpart/kdevpart_part.rc new file mode 100644 index 00000000..a38ee14e --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/kdevpart_part.rc @@ -0,0 +1,11 @@ + + + +

&Tools + + + + + + + diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_widget.cpp b/languages/cpp/app_templates/kdevpart/kdevpart_widget.cpp new file mode 100644 index 00000000..0c05b976 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/kdevpart_widget.cpp @@ -0,0 +1,21 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}widget.h" + +#include +#include +#include + +#include + +#include "%{APPNAMELC}part.h" + +%{APPNAME}Widget::%{APPNAME}Widget(%{APPNAME}Part *part) + : QWidget(0, "%{APPNAMELC} widget"), m_part(part) +{ +} + +%{APPNAME}Widget::~%{APPNAME}Widget() +{ +} + +#include "%{APPNAMELC}widget.moc" diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_widget.h b/languages/cpp/app_templates/kdevpart/kdevpart_widget.h new file mode 100644 index 00000000..e29e29d2 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/kdevpart_widget.h @@ -0,0 +1,23 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMEUC}_WIDGET_H +#define %{APPNAMEUC}_WIDGET_H + +#include +#include + +class KDevProject; +class %{APPNAME}Part; + +class %{APPNAME}Widget: public QWidget +{ + Q_OBJECT +public: + %{APPNAME}Widget(%{APPNAME}Part *part); + ~%{APPNAME}Widget(); + +private: + %{APPNAME}Part *m_part; +}; + + +#endif diff --git a/languages/cpp/app_templates/kdevpart/projectconfig.cpp b/languages/cpp/app_templates/kdevpart/projectconfig.cpp new file mode 100644 index 00000000..5f07993b --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/projectconfig.cpp @@ -0,0 +1,15 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}projectconfig.h" + +#include "%{APPNAMELC}part.h" + +%{APPNAME}ProjectConfig::%{APPNAME}ProjectConfig(%{APPNAME}Part *part, QWidget *parent, const char *name) + : %{APPNAME}ProjectConfigBase(parent, name), m_part(part) +{ +} + +void %{APPNAME}ProjectConfig::accept() +{ +} + +#include "%{APPNAMELC}projectconfig.moc" diff --git a/languages/cpp/app_templates/kdevpart/projectconfig.h b/languages/cpp/app_templates/kdevpart/projectconfig.h new file mode 100644 index 00000000..ec3ff4df --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/projectconfig.h @@ -0,0 +1,22 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMEUC}_PROJECT_CONFIG_H +#define %{APPNAMEUC}_PROJECT_CONFIG_H + +#include "%{APPNAMELC}projectconfigbase.h" + +class %{APPNAME}Part; + +class %{APPNAME}ProjectConfig: public %{APPNAME}ProjectConfigBase +{ + Q_OBJECT +public: + %{APPNAME}ProjectConfig(%{APPNAME}Part *part, QWidget *parent = 0, const char *name = 0); + +public slots: + void accept(); + +private: + %{APPNAME}Part *m_part; +}; + +#endif diff --git a/languages/cpp/app_templates/kdevpart/projectconfigbase.ui b/languages/cpp/app_templates/kdevpart/projectconfigbase.ui new file mode 100644 index 00000000..c733a774 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/projectconfigbase.ui @@ -0,0 +1,20 @@ + +%{APPNAME}ProjectConfigBase + + + %{APPNAME}ProjectConfigBase + + + + 0 + 0 + 600 + 480 + + + + %{APPNAME} + + + + diff --git a/languages/cpp/app_templates/kdevpart/src-Makefile.am b/languages/cpp/app_templates/kdevpart/src-Makefile.am new file mode 100644 index 00000000..5cd25f36 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart/src-Makefile.am @@ -0,0 +1,20 @@ +INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes) + +kde_module_LTLIBRARIES = libkdev%{APPNAMELC}.la +libkdev%{APPNAMELC}_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(KDE_PLUGIN) +libkdev%{APPNAMELC}_la_LIBADD = $(top_builddir)/lib/libkdevelop.la + +libkdev%{APPNAMELC}_la_SOURCES = %{APPNAMELC}part.cpp %{APPNAMELC}widget.cpp \ + %{APPNAMELC}globalconfigbase.ui %{APPNAMELC}globalconfig.cpp \ + %{APPNAMELC}projectconfigbase.ui %{APPNAMELC}projectconfig.cpp + +METASOURCES = AUTO + +appsharedir = $(kde_datadir)/kdev%{APPNAMELC} +appshare_DATA = + +servicedir = $(kde_servicesdir) +service_DATA = kdev%{APPNAMELC}.desktop + +rcdir = $(kde_datadir)/kdev%{APPNAMELC} +rc_DATA = kdev%{APPNAMELC}.rc diff --git a/languages/cpp/app_templates/kdevpart2/.kdev_ignore b/languages/cpp/app_templates/kdevpart2/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kdevpart2/Makefile.am b/languages/cpp/app_templates/kdevpart2/Makefile.am new file mode 100644 index 00000000..6e58fa02 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/Makefile.am @@ -0,0 +1,21 @@ +dataFiles = src-Makefile.am kdevpart_part.cpp kdevpart_part.h\ + kdevpart_widget.h kdevpart_widget.cpp \ + kdevpart_part.rc kdevpart.desktop app.kdevelop \ + kdevpart-configure.in.in README.dox subdirs globalconfigbase.ui globalconfig.h \ + globalconfig.cpp projectconfigbase.ui projectconfig.h projectconfig.cpp + +templateName = kdevpart2 + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kdevpart2/README.dox b/languages/cpp/app_templates/kdevpart2/README.dox new file mode 100644 index 00000000..86968add --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/README.dox @@ -0,0 +1,55 @@ +/** \class %{APPNAME} +Put a brief description here, the brief description ends at the first dot. +Put a more detailed description of your part in these lines. It can span +over several lines. You can even use some html commands in these lines like: +This is code, html links link text, +and images. + +\authors %{AUTHOR} +\authors 2nd author full name +... +\authors nth author full name + +\maintainer %{AUTHOR} +\maintainer 2nd maintainer full name +... +\maintainer nth maintainer full name + +\feature Describe the first feature +\feature Describe the second feature +... +\feature Describe the last feature + +\bug bugs in +YOUR_COMPONENT_NAME at Bugzilla database +\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet. +.. +\bug Describe a the nth bug that you know of, but probably hasn't been reported yet. + +\requirement Describe a the 1st requirement of your part. +\requirement Describe a the 2nd requirement of your part. +... +\requirement Describe a the nth requirement of your part. + +\todo Describe a the 1st TODO of your part. +\todo Describe a the 2nd TODO of your part. +... +\todo Describe a the nth TODO of your part. + +\faq First frequenly asked question about your part ? Answer. +\faq Second frequenly asked question about your part ? Answer. +... +\faq Last frequenly asked question about your part ? Answer. + +\note First note text. +\note Second note text. +... +\note Last note text. + +\warning First warning text. +\warning Second warning text. +... +\warning Last warning text. + +*/ diff --git a/languages/cpp/app_templates/kdevpart2/app.kdevelop b/languages/cpp/app_templates/kdevpart2/app.kdevelop new file mode 100644 index 00000000..644adcdf --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/app.kdevelop @@ -0,0 +1,148 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + KDevelop + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + executable + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + + + + + + false + true + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + -f + + + + -dP + -f + -C -d -P + -u3 -p + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + true + true + true + false + true + true + 250 + 400 + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kdevpart2/globalconfig.cpp b/languages/cpp/app_templates/kdevpart2/globalconfig.cpp new file mode 100644 index 00000000..12396fec --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/globalconfig.cpp @@ -0,0 +1,15 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}globalconfig.h" + +#include "%{APPNAMELC}part.h" + +%{APPNAME}GlobalConfig::%{APPNAME}GlobalConfig(%{APPNAME}Part *part, QWidget *parent, const char *name) + : %{APPNAME}GlobalConfigBase(parent, name), m_part(part) +{ +} + +void %{APPNAME}GlobalConfig::accept() +{ +} + +#include "%{APPNAMELC}globalconfig.moc" diff --git a/languages/cpp/app_templates/kdevpart2/globalconfig.h b/languages/cpp/app_templates/kdevpart2/globalconfig.h new file mode 100644 index 00000000..1b321cd2 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/globalconfig.h @@ -0,0 +1,22 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMEUC}_GLOBAL_CONFIG_H +#define %{APPNAMEUC}_GLOBAL_CONFIG_H + +#include "%{APPNAMELC}globalconfigbase.h" + +class %{APPNAME}Part; + +class %{APPNAME}GlobalConfig: public %{APPNAME}GlobalConfigBase +{ + Q_OBJECT +public: + %{APPNAME}GlobalConfig(%{APPNAME}Part *part, QWidget *parent = 0, const char *name = 0); + +public slots: + void accept(); + +private: + %{APPNAME}Part *m_part; +}; + +#endif diff --git a/languages/cpp/app_templates/kdevpart2/globalconfigbase.ui b/languages/cpp/app_templates/kdevpart2/globalconfigbase.ui new file mode 100644 index 00000000..c16bd90d --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/globalconfigbase.ui @@ -0,0 +1,20 @@ + +%{APPNAME}GlobalConfigBase + + + %{APPNAME}GlobalConfigBase + + + + 0 + 0 + 600 + 480 + + + + %{APPNAME} + + + + diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart-configure.in.in b/languages/cpp/app_templates/kdevpart2/kdevpart-configure.in.in new file mode 100644 index 00000000..06ee70b8 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/kdevpart-configure.in.in @@ -0,0 +1,10 @@ +#MIN_CONFIG(3.0.0) + +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + +KDE_CHECK_HEADERS([kdevelop/interfaces/kdevcore.h]) +KDE_CHECK_LIB([kdevelop],main, + [LIBKDEVELOP="-lkdevelop"]) +AC_SUBST(LIBKDEVELOP) diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart.desktop b/languages/cpp/app_templates/kdevpart2/kdevpart.desktop new file mode 100644 index 00000000..eb61eef9 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/kdevpart.desktop @@ -0,0 +1,83 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Name=KDev%{APPNAME} +Name[nds]=KDev%{ProgNaam} +Name[sv]=KDevelop %{APPNAME} +Name[ta]=கெடெவ்%{APPNAME} +GenericName=%{APPNAME} Plugin +GenericName[br]=Lugent %{APPNAME} +GenericName[ca]=Connector per a %{APPNAME} +GenericName[da]=%{APPNAME} plugin +GenericName[de]=%{APPNAME}-Modul +GenericName[el]=Πρόσθετο %{APPNAME} +GenericName[es]=Complemento %{APPNAME} +GenericName[et]=%{APPNAME} plugin +GenericName[eu]=%{APPNAME} plugina +GenericName[fa]=وصلۀ %{APPNAME} +GenericName[fr]=Module externe pour %{APPNAME} +GenericName[ga]=Breiseán %{APPNAME} +GenericName[gl]=Extensión %{APPNAME} +GenericName[hu]=%{APPNAME}-bővítőmodul +GenericName[it]=Plugin %{APPNAME} +GenericName[ja]=%{APPNAME} プラグイン +GenericName[nds]=%{APPNAME}-Moduul +GenericName[ne]=%{APPNAME} प्लगइन +GenericName[nl]=%{APPNAME}-plugin +GenericName[pl]=Wtyczka %{APPNAME} +GenericName[pt]='Plugin' %{APPNAME} +GenericName[pt_BR]=Plug-in do %{APPNAME} +GenericName[ru]=Модуль %{APPNAME} +GenericName[sk]=%{APPNAME} modul +GenericName[sl]=Vstavek za %{APPNAME} +GenericName[sr]=%{APPNAME} прикључак +GenericName[sr@Latn]=%{APPNAME} priključak +GenericName[sv]=%{APPNAME} insticksprogram +GenericName[tr]=%{APPNAME} Eklentisi +GenericName[zh_CN]=%{APPNAME} 插件 +GenericName[zh_TW]=%{APPNAME} 外掛程式 +Comment=%{APPNAME} Description +Comment[br]=Deskrivadur %{APPNAME} +Comment[ca]=Descripció per a %{APPNAME} +Comment[da]=%{APPNAME} beskrivelse +Comment[de]=%{APPNAME} Beschreibung +Comment[el]=Περιγραφή %{APPNAME} +Comment[es]=Descripción de %{APPNAME} +Comment[et]=%{APPNAME} kirjeldus +Comment[eu]=%{APPNAME} deskribapena +Comment[fa]=توصیف %{APPNAME} +Comment[fr]=Description pour %{APPNAME} +Comment[ga]=Cur Síos %{APPNAME} +Comment[gl]=Descripción de %{APPNAME} +Comment[hu]=%{APPNAME} leírása +Comment[it]=Descrizione %{APPNAME} +Comment[ja]=%{APPNAME} 概説 +Comment[nds]=%{APPNAME}-Beschrieven +Comment[ne]=%{APPNAME} वर्णन +Comment[nl]=%{APPNAME} omschrijving +Comment[pl]=Opis %{APPNAME} +Comment[pt]=Descrição de %{APPNAME$} +Comment[pt_BR]=Descrição do %{APPNAME} +Comment[ru]=Описание %{APPNAME} +Comment[sk]=%{APPNAME} popis +Comment[sl]=Opis za %{APPNAME} +Comment[sr]=Опис за %{APPNAME} +Comment[sr@Latn]=Opis za %{APPNAME} +Comment[sv]=%{APPNAME} beskrivning +Comment[tr]=%{APPNAME} Tanımı +Comment[zh_CN]=%{APPNAME} 描述 +Comment[zh_TW]=%{APPNAME} 描述 +Icon=kdevelop +ServiceTypes=KDevelop/Plugin + +X-KDevelop-Plugin-Version=1 +X-KDevelop-Plugin-Homepage= +X-KDevelop-Plugin-BugsEmailAddress=%{EMAIL} +X-KDevelop-Plugin-Copyright=(C) by %{AUTHOR} + +X-KDevelop-Args= + +X-KDevelop-Scope=%{SCOPE} +X-KDE-Library=libkdev%{APPNAMELC} +X-KDevelop-Version=3 +X-KDevelop-Properties=%{PROPS} diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart2.kdevtemplate b/languages/cpp/app_templates/kdevpart2/kdevpart2.kdevtemplate new file mode 100644 index 00000000..6b701188 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/kdevpart2.kdevtemplate @@ -0,0 +1,276 @@ +# KDE Config File +[General] +Name=KDevelop Plugin (Standalone build) +Name[ca]=Connector per a KDevelop (de construcció aïllada) +Name[da]=KDevelop plugin (Alenestående) +Name[de]=KDevelop-Modul (Unabhängige Erstellung) +Name[el]=Πρόσθετο KDevelop (Αυτόνομη κατασκευή) +Name[es]=Complemento para KDevelop (construcción independiente) +Name[et]=KDevelopi plugin (autonoomne) +Name[eu]=KDevelop plugin-a (eraikuntza autonomoak) +Name[fa]=وصلۀ KDevelop )ساخت خوداتکا( +Name[fr]=Module externe pour KDevelop (construction autonome) +Name[ga]=Breiseán KDevelop (Tógáil Shaorsheasaimh) +Name[gl]=Extensión para KDevelop (compilación independente) +Name[hu]=KDevelop-bővítőmodul (önálló) +Name[it]=Plugin di KDevelop (compilazione indipendente) +Name[ja]=KDevelop プラグイン (スタンダローンビルド) +Name[nds]=KDevelop-Moduul (Enkelprogramm) +Name[ne]=केडीई विकास प्लगइन (स्ट्यान्डअलोन निर्माण) +Name[nl]=KDevelop-plugin (standalone build) +Name[pl]=Wtyczka do KDevelopa (budowana oddzielnie) +Name[pt]='Plugin' do KDevelop (compilação autónoma) +Name[pt_BR]='Plugin' do KDevelop (compilação autónoma) +Name[ru]=Модуль KDevelop (внешний) +Name[sk]=KDevelop modul (samostatný build) +Name[sl]=Vstavek za KDevelop (samostojna izgradnja) +Name[sr]=Прикључак за KDevelop +Name[sr@Latn]=Priključak za KDevelop +Name[sv]=KDevelop-insticksprogram (att bygga fristående) +Name[tr]=KDevelop Eklentisi (Kendi başına çalışabilen) +Name[zh_CN]=KDevelop 插件(独立编译) +Name[zh_TW]=KDevelop 外掛程式(單獨建立) +Category=C++/KDevelop/ +Comment=This generates a KPart for KDevelop, to be built outside of the KDevelop source tree. +Comment[ca]=Genera una KPart per a KDevelop, per a que es construeixi fora de l'arbre de fonts de KDevelop. +Comment[da]=Dette genererer en KPart for KDevelop, til at bygges udenfor KDevelop's kildetræ. +Comment[de]=Hiermit wird eine Komponente (KPart) für KDevelop generiert, die außerhalb des Quelltextbaumes von KDevelop erstellt wird. +Comment[el]=Αυτό δημιουργεί ένα KPart για το KDevelop, για κατασκευή του έξω από το δέντρο πηγαίου κώδικα του KDevelop. +Comment[es]=Genera un KPart para KDevelop, para ser construido fuera del árbol de código fuente de KDevelop. +Comment[et]=KDevelopi KPart'i loomine, mida saab ehitada väljaspool KDevelopi lähtekoodipuud. +Comment[eu]=Honek KDevelop-en KPart bat sortzen du, KDevelop-en iturburu-zuhaitzetik at eraikitzeko. +Comment[fa]=یک KPart برای KDevelop، برای ساخته شدن در بیرون درخت منبع پروژه تولید می‌کند. +Comment[fr]=Génère un KPart pour KDevelop, à construire en dehors de l'arborescence des sources de KDevelop. +Comment[gl]=Isto xera un KPart para KDevelop que se compilará fóra da árbore de código de KDevelop. +Comment[hu]=Létrehoz egy KDevelop-bővítőmodult, mely a KDevelopos forráskönyvtáron kívül fordítható le. +Comment[it]=Genera un KPart per KDevelop, da compilare al di fuori dell'albero sorgente di KDevelop. +Comment[nds]=Dit stellt en KPart-Komponent för KDevelop op, dat buten den KDevelop-Bornboom kompileert warrt. +Comment[ne]=यसले केडीई विकास स्रोत ट्री बाहिर निर्माण हुने, केडीई विकासका लागि केडीई भाग उत्पन्न गर्दछ । +Comment[nl]=Dit genereert een KPart voor KDevelop, welke buiten de KDevelop sourcetree wordt gebouwd. +Comment[pl]=Generuje KPart dla KDevelopa budowane poza jego drzewem źródłowym. +Comment[pt]=Isto gera uma KPart para o KDevelop, de modo a ser compilada fora da árvore de código do KDevelop. +Comment[pt_BR]=Isto gera uma KPart para o KDevelop, de modo a ser compilada fora da árvore de código do KDevelop. +Comment[ru]=Создание компонента KPart для KDevelop со сборкой вне исходного кода KDevelop. +Comment[sk]=Vygenruje KPart pre KDevelop, tak aby ho bolo možné kompilovať mimo zdrojový strom KDevelop. +Comment[sr]=Ово прави KPart за KDevelop, за градњу изван KDevelop-овог изворног стабла. +Comment[sr@Latn]=Ovo pravi KPart za KDevelop, za gradnju izvan KDevelop-ovog izvornog stabla. +Comment[sv]=Detta skapar ett KDevelop-delprogram, att bygga utanför KDevelops källkodsträd. +Comment[tr]=Bu, KDevelop için, KDevelop kaynak ağacının dışında yapılacak, bir KPart yaratır. +Comment[zh_CN]=这将生成一个 KDevelop 的 KPart,可以在 KDevelop 源代码树之外编译。 +Comment[zh_TW]=產生一個 KDevelop 的 KPart 元件,建立在 KDevelop 程式源碼樹之外。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}_part.cpp +Archive=kdevpart2.tar.gz + +[SCOPE] +Type = value +ValueType=QString +Value= SCOPE +Comment= The scope of a plugin (Global, Project, Core) +Comment[ca]= L'àmbit d'un connector (Global, Project, Core) +Comment[da]= Et plugins omfang (Globalt, Projekt, Kerne) +Comment[de]= Gültigkeitsbereich eines Moduls (Global, Projekt, Kern) +Comment[el]= Η εμβέλεια ενός πρόσθετου (Καθολική, Έργο, Πυρήνας) +Comment[es]=El alcance de un complemento (global, proyecto, núcleo) +Comment[et]=Plugina skoop (globaalne, projekt, tuum) +Comment[eu]= Pluginaren barrutia (Globala, Projektua, Nukleoa) +Comment[fa]=دامنۀ یک وصله )سراسری، پروژه، هسته( +Comment[fr]= La portée d'un module externe (globale, projet, core) +Comment[ga]= Scóip an bhreiseáin (Comhchoiteann, Tionscadal, Ceartlár) +Comment[gl]=Ámbito da extensión (Global, Proxecto, Núcleo) +Comment[hu]=A modul hatóköre (globális, projektszintű, alap) +Comment[it]=Il contesto di un plugin (Globale, Progetto, Core) +Comment[nds]= Dat Rebeet vun en Moduul (Globaal, Projekt, Karn) +Comment[ne]= प्लगइनको क्षेत्र (विश्वव्यापी, परियोजना, कोर) +Comment[nl]=Het bereik van een plugin (globaal, project, core) +Comment[pl]=Przynależność wtyczki (globalna, projekt, część główna) +Comment[pt]=O âmbito de um 'plugin' (Global, Projecto, Núcleo) +Comment[pt_BR]=O âmbito de um 'plugin' (Global, Projecto, Núcleo) +Comment[ru]=Тип модуля (Global, Project, Core) +Comment[sk]=Rozsah module (globálny, projektový, jadrový) +Comment[sr]=Опсег прикључка (глобални, пројекат, језгро) +Comment[sr@Latn]=Opseg priključka (globalni, projekat, jezgro) +Comment[sv]=Insticksprogrammets omfattning (Global, Projekt, Kärna) +Comment[tr]=Bir eklentinin alanı (Genel, Proje, İç) +Comment[zh_CN]=插件的范围(全局、工程、核心) +Comment[zh_TW]=外掛程式的範圍(全域、專案、核心) +Default= Global + +[PROPS] +Type = value +ValueType=QString +Value= PROPS +Comment= The list of supported KDevelop properties +Comment[ca]= La llista de propietats suportades del KDevelop +Comment[da]= Listen af understøttede KDevelop-egenskaber +Comment[de]= Die Liste der unterstützten KDevelop-Eigenschaften +Comment[el]= Η λίστα των υποστηριζόμενων ιδιοτήτων του KDevelop +Comment[es]=La lista de propiedades de KDevelop soportadas +Comment[et]= KDevelopi toetatud omaduste nimekiri +Comment[eu]= Onartzen diren KDevelop-en propietateen zerrenda +Comment[fa]=فهرست ویژگیهای پشتیبانی‌شدۀ KDevelop +Comment[fr]= La liste des propriétés de KDevelop prises en charge +Comment[ga]= Liosta d'airíonna KDevelop a dtacaítear leo +Comment[gl]=Lista das propiedades de KDevelop soportadas +Comment[hu]=A támogatott KDevelop-tulajdonságok +Comment[it]=Lista delle proprietà supportate da KDevelop +Comment[nds]= De List mit ünnerstütt KDevelop-Egenschappen +Comment[ne]= केडीई विकास समर्थन गर्ने गुणको सूची +Comment[nl]=De lijst met ondersteunde KDevelop-properties +Comment[pl]= Lista obsługiwanych właściwości KDevelopa +Comment[pt]= A lista de propriedades do KDevelop suportadas +Comment[pt_BR]= A lista de propriedades do KDevelop suportadas +Comment[ru]=Список поддерживаемых типов модулей для KDevelop +Comment[sk]=Zoznam podporovaných vlastností KDevelop +Comment[sl]=Seznam podprtih lastnosti KDevelop +Comment[sr]=Листа подржаних KDevelop-ових својстава +Comment[sr@Latn]=Lista podržanih KDevelop-ovih svojstava +Comment[sv]=Listan med egenskaper i KDevelop som stöds +Comment[tr]=Desteklenen KDevelop özellikleri +Comment[zh_CN]=列出支持的 KDevelop 属性 +Comment[zh_TW]=支援的 KDevelop 屬性列表 +Default= + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE4] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE5] +Type=install +Source=%{src}/kdevpart-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE6] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE7] +Type=install +Source=%{src}/kdevpart_part.cpp +Dest=%{dest}/src/%{APPNAMELC}part.cpp + +[FILE71] +Type=install +EscapeXML=true +Source=%{src}/globalconfigbase.ui +Dest=%{dest}/src/%{APPNAMELC}globalconfigbase.ui + +[FILE711] +Type=install +Source=%{src}/globalconfig.h +Dest=%{dest}/src/%{APPNAMELC}globalconfig.h + +[FILE712] +Type=install +Source=%{src}/globalconfig.cpp +Dest=%{dest}/src/%{APPNAMELC}globalconfig.cpp + +[FILE72] +Type=install +EscapeXML=true +Source=%{src}/projectconfigbase.ui +Dest=%{dest}/src/%{APPNAMELC}projectconfigbase.ui + +[FILE721] +Type=install +Source=%{src}/projectconfig.h +Dest=%{dest}/src/%{APPNAMELC}projectconfig.h + +[FILE722] +Type=install +Source=%{src}/projectconfig.cpp +Dest=%{dest}/src/%{APPNAMELC}projectconfig.cpp + +[FILE8] +Type=install +Source=%{src}/kdevpart_part.h +Dest=%{dest}/src/%{APPNAMELC}part.h + +[FILE9] +Type=install +Source=%{src}/kdevpart_widget.cpp +Dest=%{dest}/src/%{APPNAMELC}widget.cpp + +[FILE10] +Type=install +Source=%{src}/kdevpart_widget.h +Dest=%{dest}/src/%{APPNAMELC}widget.h + +[FILE11] +Type=install +EscapeXML=true +Source=%{src}/kdevpart_part.rc +Dest=%{dest}/src/kdev%{APPNAMELC}.rc + +[FILE12] +Type=install +Source=%{src}/kdevpart.desktop +Dest=%{dest}/src/kdev%{APPNAMELC}.desktop + +[FILE13] +Type=install +Source=%{src}/README.dox +Dest=%{dest}/src/README.dox + +[MSG] +Type=message +Comment=A KDevelop plugin was created in %{dest} +Comment[ca]=Un connector per a KDevelop ha estat creat en %{dest} +Comment[da]=Et KDevelop plugin blev oprettet i %{dest} +Comment[de]=Ein KDevelop-Modul wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο του KDevelop δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento para KDevelop ha sido creado en %{dest} +Comment[et]=KDevelopi plugin loodi asukohta %{dest} +Comment[eu]=KDevelop plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ KDevelop در %{dest} ایجاد شد +Comment[fr]=Un module externe pour KDevelop a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán KDevelop i %{dest} +Comment[gl]=Creouse unha extensión para KDevelop en %{dest} +Comment[hu]=Létrejött egy KDevelop-bővítőmodul itt: %{dest} +Comment[it]=È stato creato un plugin per KDevelop in %{dest} +Comment[ja]=KDevelop プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KDevelop-Moduul opstellt +Comment[ne]=केडीई विकास प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Er is een KDevelop-plugin aangemaakt in %{dest} +Comment[pl]=Wtyczka do KDevelopa została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' do KDevelop em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' do KDevelop em %{dest} +Comment[ru]=Модуль KDevelop создан в %{dest} +Comment[sk]=KDevelop modul bol vytvorený v %{dest} +Comment[sl]=Vstavek za KDevelop je bil ustvarjen v %{dest} +Comment[sr]=Прикључак за KDevelop направљен је у %{dest} +Comment[sr@Latn]=Priključak za KDevelop napravljen je u %{dest} +Comment[sv]=Ett insticksprogram för KDevelop skapades i %{dest} +Comment[tr]=Bir KDevelop eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了 KDevelop 插件 +Comment[zh_TW]=一個 KDevelop 外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart2.png b/languages/cpp/app_templates/kdevpart2/kdevpart2.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/kdevpart2/kdevpart2.png differ diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_part.cpp b/languages/cpp/app_templates/kdevpart2/kdevpart_part.cpp new file mode 100644 index 00000000..dd86843d --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/kdevpart_part.cpp @@ -0,0 +1,183 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}part.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "%{APPNAMELC}widget.h" +#include "%{APPNAMELC}globalconfig.h" +#include "%{APPNAMELC}projectconfig.h" + +typedef KDevGenericFactory<%{APPNAME}Part> %{APPNAME}Factory; +KDevPluginInfo data("kdev%{APPNAMELC}"); +K_EXPORT_COMPONENT_FACTORY( libkdev%{APPNAMELC}, %{APPNAME}Factory( data ) ); + +#define GLOBALDOC_OPTIONS 1 +#define PROJECTDOC_OPTIONS 2 + +%{APPNAME}Part::%{APPNAME}Part(QObject *parent, const char *name, const QStringList &/*args*/) + : KDevPlugin(&data, parent, name ? name : "%{APPNAME}Part") +{ + setInstance(%{APPNAME}Factory::instance()); + setXMLFile("kdev%{APPNAMELC}.rc"); + + m_widget = new %{APPNAME}Widget(this); + m_widget->setCaption("widget caption"); + m_widget->setIcon(SmallIcon(info()->icon())); + + QWhatsThis::add(m_widget, i18n("WHAT DOES THIS PART DO?")); + + // now you decide what should happen to the widget. Take a look at kdevcore.h + // or at other plugins how to embed it. + + // if you want to embed your widget as an outputview, simply uncomment + // the following line. + // mainWindow()->embedOutputView( m_widget, "name that should appear", "enter a tooltip" ); + + // if you want to embed your widget as a selectview (at the left), simply uncomment + // the following line. + // mainWindow()->embedSelectView( m_widget, "name that should appear", "enter a tooltip" ); + + // if you want to embed your widget as a selectview (at the right), simply uncomment + // the following line. + // mainWindow()->embedSelectViewRight( m_widget, "name that should appear", "enter a tooltip" ); + + setupActions(); + + m_configProxy = new ConfigWidgetProxy(core()); + m_configProxy->createGlobalConfigPage(i18n("%{APPNAME}"), GLOBALDOC_OPTIONS, info()->icon()); + m_configProxy->createProjectConfigPage(i18n("%{APPNAME}"), PROJECTDOC_OPTIONS, info()->icon()); + connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )), + this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int))); + + connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), + this, SLOT(contextMenu(QPopupMenu *, const Context *))); + connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened())); + connect(core(), SIGNAL(projectClosed()), this, SLOT(projectClosed())); + + + QTimer::singleShot(0, this, SLOT(init())); +} + +%{APPNAME}Part::~%{APPNAME}Part() +{ +// if you embed a widget, you need to tell the mainwindow when you remove it +// if ( m_widget ) +// { +// mainWindow()->removeView( m_widget ); +// } + delete m_widget; + delete m_configProxy; +} + +void %{APPNAME}Part::init() +{ +// delayed initialization stuff goes here +} + +void %{APPNAME}Part::setupActions() +{ +// create XMLGUI actions here + action = new KAction(i18n("&Do Something..."), 0, + this, SLOT(doSomething()), actionCollection(), "plugin_action" ); + action->setToolTip(i18n("Do something")); + action->setWhatsThis(i18n("Do something

Describe here what does this action do.")); +} + +void %{APPNAME}Part::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo) +{ +// create configuraton dialogs here + switch (pageNo) + { + case GLOBALDOC_OPTIONS: + { + %{APPNAME}GlobalConfig *w = new %{APPNAME}GlobalConfig(this, page, "global config"); + connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); + break; + } + case PROJECTDOC_OPTIONS: + { + %{APPNAME}ProjectConfig *w = new %{APPNAME}ProjectConfig(this, page, "project config"); + connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); + break; + } + } +} + +void %{APPNAME}Part::contextMenu(QPopupMenu *popup, const Context *context) +{ +// put actions into the context menu here + if (context->hasType(Context::EditorContext)) + { + // editor context menu + const EditorContext *econtext = static_cast(context); + + // use context and plug actions here + action->plug(popup); + + // or create menu items on the fly + // int id = -1; + // id = popup->insertItem(i18n("Do Something Here"), + // this, SLOT(doSomething()) ); + // popup->setWhatsThis(id, i18n("Do something here

Describe here what does this action do." + } + else if (context->hasType(Context::FileContext)) + { + // file context menu + const FileContext *fcontext = static_cast(context); + + //use context and plug actions here + } + else if (context->hasType(Context::ProjectModelItemContext)) + { + // project tree context menu + const ProjectModelItemContext *pcontext = static_cast(context); + + // use context and plug actions here + } + else if (context->hasType(Context::CodeModelItemContext)) + { + // class tree context menu + const CodeModelItemContext *mcontext = static_cast(context); + + // use context and plug actions here + } + else if (context->hasType(Context::DocumentationContext)) + { + // documentation viewer context menu + const DocumentationContext *dcontext = static_cast(context); + + // use context and plug actions here + } +} + +void %{APPNAME}Part::projectOpened() +{ +// do something when the project is opened +} + +void %{APPNAME}Part::projectClosed() +{ +// do something when the project is closed +} + +void %{APPNAME}Part::doSomething() +{ +// do something useful here instead of showing the message box + KMessageBox::information(m_widget, i18n("This action does nothing."), i18n("%{APPNAME} Plugin")); +} + +#include "%{APPNAMELC}part.moc" diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_part.h b/languages/cpp/app_templates/kdevpart2/kdevpart_part.h new file mode 100644 index 00000000..168b8a40 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/kdevpart_part.h @@ -0,0 +1,45 @@ +%{H_TEMPLATE} +#ifndef KDEV%{APPNAMEUC}_H +#define KDEV%{APPNAMEUC}_H + +#include + +#include + +class QPopupMenu; +class KAction; +class KDialogBase; +class Context; +class ConfigWidgetProxy; +class %{APPNAME}Widget; + +/** +Please read the README.dox file for more info about this part +*/ +class %{APPNAME}Part: public KDevPlugin +{ + Q_OBJECT +public: + %{APPNAME}Part(QObject *parent, const char *name, const QStringList &args); + ~%{APPNAME}Part(); + +private slots: + void init(); + + void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo); + void contextMenu(QPopupMenu *popup, const Context *context); + void projectOpened(); + void projectClosed(); + + void doSomething(); + +private: + void setupActions(); + + KAction *action; + + QGuardedPtr<%{APPNAME}Widget> m_widget; + ConfigWidgetProxy *m_configProxy; +}; + +#endif diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_part.rc b/languages/cpp/app_templates/kdevpart2/kdevpart_part.rc new file mode 100644 index 00000000..a38ee14e --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/kdevpart_part.rc @@ -0,0 +1,11 @@ + + + +

&Tools + + + + + + + diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_widget.cpp b/languages/cpp/app_templates/kdevpart2/kdevpart_widget.cpp new file mode 100644 index 00000000..0c05b976 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/kdevpart_widget.cpp @@ -0,0 +1,21 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}widget.h" + +#include +#include +#include + +#include + +#include "%{APPNAMELC}part.h" + +%{APPNAME}Widget::%{APPNAME}Widget(%{APPNAME}Part *part) + : QWidget(0, "%{APPNAMELC} widget"), m_part(part) +{ +} + +%{APPNAME}Widget::~%{APPNAME}Widget() +{ +} + +#include "%{APPNAMELC}widget.moc" diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_widget.h b/languages/cpp/app_templates/kdevpart2/kdevpart_widget.h new file mode 100644 index 00000000..e29e29d2 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/kdevpart_widget.h @@ -0,0 +1,23 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMEUC}_WIDGET_H +#define %{APPNAMEUC}_WIDGET_H + +#include +#include + +class KDevProject; +class %{APPNAME}Part; + +class %{APPNAME}Widget: public QWidget +{ + Q_OBJECT +public: + %{APPNAME}Widget(%{APPNAME}Part *part); + ~%{APPNAME}Widget(); + +private: + %{APPNAME}Part *m_part; +}; + + +#endif diff --git a/languages/cpp/app_templates/kdevpart2/projectconfig.cpp b/languages/cpp/app_templates/kdevpart2/projectconfig.cpp new file mode 100644 index 00000000..5f07993b --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/projectconfig.cpp @@ -0,0 +1,15 @@ +%{CPP_TEMPLATE} +#include "%{APPNAMELC}projectconfig.h" + +#include "%{APPNAMELC}part.h" + +%{APPNAME}ProjectConfig::%{APPNAME}ProjectConfig(%{APPNAME}Part *part, QWidget *parent, const char *name) + : %{APPNAME}ProjectConfigBase(parent, name), m_part(part) +{ +} + +void %{APPNAME}ProjectConfig::accept() +{ +} + +#include "%{APPNAMELC}projectconfig.moc" diff --git a/languages/cpp/app_templates/kdevpart2/projectconfig.h b/languages/cpp/app_templates/kdevpart2/projectconfig.h new file mode 100644 index 00000000..ec3ff4df --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/projectconfig.h @@ -0,0 +1,22 @@ +%{H_TEMPLATE} +#ifndef %{APPNAMEUC}_PROJECT_CONFIG_H +#define %{APPNAMEUC}_PROJECT_CONFIG_H + +#include "%{APPNAMELC}projectconfigbase.h" + +class %{APPNAME}Part; + +class %{APPNAME}ProjectConfig: public %{APPNAME}ProjectConfigBase +{ + Q_OBJECT +public: + %{APPNAME}ProjectConfig(%{APPNAME}Part *part, QWidget *parent = 0, const char *name = 0); + +public slots: + void accept(); + +private: + %{APPNAME}Part *m_part; +}; + +#endif diff --git a/languages/cpp/app_templates/kdevpart2/projectconfigbase.ui b/languages/cpp/app_templates/kdevpart2/projectconfigbase.ui new file mode 100644 index 00000000..c733a774 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/projectconfigbase.ui @@ -0,0 +1,20 @@ + +%{APPNAME}ProjectConfigBase + + + %{APPNAME}ProjectConfigBase + + + + 0 + 0 + 600 + 480 + + + + %{APPNAME} + + + + diff --git a/languages/cpp/app_templates/kdevpart2/src-Makefile.am b/languages/cpp/app_templates/kdevpart2/src-Makefile.am new file mode 100644 index 00000000..dded12c0 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/src-Makefile.am @@ -0,0 +1,17 @@ +INCLUDES = -I$(kde_includes)/kdevelop/interfaces -I$(kde_includes)/kdevelop/util $(all_includes) + +kde_module_LTLIBRARIES = libkdev%{APPNAMELC}.la +libkdev%{APPNAMELC}_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(KDE_PLUGIN) +libkdev%{APPNAMELC}_la_LIBADD = -lkdevelop +libkdev%{APPNAMELC}_la_SOURCES = %{APPNAMELC}part.cpp %{APPNAMELC}widget.cpp %{APPNAMELC}globalconfigbase.ui %{APPNAMELC}globalconfig.cpp %{APPNAMELC}projectconfigbase.ui %{APPNAMELC}projectconfig.cpp + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdev%{APPNAMELC}.desktop + +rcdir = $(kde_datadir)/kdev%{APPNAMELC} +rc_DATA = kdev%{APPNAMELC}.rc + +appsharedir = $(kde_datadir)/kdev%{APPNAMELC} +appshare_DATA = diff --git a/languages/cpp/app_templates/kdevpart2/subdirs b/languages/cpp/app_templates/kdevpart2/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kdevpart2/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kfileplugin/.kdev_ignore b/languages/cpp/app_templates/kfileplugin/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kfileplugin/Makefile.am b/languages/cpp/app_templates/kfileplugin/Makefile.am new file mode 100644 index 00000000..9ac8003d --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = README.devel kfile_plugin.cpp kfile_plugin.desktop \ + kfile_plugin.h plugin.kdevelop kfileplugin kfileplugin.png \ + src-Makefile.am subdirs +templateName = kfileplugin + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kfileplugin/README.devel b/languages/cpp/app_templates/kfileplugin/README.devel new file mode 100644 index 00000000..21ee67c7 --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/README.devel @@ -0,0 +1,9 @@ +@todo: + +1. add information to src/kfile_%{APPNAMELC}.desktop +MimeType= +PreferredGroups= +PreferredItems= + +2. plugin +Note: Please change to "Optimized" compilation if you want to make a release. diff --git a/languages/cpp/app_templates/kfileplugin/kfile_plugin.cpp b/languages/cpp/app_templates/kfileplugin/kfile_plugin.cpp new file mode 100644 index 00000000..3e6b849a --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/kfile_plugin.cpp @@ -0,0 +1,55 @@ +%{CPP_TEMPLATE} + +#include +#include "kfile_%{APPNAMELC}.h" + +#include +//#include + +//#include +//#include + +typedef KGenericFactory<%{APPNAME}Plugin> %{APPNAME}Factory; + +K_EXPORT_COMPONENT_FACTORY(kfile_%{APPNAME}, %{APPNAME}Factory( "kfile_%{APPNAMELC}" )) + +%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const char *name, + const QStringList &args) + : KFilePlugin(parent, name, args) +{ + //add the mimetype here - example: + //KFileMimeTypeInfo* info = addMimeTypeInfo( "text/html" ); + KFileMimeTypeInfo* info = addMimeTypeInfo( "text/html" ); + + // our new group + KFileMimeTypeInfo::GroupInfo* group = 0L; + group = addGroupInfo(info, "%{APPNAME}Info", i18n("%{APPNAME} Information")); + + KFileMimeTypeInfo::ItemInfo* item; + + // our new items in the group + item = addItemInfo(group, "Items", i18n("Items"), QVariant::Int); + item = addItemInfo(group, "Size", i18n("Size"), QVariant::Int); + setUnit(item, KFileMimeTypeInfo::KiloBytes); + + // strings are possible, too: + //addItemInfo(group, "Text", i18n("Document Type"), QVariant::String); +} + +bool %{APPNAME}Plugin::readInfo( KFileMetaInfo& info, uint /*what*/) +{ + KFileMetaInfoGroup group = appendGroup(info, "%{APPNAME}Info"); + + // add your "calculations" here + // if something goes wrong, "return false;" + + + // and finally display it! + appendItem(group, "Items", 100); + appendItem(group, "Size", int(5000/1024)); + + return true; +} + +#include "kfile_%{APPNAMELC}.moc" + diff --git a/languages/cpp/app_templates/kfileplugin/kfile_plugin.desktop b/languages/cpp/app_templates/kfileplugin/kfile_plugin.desktop new file mode 100644 index 00000000..9af8b5e9 --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/kfile_plugin.desktop @@ -0,0 +1,39 @@ +[Desktop Entry] +Type=Service +Name=%{APPNAME} Info +Name[br]=Titouriñ diwar-benn %{APPNAME} +Name[ca]=Informació per a %{APPNAME} +Name[da]=%{APPNAME} info +Name[el]=Πληροφορίες %{APPNAME} +Name[es]=Información de %{APPNAME} +Name[et]=%{APPNAME} info +Name[eu]=%{APPNAME} informazioa +Name[fa]=اطلاعات %{APPNAME} +Name[fr]=Informations sur %{APPNAME} +Name[ga]=Eolas faoi %{APPNAME} +Name[gl]=Información de %{APPNAME} +Name[hu]=%{APPNAME} jellemzői +Name[it]=Informazioni su %{APPNAME} +Name[nds]=%{APPNAME}-Info +Name[ne]=%{APPNAME} सूचना +Name[pl]=Informacje dla %{APPNAME} +Name[pt]=Informação do %{APPNAME} +Name[pt_BR]=Informações de %{APPNAME} +Name[ru]=Информация о %{APPNAME} +Name[sk]=%{APPNAME} info +Name[sl]=Informacije o %{APPNAME} +Name[sr]=Информације за %{APPNAME} +Name[sr@Latn]=Informacije za %{APPNAME} +Name[sv]=%{APPNAME} information +Name[ta]=%{APPNAME} தகவல் +Name[tg]=Маълумот дар бораи %{APPNAME} +Name[zh_CN]=%{APPNAME}的信息 +Name[zh_TW]=%{APPNAME} 資訊 +ServiceTypes=KFilePlugin +X-KDE-Library=kfile_%{APPNAMELC} +# change MimeType here! (example: inode/directory) +MimeType= +# change PreferredGroups here! (example: FolderInfo) +PreferredGroups= +# change PreferredItems here! (example: Items;Size) +PreferredItems= diff --git a/languages/cpp/app_templates/kfileplugin/kfile_plugin.h b/languages/cpp/app_templates/kfileplugin/kfile_plugin.h new file mode 100644 index 00000000..358b4dcb --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/kfile_plugin.h @@ -0,0 +1,24 @@ +%{H_TEMPLATE} + +#ifndef __KFILE_%{APPNAMEUC}_H__ +#define __KFILE_%{APPNAMEUC}_H__ + +/** + * Note: For further information look into <$KDEDIR/include/kfilemetainfo.h> + */ +#include + +class QStringList; + +class %{APPNAME}Plugin: public KFilePlugin +{ + Q_OBJECT + +public: + %{APPNAME}Plugin( QObject *parent, const char *name, const QStringList& args ); + + virtual bool readInfo( KFileMetaInfo& info, uint what); +}; + +#endif // __KFILE_%{APPNAMEUC}_H__ + diff --git a/languages/cpp/app_templates/kfileplugin/kfileplugin b/languages/cpp/app_templates/kfileplugin/kfileplugin new file mode 100644 index 00000000..6717cdc2 --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/kfileplugin @@ -0,0 +1,8 @@ +# KDE Config File +[General] +Name=KFile plugin +Icon=kfileplugin.png +Category=C++/KDE +Comment=Generates a KFile plugin for konqueror to display meta information. +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=README.devel,src/kfile_APPNAMELC.cpp diff --git a/languages/cpp/app_templates/kfileplugin/kfileplugin.kdevtemplate b/languages/cpp/app_templates/kfileplugin/kfileplugin.kdevtemplate new file mode 100644 index 00000000..edff2fd4 --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/kfileplugin.kdevtemplate @@ -0,0 +1,166 @@ +# KDE Config File +[General] +Name=KFile plugin +Name[br]=Lugent KFile +Name[ca]=Connector KFile +Name[de]=KFile-Modul +Name[el]=Πρόσθετο KFile +Name[es]=Complemento para KFile +Name[et]=KFile'i plugin +Name[eu]=KFile plugin-a +Name[fa]=وصلۀ KFile +Name[fr]=Module externe KFile +Name[ga]=Breiseán KFile +Name[gl]=Extensión para KFile +Name[hu]=KFile-bővítőmodul +Name[it]=Plugin KFile +Name[ja]=KFile プラグイン +Name[nds]=KFile-Moduul +Name[ne]=केडीई फाइल प्लगइन +Name[nl]=KFile-plugin +Name[pl]=Wtyczka do KFile +Name[pt]='Plugin' do KFile +Name[pt_BR]='Plugin' do KFile +Name[ru]=Модуль KFile +Name[sk]=KFile modul +Name[sl]=Vstavek za KFile +Name[sr]=Прикључак за KFile +Name[sr@Latn]=Priključak za KFile +Name[sv]=KFile-insticksprogram +Name[tr]=KFile Eklentisi +Name[zh_CN]=KFile 插件 +Name[zh_TW]=KFile 外掛程式 +Icon=kfileplugin.png +Category=C++/KDE +Comment=Generates a KFile plugin for konqueror to display meta information. +Comment[ca]=Genera un connector KFile per al konqueror per a mostrar meta informació. +Comment[da]=Genererer et KFile-plugin for konqueror til at vise meta-information. +Comment[de]=Erstellt ein KFile-Modul für Konqueror zur Anzeige von Meta-Daten. +Comment[el]=Δημιουργεί ένα πρόσθετο KFile για την εμφάνιση μεταπληροφοριών στον konqueror. +Comment[es]=Genera un complemento de KFile para Konqueror que muestra metainformación. +Comment[et]=Konquerori KFile'i plugina loomine, mis näitab metainfot. +Comment[eu]=Meta-informazioa bistaratzeko Konqueror-en KFile plugin bat sortzen du. +Comment[fa]=یک وصلۀ KFile برای konqueror جهت نمایش فرااطلاعات تولید می‌کند. +Comment[fr]=Génère un module externe KFile pour que Konqueror affiche des méta-informations. +Comment[gl]=Xera unha extensión para KFile para permitir a konqueror mostrar metainformación. +Comment[hu]=Létrehoz egy KFile-bővítőmodult, mellyel a Konquerorban dokumentumjellemzőket lehet megjeleníteni. +Comment[it]=Genera un plugin KFile per Konqueror per mostrare meta informazioni. +Comment[nds]=Stellt en KFile-Moduul för Konqueror op, dat Metadaten wiest. +Comment[ne]=मेटा सूचना देखाउन कन्क्वेररका लागि केडीई फाइल प्लगइन उत्पन्न गर्दछ । +Comment[nl]=Genereert een KFile-plugin voor konqueror voor het weergeven van meta-informatie. +Comment[pl]=Generuje wtyczkę KFile dla Konquerora do wyświetlania informacji meta. +Comment[pt]=Gera um 'plugin' do KFile para o Konqueror poder mostrar meta-informações. +Comment[pt_BR]=Gera um 'plugin' do KFile para o Konqueror poder mostrar meta-informações. +Comment[ru]=Создание модуля KFile для показа метаданных в Konqueror. +Comment[sk]=Vygeneruje KFile modul pre konqueror na zobrazenie meta informácií. +Comment[sr]=Прави прикључак за KFile за приказ метаинформација у Konqueror-у. +Comment[sr@Latn]=Pravi priključak za KFile za prikaz metainformacija u Konqueror-u. +Comment[sv]=Skapar ett KFile-insticksprogram till Konqueror för att visa metainformation. +Comment[tr]=Meta bilgisini göstermesi için Konqueror'a bir KFile eklentisi yaratır. +Comment[zh_CN]=生成一个可显示元信息的 Konqueror KFile 插件。 +Comment[zh_TW]=產生一個 Konqueror 的 KFile 外掛程式,顯示中繼資訊 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=${dest}/README.devel,%{dest}/src/kfile_%{APPNAMELC}.cpp +Archive=kfileplugin.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/plugin.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/kfile_plugin.desktop +Dest=%{dest}/src/kfile_%{APPNAMELC}.desktop + +[FILE13] +Type=install +Source=%{src}/kfile_plugin.cpp +Dest=%{dest}/src/kfile_%{APPNAMELC}.cpp + +[FILE14] +Type=install +Source=%{src}/kfile_plugin.h +Dest=%{dest}/src/kfile_%{APPNAMELC}.h + +[FILE15] +Type=install +Source=%{src}/README.devel +Dest=%{dest}/README.devel + diff --git a/languages/cpp/app_templates/kfileplugin/kfileplugin.png b/languages/cpp/app_templates/kfileplugin/kfileplugin.png new file mode 100644 index 00000000..d2a56245 Binary files /dev/null and b/languages/cpp/app_templates/kfileplugin/kfileplugin.png differ diff --git a/languages/cpp/app_templates/kfileplugin/plugin.kdevelop b/languages/cpp/app_templates/kfileplugin/plugin.kdevelop new file mode 100644 index 00000000..a95b52f9 --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/plugin.kdevelop @@ -0,0 +1,114 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/kfile_%{APPNAMELC}.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kfileplugin/src-Makefile.am b/languages/cpp/app_templates/kfileplugin/src-Makefile.am new file mode 100644 index 00000000..48ac1c66 --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/src-Makefile.am @@ -0,0 +1,22 @@ +## Makefile.am for folder file meta info plugin + +INCLUDES = $(all_includes) + +# these are the headers for your project +noinst_HEADERS = kfile_%{APPNAMELC}.h + +kde_module_LTLIBRARIES = kfile_%{APPNAMELC}.la + +kfile_%{APPNAMELC}_la_SOURCES = kfile_%{APPNAMELC}.cpp +kfile_%{APPNAMELC}_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kfile_%{APPNAMELC}_la_LIBADD = $(LIB_KIO) + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +services_DATA = kfile_%{APPNAMELC}.desktop +servicesdir = $(kde_servicesdir) + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kfile_%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/kfileplugin/subdirs b/languages/cpp/app_templates/kfileplugin/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kfileplugin/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/khello/.kdev_ignore b/languages/cpp/app_templates/khello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/khello/Makefile.am b/languages/cpp/app_templates/khello/Makefile.am new file mode 100644 index 00000000..6f788f99 --- /dev/null +++ b/languages/cpp/app_templates/khello/Makefile.am @@ -0,0 +1,18 @@ +# all khello data files +dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \ + subdirs app.desktop khello.png +templateName = khello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/khello/app.cpp b/languages/cpp/app_templates/khello/app.cpp new file mode 100644 index 00000000..44332685 --- /dev/null +++ b/languages/cpp/app_templates/khello/app.cpp @@ -0,0 +1,23 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" + +#include + +#include +#include + +%{APPNAME}::%{APPNAME}() + : KMainWindow( 0, "%{APPNAME}" ) +{ + // set the shell's ui resource file + setXMLFile("%{APPNAMELC}ui.rc"); + + new QLabel( "Hello World", this, "hello label" ); +} + +%{APPNAME}::~%{APPNAME}() +{ +} + +#include "%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/khello/app.desktop b/languages/cpp/app_templates/khello/app.desktop new file mode 100644 index 00000000..8b36e6e0 --- /dev/null +++ b/languages/cpp/app_templates/khello/app.desktop @@ -0,0 +1,40 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} +Icon=%{APPNAMELC} +Type=Application +Comment=A simple KDE Application +Comment[br]=Ur meziant eeun evit KDE +Comment[ca]=Una simple aplicació per al KDE +Comment[da]=Et simpelt KDE program +Comment[de]=Eine einfache KDE-Anwendung +Comment[el]=Μια απλή εφαρμογή του KDE +Comment[es]=Una aplicación de KDE sencilla +Comment[et]=Lihtne KDE rakendus +Comment[eu]=KDE aplikazio simple bat +Comment[fa]=یک کاربرد سادۀ KDE +Comment[fr]=Une application simple pour KDE +Comment[ga]=Feidhmchlár Simplí KDE +Comment[gl]=Unha aplicación KDE sinxela +Comment[hi]=एक सादा केडीई अनुप्रयोग +Comment[hu]=Egyszerű KDE-alkalmazás +Comment[is]=Einfalt KDE forrit +Comment[it]=Una semplice applicazione KDE +Comment[ja]=簡単な KDE アプリケーション +Comment[nds]=En eenfach KDE-Programm +Comment[ne]=एउटा साधारण केडीई अनुप्रयोग +Comment[nl]=Een eenvoudige KDE-toepassing +Comment[pl]=Prosty program KDE +Comment[pt]=Uma aplicação simples do KDE +Comment[pt_BR]=Um simples Aplicativo do KDE +Comment[ru]=Простое приложение KDE +Comment[sk]=Jednoduchá KDE aplikácia +Comment[sl]=Preprost program za KDE +Comment[sr]=Једноставан KDE програм +Comment[sr@Latn]=Jednostavan KDE program +Comment[sv]=Ett enkelt KDE-program +Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு +Comment[tg]=Гузориши оддиKDE +Comment[tr]=Basit bir KDE Uygulaması +Comment[zh_CN]=一个简单的 KDE 应用程序 +Comment[zh_TW]=簡單的 KDE 應用程式 diff --git a/languages/cpp/app_templates/khello/app.h b/languages/cpp/app_templates/khello/app.h new file mode 100644 index 00000000..678df7a3 --- /dev/null +++ b/languages/cpp/app_templates/khello/app.h @@ -0,0 +1,32 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +/** + * @short Application Main Window + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAME} : public KMainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); +}; + +#endif // _%{APPNAMEUC}_H_ diff --git a/languages/cpp/app_templates/khello/app.kdevelop b/languages/cpp/app_templates/khello/app.kdevelop new file mode 100644 index 00000000..7e6cf8da --- /dev/null +++ b/languages/cpp/app_templates/khello/app.kdevelop @@ -0,0 +1,115 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/khello/appui.rc b/languages/cpp/app_templates/khello/appui.rc new file mode 100644 index 00000000..ceb4f14e --- /dev/null +++ b/languages/cpp/app_templates/khello/appui.rc @@ -0,0 +1,8 @@ + + + + C&ustom + + + + diff --git a/languages/cpp/app_templates/khello/khello.kdevtemplate b/languages/cpp/app_templates/khello/khello.kdevtemplate new file mode 100644 index 00000000..e401fa5d --- /dev/null +++ b/languages/cpp/app_templates/khello/khello.kdevtemplate @@ -0,0 +1,220 @@ +# KDE Config File +[General] +Name=Simple KDE Application +Name[ca]=Una simple aplicació per al KDE +Name[da]=Et simpelt KDE program +Name[de]=Einfache KDE-Anwendung +Name[el]=Απλή εφαρμογή του KDE +Name[es]=Aplicación de KDE sencilla +Name[et]=Lihtne KDE rakendus +Name[eu]=KDE aplikazio simple bat +Name[fa]=کاربرد سادۀ KDE +Name[fr]=Application KDE simple +Name[ga]=Feidhmchlár Simplí KDE +Name[gl]=Aplicación KDE sinxela +Name[hu]=Egyszerű KDE-s alkalmazás +Name[it]=Una semplice applicazione KDE +Name[ja]=簡単な KDE アプリケーション +Name[nds]=Eenfach KDE-Programm +Name[ne]=साधारण केडीई अनुप्रयोग +Name[nl]=Eenvoudige KDE-toepassing +Name[pl]=Prosty program dla KDE +Name[pt]=Aplicação Simples do KDE +Name[pt_BR]=Aplicação Simples do KDE +Name[ru]=Простое приложение KDE +Name[sk]=Jednoduchá KDE aplikácia +Name[sl]=Preprost program za KDE +Name[sr]=Једноставан KDE програм +Name[sr@Latn]=Jednostavan KDE program +Name[sv]=Enkelt KDE-program +Name[tr]=Basit KDE Uygulaması +Name[zh_CN]=简单的 KDE 应用程序 +Name[zh_TW]=簡單的 KDE 應用程式 +Category=C++/KDE +Icon=khello.png +Comment=Generates a simple KDE application with one widget. +Comment[ca]=Genera una simple aplicació per al KDE amb un estri. +Comment[da]=Genererer et simpelt KDE program men en kontrol +Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Oberflächenelement +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό. +Comment[es]=Genera una sencilla aplicación para KDE con una ventana. +Comment[et]=Lihtsa KDE rakenduse loomine ühe vidinaga. +Comment[eu]=Trepeta bakarra duen KDE aplikazio simple bat sortzen du. +Comment[fa]=یک کاربرد سادۀ KDE با یک عنصر تولید می‌کند. +Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget). +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le giuirléid amháin. +Comment[gl]=Xera unha aplicación KDE sinxela con un compoñente. +Comment[hu]=Létrehoz egy egyszerű KDE-s alkalmazást, egy grafikus elemmel. +Comment[it]=Genera una semplice applicazione KDE senza elementi grafici. +Comment[ja]=ウィジェットを一つ含んだ簡単な KDE アプリケーションを作成します。 +Comment[nds]=Stellt en eenfach KDE-Programm mit een Element op. +Comment[ne]=एउटा विगेटसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ । +Comment[nl]=Genereert een eenvoudige KDE-toepassing met één widget. +Comment[pl]=Generuje prosty program dla KDE z jednym widgetem. +Comment[pt]=Gera uma aplicação simples para o KDE com uma janela. +Comment[pt_BR]=Gera uma aplicação simples para o KDE com uma janela. +Comment[ru]=Создание простого приложения KDE с одним окном. +Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom. +Comment[sl]=Ustvari preprost program za KDE z enim gradnikom. +Comment[sr]=Прави једноставан KDE програм са једном контролом. +Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom. +Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent. +Comment[tr]=Tek parçacıklı basit bir KDE uygulaması yaratır. +Comment[zh_CN]=生成只有一个部件的 KDE 应用程序。 +Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含一個元件 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=khello.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/po + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE9] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[MkDir4] +Type=mkdir +Dir=%{dest}/src + +[FILE10] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE11] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE12] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[FILE13] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE14] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE15] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE16] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE17] +Type=install +EscapeXML=true +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}ui.rc + +[FILE18] +Type=install +Source=%{src}/app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[MSG] +Type=message +Comment=A KDE Hello world program was created in %{dest} +Comment[ca]=Un programa de Hello world per al KDE ha estat creat en %{dest} +Comment[da]=Et KDE Goddag verden program blev oprettet i %{dest} +Comment[de]=Ein KDE-"Hello World"-Programm wurde in %{dest} erstellt. +Comment[el]=Ένα πρόγραμμα Γεια σου Κόσμε του KDE δημιουργήθηκε στο %{dest} +Comment[es]=Un programa «Hola mundo» para KDE ha sido creado en %{dest} +Comment[et]=KDE "Tere, maailm" programm loodi asukohta %{dest} +Comment[eu]=KDE-ren "Kaixo mundua" programa bat sortu da hemen: %{dest} +Comment[fa]=یک برنامۀ KDE Hello world در %{dest} ایجاد شد +Comment[fr]=Un programme KDE « Bonjour monde » a été créé dans %{dest} +Comment[ga]=Cruthaíodh ríomhchlár "Hello World" KDE i %{dest} +Comment[gl]=Creouse un programa KDE Ola mundo en %{dest} +Comment[hu]=Létrejött egy KDE Hello world program itt: %{dest} +Comment[it]=È stato creato un semplice programma KDE di "Hello world" in %{dest} +Comment[ja]=KDE Hello world プログラムを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en "Moin Welt"-Programm för KDE opstellt +Comment[ne]=केडीई हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो +Comment[nl]=Een KDE Hello World-programma is aangemaakt in %{dest} +Comment[pl]=Program 'Witaj świecie' dla KDE został utworzony w %{dest} +Comment[pt]=Foi criado um programa Olá Mundo do KDE em %{dest} +Comment[pt_BR]=Foi criado um programa Olá Mundo do KDE em %{dest} +Comment[ru]=Приложение KDE Hello world создано в %{dest} +Comment[sk]=KDE Ahoj svet program bol vytvorený v %{dest} +Comment[sl]=Program Hello World za KDE je bil ustvarjen v %{dest} +Comment[sr]=KDE „Здраво свете“ програм направљен је у %{dest} +Comment[sr@Latn]=KDE „Zdravo svete“ program napravljen je u %{dest} +Comment[sv]=Ett KDE Hello world-program skapades i %{dest} +Comment[tr]=Bir KDE Merhaba Dünya programı %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了 KDE Hello world 程序 +Comment[zh_TW]=一個 KDE Hello World 程式已建立於 %{dest} + diff --git a/languages/cpp/app_templates/khello/khello.png b/languages/cpp/app_templates/khello/khello.png new file mode 100644 index 00000000..9fe493f5 Binary files /dev/null and b/languages/cpp/app_templates/khello/khello.png differ diff --git a/languages/cpp/app_templates/khello/main.cpp b/languages/cpp/app_templates/khello/main.cpp new file mode 100644 index 00000000..da7c5335 --- /dev/null +++ b/languages/cpp/app_templates/khello/main.cpp @@ -0,0 +1,51 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE KPart Application"); + +static const char version[] = "%{VERSION}"; + +static KCmdLineOptions options[] = +{ +// { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions( options ); + KApplication app; + %{APPNAME} *mainWin = 0; + + if (app.isRestored()) + { + RESTORE(%{APPNAME}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + + /// @todo do something with the command line args here + + mainWin = new %{APPNAME}(); + app.setMainWidget( mainWin ); + mainWin->show(); + + args->clear(); + } + + // mainWin has WDestructiveClose flag by default, so it will delete itself. + return app.exec(); +} + diff --git a/languages/cpp/app_templates/khello/src-Makefile.am b/languages/cpp/app_templates/khello/src-Makefile.am new file mode 100644 index 00000000..d9ac7c7a --- /dev/null +++ b/languages/cpp/app_templates/khello/src-Makefile.am @@ -0,0 +1,35 @@ +# set the include path for X, qt and KDE +INCLUDES = $(all_includes) + +# these are the headers for your project +noinst_HEADERS = %{APPNAMELC}.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + +KDE_ICON = AUTO + +######################################################################### +# APPLICATION SECTION +######################################################################### +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = %{APPNAMELC} + +# the application source, library search path, and link libraries +%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp +%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries) +%{APPNAMELC}_LDADD = $(LIB_KDEUI) + +# this is where the desktop file will go +shelldesktopdir = $(kde_appsdir)/Utilities +shelldesktop_DATA = %{APPNAMELC}.desktop + +# this is where the shell's XML-GUI resource file goes +shellrcdir = $(kde_datadir)/%{APPNAMELC} +shellrc_DATA = %{APPNAMELC}ui.rc + diff --git a/languages/cpp/app_templates/khello/subdirs b/languages/cpp/app_templates/khello/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/khello/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/khello2/.kdev_ignore b/languages/cpp/app_templates/khello2/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/khello2/Makefile.am b/languages/cpp/app_templates/khello2/Makefile.am new file mode 100644 index 00000000..8ac1b18d --- /dev/null +++ b/languages/cpp/app_templates/khello2/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \ + subdirs app.desktop khello2.png widget.cpp widget.h widgetbase.ui + +templateName = khello2 + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/khello2/app.cpp b/languages/cpp/app_templates/khello2/app.cpp new file mode 100644 index 00000000..948a98fc --- /dev/null +++ b/languages/cpp/app_templates/khello2/app.cpp @@ -0,0 +1,19 @@ +%{CPP_TEMPLATE} + +#include +#include + +#include "%{APPNAMELC}.h" +#include "%{APPNAMELC}widget.h" + +%{APPNAME}::%{APPNAME}() + : KMainWindow( 0, "%{APPNAME}" ) +{ + setCentralWidget( new %{APPNAME}Widget( this ) ); +} + +%{APPNAME}::~%{APPNAME}() +{ +} + +#include "%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/khello2/app.desktop b/languages/cpp/app_templates/khello2/app.desktop new file mode 100644 index 00000000..8b36e6e0 --- /dev/null +++ b/languages/cpp/app_templates/khello2/app.desktop @@ -0,0 +1,40 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} +Icon=%{APPNAMELC} +Type=Application +Comment=A simple KDE Application +Comment[br]=Ur meziant eeun evit KDE +Comment[ca]=Una simple aplicació per al KDE +Comment[da]=Et simpelt KDE program +Comment[de]=Eine einfache KDE-Anwendung +Comment[el]=Μια απλή εφαρμογή του KDE +Comment[es]=Una aplicación de KDE sencilla +Comment[et]=Lihtne KDE rakendus +Comment[eu]=KDE aplikazio simple bat +Comment[fa]=یک کاربرد سادۀ KDE +Comment[fr]=Une application simple pour KDE +Comment[ga]=Feidhmchlár Simplí KDE +Comment[gl]=Unha aplicación KDE sinxela +Comment[hi]=एक सादा केडीई अनुप्रयोग +Comment[hu]=Egyszerű KDE-alkalmazás +Comment[is]=Einfalt KDE forrit +Comment[it]=Una semplice applicazione KDE +Comment[ja]=簡単な KDE アプリケーション +Comment[nds]=En eenfach KDE-Programm +Comment[ne]=एउटा साधारण केडीई अनुप्रयोग +Comment[nl]=Een eenvoudige KDE-toepassing +Comment[pl]=Prosty program KDE +Comment[pt]=Uma aplicação simples do KDE +Comment[pt_BR]=Um simples Aplicativo do KDE +Comment[ru]=Простое приложение KDE +Comment[sk]=Jednoduchá KDE aplikácia +Comment[sl]=Preprost program za KDE +Comment[sr]=Једноставан KDE програм +Comment[sr@Latn]=Jednostavan KDE program +Comment[sv]=Ett enkelt KDE-program +Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு +Comment[tg]=Гузориши оддиKDE +Comment[tr]=Basit bir KDE Uygulaması +Comment[zh_CN]=一个简单的 KDE 应用程序 +Comment[zh_TW]=簡單的 KDE 應用程式 diff --git a/languages/cpp/app_templates/khello2/app.h b/languages/cpp/app_templates/khello2/app.h new file mode 100644 index 00000000..678df7a3 --- /dev/null +++ b/languages/cpp/app_templates/khello2/app.h @@ -0,0 +1,32 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +/** + * @short Application Main Window + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAME} : public KMainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); +}; + +#endif // _%{APPNAMEUC}_H_ diff --git a/languages/cpp/app_templates/khello2/app.kdevelop b/languages/cpp/app_templates/khello2/app.kdevelop new file mode 100644 index 00000000..43425791 --- /dev/null +++ b/languages/cpp/app_templates/khello2/app.kdevelop @@ -0,0 +1,115 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + + + + optimized + GccOptions + GppOptions + G77Options + -O2 -g0 + + + --enable-debug=full + debug + GccOptions + GppOptions + G77Options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/khello2/appui.rc b/languages/cpp/app_templates/khello2/appui.rc new file mode 100644 index 00000000..ceb4f14e --- /dev/null +++ b/languages/cpp/app_templates/khello2/appui.rc @@ -0,0 +1,8 @@ + + + + C&ustom + + + + diff --git a/languages/cpp/app_templates/khello2/khello2.kdevtemplate b/languages/cpp/app_templates/khello2/khello2.kdevtemplate new file mode 100644 index 00000000..479d7496 --- /dev/null +++ b/languages/cpp/app_templates/khello2/khello2.kdevtemplate @@ -0,0 +1,230 @@ +# KDE Config File +[General] +Name=Simple Designer based KDE Application +Name[ca]=Simple aplicació per al KDE basada en el dissenyador +Name[da]=Simpelt Designer-baseret KDE program +Name[de]=Einfache, auf Designer basierende KDE-Anwendung +Name[el]=Απλή εφαρμογή KDE βασισμένη στο σχεδιαστή +Name[es]=Aplicación para KDE sencilla basada en el diseñador +Name[et]=Lihtne KDE rakendus Disaineri põhjal +Name[eu]=Designer-en oinarritutako KDE aplikazio simple bat +Name[fa]=کاربرد KDE بر مبنای طراح ساده +Name[fr]=Application KDE simple basée sur Designer +Name[gl]=Aplicación KDE sinxela baseada no deseñador +Name[hu]=Egyszerű Qt Designer-alapú KDE-s alkalmazás +Name[it]=Una semplice applicazione KDE basata su designer +Name[ja]=Designer ベースの簡単な KDE アプリケーション +Name[nds]=Eenfach, op "Designer" opbuut KDE-Programm +Name[ne]=साधारण डिजाइनरमा आधारित केडीई अनुप्रयोग +Name[nl]=Eenvoudige Designer-gebaseerde KDE-toepassing +Name[pl]=Prosty program dla KDE wykonany w Designerze +Name[pt]=Aplicação Simples do KDE baseada no Qt Designer +Name[pt_BR]=Aplicação Simples do KDE baseada no Qt Designer +Name[ru]=Простое приложение KDE с формой +Name[sk]=Jednoduchý dizajnér založený na KDE aplikácii +Name[sr]=Једноставан KDE програм на основу Designer-а +Name[sr@Latn]=Jednostavan KDE program na osnovu Designer-a +Name[sv]=Enkelt KDE-program baserat på Designer +Name[tr]=Basit Designer tabanlı KDE Uygulaması +Name[zh_CN]=基于设计师的简单 KDE 应用程序 +Name[zh_TW]=簡單的設計器 KDE 應用程式 +Category=C++/KDE +Icon=khello2.png +Comment=Generates a simple KDE application with one Qt-designer based widget. +Comment[ca]=Genera una simple aplicació per al KDE basada en el dissenyador de Qt. +Comment[da]=Genererer et simpelt KDE program med en Qt-designer baseret kontrol. +Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem auf Qt-Designer basierenden Widget. +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό βασισμένο στο σχεδιαστή Qt. +Comment[es]=Genera una sencilla aplicación para KDE con una ventana basada en Qt-designer. +Comment[et]=Lihtsa KDE rakenduse loomine ühe vidinaga Qt Disaineri põhjal. +Comment[eu]=Qt Designer-en oinarritutako trepeta bat duen KDE aplikazio sinple bat sortzen du. +Comment[fa]=یک کاربرد سادۀ KDE با یک عنصر مبنای طراح Qt تولید می‌کند. +Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget) basé sur Qt-designer. +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le giuirléid amháin bunaithe ar Qt-Designer +Comment[gl]=Xera unha aplicación KDE sinxela cunha compoñente baseada en Qt-designer. +Comment[hu]=Létrehoz egy egyszerű KDE-s alkalmazást, mely egy Qt Designerrel készített grafikus elemre épül. +Comment[it]=Genera una semplice applicazione KDE con un elemento grafico basato su Qt-designer. +Comment[nds]=Stellt en eenfach KDE-Programm mit een op Qt-Designer opbuut Element op. +Comment[ne]=क्यू टी डिजाइनरमा आधारित विगेटसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ । +Comment[nl]=Genereert een eenvoudige KDE-toepassing met één Qt-Designer-gebaseerde widget. +Comment[pl]=Generuje prosty program dla KDE z jednym widgetem pochodzącym z Qt Designera. +Comment[pt]=Gera uma aplicação simples do KDE com uma interface baseada no Qt-designer. +Comment[pt_BR]=Gera uma aplicação simples do KDE com uma interface baseada no Qt-designer. +Comment[ru]=Создание простого приложения KDE с формой, созданной в Qt Designer. +Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom Qt dizajnéra. +Comment[sr]=Прави једноставан KDE програма са једном контролом на основу Qt-Designer-а. +Comment[sr@Latn]=Pravi jednostavan KDE programa sa jednom kontrolom na osnovu Qt-Designer-a. +Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent baserad på Qt-Designer. +Comment[tr]=Qt-designer tabanlı bir parçacığı olan basit bir KDE uygulaması yaratır. +Comment[zh_CN]=生成一个带一个基于 Qt 设计师部件的简单 KDE 应用程序。 +Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含 Qt 設計器的元件 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=khello2.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/po + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE9] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[MkDir4] +Type=mkdir +Dir=%{dest}/src + +[FILE10] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE11] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE12] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[FILE13] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE14] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE15] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE16] +Type=install +Source=%{src}/widget.cpp +Dest=%{dest}/src/%{APPNAMELC}widget.cpp + +[FILE17] +Type=install +Source=%{src}/widget.h +Dest=%{dest}/src/%{APPNAMELC}widget.h + +[FILE18] +Type=install +EscapeXML=true +Source=%{src}/widgetbase.ui +Dest=%{dest}/src/%{APPNAMELC}widgetbase.ui + +[FILE19] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE20] +Type=install +EscapeXML=true +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}ui.rc + +[FILE21] +Type=install +Source=%{src}/app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[MSG] +Type=message +Comment=A simple designer based KDE application was created in %{dest} +Comment[ca]=A simple aplicació per al KDE basada en el dissenyador ha estat creada en %{dest} +Comment[da]=Et simpelt designer-baseret KDE program blev oprettet i %{dest} +Comment[de]=Eine einfache, auf Designer basierende KDE-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια απλή εφαρμογή KDE βασισμένη στο σχεδιαστή δημιουργήθηκε στο %{dest} +Comment[es]=Una sencilla aplicación para KDE basada en el diseñador ha sido creada en %{dest} +Comment[et]=Lihtne KDE rakendus Disaineri põhjal loodi asukohta %{dest} +Comment[eu]=Designer-en oinarritutako KDE aplikazio simple bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد ساده‌ای بر مبنای طراح در %{dest} ایجاد شد +Comment[fr]=Une application KDE simple basée sur Designer a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár simplí KDE bunaithe ar Qt-Designer i %{dest} +Comment[gl]=Creouse unha aplicación KDE baseada no deseñador en %{dest} +Comment[hu]=Létrejött egy egyszerű, Qt Designer-alapú KDE-s alkalmazás itt: %{dest} +Comment[it]=È stata creata una semplice applicazione KDE basata su designer +Comment[ja]=Designer ベースの簡単な KDE アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach op "Designer" opbuut KDE-Programm opstellt +Comment[ne]=साधारण डिजाइनरमा आधारित केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een eenvoudige Designer-gebaseerde KDE-toepassing is aangemaakt in %{dest} +Comment[pl]=Prosty program wykorzystujący Qt Designera został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação simples do KDE em %{dest} +Comment[pt_BR]=Foi criada uma aplicação simples do KDE em %{dest} +Comment[ru]=Простое приложение KDE с формой создано в %{dest} +Comment[sk]=Jednoduchý dizajnér založený na KDE aplikácii bol vytvorený v %{dest} +Comment[sr]=Једноставан KDE програм на основу Designer-а направљен је у %{dest} +Comment[sr@Latn]=Jednostavan KDE program na osnovu Designer-a napravljen je u %{dest} +Comment[sv]=Ett enkelt KDE-program baserat på Designer skapades i %{dest} +Comment[tr]=Designer tabanlı basit bir KDE uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个基于设计师的简单 KDE 应用程序 +Comment[zh_TW]=一個簡單的設計器 KDE 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/khello2/khello2.png b/languages/cpp/app_templates/khello2/khello2.png new file mode 100644 index 00000000..97422793 Binary files /dev/null and b/languages/cpp/app_templates/khello2/khello2.png differ diff --git a/languages/cpp/app_templates/khello2/main.cpp b/languages/cpp/app_templates/khello2/main.cpp new file mode 100644 index 00000000..278eef46 --- /dev/null +++ b/languages/cpp/app_templates/khello2/main.cpp @@ -0,0 +1,51 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE KPart Application"); + +static const char version[] = "%{VERSION}"; + +static KCmdLineOptions options[] = +{ +// { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions( options ); + KApplication app; + %{APPNAME} *mainWin = 0; + + if (app.isRestored()) + { + RESTORE(%{APPNAME}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + + /// @todo do something with the command line args here + + mainWin = new %{APPNAME}(); + app.setMainWidget( mainWin ); + mainWin->show(); + + args->clear(); + } + + // mainWin has WDestructiveClose flag by default, so it will delete itself. + return app.exec(); +} + diff --git a/languages/cpp/app_templates/khello2/src-Makefile.am b/languages/cpp/app_templates/khello2/src-Makefile.am new file mode 100644 index 00000000..4664fe84 --- /dev/null +++ b/languages/cpp/app_templates/khello2/src-Makefile.am @@ -0,0 +1,35 @@ +# set the include path for X, qt and KDE +INCLUDES = $(all_includes) + +# these are the headers for your project +noinst_HEADERS = %{APPNAMELC}.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + +KDE_ICON = AUTO + +######################################################################### +# APPLICATION SECTION +######################################################################### +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = %{APPNAMELC} + +# the application source, library search path, and link libraries +%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp %{APPNAMELC}widget.cpp %{APPNAMELC}widgetbase.ui +%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries) +%{APPNAMELC}_LDADD = $(LIB_KDEUI) + +# this is where the desktop file will go +shelldesktopdir = $(kde_appsdir)/Utilities +shelldesktop_DATA = %{APPNAMELC}.desktop + +# this is where the shell's XML-GUI resource file goes +shellrcdir = $(kde_datadir)/%{APPNAMELC} +shellrc_DATA = %{APPNAMELC}ui.rc + diff --git a/languages/cpp/app_templates/khello2/subdirs b/languages/cpp/app_templates/khello2/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/khello2/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/khello2/widget.cpp b/languages/cpp/app_templates/khello2/widget.cpp new file mode 100644 index 00000000..6775ac39 --- /dev/null +++ b/languages/cpp/app_templates/khello2/widget.cpp @@ -0,0 +1,30 @@ +%{CPP_TEMPLATE} + +#include + +#include "%{APPNAMELC}widget.h" + +%{APPNAME}Widget::%{APPNAME}Widget(QWidget* parent, const char* name, WFlags fl) + : %{APPNAME}WidgetBase(parent,name,fl) +{} + +%{APPNAME}Widget::~%{APPNAME}Widget() +{} + +/*$SPECIALIZATION$*/ +void %{APPNAME}Widget::button_clicked() +{ + if ( label->text().isEmpty() ) + { + label->setText( "Hello World!" ); + } + else + { + label->clear(); + } +} + + + +#include "%{APPNAMELC}widget.moc" + diff --git a/languages/cpp/app_templates/khello2/widget.h b/languages/cpp/app_templates/khello2/widget.h new file mode 100644 index 00000000..275e13c7 --- /dev/null +++ b/languages/cpp/app_templates/khello2/widget.h @@ -0,0 +1,30 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}WIDGET_H_ +#define _%{APPNAMEUC}WIDGET_H_ + +#include "%{APPNAMELC}widgetbase.h" + +class %{APPNAME}Widget : public %{APPNAME}WidgetBase +{ + Q_OBJECT + +public: + %{APPNAME}Widget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~%{APPNAME}Widget(); + /*$PUBLIC_FUNCTIONS$*/ + +public slots: + /*$PUBLIC_SLOTS$*/ + virtual void button_clicked(); + +protected: + /*$PROTECTED_FUNCTIONS$*/ + +protected slots: + /*$PROTECTED_SLOTS$*/ + +}; + +#endif + diff --git a/languages/cpp/app_templates/khello2/widgetbase.ui b/languages/cpp/app_templates/khello2/widgetbase.ui new file mode 100644 index 00000000..e6f5be3d --- /dev/null +++ b/languages/cpp/app_templates/khello2/widgetbase.ui @@ -0,0 +1,52 @@ + +%{APPNAME}WidgetBase + + + %{APPNAMELC}widgetbase + + + + 0 + 0 + 220 + 133 + + + + + + + + unnamed + + + + button + + + Click Me! + + + + + label + + + + + + + + + + button + clicked() + %{APPNAMELC}widgetbase + button_clicked() + + + + button_clicked() + + + diff --git a/languages/cpp/app_templates/kicker/.kdev_ignore b/languages/cpp/app_templates/kicker/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kicker/Makefile.am b/languages/cpp/app_templates/kicker/Makefile.am new file mode 100644 index 00000000..168a93c9 --- /dev/null +++ b/languages/cpp/app_templates/kicker/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = applet.cpp applet.h applet.desktop applet.kdevelop \ + src-Makefile.am kicker.png subdirs +templateName = kicker + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kicker/applet.cpp b/languages/cpp/app_templates/kicker/applet.cpp new file mode 100644 index 00000000..5345ac0c --- /dev/null +++ b/languages/cpp/app_templates/kicker/applet.cpp @@ -0,0 +1,72 @@ +%{CPP_TEMPLATE} + +#include +#include +#include +#include +#include +#include + +#include "%{APPNAMELC}.h" + + +%{APPNAME}::%{APPNAME}(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) + : KPanelApplet(configFile, type, actions, parent, name) +{ + // Get the current application configuration handle + ksConfig = config(); + QLCDNumber *w = new QLCDNumber(this); + w->display(42); + + mainView = w; + mainView->show(); +} + + +%{APPNAME}::~%{APPNAME}() +{ +} + + +void %{APPNAME}::about() +{ + KMessageBox::information(0, i18n("This is an about box")); +} + + +void %{APPNAME}::help() +{ + KMessageBox::information(0, i18n("This is a help box")); +} + + +void %{APPNAME}::preferences() +{ + KMessageBox::information(0, i18n("This is a preferences box")); +} + +int %{APPNAME}::widthForHeight(int height) const +{ + return width(); +} + +int %{APPNAME}::heightForWidth(int width) const +{ + return height(); +} + +void %{APPNAME}::resizeEvent(QResizeEvent *e) +{ +} + + +extern "C" +{ + KPanelApplet* init( QWidget *parent, const QString& configFile) + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}(configFile, KPanelApplet::Normal, + KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences, + parent, "%{APPNAMELC}"); + } +} diff --git a/languages/cpp/app_templates/kicker/applet.desktop b/languages/cpp/app_templates/kicker/applet.desktop new file mode 100644 index 00000000..24e47c40 --- /dev/null +++ b/languages/cpp/app_templates/kicker/applet.desktop @@ -0,0 +1,40 @@ +[Desktop Entry] +Comment=A panel applet called $NAME$ +Comment[br]=Un arloadig panell a vez graet $NAME$ +Comment[ca]=Una miniaplicació del plafó anomenat $NAME$ +Comment[cy]=Rhaglennig panel o'r enw $NAME$ +Comment[da]=En panel-applet der hedder $NAME$ +Comment[de]=Ein Miniprogramm mit dem Namen $NAME$ +Comment[el]=Μία μικροεφαρμογή πίνακα με όνομα $NAME$ +Comment[es]=Un applet del panel llamado $NAME$ +Comment[et]=Paneeliaplett nimega $NAME$ +Comment[eu]=$NAME$ izeneko panel applet bat +Comment[fa]=برنامک تابلو، $NAME$ نامیده شد +Comment[fr]=Un applet pour le tableau de bord nommé $NAME$ +Comment[ga]=Feidhmchláirín painéil darbh ainm $NAME$ +Comment[gl]=Un applet para o panel chamado $NAME$ +Comment[hi]=एक फलक ऐपलेट जो कहलाता है- $NAME$ +Comment[hu]=$NAME$ nevű panel-kisalkalmazás +Comment[is]=Spjaldforritlingur nefndur $NAME$ +Comment[it]=Un applet per il pannello chiamata $NAME$ +Comment[ja]=$NAME$ と呼ばれるパネルアプレット +Comment[nds]=En Paneel-Lüttprogramm nöömt $NAME$ +Comment[ne]= $NAME$ भनिने प्यानल एप्लेट +Comment[nl]=Een paneel-applet met naam $NAME$ +Comment[pl]=Aplet panelu o nazwie $NAME$ +Comment[pt]=Um 'applet' para o painel chamado $NAME$ +Comment[pt_BR]=Uma applet de painel chamada $NAME$ +Comment[ru]=Аплет панели $NAME$ +Comment[sk]=Applet panel s menom $NAME$ +Comment[sl]=Pultni vstavek z imenom $NAME$ +Comment[sr]=Панелни аплет по имену $NAME$ +Comment[sr@Latn]=Panelni aplet po imenu $NAME$ +Comment[sv]=Ett panelminiprogram som kallas $NAME$ +Comment[ta]=ஒரு பானல் ஆப்லெட் $NAME$ என்ற்உ அழைக்கப்படுகிறது +Comment[tg]=Пайраҳаи апплети $NAME$ +Comment[tr]=$NAME$ adında bir panel küçük uygulaması +Comment[zh_CN]=一个称作 $NAME$ 的面板小程序 +Comment[zh_TW]=一個名稱為 $NAME$ 的面板小程式 +Name=%{APPNAMELC} +X-KDE-Library=%{APPNAMELC}_panelapplet +X-KDE-UniqueApplet = false diff --git a/languages/cpp/app_templates/kicker/applet.h b/languages/cpp/app_templates/kicker/applet.h new file mode 100644 index 00000000..b078b2a4 --- /dev/null +++ b/languages/cpp/app_templates/kicker/applet.h @@ -0,0 +1,107 @@ +%{H_TEMPLATE} + +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + + +class %{APPNAME} : public KPanelApplet +{ + Q_OBJECT + +public: + /** + * Construct a @ref KPanelApplet just like any other widget. + * + * @param configFile The configFile handed over in the factory function. + * @param Type The applet @ref type(). + * @param actions Standard RMB menu actions supported by the applet (see @ref action() ). + * @param parent The pointer to the parent widget handed over in the factory function. + * @param name A Qt object name for your applet. + **/ + %{APPNAME}(const QString& configFile, Type t = Normal, int actions = 0, + QWidget *parent = 0, const char *name = 0); + /** destructor */ + ~%{APPNAME}(); + + /** + * Retrieve a suggested width for a given height. + * + * Every applet should reimplement this function. + * + * Depending on the panel orientation the height (horizontal panel) or the + * width (vertical panel) of the applets is fixed. + * The exact values of the fixed size component depend on the panel size. + * + * On a horizontal panel the applet height is fixed, the panel will + * call @ref widthForHeight(int height) with @p height + * equal to 'the fixed applet height' + * when laying out the applets. + * + * The applet can now choose the other size component (width) + * based on the given height. + * + * The width you return is granted. + **/ + virtual int widthForHeight(int height) const; + /** + * @return A suggested height for a given width. + * + * Every applet should reimplement this function. + * + * Depending on the panel orientation the height (horizontal panel) or the + * width (vertical panel) of the applets is fixed. + * The exact values of the fixed size component depend on the panel size. + * + * On a vertical panel the applet width is fixed, the panel will + * call @ref heightForWidth(int width) with @p width + * equal to 'the fixed applet width' + * when laying out the applets. + * + * The applet can now choose the other size component (height) + * based on the given width. + * + * The height you return is granted. + **/ + virtual int heightForWidth(int width) const; + /** + * Is called when the user selects "About" from the applets RMB menu. + * Reimplement this function to launch a about dialog. + * + * Note that this is called only when your applet supports the About action. + * See @ref Action and @ref KPanelApplet(). + **/ + virtual void about(); + /** + * Is called when the user selects "Help" from the applets RMB menu. + * Reimplement this function to launch a manual or help page. + * + * Note that this is called only when your applet supports the Help action. + * See @ref Action and @ref KPanelApplet(). + **/ + virtual void help(); + /** + * Is called when the user selects "Preferences" from the applets RMB menu. + * Reimplement this function to launch a preferences dialog or kcontrol module. + * + * Note that this is called only when your applet supports the preferences action. + * See @ref Action and @ref KPanelApplet(). + **/ + virtual void preferences(); + +protected: + void resizeEvent(QResizeEvent *); + +private: + KConfig *ksConfig; + QWidget *mainView; +}; + +#endif diff --git a/languages/cpp/app_templates/kicker/applet.kdevelop b/languages/cpp/app_templates/kicker/applet.kdevelop new file mode 100644 index 00000000..8bb35326 --- /dev/null +++ b/languages/cpp/app_templates/kicker/applet.kdevelop @@ -0,0 +1,115 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + Kicker + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/lib%{APPNAMELC}.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kicker/kicker.kdevtemplate b/languages/cpp/app_templates/kicker/kicker.kdevtemplate new file mode 100644 index 00000000..f6f87256 --- /dev/null +++ b/languages/cpp/app_templates/kicker/kicker.kdevtemplate @@ -0,0 +1,194 @@ +# KDE Config File +[General] +Name=Kicker Applet +Name[br]=Arloadig Kicker +Name[ca]=Una miniaplicació per a Kicker +Name[da]=Kicker-applet +Name[de]=Kicker-Miniprogramm +Name[el]=Μικροεφαρμογή Kicker +Name[es]=Applet para Kicker +Name[et]=Kickeri aplett +Name[eu]=Kicker applet-a +Name[fa]=برنامک Kicker +Name[fr]=Applet Kicker +Name[ga]=Feidhmchláirín Kicker +Name[gl]=Applet para Kicker +Name[hu]=Panel-kisalkalmazás +Name[it]=Applet di kicker +Name[ja]=Kicker アプレット +Name[nds]=Kicker-Lüttprogramm +Name[ne]=किकर एप्लेट +Name[nl]=Kicker-applet +Name[pl]=Aplet panelu +Name[pt]='Applet' do Kicker +Name[pt_BR]='Applet' do Kicker +Name[ru]=Аплет панели KDE +Name[sk]=Kicker applet +Name[sl]=Vstavek za Kicker +Name[sr]=Аплет за Kicker +Name[sr@Latn]=Aplet za Kicker +Name[sv]=Miniprogram för Kicker +Name[tr]=Kicker Küçük Uygulaması +Name[zh_CN]=Kicker 小程序 +Name[zh_TW]=Kicker 小程式 +Icon=kicker.png +Category=C++/KDE +Comment=Generates a framework for an applet that embeds into the KDE panel +Comment[ca]=Genera una infraestructura per a una miniaplicació encastada en el plafó de KDE +Comment[da]=Genererer et skelet for en applet der indlejres i KDE's panel +Comment[de]=Erstellt das Grundgerüst für ein Miniprogramm, das in die KDE-Kontrollleiste eingebettet wird. +Comment[el]=Δημιουργεί ένα πλαίσιο για μία μικροεφαρμογή που ενσωματώνεται στον πίνακα του KDE +Comment[es]=Genera una infraestructura para un applet empotrado en el panel de KDE +Comment[et]=Apleti raamistiku loomine, mida saab põimida KDE paneelile +Comment[eu]=KDE-ren panelean kapsulatzen den applet baten lan-marko bat sortzen du +Comment[fa]=چارچوبی برای برنامک نهفته‌شده در تابلوی KDEتولید می‌کند +Comment[fr]=Génère une infrastructure pour un applet qui s'intègre dans le tableau de bord de KDE +Comment[gl]=Xera un contorno de traballo para un applet que se incrusta no panel de KDE. +Comment[hu]=Létrehoz egy keretprogramot KDE-s panel-kisalkalmazás készítéséhez +Comment[it]=Genera l'infrastruttura per un'applet che si integra nel pannello di KDE +Comment[nds]=Stellt dat Rahmenwark för en Lüttprogramm op, dat sik na dat KDE-Paneel inbett +Comment[ne]=केडीई प्यानलमा सम्मिलित एप्लेटका लागि फ्रेमवर्क उत्पन्न गर्दछ +Comment[nl]=Genereert een framework voor een applet die kan worden ingebed in het KDE-paneel +Comment[pl]=Generuje szablon apletu, który można wstawić do panelu KDE +Comment[pt]=Gera a plataforma para uma 'applet' que se incorpore no painel do KDE +Comment[pt_BR]=Gera a plataforma para uma 'applet' que se incorpore no painel do KDE +Comment[ru]=Создание аплета панели KDE +Comment[sk]=Vygeneruje framework pre applet, ktorý sa bude dať vložiť do KDE panelu +Comment[sr]=Прави радни оквир за аплет који се уграђује у KDE-ов панел +Comment[sr@Latn]=Pravi radni okvir za aplet koji se ugrađuje u KDE-ov panel +Comment[sv]=Skapar ett ramverk för ett miniprogram som inbäddas i KDE:s panel +Comment[tr]=KDE paneline gömülen bir küçük uygulama için bir çatı oluşturur. +Comment[zh_CN]=生成一个可嵌入 KDE 面板的小程序框架 +Comment[zh_TW]=產生一個嵌入 KDE 面板的小程式框架 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=kicker.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/applet.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/applet.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/applet.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE14] +Type=install +Source=%{src}/applet.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[MSG] +Type=message +Comment=A Kicker Applet was created in %{dest} +Comment[ca]=Una miniaplicació per a Kicker ha estat creat en %{dest} +Comment[da]=En Kicker applet blev oprettet i %{dest} +Comment[de]=Ein Miniprogramm für Kicker wurde in %{dest} erstellt. +Comment[el]=Μία μικροεφαρμογή Kicker δημιουργήθηκε στο %{dest} +Comment[es]=Un applet para Kicker ha sido creado en %{dest} +Comment[et]=Kickeri aplett loodi asukohta %{dest} +Comment[eu]=Kicker Applet bat sortu da hemen: %{dest} +Comment[fa]=یک برنامک Kicker در %{dest} ایجاد شد +Comment[fr]=Un applet Kicker a été créé dans %{dest} +Comment[ga]=Cruthaíodh feidhmchláirín Kicker i %{dest} +Comment[gl]=Creouse un applet para Kicker en %{dest} +Comment[hu]=Létrejött egy panel-kisalkalmazás itt: %{dest} +Comment[it]=È stata creata un'applet per kicker in %{dest} +Comment[ja]=Kicker アプレットを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Kicker-Lüttprogramm opstellt +Comment[ne]=किकर एप्लेट %{dest} मा सिर्जना गरियो +Comment[nl]=Een Kicker-applet is aangemaakt in %{dest} +Comment[pl]=Aplet panelu został utworzony w %{dest} +Comment[pt]=Foi criada uma 'applet' do Kicker em %{dest} +Comment[pt_BR]=Foi criada uma 'applet' do Kicker em %{dest} +Comment[ru]=Аплет панели KDE создан в %{dest} +Comment[sk]=Kicker applet bol vytvorený v %{dest} +Comment[sl]=Vstavek za Kicker je bil ustvarjen v %{dest} +Comment[sr]=Аплет за Kicker направљен је у %{dest} +Comment[sr@Latn]=Aplet za Kicker napravljen je u %{dest} +Comment[sv]=Ett miniprogram för Kicker skapades i %{dest} +Comment[tr]=Bir Kicker küçük uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 Kicker 小程序 +Comment[zh_TW]=一個 Kicker 小程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kicker/kicker.png b/languages/cpp/app_templates/kicker/kicker.png new file mode 100644 index 00000000..5e4f746f Binary files /dev/null and b/languages/cpp/app_templates/kicker/kicker.png differ diff --git a/languages/cpp/app_templates/kicker/src-Makefile.am b/languages/cpp/app_templates/kicker/src-Makefile.am new file mode 100644 index 00000000..424062d1 --- /dev/null +++ b/languages/cpp/app_templates/kicker/src-Makefile.am @@ -0,0 +1,15 @@ +INCLUDES= $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = %{APPNAMELC}_panelapplet.la + +%{APPNAMELC}_panelapplet_la_SOURCES = %{APPNAMELC}.cpp +%{APPNAMELC}_panelapplet_la_LDFLAGS = -module -avoid-version $(all_libraries) +%{APPNAMELC}_panelapplet_la_LIBADD = $(LIB_KDEUI) + +%{APPNAMELC}_DATA = %{APPNAMELC}.desktop +%{APPNAMELC}dir = $(kde_datadir)/kicker/applets + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/kicker/subdirs b/languages/cpp/app_templates/kicker/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kicker/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kioslave/.kdev_ignore b/languages/cpp/app_templates/kioslave/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kioslave/Makefile.am b/languages/cpp/app_templates/kioslave/Makefile.am new file mode 100644 index 00000000..5aa5b88e --- /dev/null +++ b/languages/cpp/app_templates/kioslave/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = slave.cpp slave.h slave.protocol slave.kdevelop \ + src-Makefile.am kioslave.png subdirs +templateName = kioslave + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kioslave/kioslave.kdevtemplate b/languages/cpp/app_templates/kioslave/kioslave.kdevtemplate new file mode 100644 index 00000000..0af80e7b --- /dev/null +++ b/languages/cpp/app_templates/kioslave/kioslave.kdevtemplate @@ -0,0 +1,183 @@ +# KDE Config File +[General] +Name=KIO slave +Name[br]=Sklav KIO +Name[ca]=Esclau KIO +Name[da]=KIO-slave +Name[de]=Ein-/Ausgabemodul +Name[el]=Υπηρέτης KIO +Name[es]=Esclavo KIO +Name[et]=KIO-moodul +Name[eu]=KIO morroia +Name[fr]=Esclave KIO +Name[ga]=Sclábhaí KIO +Name[gl]=Escravo KIO +Name[hu]=KDE-protokoll (KIOslave) +Name[it]=Slave KIO +Name[nds]=In-/Utgaavmoduul +Name[ne]=KIO स्लेभ +Name[nl]=KIO-slave +Name[pt]=KIO Slave +Name[sk]=KIO otrok +Name[sv]=I/O-slav +Icon=kioslave.png +Category=C++/KDE +Comment=Generates a framework for an IO slave +Comment[ca]=Genera una infraestructura per a un esclau IO +Comment[da]=Genererer et skelet for en IO-slave +Comment[de]=Erstellt das Grundgerüst für ein Ein-/Ausgabemodul. +Comment[el]=Δημιουργεί ένα πλαίσιο για έναν υπηρέτη IO +Comment[es]=Genera una infraestructura para un esclavo de E/S +Comment[et]=IO-mooduli raamistiku loomine +Comment[eu]=IO morroi baterako lan-marko bat sortzen du +Comment[fa]=چارچوبی برای یک IO slave تولید می‌کند +Comment[fr]=Génère une infrastructure pour un esclave d'entrée / sortie +Comment[ga]=Cruthaíonn sé seo creatlach le haghaidh sclábhaí IO +Comment[gl]=Xera un contorno de traballo para un escravo IO +Comment[hu]=Létrehoz egy kiindulási keretprogramot KIOslave készítéséhez +Comment[it]=Genera l'infrastruttura per uno slave di I/O +Comment[ja]=IO slave のフレームワークを作成します +Comment[nds]=Stellt dat Rahmenwark för en In-/Utgaavmoduul op +Comment[ne]=IO स्लेभका लागि फ्रेमवर्क उत्पन्न गर्दछ +Comment[nl]=Genereert een framework voor een IO-slave +Comment[pl]=Generuje szablon dla IO slave +Comment[pt]=Gera a plataforma para um 'IO slave' +Comment[pt_BR]=Gera a plataforma para um 'IO slave' +Comment[ru]=Создание канала IO slave для KDE +Comment[sk]=Vygeneruje framework pre IO otroka +Comment[sr]=Прави радни оквир за IO slave +Comment[sr@Latn]=Pravi radni okvir za IO slave +Comment[sv]=Skapar ett ramverk för en I/O-slav +Comment[zh_CN]=生成一个 IO slave 的框架 +Comment[zh_TW]=產生一個 IO slave 的框架 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=kioslave.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/slave.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/slave.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/slave.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE14] +Type=install +Source=%{src}/slave.protocol +Dest=%{dest}/src/%{APPNAMELC}.protocol + +[MSG] +Type=message +Comment=A KIO slave was created in %{dest} +Comment[ca]=Un esclau KIO ha estat creat en %{dest} +Comment[da]=En KIO-slave blev oprettet i %{dest} +Comment[de]=Ein Ein-/Ausgabemodul wurde in %{dest} erstellt. +Comment[el]=Ένας υπηρέτης KIO δημιουργήθηκε στο %{dest} +Comment[es]=Un esclavo KIO ha sido creado en %{dest} +Comment[et]=KIO-moodul loodi asukohta %{dest} +Comment[eu]=KIO morroi bat sortu da hemen: %{dest} +Comment[fa]=یک KIO slave در %{dest} ایجاد شد +Comment[fr]=Un esclave d'entrée / sortie a été créé dans %{dest} +Comment[ga]=Cruthaíodh sclábhaí KIO i %{dest} +Comment[gl]=Creouse un escravo KIO en %{dest} +Comment[hu]=Létrejött egy KIOslave itt: %{dest} +Comment[it]=È stato generato un slave KIO in %{dest} +Comment[ja]=KIO slave を %{dest} に作成しました。 +Comment[nds]=In %{dest} wöör en In-/Utgaavmoduul opstellt +Comment[ne]=KIO स्लेभ %{dest} मा सिर्जना गरियो +Comment[nl]=Een KIO-slave is aangemaakt in %{dest} +Comment[pl]=KIO slave został utworzony w %{dest} +Comment[pt]=Foi criado um 'KIO slave' em %{dest} +Comment[pt_BR]=Foi criado um 'KIO slave' em %{dest} +Comment[ru]=Канал KIO slave создан в %{dest} +Comment[sk]=KIO otrok bol vytvorený v %{dest} +Comment[sr]=KIO slave је направљен у %{dest} +Comment[sr@Latn]=KIO slave je napravljen u %{dest} +Comment[sv]=En I/O-slav skapades i %{dest} +Comment[tr]=Bir KIO slave'i %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 KIO slave +Comment[zh_TW]=一個 KIO slave 已建立於 %{dest} diff --git a/languages/cpp/app_templates/kioslave/kioslave.png b/languages/cpp/app_templates/kioslave/kioslave.png new file mode 100644 index 00000000..f0cd89a8 Binary files /dev/null and b/languages/cpp/app_templates/kioslave/kioslave.png differ diff --git a/languages/cpp/app_templates/kioslave/slave.cpp b/languages/cpp/app_templates/kioslave/slave.cpp new file mode 100644 index 00000000..df32aebf --- /dev/null +++ b/languages/cpp/app_templates/kioslave/slave.cpp @@ -0,0 +1,88 @@ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "%{APPNAMELC}.h" + +using namespace KIO; + + +kio_%{APPNAMELC}Protocol::kio_%{APPNAMELC}Protocol(const QCString &pool_socket, const QCString &app_socket) + : SlaveBase("kio_%{APPNAMELC}", pool_socket, app_socket) +{ + kdDebug() << "kio_%{APPNAMELC}Protocol::kio_%{APPNAMELC}Protocol()" << endl; +} + + +kio_%{APPNAMELC}Protocol::~kio_%{APPNAMELC}Protocol() +{ + kdDebug() << "kio_%{APPNAMELC}Protocol::~kio_%{APPNAMELC}Protocol()" << endl; +} + + +void kio_%{APPNAMELC}Protocol::get(const KURL& url ) +{ + kdDebug() << "kio_%{APPNAMELC}::get(const KURL& url)" << endl ; + + kdDebug() << "Seconds: " << url.query() << endl; + QString remoteServer = url.host(); + int remotePort = url.port(); + kdDebug() << "myURL: " << url.prettyURL() << endl; + + infoMessage(i18n("Looking for %1...").arg( remoteServer ) ); + // Send the mimeType as soon as it is known + mimeType("text/plain"); + // Send the data + QString theData = "This is a test of kio_%{APPNAMELC}"; + data(QCString(theData.local8Bit())); + data(QByteArray()); // empty array means we're done sending the data + finished(); +} + + +void kio_%{APPNAMELC}Protocol::mimetype(const KURL & /*url*/) +{ + mimeType("text/plain"); + finished(); +} + + +extern "C" +{ + int kdemain(int argc, char **argv) + { + KInstance instance( "kio_%{APPNAMELC}" ); + + kdDebug(7101) << "*** Starting kio_%{APPNAMELC} " << endl; + + if (argc != 4) { + kdDebug(7101) << "Usage: kio_%{APPNAMELC} protocol domain-socket1 domain-socket2" << endl; + exit(-1); + } + + kio_%{APPNAMELC}Protocol slave(argv[2], argv[3]); + slave.dispatchLoop(); + + kdDebug(7101) << "*** kio_%{APPNAMELC} Done" << endl; + return 0; + } +} diff --git a/languages/cpp/app_templates/kioslave/slave.h b/languages/cpp/app_templates/kioslave/slave.h new file mode 100644 index 00000000..649ead8c --- /dev/null +++ b/languages/cpp/app_templates/kioslave/slave.h @@ -0,0 +1,23 @@ + +#ifndef _%{APPNAMELC}_H_ +#define _%{APPNAMELC}_H_ + +#include +#include + +#include +#include +#include + +class QCString; + +class kio_%{APPNAMELC}Protocol : public KIO::SlaveBase +{ +public: + kio_%{APPNAMELC}Protocol(const QCString &pool_socket, const QCString &app_socket); + virtual ~kio_%{APPNAMELC}Protocol(); + virtual void mimetype(const KURL& url); + virtual void get(const KURL& url); +}; + +#endif diff --git a/languages/cpp/app_templates/kioslave/slave.kdevelop b/languages/cpp/app_templates/kioslave/slave.kdevelop new file mode 100644 index 00000000..a2ca970a --- /dev/null +++ b/languages/cpp/app_templates/kioslave/slave.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + kioslave + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/lib%{APPNAMELC}.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + + + + + libtool + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kioslave/slave.protocol b/languages/cpp/app_templates/kioslave/slave.protocol new file mode 100644 index 00000000..2e2cc076 --- /dev/null +++ b/languages/cpp/app_templates/kioslave/slave.protocol @@ -0,0 +1,39 @@ +[Protocol] +exec=kio_%{APPNAMELC} +protocol=%{APPNAMELC} +input=none +output=stream +reading=true +defaultMimetype=text/plain +Icon=remote +Description=A kioslave for %{APPNAMELC} +Description[br]=Ur c'hioslave evit %{APPNAMELC} +Description[ca]=Un kioslave per a %{APPNAMELC} +Description[da]=En kioslave til %{APPNAMELC} +Description[de]=Ein Ein-/Ausgabemodul für %{APPNAMELC} +Description[el]=Ένα υπηρέτης kio για %{APPNAMELC} +Description[es]=Un kioslave para %{APPNAMELC} +Description[et]=%{APPNAMELC} IO-moodul +Description[eu]=kioslave bat honentzat: %{APPNAMELC} +Description[fa]=یک kioslave برای %{APPNAMELC} +Description[fr]=Un esclave d'E/S (kioslave) pour %{APPNAMELC} +Description[ga]=kioslave le haghaidh %{APPNAMELC} +Description[gl]=Un kioslave para %{APPNAMELC} +Description[hu]=%{APPNAMELC}-támogató KIOslave +Description[it]=Un kioslave per %{APPNAMELC} +Description[ja]=%{APPNAMELC} のための kioslave +Description[nds]=En In-/Utgaavmoduul för %{APPNAMELC} +Description[ne]= %{APPNAMELC} का लागि किवस्लेभ +Description[nl]=Kioslave voor %{APPNAMELC} +Description[pl]=kioslave dla %{APPNAMELC} +Description[pt]=Um 'kioslave' para %{APPNAMELC} +Description[pt_BR]=Um kioslave para %{APPNAMELC} +Description[ru]=Канал kioslave для %{APPNAMELC} +Description[sk]=kioslave pre %{APPNAMELC} +Description[sl]=kioslave za %{APPNAMELC} +Description[sr]=KIOSlave за %{APPNAMELC} +Description[sr@Latn]=KIOSlave za %{APPNAMELC} +Description[sv]=En I/O-slav för %{APPNAMELC} +Description[tr]=%{APPNAMELC} için bir kioslave +Description[zh_CN]=%{APPNAMELC} 的 kioslave +Description[zh_TW]=%{APPNAMELC} 的 kioslave diff --git a/languages/cpp/app_templates/kioslave/src-Makefile.am b/languages/cpp/app_templates/kioslave/src-Makefile.am new file mode 100644 index 00000000..957ec330 --- /dev/null +++ b/languages/cpp/app_templates/kioslave/src-Makefile.am @@ -0,0 +1,14 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = kio_%{APPNAMELC}.la + +kio_%{APPNAMELC}_la_SOURCES = %{APPNAMELC}.cpp +kio_%{APPNAMELC}_la_LIBADD = -lkio +kio_%{APPNAMELC}_la_LDFLAGS = -module -avoid-version $(all_libraries) $(KDE_PLUGIN) + +protocol_DATA = %{APPNAMELC}.protocol +protocoldir = $(kde_servicesdir) + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kio_%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/kioslave/subdirs b/languages/cpp/app_templates/kioslave/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kioslave/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kmake/Makefile.am b/languages/cpp/app_templates/kmake/Makefile.am new file mode 100644 index 00000000..87d660e0 --- /dev/null +++ b/languages/cpp/app_templates/kmake/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = appui.rc app.desktop app.cpp mainviewimp.cpp mainviewimp.h mainview.ui app.kdevelop app.pro src.pro +templateName = kmake + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/kmake/app.cpp b/languages/cpp/app_templates/kmake/app.cpp new file mode 100644 index 00000000..8920b2f0 --- /dev/null +++ b/languages/cpp/app_templates/kmake/app.cpp @@ -0,0 +1,33 @@ + +#include +#include +#include +#include +#include "mainviewimp.h" + +static const char description[] = I18N_NOOP("A KDE Application"); + +static const char version[] = "%{VERSION}"; + +static KCmdLineOptions options[] = + { + { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption + }; + + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAME}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) 2004 %{AUTHOR}", 0, 0, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + KApplication app; + MainViewImp *widget = new MainViewImp; + app.setMainWidget(widget); + widget->show(); + return app.exec(); +} + diff --git a/languages/cpp/app_templates/kmake/app.desktop b/languages/cpp/app_templates/kmake/app.desktop new file mode 100644 index 00000000..7389904a --- /dev/null +++ b/languages/cpp/app_templates/kmake/app.desktop @@ -0,0 +1,44 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} %i -caption "%c" +Icon=%{APPNAMELC} +Type=Application +X-DocPath=%{APPNAMELC}/%{APPNAMELC}.html +Comment=A KDE KPart Application +Comment[br]=Ur meziant Kpart evit KDE +Comment[ca]=Una aplicació KPart per al KDE +Comment[cy]=Cymhwysiad KPart KDE +Comment[da]=Et KDE KPart-program +Comment[de]=Eine auf der Komponententechnik KPart basierende KDE-Anwendung +Comment[el]=Μια εφαρμογή KPart του KDE +Comment[es]=Una aplicación KPart de KDE +Comment[et]=KDE KPart rakendus +Comment[eu]=KDE KPart aplikazio bat +Comment[fa]=یک کاربرد KDE KPart +Comment[fr]=Une application KPart pour KDE +Comment[ga]=Feidhmchlár KPart KDE +Comment[gl]=Unha aplicación KPart de KDE +Comment[hi]=एक केडीई के-पार्ट अनुप्रयोग +Comment[hu]=KPart-alapú KDE-alkalmazás +Comment[is]=KDE KPart forrit +Comment[it]=Applicazione KPart di KDE +Comment[ja]=KDE KPart アプリケーション +Comment[lt]=KDE KPart programa +Comment[nds]=En KPart-Deelprogramm för KDE +Comment[ne]=एउटा केडीई KPart अनुप्रयोग +Comment[nl]=Een KDE KPart-toepassing +Comment[pl]=Osadzalny element KPart KDE +Comment[pt]=Uma Aplicação KPart do KDE +Comment[pt_BR]=Um Aplicativo KPart do KDE +Comment[ru]=Приложение KPart для KDE +Comment[sk]=KDE KPart aplikácia +Comment[sl]=Program KPart za KDE +Comment[sr]=KDE KPart програм +Comment[sr@Latn]=KDE KPart program +Comment[sv]=Ett KDE Kpart-program +Comment[ta]=கெடி கெபார்ட் பயன்பாடு +Comment[tg]=Ба кор андохтани KPart барои KDE +Comment[tr]=Bir KDE KPart Uygulaması +Comment[zh_CN]=一个 KDE KPart 应用程序 +Comment[zh_TW]=KDE KPart 應用程式 +Terminal=false diff --git a/languages/cpp/app_templates/kmake/app.kdevelop b/languages/cpp/app_templates/kmake/app.kdevelop new file mode 100644 index 00000000..aa290baa --- /dev/null +++ b/languages/cpp/app_templates/kmake/app.kdevelop @@ -0,0 +1,111 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + KDE Libraries (Doxygen) + + + + + + + + /usr/bin/ + true + false + false + + + false + true + + + + + + ./bin/%{APPNAMELC} + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kmake/app.pro b/languages/cpp/app_templates/kmake/app.pro new file mode 100644 index 00000000..7dc1cc78 --- /dev/null +++ b/languages/cpp/app_templates/kmake/app.pro @@ -0,0 +1,7 @@ +# File generated by kdevelop's qmake manager. +# ------------------------------------------- +# Subdir relative project main directory: . +# Target is a subdirs project + +SUBDIRS += src +TEMPLATE=subdirs diff --git a/languages/cpp/app_templates/kmake/appui.rc b/languages/cpp/app_templates/kmake/appui.rc new file mode 100644 index 00000000..25884e61 --- /dev/null +++ b/languages/cpp/app_templates/kmake/appui.rc @@ -0,0 +1,3 @@ + + + diff --git a/languages/cpp/app_templates/kmake/kmake.kdevtemplate b/languages/cpp/app_templates/kmake/kmake.kdevtemplate new file mode 100644 index 00000000..3797d8e9 --- /dev/null +++ b/languages/cpp/app_templates/kmake/kmake.kdevtemplate @@ -0,0 +1,148 @@ +# KDE Config File +[General] +Name=QMake based KDE template +Name[ca]=Plantilla per al KDE basada en QMake +Name[da]=QMake baseret KDE-skabelon +Name[de]=Auf QMake basierende KDE-Vorlage +Name[el]=Πρότυπο KDE βασισμένο στο QMake +Name[es]=Plantilla para KDE basada en QMake +Name[et]=KDE mall QMake'i põhjal +Name[eu]=QMake-en oinarritutatko KDE txantiloia +Name[fa]=قالب KDE بر مبنای QMake +Name[fr]=Modèle KDE basé sur QMake +Name[ga]=Teimpléad KDE bunaithe ar QMake +Name[gl]=Modelo de KDE baseado en QMake +Name[hu]=QMake-alapú KDE-s sablon +Name[it]=Modello KDE basato su QMake +Name[ja]=QMake ベースの KDE テンプレート +Name[nds]=Op QMake opbuut KDE-Vörlaag +Name[ne]=QMake मा आधारित केडीई टेम्प्लेट +Name[nl]=Qmake-gebaseerde KDE-jabloon +Name[pl]=Oparty na QMake szablon dla KDE +Name[pt]=Modelo do KDE baseado no QMake +Name[pt_BR]=Modelo do KDE baseado no QMake +Name[ru]=Приложение KDE как проект QMake +Name[sk]=Šablóna KDE založená na QMake +Name[sr]=KDE шаблон на основи QMake-а +Name[sr@Latn]=KDE šablon na osnovi QMake-a +Name[sv]=QMake-baserad KDE-mall +Name[tr]=QMake tabanlı KDE şablonu +Name[zh_CN]=基于 QMake 的 KDE 模板 +Name[zh_TW]=QMake 為基礎的 KDE 樣本 +Icon=kmake.png +Category=C++/QMake project +Comment=Generates a simple KDE application using QMake based project manager +Comment[ca]=Genera una simple aplicació per al KDE usant un gestor de projectes basat en QMake +Comment[da]=Genererer et simpelt KDE program ved brug af QMake baseret projekthåndtering +Comment[de]=Erstellt eine einfache KDE-Anwendung unter Verwendung der QMake-Projektverwaltung +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE χρησιμοποιώντας το διαχειριστή έργου βασισμένο στο QMake +Comment[es]=Genera una sencilla aplicación para KDE que usa un gestor de proyecto basado en QMake +Comment[et]=Lihtsa KDE rakenduse loomine projektihalduriga QMake'i põhjal +Comment[eu]=KDE aplikazio sinple bat sortzen du QMake-en oinarritutako proiektu-kudeatzailea erabiliz +Comment[fa]=یک کاربرد سادۀ KDE، با استفاده از مدیر پروژۀ بر مبنای QMake تولید می‌کند +Comment[fr]=Génère une application KDE simple utilisant un gestionnaire de projet basé sur QMake +Comment[gl]=Xera unha aplicación KDE sinxela usando un xestor de proxectos baseado en QMake +Comment[hu]=Létrehoz egy egyszerű KDE-s alkalmazást Qmake-alapú projektkezelővel +Comment[it]=Genera una semplice applicazione KDE che usa QMake basata sul gestore di progetto +Comment[ja]=QMake ベースのプロジェクトマネージャを使って 簡単な KDE アプリケーションを作成します +Comment[nds]=Stellt mit den op QMake opbuut Projektpleger en eenfach KDE-Programm op +Comment[ne]=QMake आधारित परियोजना प्रबन्धक प्रयोग गरेर एउटा साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudige KDE-toepassing met behulp van Qmake-gebaseerde projectmanager +Comment[pl]=Generuje prosty program KDE używający menedżera projektów QMake +Comment[pt]=Gera uma aplicação simples do KDE, usando o QMake como gestor de projectos +Comment[pt_BR]=Gera uma aplicação simples do KDE, usando o QMake como gestor de projectos +Comment[ru]=Создание простого приложения KDE как проекта QMake +Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu založenú na QMake projektovom manažéri +Comment[sr]=Прави једноставан KDE програм помоћу менаџера пројекта на основи QMake-а +Comment[sr@Latn]=Pravi jednostavan KDE program pomoću menadžera projekta na osnovi QMake-a +Comment[sv]=Skapar ett enkelt KDE-program baserat på QMake projekthantering +Comment[tr]=QMake tabanlı proje yöneticisini kullanarak basit bir KDE uygulaması yaratır. +Comment[zh_CN]=使用基于 QMake的工程管理器生成一个简单的 KDE 应用程序 +Comment[zh_TW]=產生一個使用 QMake 專案管理員的簡單 KDE 應用程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=kmake.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE3] +Type=install +Source=%{src}/src.pro +Dest=%{dest}/src/src.pro + +[FILE4] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/mainviewimp.cpp +Dest=%{dest}/src/mainviewimp.cpp + +[FILE7] +Type=install +Source=%{src}/mainviewimp.h +Dest=%{dest}/src/mainviewimp.h + +[FILE8] +Type=install +EscapeXML=true +Source=%{src}/mainview.ui +Dest=%{dest}/src/mainview.ui + +[FILE9] +Type=install +EscapeXML=true +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}.rc + +[FILE10] +Type=install +Source=%{src}/app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[MSG] +Type=message +Comment=A Qmake based KDE application was created in %{dest} +Comment[ca]=Una aplicació per al KDE basada en QMake ha estat creada en %{dest} +Comment[da]=Et Qmake baseret KDE program blev oprettet i %{dest} +Comment[de]=Eine auf Qmake basierende KDE-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή KDE βασισμένη στο Qmake δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación para KDE basada en QMake ha sido creada en %{dest} +Comment[et]=KDE rakendus QMake'i põhjal loodi asukohta %{dest} +Comment[eu]=Qmake-en oinarritutako KDE aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد KDE بر مبنای Qmake در %{dest} ایجاد شد +Comment[fr]=Une application KDE basée sur QMake a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár KDE bunaithe ar Qmake i %{dest} +Comment[gl]=Creouse unha aplicación KDE baseada en QMake en %{dest} +Comment[hu]=Létrejött egy Qmake-alapú KDE-s alkalmazás itt: %{dest} +Comment[it]=È stata creata una semplice applicazione KDE basata su Qmake in %{dest} +Comment[ja]=QMake ベースの KDE アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op QMake opbuut KDE-Programm opstellt +Comment[ne]=Qmake आधारित केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een Qmake-gebaseerde KDE-toepassing is aangemaakt in %{dest} +Comment[pl]=Program KDE oparty na QMake został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KDE baseada no Qmake em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KDE baseada no Qmake em %{dest} +Comment[ru]=Приложение KDE как проект QMake создано в %{dest} +Comment[sk]=KDE aplikácia založená na QMake bola vytvorená v %{dest} +Comment[sr]=KDE програм на основу QMake-а направљен је у %{dest} +Comment[sr@Latn]=KDE program na osnovu QMake-a napravljen je u %{dest} +Comment[sv]=Ett Qmake-baserat KDE-program skapades i %{dest} +Comment[tr]=Bir QMake tabanlı KDE uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了基于 QMake 的 KDE 应用程序 +Comment[zh_TW]=一個以 Qmake 為基礎的 KDE 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kmake/kmake.png b/languages/cpp/app_templates/kmake/kmake.png new file mode 100644 index 00000000..913ebb87 Binary files /dev/null and b/languages/cpp/app_templates/kmake/kmake.png differ diff --git a/languages/cpp/app_templates/kmake/mainview.ui b/languages/cpp/app_templates/kmake/mainview.ui new file mode 100644 index 00000000..fea02def --- /dev/null +++ b/languages/cpp/app_templates/kmake/mainview.ui @@ -0,0 +1,76 @@ + +MainView + + + Form1 + + + + 0 + 0 + 124 + 90 + + + + + unnamed + + + + groupBox1 + + + + 5 + 5 + 0 + 1 + + + + Output + + + + unnamed + + + + helloLabel + + + + + + true + + + AlignCenter + + + + + + + helloButton + + + Hello + + + + + + + helloButton + clicked() + Form1 + slotHelloButtonClicked() + + + + slotHelloButtonClicked() + + + diff --git a/languages/cpp/app_templates/kmake/mainviewimp.cpp b/languages/cpp/app_templates/kmake/mainviewimp.cpp new file mode 100644 index 00000000..68cb262a --- /dev/null +++ b/languages/cpp/app_templates/kmake/mainviewimp.cpp @@ -0,0 +1,23 @@ + +#include "mainviewimp.h" +#include +#include + +MainViewImp::MainViewImp(QWidget* parent, const char* name, WFlags fl) +: MainView(parent,name,fl) +{ +} + +MainViewImp::~MainViewImp() +{ +} + +void MainViewImp::slotHelloButtonClicked() +{ + helloLabel->setText(i18n("Hello there.")); +} + + + + + diff --git a/languages/cpp/app_templates/kmake/mainviewimp.h b/languages/cpp/app_templates/kmake/mainviewimp.h new file mode 100644 index 00000000..51af1957 --- /dev/null +++ b/languages/cpp/app_templates/kmake/mainviewimp.h @@ -0,0 +1,19 @@ +#ifndef MAINVIEWIMP_H +#define MAINVIEWIMP_H + +#include "mainview.h" + +class MainViewImp : public MainView +{ + Q_OBJECT + +public: + MainViewImp(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~MainViewImp(); + +public slots: + virtual void slotHelloButtonClicked(); +}; + +#endif + diff --git a/languages/cpp/app_templates/kmake/src.pro b/languages/cpp/app_templates/kmake/src.pro new file mode 100644 index 00000000..a27a6b13 --- /dev/null +++ b/languages/cpp/app_templates/kmake/src.pro @@ -0,0 +1,29 @@ +# File generated by kdevelop's qmake manager. +# ------------------------------------------- +# Subdir relative project main directory: ./src +# Target is an application: ../bin/%{APPNAMELC} +KDELIB=$$system(kde-config --expandvars --install lib) +KDEBIN=$$system(kde-config --expandvars --install exe) +KDEAPPS=$$system(kde-config --expandvars --install apps) +KDEPREFIX=$$system(kde-config --prefix) +KDEINCLUDE=$$KDEPREFIX/include/kde $$KDEPREFIX/include + +TEMPLATE = app + +INSTALLS += %{APPNAMELC}_rc \ + %{APPNAMELC}_desktop \ + target +target.path = $$KDEBIN +%{APPNAMELC}_desktop.files += *.desktop +%{APPNAMELC}_desktop.path = $$KDEAPPS/Utils +%{APPNAMELC}_rc.files += *.rc +%{APPNAMELC}_rc.path = $$KDEAPPDATA/%{APPNAMELC} +FORMS += mainview.ui +HEADERS += mainviewimp.h +SOURCES += %{APPNAMELC}.cpp mainviewimp.cpp +LIBS += -lkdeui -lkdecore +INCLUDEPATH = $$KDEINCLUDE +QMAKE_LIBDIR = $$KDELIB +TARGET = %{APPNAMELC} +DESTDIR = ../bin +CONFIG += release warn_on diff --git a/languages/cpp/app_templates/kmod/.kdev_ignore b/languages/cpp/app_templates/kmod/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kmod/Makefile.am b/languages/cpp/app_templates/kmod/Makefile.am new file mode 100644 index 00000000..76afcd5a --- /dev/null +++ b/languages/cpp/app_templates/kmod/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = src-Makefile kmod.kdevelop kmod-driver.c + +templateName = kmod + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kmod/kmod-driver.c b/languages/cpp/app_templates/kmod/kmod-driver.c new file mode 100644 index 00000000..5ddc7ce6 --- /dev/null +++ b/languages/cpp/app_templates/kmod/kmod-driver.c @@ -0,0 +1,22 @@ + +#include +#include +#include + +MODULE_DESCRIPTION("My kernel module"); +MODULE_AUTHOR("%{AUTHOR} (%{EMAIL})"); +MODULE_LICENSE("$LICENSE$"); + +static int %{APPNAMELC}_init_module(void) +{ + printk( KERN_DEBUG "Module %{APPNAME} init\n" ); + return 0; +} + +static void %{APPNAMELC}_exit_module(void) +{ + printk( KERN_DEBUG "Module %{APPNAME} exit\n" ); +} + +module_init(%{APPNAMELC}_init_module); +module_exit(%{APPNAMELC}_exit_module); diff --git a/languages/cpp/app_templates/kmod/kmod.kdevelop b/languages/cpp/app_templates/kmod/kmod.kdevelop new file mode 100644 index 00000000..93c6c0f4 --- /dev/null +++ b/languages/cpp/app_templates/kmod/kmod.kdevelop @@ -0,0 +1,93 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevCustomProject + C + + KDevDebugger + + + C + Linux + Kernel + + + + + + + + + + + + make + + + + true + 1 + false + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + libstdc++ + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kmod/kmod.kdevtemplate b/languages/cpp/app_templates/kmod/kmod.kdevtemplate new file mode 100644 index 00000000..03a335cd --- /dev/null +++ b/languages/cpp/app_templates/kmod/kmod.kdevtemplate @@ -0,0 +1,89 @@ +# KDE Config File +[General] +Name=Linux Kernel module +Name[br]=Mollad ar galon Linux +Name[ca]=Mòdul del nucli Linux +Name[da]=Linux kernemodul +Name[de]=Linux-Kernelmodul +Name[el]=Άρθρωμα πυρήνα Linux +Name[es]=Módulo para el núcleo de Linux +Name[et]=Linuxi kerneli moodul +Name[eu]=Linux Kernel modulua +Name[fa]=پیمانۀ هستۀ لینوکس +Name[fr]=Module de noyau Linux +Name[ga]=Modúl Eithne Linux +Name[gl]=Módulo para o kernel Linux +Name[hu]=Linuxos kernelmodul +Name[it]=Modulo del kernel Linux +Name[ja]=Linux カーネルモジュール +Name[nds]=Linux-Kernelmoduul +Name[ne]=लिनक्स कर्नेल मोड्युल +Name[nl]=Linux kernelmodule +Name[pl]=Moduł jądra Linuksa +Name[pt]=Módulo do 'kernel' do Linux +Name[pt_BR]=Módulo do 'kernel' do Linux +Name[ru]=Драйвер ядра Linux +Name[sk]=Linux kernel modul +Name[sr]=Модул језгра Linux-а +Name[sr@Latn]=Modul jezgra Linux-a +Name[sv]=Modul för Linux kärna +Name[tr]=Linux Çekirdek Birimi +Name[zh_CN]=Linux 内核模块 +Name[zh_TW]=Linux 核心模組 +Icon= +Category=C +Comment=Generates a template for a Linux kernel module. +Comment[ca]=Genera una plantilla per a un mòdul del nucli Linux. +Comment[da]=Genererer en skabelon for en Linux kernemodul. +Comment[de]=Erstellt eine Vorlage für ein Linux-Kernelmodul. +Comment[el]=Δημιουργεί ένα πρότυπο για ένα άρθρωμα του πυρήνα του Linux. +Comment[es]=Genera una plantilla para un módulo del núcleo de Linux. +Comment[et]=Linuxi kerneli mooduli malli loomine. +Comment[eu]=Linux kernel modulu batentzat txantiloi bat sortzen du. +Comment[fa]=قالبی برای پیمانۀ هستۀ لینوکس تولید می‌کند +Comment[fr]=Génère un modèle pour un module de noyau Linux. +Comment[gl]=Xera unha modelo dun módulo para o kernel Linux. +Comment[hu]=Létrehoz egy sablont linuxos kernelmodul készítéséhez. +Comment[it]=Genera un modello per un modulo del kernel Linux kernel. +Comment[ja]=Linux カーネルモジュール用のテンプレートを作成します +Comment[nds]=Stellt en Vörlaag för en Linux-Kernelmoduul op. +Comment[ne]=लिनक्स कर्नेल मोड्युलका लागि टेम्प्लेट उत्पन्न गर्दछ +Comment[nl]=Genereert een sjabloon voor een Linux kernelmodule +Comment[pl]=Generuje szablon dla modułu jądra Linuksa. +Comment[pt]=Gera um modelo para um módulo do 'kernel' do Linux. +Comment[pt_BR]=Gera um modelo para um módulo do 'kernel' do Linux. +Comment[ru]=Создание драйвера ядра Linux. +Comment[sk]=Vygeneruje šablónu pre Linux kernel modul +Comment[sr]=Прави шаблон за модул језгра Linux-а. +Comment[sr@Latn]=Pravi šablon za modul jezgra Linux-a. +Comment[sv]=Skapar en mall för en modul i Linux kärna. +Comment[tr]=Bir Linux çekirdek birimi için bir şablon yaratır. +Comment[zh_CN]=生成一个 Linux 内核模块的模板。 +Comment[zh_TW]=產生一個 Linux 核心模組的樣本 +FileTemplates=h,CStyle,c,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}-driver.c +Archive=kmod.tar.gz + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/kmod.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/src-Makefile +Dest=%{dest}/Makefile + +[FILE3] +Type=install +Source=%{src}/kmod-driver.c +Dest=%{dest}/%{APPNAMELC}-driver.c + +[MSG] +Type=message +Command=A linux kernel module was created in %{dest} diff --git a/languages/cpp/app_templates/kmod/kmod.png b/languages/cpp/app_templates/kmod/kmod.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/kmod/kmod.png differ diff --git a/languages/cpp/app_templates/kmod/src-Makefile b/languages/cpp/app_templates/kmod/src-Makefile new file mode 100644 index 00000000..92a2b461 --- /dev/null +++ b/languages/cpp/app_templates/kmod/src-Makefile @@ -0,0 +1,30 @@ +TARGET = %{APPNAMELC}-driver +OBJS = %{APPNAMELC}-driver.o +MDIR = drivers/misc + +EXTRA_CFLAGS = -DEXPORT_SYMTAB +CURRENT = $(shell uname -r) +KDIR = /lib/modules/$(CURRENT)/build +PWD = $(shell pwd) +DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR) + +obj-m := $(TARGET).o + +default: + make -C $(KDIR) SUBDIRS=$(PWD) modules + +$(TARGET).o: $(OBJS) + $(LD) $(LD_RFLAG) -r -o $@ $(OBJS) + +ifneq (,$(findstring 2.4.,$(CURRENT))) +install: + su -c "cp -v $(TARGET).o $(DEST) && /sbin/depmod -a" +else +install: + su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a" +endif + +clean: + -rm -f *.o *.ko .*.cmd .*.flags *.mod.c + +-include $(KDIR)/Rules.make diff --git a/languages/cpp/app_templates/kofficepart/.kdev_ignore b/languages/cpp/app_templates/kofficepart/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kofficepart/Makefile.am b/languages/cpp/app_templates/kofficepart/Makefile.am new file mode 100644 index 00000000..96280d88 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/Makefile.am @@ -0,0 +1,21 @@ +dataFiles = kopart.kdevelop kopart_aboutdata.h kopart_part.cpp kopart_view.h \ + src-Makefile.am kopart.png kopart_factory.cpp kopart_part.h \ + subdirs kopart.desktop kopart.rc kopart_factory.h \ + kopart_view.cpp x-kopart.desktop kde-configure.in.in \ + main.cpp + +templateName = kopart + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kofficepart/kde-configure.in.in b/languages/cpp/app_templates/kofficepart/kde-configure.in.in new file mode 100644 index 00000000..ec8e8bea --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kde-configure.in.in @@ -0,0 +1,42 @@ +#MIN_CONFIG + +AM_INIT_AUTOMAKE(kotest, 0.1) + +AC_CHECK_HEADERS(unistd.h sys/param.h floatingpoint.h paths.h) +KDE_CHECK_KIMGIO +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + +dnl AC_DEFINE(USE_QFD, 1, [Define if you prefer the Qt provided file dialog]) +KWMF_INCLUDES='-I$(KDEDIR)/lib/kwmf -I$(KDEDIR)/lib/kwmf' +AC_SUBST(KWMF_INCLUDES) + +KSTORE_INCLUDES='-I$(KDEDIR)/include' +AC_SUBST(KSTORE_INCLUDES) + +KOFFICECORE_INCLUDES='-I$(KDEDIR)/include' +AC_SUBST(KOFFICECORE_INCLUDES) + +KOFFICEUI_INCLUDES='-I$(KDEDIR)/include' +AC_SUBST(KOFFICEUI_INCLUDES) + +LIB_KOFFICEUI='$(KDEDIR)/lib/libkofficeui.la' +LIB_KOFFICECORE='$(KDEDIR)/lib/libkofficecore.la' +LIB_KSTORE='$(KDEDIR)/lib/libkstore.la' +LIB_KWMF='$(KDEDIR)/lib/libkwmf.la' +AC_SUBST(LIB_KOFFICEUI) +AC_SUBST(LIB_KOFFICECORE) +AC_SUBST(LIB_KSTORE) +AC_SUBST(LIB_KWMF) + +KOFFICE_LIBS='$(LIB_KOFFICEUI) $(LIB_KOFFICECORE) $(LIB_KSTORE)' +AC_SUBST(KOFFICE_LIBS) + +KOFFICE_INCLUDES='$(KOFFICEUI_INCLUDES) $(KOFFICECORE_INCLUDES) $(KSTORE_INCLUDES) $(KWMF_INCLUDES)' +AC_SUBST(KOFFICE_INCLUDES) + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CHECK_HEADERS(streambuf streambuf.h) +AC_LANG_RESTORE + diff --git a/languages/cpp/app_templates/kofficepart/kopart.desktop b/languages/cpp/app_templates/kofficepart/kopart.desktop new file mode 100644 index 00000000..8b2be99e --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} +X-KDE-Library=lib%{APPNAMELC}part +MimeType=application/x-%{APPNAMELC}; +Type=Application +Icon=%{APPNAMELC} +ServiceTypes=KOfficePart,KParts/ReadOnlyPart,KParts/ReadWritePart +X-KDE-NativeMimeType=application/x-%{APPNAMELC} diff --git a/languages/cpp/app_templates/kofficepart/kopart.kdevelop b/languages/cpp/app_templates/kofficepart/kopart.kdevelop new file mode 100644 index 00000000..bf70fc63 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + kioslave + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/lib%{APPNAMELC}part.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kofficepart/kopart.kdevtemplate b/languages/cpp/app_templates/kofficepart/kopart.kdevtemplate new file mode 100644 index 00000000..9d5ecba4 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart.kdevtemplate @@ -0,0 +1,231 @@ +# KDE Config File +[General] +Name=KOffice Part +Name[br]=Perzh KOffice +Name[ca]=Part per a KOffice +Name[da]=KOffice part +Name[de]=KOffice-Komponente +Name[el]=Τμήμα KOffice +Name[es]=Part de KOffice +Name[et]=KOffice'i komponent +Name[eu]=KOffice zatia +Name[fa]=جزء KOffice +Name[fr]=Composant KOffice +Name[ga]=Páirt KOffice +Name[gl]='Part' para KOffice +Name[hu]=KOffice-objektum +Name[it]=Part di KOffice +Name[nds]=KOffice-Komponent +Name[ne]=केडीई अफिस भाग +Name[nl]=Koffice-part +Name[pt]=Componente do KOffice +Name[pt_BR]=Componente do KOffice +Name[ru]=Приложение KOffice +Name[sr]=KOffice део +Name[sr@Latn]=KOffice deo +Name[sv]=Koffice-delprogram +Name[tr]=KOffice Bileşeni +Name[zh_CN]=KOffice 部件 +Name[zh_TW]=KOffice 元件 +Icon=kopart.png +Category=C++/KDE +Comment=Generates a framework for a full KOffice Application. +Comment[ca]=Genera una infraestructura per a una completa aplicació de KOffice. +Comment[da]=Genererer et skelet for et fuldstændigt KOffice-program. +Comment[de]=Erstellt ein Grundgerüst für eine vollwertige KOffice-Anwendung +Comment[el]=Δημιουργεί ένα πλαίσιο για μια πλήρης εφαρμογή του KOffice. +Comment[es]=Genera una infraestructura para una aplicación completa de KOffice. +Comment[et]=KOffice'i rakenduse raamistiku loomine. +Comment[eu]=KOffice-en aplikazio batentzat lan-marko oso bat sortzen du. +Comment[fa]=چارچوبی را برای کاربرد کامل KOffice تولید می‌کند. +Comment[fr]=Génère une infrastructure pour une application KOffice complète. +Comment[gl]=Xera un contorno de traballo para unha aplicación KOffice completa. +Comment[hu]=Létrehoz egy kiindulási keretprogramot teljes KOffice-alkalmazás készítéséhez. +Comment[it]=Genera l'infrastruttura per un'applicazione completa di KOffice. +Comment[nds]=Stellt dat Rahmenwark för en heel KOffice-Programm op. +Comment[ne]=पूर्ण केडीई अफिस अनुप्रयोगका लागि फ्रेमवर्क उत्पन्न गर्दछ +Comment[nl]=Genereert een framework voor een volledige KOffice-toepassing +Comment[pl]=Generuje szablon pełnego programu KOffice. +Comment[pt]=Gera a plataforma para uma aplicação completa do KOffice. +Comment[pt_BR]=Gera a plataforma para uma aplicação completa do KOffice. +Comment[ru]=Создание приложения KOffice. +Comment[sk]=Vygeneruje framework pre kompletnú aplikáciu KOffice. +Comment[sl]=Ustvari ogrodje za poln program KOffice +Comment[sr]=Прави радни оквир за пуни KOffice програм. +Comment[sr@Latn]=Pravi radni okvir za puni KOffice program. +Comment[sv]=Skapar ett ramverk för ett fullständigt Koffice-program. +Comment[tr]=Tam bir KOffice Uygulaması için bir çatı yaratır. +Comment[zh_CN]=生成一个全功能的 KOffice 应用程序框架。 +Comment[zh_TW]=產生一個完整的 KOffice 應用程式的框架 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}_part.cpp +Archive=kopart.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/kopart.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE9] +Type=install +Source=%{src}/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/kopart_view.cpp +Dest=%{dest}/src/%{APPNAMELC}_view.cpp + +[FILE13] +Type=install +Source=%{src}/kopart_view.h +Dest=%{dest}/src/%{APPNAMELC}_view.h + +[FILE14] +Type=install +Source=%{src}/kopart_part.cpp +Dest=%{dest}/src/%{APPNAMELC}_part.cpp + +[FILE15] +Type=install +Source=%{src}/kopart_part.h +Dest=%{dest}/src/%{APPNAMELC}_part.h + +[FILE16] +Type=install +Source=%{src}/kopart_factory.cpp +Dest=%{dest}/src/%{APPNAMELC}_factory.cpp + +[FILE17] +Type=install +Source=%{src}/kopart_factory.h +Dest=%{dest}/src/%{APPNAMELC}_factory.h + +[FILE18] +Type=install +Source=%{src}/kopart_aboutdata.h +Dest=%{dest}/src/%{APPNAMELC}_aboutdata.h + +[FILE19] +Type=install +EscapeXML=true +Source=%{src}/kopart.rc +Dest=%{dest}/src/%{APPNAMELC}.rc + +[FILE20] +Type=install +Source=%{src}/kopart.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE21] +Type=install +Source=%{src}/x-kopart.desktop +Dest=%{dest}/src/x-%{APPNAMELC}.desktop + +[FILE22] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[MSG] +Type=message +Comment=A KOffice part was created in %{dest} +Comment[ca]=Una part per a KOffice ha estat creada en %{dest} +Comment[da]=En KOffice part blev oprettet i %{dest} +Comment[de]=Eine KOffice-Komponente wurde in %{dest} erstellt. +Comment[el]=Ένα τμήμα του KOffice δημιουργήθηκε στο %{dest} +Comment[es]=Un Part de KOffice ha sido creado en %{dest} +Comment[et]=KOffice'i komponent loodi asukohta %{dest} +Comment[eu]=KOffice zati bat sortu da hemen: %{dest} +Comment[fa]=یک جزء KOffice در %{dest} ایجاد شد +Comment[fr]=Un composant KOffice a été créé dans %{dest} +Comment[ga]=Cruthaíodh páirt KDE i %{dest} +Comment[gl]=Creouse unha 'part' para KOffice en %{dest} +Comment[hu]=Létrejött egy KOffice-objektum itt: %{dest} +Comment[it]=È stata creata una part di KOffice in %{dest} +Comment[ja]=KOffice パートを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KOffice-Komponent opstellt +Comment[ne]=केडीई अफिस भाग %{dest} मा सिर्जना गरियो +Comment[nl]=Een KOffice-part is aangemaakt in %{dest} +Comment[pl]=KOffice part została utworzona w %{dest} +Comment[pt]=Foi criado um componente do KOffice em %{dest} +Comment[pt_BR]=Foi criado um componente do KOffice em %{dest} +Comment[ru]=Приложение KOffice создано в %{dest} +Comment[sk]=KOffice Part bol vytvorený v %{dest} +Comment[sr]=KOffice део је направљен у %{dest} +Comment[sr@Latn]=KOffice deo je napravljen u %{dest} +Comment[sv]=Ett Koffice-delprogram skapades i %{dest} +Comment[tr]=Bir KOffice bileşeni %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 KOffice 部件 +Comment[zh_TW]=一個 KOffice 元件已建立於 %{dest} diff --git a/languages/cpp/app_templates/kofficepart/kopart.png b/languages/cpp/app_templates/kofficepart/kopart.png new file mode 100644 index 00000000..fa45e5c3 Binary files /dev/null and b/languages/cpp/app_templates/kofficepart/kopart.png differ diff --git a/languages/cpp/app_templates/kofficepart/kopart.rc b/languages/cpp/app_templates/kofficepart/kopart.rc new file mode 100644 index 00000000..d03230ec --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart.rc @@ -0,0 +1,10 @@ + + + Edit + + + +Edit + + + diff --git a/languages/cpp/app_templates/kofficepart/kopart_aboutdata.h b/languages/cpp/app_templates/kofficepart/kopart_aboutdata.h new file mode 100644 index 00000000..ab66d088 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart_aboutdata.h @@ -0,0 +1,24 @@ + +/* This template is based off of the KOffice example written by Torben Weis +*/ + +#ifndef %{APPNAME}_ABOUTDATA +#define %{APPNAME}_ABOUTDATA + +#include +#include + +static const char description[] = I18N_NOOP("%{APPNAME} KOffice Program"); +static const char version[] = "%{VERSION}"; + +KAboutData * new%{APPNAME}AboutData() +{ + KAboutData * aboutData=new KAboutData( "%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), + version, description, KAboutData::License_%{LICENSE}, + "(c) %{YEAR}, %{AUTHOR}"); + aboutData->addAuthor("%{AUTHOR}",0, "%{EMAIL}"); + return aboutData; +} + +#endif diff --git a/languages/cpp/app_templates/kofficepart/kopart_factory.cpp b/languages/cpp/app_templates/kofficepart/kopart_factory.cpp new file mode 100644 index 00000000..bd79c317 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart_factory.cpp @@ -0,0 +1,76 @@ + +/* This template is based off of the KOffice example written by Torben Weis +*/ +#include <%{APPNAMELC}_factory.h> +#include <%{APPNAMELC}_part.h> +#include <%{APPNAMELC}_aboutdata.h> +#include +#include +#include +#include +#include + +extern "C" +{ + void* init_lib%{APPNAMELC}part() + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}Factory; + } +}; + +KInstance* %{APPNAME}Factory::s_global = 0L; +KAboutData* %{APPNAME}Factory::s_aboutData = 0L; + +%{APPNAME}Factory::%{APPNAME}Factory( QObject* parent, const char* name ) + : KoFactory( parent, name ) +{ + global(); +} + +%{APPNAME}Factory::~%{APPNAME}Factory() +{ + delete s_aboutData; + s_aboutData = 0L; + delete s_global; + s_global = 0L; +} + +KParts::Part* %{APPNAME}Factory::createPartObject( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, const char* classname, const QStringList & ) +{ + // If classname is "KoDocument", our host is a koffice application + // otherwise, the host wants us as a simple part, so switch to readonly and single view. + bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 ); + + // parentWidget and widgetName are used by KoDocument for the "readonly+singleView" case. + %{APPNAME}Part *part = new %{APPNAME}Part( parentWidget, widgetName, parent, name, !bWantKoDocument ); + + if ( !bWantKoDocument ) + part->setReadWrite( false ); + + return part; +} + +KAboutData* %{APPNAME}Factory::aboutData() +{ + if ( !s_aboutData ) + // Change this, of course + s_aboutData = new%{APPNAME}AboutData(); + return s_aboutData; +} + +KInstance* %{APPNAME}Factory::global() +{ + if ( !s_global ) + { + s_global = new KInstance( aboutData() ); + // Add any application-specific resource directories here + + // Tell the iconloader about share/apps/koffice/icons + s_global->iconLoader()->addAppDir("koffice"); + } + return s_global; +} + +#include <%{APPNAMELC}_factory.moc> diff --git a/languages/cpp/app_templates/kofficepart/kopart_factory.h b/languages/cpp/app_templates/kofficepart/kopart_factory.h new file mode 100644 index 00000000..45f1f649 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart_factory.h @@ -0,0 +1,33 @@ + +/* This template is based off of the KOffice example written by Torben Weis +*/ + +#ifndef %{APPNAME}_FACTORY_H +#define %{APPNAME}_FACTORY_H + +#include + +class KInstance; +class KAboutData; + +class %{APPNAME}Factory : public KoFactory +{ + Q_OBJECT +public: + %{APPNAME}Factory( QObject* parent = 0, const char* name = 0 ); + ~%{APPNAME}Factory(); + + virtual KParts::Part *createPartObject( QWidget *parentWidget = 0, const char *widgetName = 0, QObject *parent = 0, const char *name = 0, const char *classname = "KoDocument", const QStringList &args = QStringList() ); + + static KInstance* global(); + + // _Creates_ a KAboutData but doesn't keep ownership + static KAboutData* aboutData(); + +private: + static KInstance* s_global; + static KAboutData* s_aboutData; +}; + +#endif diff --git a/languages/cpp/app_templates/kofficepart/kopart_part.cpp b/languages/cpp/app_templates/kofficepart/kopart_part.cpp new file mode 100644 index 00000000..500179f3 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart_part.cpp @@ -0,0 +1,69 @@ + +/* This template is based off of the KOffice example written by Torben Weis +*/ + +#include "%{APPNAMELC}_part.h" +#include "%{APPNAMELC}_view.h" + +#include + +%{APPNAME}Part::%{APPNAME}Part( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, bool singleViewMode ) + : KoDocument( parentWidget, widgetName, parent, name, singleViewMode ) +{ +} + +bool %{APPNAME}Part::initDoc( InitDocFlags flags, QWidget* parentWidget ) +{ + // If nothing is loaded, do initialize here + return TRUE; +} + +KoView* %{APPNAME}Part::createViewInstance( QWidget* parent, const char* name ) +{ + return new %{APPNAME}View( this, parent, name ); +} + +bool %{APPNAME}Part::loadOasis( const QDomDocument & doc, KoOasisStyles& oasisStyles, const QDomDocument & settings, KoStore* store ) +{ + /// @todo load the document using the OASIS format + return true; +} + +bool %{APPNAME}Part::loadXML( QIODevice *, const QDomDocument & ) +{ + /// @todo load the document from the QDomDocument + return true; +} + +QDomDocument %{APPNAME}Part::saveXML() +{ + /// @todo save the document into a QDomDocument + return QDomDocument(); +} + +bool %{APPNAME}Part::saveOasis( KoStore* store, KoXmlWriter* manifestWriter ) +{ + /// @todo save the document using the OASIS format + return true; +} + + +void %{APPNAME}Part::paintContent( QPainter& painter, const QRect& rect, bool /*transparent*/, + double /*zoomX*/, double /*zoomY*/ ) +{ + // ####### handle transparency + + // Need to draw only the document rectangle described in the parameter rect. + int left = rect.left() / 20; + int right = rect.right() / 20 + 1; + int top = rect.top() / 20; + int bottom = rect.bottom() / 20 + 1; + + for( int x = left; x < right; ++x ) + painter.drawLine( x * 20, top * 20, x * 20, bottom * 20 ); + for( int y = left; y < right; ++y ) + painter.drawLine( left * 20, y * 20, right * 20, y * 20 ); +} + +#include "%{APPNAMELC}_part.moc" diff --git a/languages/cpp/app_templates/kofficepart/kopart_part.h b/languages/cpp/app_templates/kofficepart/kopart_part.h new file mode 100644 index 00000000..03361ca7 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart_part.h @@ -0,0 +1,30 @@ + +/* This template is based off of the KOffice example written by Torben Weis +*/ + +#ifndef %{APPNAME}_PART_H +#define %{APPNAME}_PART_H + +#include + +class %{APPNAME}Part : public KoDocument +{ + Q_OBJECT +public: + %{APPNAME}Part( QWidget *parentWidget = 0, const char *widgetName = 0, QObject* parent = 0, const char* name = 0, bool singleViewMode = false ); + + virtual void paintContent( QPainter& painter, const QRect& rect, bool transparent = FALSE, double zoomX = 1.0, double zoomY = 1.0 ); + + virtual bool initDoc( InitDocFlags flags, QWidget* parentWidget = 0 ); + + virtual bool loadOasis( const QDomDocument & doc, KoOasisStyles& oasisStyles, const QDomDocument & settings, KoStore* store ); + virtual bool loadXML( QIODevice *, const QDomDocument & ); + virtual QDomDocument saveXML(); + virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter ); + +protected: + virtual KoView* createViewInstance( QWidget* parent, const char* name ); +}; + +#endif diff --git a/languages/cpp/app_templates/kofficepart/kopart_view.cpp b/languages/cpp/app_templates/kofficepart/kopart_view.cpp new file mode 100644 index 00000000..28c0b42f --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart_view.cpp @@ -0,0 +1,52 @@ + +/* This template is based off of the KOffice example written by Torben Weis +*/ +#include "%{APPNAMELC}_view.h" +#include "%{APPNAMELC}_factory.h" +#include "%{APPNAMELC}_part.h" + +#include +#include +#include +#include +#include +#include + +%{APPNAME}View::%{APPNAME}View( %{APPNAME}Part* part, QWidget* parent, const char* name ) + : KoView( part, parent, name ) +{ + setInstance( %{APPNAME}Factory::global() ); + setXMLFile( "%{APPNAMELC}.rc" ); + KStdAction::cut(this, SLOT( cut() ), actionCollection(), "cut" ); + // Note: Prefer KStdAction::* to any custom action if possible. + //m_cut = new KAction( i18n("&Cut"), "editcut", 0, this, SLOT( cut() ), + // actionCollection(), "cut"); +} + +void %{APPNAME}View::paintEvent( QPaintEvent* ev ) +{ + QPainter painter; + painter.begin( this ); + + /// @todo Scaling + + // Let the document do the drawing + koDocument()->paintEverything( painter, ev->rect(), FALSE, this ); + + painter.end(); +} + +void %{APPNAME}View::updateReadWrite( bool /*readwrite*/ ) +{ +#ifdef __GNUC__ +#warning TODO +#endif +} + +void %{APPNAME}View::cut() +{ + kdDebug(31000) << "%{APPNAME}View::cut(): CUT called" << endl; +} + +#include "%{APPNAMELC}_view.moc" diff --git a/languages/cpp/app_templates/kofficepart/kopart_view.h b/languages/cpp/app_templates/kofficepart/kopart_view.h new file mode 100644 index 00000000..eb14763f --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/kopart_view.h @@ -0,0 +1,34 @@ + +/* This template is based off of the KOffice example written by Torben Weis +*/ + +#ifndef %{APPNAME}_VIEW +#define %{APPNAME}_VIEW + +#include + +class KAction; +class QPaintEvent; + +class %{APPNAME}Part; + +class %{APPNAME}View : public KoView +{ + Q_OBJECT +public: + %{APPNAME}View( %{APPNAME}Part* part, QWidget* parent = 0, const char* name = 0 ); + +protected slots: + void cut(); + +protected: + void paintEvent( QPaintEvent* ); + + virtual void updateReadWrite( bool readwrite ); + +private: + //KAction* m_cut; +}; + +#endif diff --git a/languages/cpp/app_templates/kofficepart/main.cpp b/languages/cpp/app_templates/kofficepart/main.cpp new file mode 100644 index 00000000..1561922a --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/main.cpp @@ -0,0 +1,33 @@ + +/* This template is based off of the KOffice example written by Torben Weis +*/ + +#include +#include +#include +#include +#include +#include +#include "%{APPNAMELC}_aboutdata.h" + + +static const KCmdLineOptions options[]= +{ + {"+[file]", I18N_NOOP("File to open"),0}, + KCmdLineLastOption +}; + +int main( int argc, char **argv ) +{ + KCmdLineArgs::init( argc, argv, new%{APPNAME}AboutData() ); + KCmdLineArgs::addCmdLineOptions( options ); + KoApplication app; + + app.dcopClient()->attach(); + app.dcopClient()->registerAs( "%{APPNAMELC}" ); + + if (!app.start()) // parses command line args, create initial docs and shells + return 1; + return app.exec(); +} diff --git a/languages/cpp/app_templates/kofficepart/src-Makefile.am b/languages/cpp/app_templates/kofficepart/src-Makefile.am new file mode 100644 index 00000000..19d38267 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/src-Makefile.am @@ -0,0 +1,41 @@ + +INCLUDES = $(KOFFICE_INCLUDES) $(all_includes) + +## The part +kde_module_LTLIBRARIES = lib%{APPNAMELC}part.la +lib%{APPNAMELC}part_la_SOURCES = %{APPNAMELC}_part.cpp \ + %{APPNAMELC}_view.cpp %{APPNAMELC}_factory.cpp +lib%{APPNAMELC}part_la_LDFLAGS = $(KDE_PLUGIN) +lib%{APPNAMELC}part_la_LIBADD = -lkofficeui + +## The kdeinit loadable module +lib_LTLIBRARIES = %{APPNAMELC}.la +%{APPNAMELC}_la_SOURCES = %{APPNAMELC}.cpp +%{APPNAMELC}_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) +%{APPNAMELC}_la_LIBADD = -lkofficecore + +## The executable +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = dummy.cpp +%{APPNAMELC}_LDFLAGS = $(all_libraries) $(KDE_RPATH) +%{APPNAMELC}_LDADD = %{APPNAMELC}.la + +dummy.cpp: + echo > dummy.cpp + +METASOURCES = AUTO +noinst_HEADERS = %{APPNAMELC}_part.h \ + %{APPNAMELC}_view.h %{APPNAMELC}_factory.h %{APPNAMELC}_aboutdata.h + +kdelnk_DATA = %{APPNAMELC}.desktop +kdelnkdir = $(kde_appsdir)/Office + +kdemime_DATA = x-%{APPNAMELC}.desktop +kdemimedir = $(kde_mimedir)/application + +rc_DATA = %{APPNAMELC}.rc +rcdir = $(kde_datadir)/%{APPNAMELC} + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp %{APPNAMELC}_aboutdata.h -o $(podir)/%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/kofficepart/subdirs b/languages/cpp/app_templates/kofficepart/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kofficepart/x-kopart.desktop b/languages/cpp/app_templates/kofficepart/x-kopart.desktop new file mode 100644 index 00000000..f4e15e79 --- /dev/null +++ b/languages/cpp/app_templates/kofficepart/x-kopart.desktop @@ -0,0 +1,40 @@ +# KDE Config File +[Desktop Entry] +MimeType=application/x-%{APPNAMELC} +Comment= A really awesome KOffice application +Comment[ca]=Una aplicació de KOffice realment interessant +Comment[da]=Et helt fantastisk KOffice program +Comment[de]=Eine wirklich großartige KOffice-Anwendung +Comment[el]= Μια πραγματικά όμορφη εφαρμογή KOffice +Comment[es]=Una aplicación de KOffice realmente intesesante +Comment[et]=Tõesti imeline KOffice'i rakendus +Comment[eu]=KOffice aplikazio harrigarri bat +Comment[fa]=کاربرد واقعاً بیمناک KOffice +Comment[fr]=Une application pour KOffice vraiment superbe +Comment[ga]= Feidhmchlár sármhaith KOffice +Comment[gl]=Unha aplicación de KOffice realmente impresionante +Comment[hu]=Egy bámulatos KOffice-alkalmazás +Comment[it]=Un'applicazione di KOffice veramente bella +Comment[nds]=En redig deegt KOffice-Programm +Comment[ne]= वास्तवमै प्रभावकारी केडीई अफिस अनुप्रयोग +Comment[nl]=Een fantastische KOffice-toepassing +Comment[pl]=Wspaniały program KOffice +Comment[pt]=Uma aplicação fantástica para o KOffice +Comment[pt_BR]=Um aplicativo realmente do tipo do KOffice +Comment[ru]=Приложение KOffice +Comment[sk]=Naozaj hrozná KOffice aplikácia +Comment[sl]=Sijajen program za KOffice +Comment[sr]=Стварно сјајан KOffice програм +Comment[sr@Latn]=Stvarno sjajan KOffice program +Comment[sv]=Ett riktigt suveränt Koffice-program +Comment[tr]=Gerçekten harika bir KOffice uygulaması +Comment[zh_CN]=一个非常杰出的 KOffice 应用程序 +Comment[zh_TW]=一個十分完美的 KOffice 應用程式 +Type=MimeType +#You need to change the mime type below to match what your application will handle... +Patterns=*.xmpl; +X-KDE-AutoEmbed=false +[Property::X-KDE-NativeExtension] +Type=QString +#You need to change the mime type below to match what your application will handle... +Value=.xmpl diff --git a/languages/cpp/app_templates/konqnavpanel/.kdev_ignore b/languages/cpp/app_templates/konqnavpanel/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/konqnavpanel/Makefile.am b/languages/cpp/app_templates/konqnavpanel/Makefile.am new file mode 100644 index 00000000..7a3ae56b --- /dev/null +++ b/languages/cpp/app_templates/konqnavpanel/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = konqnavpanel.cpp konqnavpanel.h konqnavpanel.desktop \ + konqnavpanel.kdevelop src-Makefile.am \ + konqnavpanel.png subdirs +templateName = konqnavpanel + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.cpp b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.cpp new file mode 100644 index 00000000..34515ce2 --- /dev/null +++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.cpp @@ -0,0 +1,34 @@ + +#include +#include +#include +#include + +#include "%{APPNAMELC}.h" +#include "%{APPNAMELC}.moc" + +%{APPNAME}::%{APPNAME}(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name): + KonqSidebarPlugin(inst,parent,widgetParent,desktopName,name) +{ + widget=new QLabel("Init Value",widgetParent); +} + + +%{APPNAME}::~%{APPNAME}() +{ +} + +void %{APPNAME}::handleURL(const KURL &url) +{ + widget->setText(QString("%{APPNAME}")+"::"+url.url()); +} + + + +extern "C" +{ + void* create_konqsidebar_%{APPNAME}(KInstance *instance,QObject *par,QWidget *widp,QString &desktopname,const char *name) + { + return new %{APPNAME}(instance,par,widp,desktopname,name); + } +}; diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.desktop b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.desktop new file mode 100644 index 00000000..31e23a1a --- /dev/null +++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.desktop @@ -0,0 +1,39 @@ +[Desktop Entry] +Type=Link +URL= +Icon=wizard +Comment=A konqueror navigation panel plugin called $NAME$ +Comment[ca]=Un connector per al plafó de navegació de Konqueror anomenat $NAME$ +Comment[da]=Et Konqueror navigationspanel plugin der hedder $NAME$ +Comment[de]=Ein Modul für den Navigationsbereich von Konqueror mit Namen $NAME$ +Comment[el]=Ένα πρόσθετο του πίνακα πλοήγησης του konqueror με το όνομα $NAME$ +Comment[es]=Un complemento del panel de navegación de Konqueror llamado $NAME$ +Comment[et]=Konquerori liikumispaneeli plugin nimega $NAME$ +Comment[eu]=$NAME$ izeneko konqueror arakatze-paneleko plugin bat +Comment[fa]=وصلۀ تابلوی ناوش konqueror، $NAME$ نامیده شد +Comment[fr]=Un module externe pour le panneau de navigation de Konqueror appelé $NAME$ +Comment[ga]=Breiseán painéil nascleanúna konqueror darb ainm $NAME$ +Comment[gl]=Unha extensión para o panel de navegación de konqueror chamado $NAME$ +Comment[hu]=Bővítőmodul a Konqueror navigációs paneljéhez ($NAMES$) +Comment[it]=Un plugin per il pannello di navigazione di Konqueror chiamato $NAME$ +Comment[ja]=$NAME$ と呼ばれる konqueror ナビゲーションプラグイン +Comment[nds]=En Sietpaneelmoduul för Konqueror, nöömt $NAME$ +Comment[ne]= $NAME$ भनिने कन्क्वेरर नेभिगेसन प्यानल प्लगइन +Comment[nl]=Een konqueror navigatiepaneel-plugin met de naam $NAME$ +Comment[pl]=Wtyczka do panelu nawigacyjnego Konquerora o nazwie $NAME$ +Comment[pt]=Um 'plugin' do painel de navegação do konqueror chamado $NAME$ +Comment[pt_BR]=Um plug-in de painel de navegação do konqueror chamado $NAME$ +Comment[ru]=Модуль панели навигации Konqueror $NAME$ +Comment[sk]=Modul pre konqueror navigačný panel s menom $NAME$ +Comment[sl]=Konquerorjev vstavek pulta za navigacijo z imenom $NAME$ +Comment[sr]=Кonqueror-ов прикључак за навигациони панел по имену $NAME$ +Comment[sr@Latn]=Konqueror-ov priključak za navigacioni panel po imenu $NAME$ +Comment[sv]=Ett insticksprogram i Konquerors navigeringspanel som heter $NAME$ +Comment[tr]=$NAME$ adında bir konqueror gezinme paneli eklentisi +Comment[zh_CN]=一个称作 $NAME$ 的 konqueror 导航面板插件 +Comment[zh_TW]=名稱為 $NAME$ 的 Konqueror 導覽面板外掛程式 +Name=%{APPNAMELC} + +Open=false +X-KDE-KonqSidebarModule=konqsidebar_%{APPNAMELC} + diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.h b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.h new file mode 100644 index 00000000..949c68d3 --- /dev/null +++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.h @@ -0,0 +1,43 @@ + +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + + +class %{APPNAME} : public KonqSidebarPlugin +{ + Q_OBJECT + +public: + /** + * Construct a @ref KonqSidebarPlugin. + * + * @param inst The sidebar's kinstance class. + * @param parent The sidebar internal button info class responsible for this plugin. + * @param widgetParent The container which will contain the plugins widget. + * @param desktopName The filename of the configuration file. + * @param name A Qt object name for your plugin. + **/ + %{APPNAME}(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name=0); + + /** destructor */ + ~%{APPNAME}(); + + virtual QWidget *getWidget(){return widget;} + virtual void *provides(const QString &) {return 0;} + +protected: + /*Example widget only. You use whichever widget you want. You onl have to care that getWidget returns some kind of widget */ + QLabel *widget; + virtual void handleURL(const KURL &url); + +}; + +#endif diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevelop b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevelop new file mode 100644 index 00000000..8bb35326 --- /dev/null +++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevelop @@ -0,0 +1,115 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + Kicker + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/lib%{APPNAMELC}.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevtemplate b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevtemplate new file mode 100644 index 00000000..4cbc7d5d --- /dev/null +++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevtemplate @@ -0,0 +1,192 @@ +# KDE Config File +[General] +Name=Konqueror Navigation Panel Plugin +Name[br]=Lugent panell furchal Konqueror +Name[ca]=Un connector per al plafó de navegació de Konqueror +Name[da]=Konqueror navigationspanel plugin +Name[de]=Modul für den Navigationsbereich von Konqueror +Name[el]=Πρόσθετο πίνακα πλοήγησης του Konqueror +Name[es]=Un complemento para el panel de navegación de Konqueror +Name[et]=Konquerori liikumispaneeli plugin +Name[eu]=Konqueror arakatze-panel plugina +Name[fa]=وصلۀ تابلوی ناوش Konqueror +Name[fr]=Module externe pour le panneau de navigation de Konqueror +Name[ga]=Breiseán Painéil Nascleanúna Konqueror +Name[gl]=Extensión para o panel de navegación de Konqueror +Name[hu]=Konqueroros navigációs bővítőmodul +Name[it]=Plugin per il pannello di navigazione di Konqueror +Name[ja]=Konqueror ナビゲーションプラグイン +Name[nds]=En Sietpaneelmoduul för Konqueror +Name[ne]=कन्क्वेरर नेभिगेसन प्यानल प्लगइन +Name[nl]=Konqueror Navigatiepaneel-plugin +Name[pl]=Wtyczka panelu nawigacji Konquerora +Name[pt]='Plugin' do Painel de Navegação do Konqueror +Name[pt_BR]='Plugin' do Painel de Navegação do Konqueror +Name[ru]=Модуль панели навигации Konqueror +Name[sk]=Modul pre konqueror navigačný panel +Name[sr]=Кonqueror-ов прикључак за навигациони панел +Name[sr@Latn]=Konqueror-ov priključak za navigacioni panel +Name[sv]=Konqueror-insticksprogram för navigeringspanelen +Name[tr]=Konqueror Gezinme Paneli Eklentisi +Name[zh_CN]=Konqueror 导航面板插件 +Name[zh_TW]=Konqueror 導覽面板外掛程式 +Icon=konqnavpanel.png +Category=C++/KDE +Comment=Generates a framework for a plugin that embeds into Konqueror's navigation panel +Comment[ca]=Genera una infraestructura per a un connector que s'encasti al plafó de navegació de Konqueror +Comment[da]=Genererer et skelet for et plugin der indlejres i Konqueror's navigationspanel +Comment[de]=Erstellt das Gerüst für ein Modul, das in den Navigationsbereich von Konqueror eingebunden werden kann. +Comment[el]=Δημιουργεί ένα πλαίσιο για ένα πρόσθετο που ενσωματώνεται στον πίνακα πλοήγησης του Konqueror +Comment[es]=Genera una infraestructura para un complemento empotrado en el panel de navegación de Konqueror +Comment[et]=Plugina raamistiku loomine, mida saab põimida Konquerori liikumispaneelile. +Comment[eu]=Konqueror-en arakatze-panelean kapsulatzen den plugin batentzat lan-marko oso bat sortzen du +Comment[fa]=چارچوبی را برای یک وصله که در تابلوی ناوش Konqueror نهفته بود، تولید می‌کند +Comment[fr]=Génère une infrastructure pour un module externe qui s'intègre dans le panneau de navigation de Konqueror +Comment[gl]=Xera un contorno de traballo para unha extensión que se incrusta no panel de navegación de Konqueror +Comment[hu]=Létrehoz egy alapprogramot konqueroros navigációs panelmodul készítéséhez +Comment[it]=Genera l'infrastruttura per un plugin che si integra nel pannello di navigazione di Konqueror +Comment[nds]=Stellt dat Rahmenwark för en Moduul op, dat sik in't Sietpaneel vun Konqueror inbett +Comment[ne]=कन्क्वेररको नेभिगेसन प्यानलमा सम्मिलित हुने प्लगइनका लागि फ्रेमवर्क उत्पन्न गर्दछ +Comment[nl]=Genereert een framework voor een plugin die kan worden ingebed in Konqueror's navigatiepaneel. +Comment[pl]=Generuje wtyczkę, którą można osadzić w panelu nawigacyjnym Konquerora +Comment[pt]=Gera a plataforma para um 'plugin' que se incorpore no painel de navegação do Konqueror +Comment[pt_BR]=Gera a plataforma para um 'plugin' que se incorpore no painel de navegação do Konqueror +Comment[ru]=Создание модуля панели навигации Konqueror +Comment[sk]=Vygeneruje framework pre modul, ktorý sa bude dať vložiť do konqueror navigačného panelu +Comment[sr]=Прави радни оквир за прикључак који се уграђује у Konqueror-ов навигациони панел +Comment[sr@Latn]=Pravi radni okvir za priključak koji se ugrađuje u Konqueror-ov navigacioni panel +Comment[sv]=Skapar ett ramverk för ett insticksprogram som inbäddas i Konquerors navigeringspanel +Comment[tr]=Konqueror'un gezinme paneline gömülen bir eklenti için bir çatı oluşturur. +Comment[zh_CN]=生成可嵌入到 Konqueror 导航面板的插件框架 +Comment[zh_TW]=產生一個嵌入 Konqueror 導覽面板的外掛程式的框架 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=konqnavpanel.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/konqnavpanel.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/konqnavpanel.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/konqnavpanel.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE14] +Type=install +Source=%{src}/konqnavpanel.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[MSG] +Type=message +Comment=A konqueror navigation panel plugin was created in %{dest} +Comment[ca]=Un connector per al plafó de navegació de Konqueror ha estat creada en %{dest} +Comment[da]=Et Konqueror navigationspanel plugin blev oprettet i %{dest} +Comment[de]=Ein Modul für den Navigationsbereich von Konqueror wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο του πίνακα πλοήγησης του konqueror δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento para el panel de navegación de Konqueror ha sido creado en %{dest} +Comment[et]=Konquerori liikumispaneeli plugin loodi asukohta %{dest} +Comment[eu]=Konqueror-en arakatze-paneleko plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ تابلوی ناوش konqueror در %{dest} ایجاد شد +Comment[fr]=Un module externe pour le panneau de navigation de Konqueror a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán painéil nascleanúna konqueror i %{dest} +Comment[gl]=Creouse unha extensión para o panel de navegación en %{dest} +Comment[hu]=Létrejött egy konqueroros navigációs modul itt: %{dest} +Comment[it]=È stato creato un plugin per il pannello di navigazione di Konqueror in %{dest} +Comment[ja]=Konqueror ナビゲーションプラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Sietpaneelmoduul för Konqueror opstellt +Comment[ne]=कन्क्वेरर नेभिगेसन प्यानल प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een Konqueror-navigatiepaneel-plugin is aangemaakt in %{dest} +Comment[pl]=Wtyczka do panelu nawigacyjnego Konquerora została utworzona w %{dest} +Comment[pt]=Um 'plugin' do painel de navegação do Konqueror foi criado em %{dest} +Comment[pt_BR]=Um 'plugin' do painel de navegação do Konqueror foi criado em %{dest} +Comment[ru]=Модуль панели навигации Konqueror создан в %{dest} +Comment[sk]=Modul pre konqueror navigačný panel bol vytvorený v %{dest} +Comment[sr]=Кonqueror-ов прикључак за навигациони панел направљен је у %{dest} +Comment[sr@Latn]=Konqueror-ov priključak za navigacioni panel napravljen je u %{dest} +Comment[sv]=Ett Konqueror-insticksprogram för navigeringspanelen skapades i %{dest} +Comment[tr]=Bir konqueror gezinme paneli eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 konqueror 导航器面板插件 +Comment[zh_TW]=一個 Konqueror 導覽面板外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.png b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.png new file mode 100644 index 00000000..dd0d89f3 Binary files /dev/null and b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.png differ diff --git a/languages/cpp/app_templates/konqnavpanel/src-Makefile.am b/languages/cpp/app_templates/konqnavpanel/src-Makefile.am new file mode 100644 index 00000000..5a9113c5 --- /dev/null +++ b/languages/cpp/app_templates/konqnavpanel/src-Makefile.am @@ -0,0 +1,11 @@ +INCLUDES= $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES=konqsidebar_%{APPNAMELC}.la + +konqsidebar_%{APPNAMELC}_la_SOURCES = %{APPNAMELC}.cpp +konqsidebar_%{APPNAMELC}_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) -lkonqsidebarplugin +konqsidebar_%{APPNAMELC}_la_LIBADD = $(LIB_KPARTS) $(LIB_KFILE) + +%{APPNAMELC}_entry_DATA = %{APPNAMELC}.desktop +%{APPNAMELC}_entrydir = $(kde_datadir)/konqsidebartng/entries diff --git a/languages/cpp/app_templates/konqnavpanel/subdirs b/languages/cpp/app_templates/konqnavpanel/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/konqnavpanel/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kpartapp/.kdev_ignore b/languages/cpp/app_templates/kpartapp/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kpartapp/Makefile.am b/languages/cpp/app_templates/kpartapp/Makefile.am new file mode 100644 index 00000000..9b69f17d --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = src-Makefile.am app.cpp app.h app_part.cpp\ + app_part.h main.cpp app_part.rc app_shell.rc \ + kpartapp.png app.kdevelop subdirs +templateName = kpartapp +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/kpartapp/app.cpp b/languages/cpp/app_templates/kpartapp/app.cpp new file mode 100644 index 00000000..68c34ab3 --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/app.cpp @@ -0,0 +1,209 @@ + +#include "%{APPNAMELC}.h" + +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +%{APPNAME}::%{APPNAME}() + : KParts::MainWindow( 0L, "%{APPNAME}" ) +{ + // set the shell's ui resource file + setXMLFile("%{APPNAMELC}_shell.rc"); + + // then, setup our actions + setupActions(); + + // and a status bar + statusBar()->show(); + + // this routine will find and load our Part. it finds the Part by + // name which is a bad idea usually.. but it's alright in this + // case since our Part is made for this Shell + KLibFactory *factory = KLibLoader::self()->factory("lib%{APPNAMELC}part"); + if (factory) + { + // now that the Part is loaded, we cast it to a Part to get + // our hands on it + m_part = static_cast(factory->create(this, + "%{APPNAMELC}_part", "KParts::ReadWritePart" )); + + if (m_part) + { + // tell the KParts::MainWindow that this is indeed the main widget + setCentralWidget(m_part->widget()); + + // and integrate the part's GUI with the shell's + createGUI(m_part); + } + } + else + { + // if we couldn't find our Part, we exit since the Shell by + // itself can't do anything useful + KMessageBox::error(this, i18n("Could not find our part.")); + kapp->quit(); + // we return here, cause kapp->quit() only means "exit the + // next time we enter the event loop... + return; + } + + // apply the saved mainwindow settings, if any, and ask the mainwindow + // to automatically save settings if changed: window size, toolbar + // position, icon size, etc. + setAutoSaveSettings(); +} + +%{APPNAME}::~%{APPNAME}() +{ +} + +void %{APPNAME}::load(const KURL& url) +{ + m_part->openURL( url ); +} + +void %{APPNAME}::setupActions() +{ + KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStdAction::open(this, SLOT(fileOpen()), actionCollection()); + + KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + + m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); + m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); + + KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); +} + +void %{APPNAME}::saveProperties(KConfig* /*config*/) +{ + // the 'config' object points to the session managed + // config file. anything you write here will be available + // later when this app is restored +} + +void %{APPNAME}::readProperties(KConfig* /*config*/) +{ + // the 'config' object points to the session managed + // config file. this function is automatically called whenever + // the app is being restored. read in here whatever you wrote + // in 'saveProperties' +} + +void %{APPNAME}::fileNew() +{ + // this slot is called whenever the File->New menu is selected, + // the New shortcut is pressed (usually CTRL+N) or the New toolbar + // button is clicked + + // About this function, the style guide ( + // http://developer.kde.org/documentation/standards/kde/style/basics/index.html ) + // says that it should open a new window if the document is _not_ + // in its initial state. This is what we do here.. + if ( ! m_part->url().isEmpty() || m_part->isModified() ) + { + (new %{APPNAME})->show(); + }; +} + + +void %{APPNAME}::optionsShowToolbar() +{ + // this is all very cut and paste code for showing/hiding the + // toolbar + if (m_toolbarAction->isChecked()) + toolBar()->show(); + else + toolBar()->hide(); +} + +void %{APPNAME}::optionsShowStatusbar() +{ + // this is all very cut and paste code for showing/hiding the + // statusbar + if (m_statusbarAction->isChecked()) + statusBar()->show(); + else + statusBar()->hide(); +} + +void %{APPNAME}::optionsConfigureKeys() +{ + KKeyDialog::configure(actionCollection()); +} + +void %{APPNAME}::optionsConfigureToolbars() +{ +#if defined(KDE_MAKE_VERSION) +# if KDE_VERSION >= KDE_MAKE_VERSION(3,1,0) + saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); +# else + saveMainWindowSettings(KGlobal::config() ); +# endif +#else + saveMainWindowSettings(KGlobal::config() ); +#endif + + // use the standard toolbar editor + KEditToolbar dlg(factory()); + connect(&dlg, SIGNAL(newToolbarConfig()), + this, SLOT(applyNewToolbarConfig())); + dlg.exec(); +} + +void %{APPNAME}::applyNewToolbarConfig() +{ +#if defined(KDE_MAKE_VERSION) +# if KDE_VERSION >= KDE_MAKE_VERSION(3,1,0) + applyMainWindowSettings(KGlobal::config(), autoSaveGroup()); +# else + applyMainWindowSettings(KGlobal::config()); +# endif +#else + applyMainWindowSettings(KGlobal::config()); +#endif +} + +void %{APPNAME}::fileOpen() +{ + // this slot is called whenever the File->Open menu is selected, + // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar + // button is clicked + KURL url = + KFileDialog::getOpenURL( QString::null, QString::null, this ); + + if (url.isEmpty() == false) + { + // About this function, the style guide ( + // http://developer.kde.org/documentation/standards/kde/style/basics/index.html ) + // says that it should open a new window if the document is _not_ + // in its initial state. This is what we do here.. + if ( m_part->url().isEmpty() && ! m_part->isModified() ) + { + // we open the file in this window... + load( url ); + } + else + { + // we open the file in a new window... + %{APPNAME}* newWin = new %{APPNAME}; + newWin->load( url ); + newWin->show(); + } + } +} + +#include "%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/kpartapp/app.desktop b/languages/cpp/app_templates/kpartapp/app.desktop new file mode 100644 index 00000000..01cc9d37 --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/app.desktop @@ -0,0 +1,18 @@ +[Desktop Entry] +Name=%{APPNAME}Part +Name[br]=Perzh%{APPNAME} +Name[ca]=Part per a %{APPNAME} +Name[el]=Τμήμα%{APPNAME} +Name[et]=%{APPNAME} komponent +Name[fa]=جزء %{APPNAME} +Name[gl]=%{APPNAME} Part +Name[ja]=%{APPNAME} パート +Name[ne]=%{APPNAME}भाग +Name[pt_BR]=Parte %{APPNAME} +Name[sv]=%{APPNAME}-del +Name[ta]=%{APPNAME}பாகம் +Name[tr]=%{APPNAME} Bileşeni +MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; +ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart +X-KDE-Library=lib%{APPNAMELC}part +Type=Service diff --git a/languages/cpp/app_templates/kpartapp/app.h b/languages/cpp/app_templates/kpartapp/app.h new file mode 100644 index 00000000..25cd63bf --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/app.h @@ -0,0 +1,76 @@ + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +class KToggleAction; + +/** + * This is the application "Shell". It has a menubar, toolbar, and + * statusbar but relies on the "Part" to do all the real work. + * + * @short Application Shell + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAME} : public KParts::MainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); + + /** + * Use this method to load whatever file/URL you have + */ + void load(const KURL& url); + +protected: + /** + * This method is called when it is time for the app to save its + * properties for session management purposes. + */ + void saveProperties(KConfig *); + + /** + * This method is called when this app is restored. The KConfig + * object points to the session management config file that was saved + * with @ref saveProperties + */ + void readProperties(KConfig *); + +private slots: + void fileNew(); + void fileOpen(); + void optionsShowToolbar(); + void optionsShowStatusbar(); + void optionsConfigureKeys(); + void optionsConfigureToolbars(); + + void applyNewToolbarConfig(); + +private: + void setupAccel(); + void setupActions(); + +private: + KParts::ReadWritePart *m_part; + + KToggleAction *m_toolbarAction; + KToggleAction *m_statusbarAction; +}; + +#endif // _%{APPNAMEUC}_H_ diff --git a/languages/cpp/app_templates/kpartapp/app.kdevelop b/languages/cpp/app_templates/kpartapp/app.kdevelop new file mode 100644 index 00000000..3adbae9e --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/app.kdevelop @@ -0,0 +1,115 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kpartapp/app_part.cpp b/languages/cpp/app_templates/kpartapp/app_part.cpp new file mode 100644 index 00000000..bf63557f --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/app_part.cpp @@ -0,0 +1,201 @@ + +#include "%{APPNAMELC}_part.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +%{APPNAME}Part::%{APPNAME}Part( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name ) + : KParts::ReadWritePart(parent, name) +{ + // we need an instance + setInstance( %{APPNAME}PartFactory::instance() ); + + // this should be your custom internal widget + m_widget = new QMultiLineEdit( parentWidget, widgetName ); + + // notify the part that this is our internal widget + setWidget(m_widget); + + // create our actions + KStdAction::open(this, SLOT(fileOpen()), actionCollection()); + KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); + KStdAction::save(this, SLOT(save()), actionCollection()); + + // set our XML-UI resource file + setXMLFile("%{APPNAMELC}_part.rc"); + + // we are read-write by default + setReadWrite(true); + + // we are not modified since we haven't done anything yet + setModified(false); +} + +%{APPNAME}Part::~%{APPNAME}Part() +{ +} + +void %{APPNAME}Part::setReadWrite(bool rw) +{ + // notify your internal widget of the read-write state + m_widget->setReadOnly(!rw); + if (rw) + connect(m_widget, SIGNAL(textChanged()), + this, SLOT(setModified())); + else + { + disconnect(m_widget, SIGNAL(textChanged()), + this, SLOT(setModified())); + } + + ReadWritePart::setReadWrite(rw); +} + +void %{APPNAME}Part::setModified(bool modified) +{ + // get a handle on our Save action and make sure it is valid + KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save)); + if (!save) + return; + + // if so, we either enable or disable it based on the current + // state + if (modified) + save->setEnabled(true); + else + save->setEnabled(false); + + // in any event, we want our parent to do it's thing + ReadWritePart::setModified(modified); +} + +bool %{APPNAME}Part::openFile() +{ + // m_file is always local so we can use QFile on it + QFile file(m_file); + if (file.open(IO_ReadOnly) == false) + return false; + + // our example widget is text-based, so we use QTextStream instead + // of a raw QDataStream + QTextStream stream(&file); + QString str; + while (!stream.eof()) + str += stream.readLine() + "\n"; + + file.close(); + + // now that we have the entire file, display it + m_widget->setText(str); + + // just for fun, set the status bar + emit setStatusBarText( m_url.prettyURL() ); + + return true; +} + +bool %{APPNAME}Part::saveFile() +{ + // if we aren't read-write, return immediately + if (isReadWrite() == false) + return false; + + // m_file is always local, so we use QFile + QFile file(m_file); + if (file.open(IO_WriteOnly) == false) + return false; + + // use QTextStream to dump the text to the file + QTextStream stream(&file); + stream << m_widget->text(); + + file.close(); + + return true; +} + +void %{APPNAME}Part::fileOpen() +{ + // this slot is called whenever the File->Open menu is selected, + // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar + // button is clicked + QString file_name = KFileDialog::getOpenFileName(); + + if (file_name.isEmpty() == false) + openURL(file_name); +} + +void %{APPNAME}Part::fileSaveAs() +{ + // this slot is called whenever the File->Save As menu is selected, + QString file_name = KFileDialog::getSaveFileName(); + if (file_name.isEmpty() == false) + saveAs(file_name); +} + + +// It's usually safe to leave the factory code alone.. with the +// notable exception of the KAboutData data +#include +#include + +KInstance* %{APPNAME}PartFactory::s_instance = 0L; +KAboutData* %{APPNAME}PartFactory::s_about = 0L; + +%{APPNAME}PartFactory::%{APPNAME}PartFactory() + : KParts::Factory() +{ +} + +%{APPNAME}PartFactory::~%{APPNAME}PartFactory() +{ + delete s_instance; + delete s_about; + + s_instance = 0L; +} + +KParts::Part* %{APPNAME}PartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList &args ) +{ + // Create an instance of our Part + %{APPNAME}Part* obj = new %{APPNAME}Part( parentWidget, widgetName, parent, name ); + + // See if we are to be read-write or not + if (QCString(classname) == "KParts::ReadOnlyPart") + obj->setReadWrite(false); + + return obj; +} + +KInstance* %{APPNAME}PartFactory::instance() +{ + if( !s_instance ) + { + s_about = new KAboutData("%{APPNAMELC}part", I18N_NOOP("%{APPNAME}Part"), "%{VERSION}"); + s_about->addAuthor("%{AUTHOR}", 0, "%{EMAIL}"); + s_instance = new KInstance(s_about); + } + return s_instance; +} + +extern "C" +{ + void* init_lib%{APPNAMELC}part() + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}PartFactory; + } +}; + +#include "%{APPNAMELC}_part.moc" diff --git a/languages/cpp/app_templates/kpartapp/app_part.h b/languages/cpp/app_templates/kpartapp/app_part.h new file mode 100644 index 00000000..37c30189 --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/app_part.h @@ -0,0 +1,86 @@ + +#ifndef _%{APPNAMEUC}PART_H_ +#define _%{APPNAMEUC}PART_H_ + +#include +#include + +class QWidget; +class QPainter; +class KURL; +class QMultiLineEdit; + +/** + * This is a "Part". It that does all the real work in a KPart + * application. + * + * @short Main Part + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAME}Part : public KParts::ReadWritePart +{ + Q_OBJECT +public: + /** + * Default constructor + */ + %{APPNAME}Part(QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name); + + /** + * Destructor + */ + virtual ~%{APPNAME}Part(); + + /** + * This is a virtual function inherited from KParts::ReadWritePart. + * A shell will use this to inform this Part if it should act + * read-only + */ + virtual void setReadWrite(bool rw); + + /** + * Reimplemented to disable and enable Save action + */ + virtual void setModified(bool modified); + +protected: + /** + * This must be implemented by each part + */ + virtual bool openFile(); + + /** + * This must be implemented by each read-write part + */ + virtual bool saveFile(); + +protected slots: + void fileOpen(); + void fileSaveAs(); + +private: + QMultiLineEdit *m_widget; +}; + +class KInstance; +class KAboutData; + +class %{APPNAME}PartFactory : public KParts::Factory +{ + Q_OBJECT +public: + %{APPNAME}PartFactory(); + virtual ~%{APPNAME}PartFactory(); + virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, + const char *classname, const QStringList &args ); + static KInstance* instance(); + +private: + static KInstance* s_instance; + static KAboutData* s_about; +}; + +#endif // _%{APPNAMEUC}PART_H_ diff --git a/languages/cpp/app_templates/kpartapp/app_part.rc b/languages/cpp/app_templates/kpartapp/app_part.rc new file mode 100644 index 00000000..cec8ec5c --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/app_part.rc @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/languages/cpp/app_templates/kpartapp/app_shell.rc b/languages/cpp/app_templates/kpartapp/app_shell.rc new file mode 100644 index 00000000..e0600cda --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/app_shell.rc @@ -0,0 +1,28 @@ + + + + &File + + + + + + &Settings + + + + + + + + + + + + +Main Toolbar + + + + + diff --git a/languages/cpp/app_templates/kpartapp/kpartapp.kdevtemplate b/languages/cpp/app_templates/kpartapp/kpartapp.kdevtemplate new file mode 100644 index 00000000..03583faa --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/kpartapp.kdevtemplate @@ -0,0 +1,237 @@ +# KDE Config File +[General] +Name=Application framework (KParts) +Name[ca]=Infraestructura d'aplicació (KParts) +Name[da]=Programskelet (KParts) +Name[de]=Anwendungsgerüst (KParts) +Name[el]=Πλαίσιο εφαρμογής (KParts) +Name[es]=Infraestructura de aplicación (KParts) +Name[et]=Rakenduse raamistik (KParts) +Name[eu]=Aplikazioen lan-markoa (KParts) +Name[fa]=(KParts)چارچوب کاربرد +Name[fr]=Infrastructure d'application (KParts) +Name[ga]=Creatlach feidhmchláir (KParts) +Name[gl]=Entorno de traballo de aplicación (KParts) +Name[hu]=Alkalmazás-keretrendszer (objektumokkal) +Name[it]=Infrastruttura applicativa (KParts) +Name[ja]=アプリケーションフレームワーク (KParts) +Name[nds]=Programmrahmenwark (KParts) +Name[ne]=अनुप्रयोग फ्रेमवर्क (केडीई भाग) +Name[nl]=Toepassingframework (KParts) +Name[pl]=Szablon progamu (KParts) +Name[pt]=Plataforma de aplicações (KParts) +Name[pt_BR]=Plataforma de aplicações (KParts) +Name[ru]=Приложение KPart +Name[sk]=Aplikačný framework (KParts) +Name[sr]=Радни оквир програма (KParts) +Name[sr@Latn]=Radni okvir programa (KParts) +Name[sv]=Programramverk (KParts) +Name[tr]=Uygulama Çatısı (KParts) +Name[zh_CN]=应用程序框架(KParts) +Name[zh_TW]=應用程式框架(KParts) +Icon=kpartapp.png +Category=C++/KDE +Comment=Generates a complex KDE application with a KParts shell and a KPart component. +Comment[ca]=Genera una complexa aplicació per al KDE amb un intèrpret de comandaments KParts i un component KPart. +Comment[da]=Genererer et komplekst KDE-program med en KParts-skal og en KPart-komponent. +Comment[de]=Erstellt eine aufwändige KDE-Anwendung mit einer Shell für KParts und einer KPart-Komponente. +Comment[el]=Δημιουργεί μια πολύπλοκη εφαρμογή KDE με ένα κέλυφος KParts και ένα συστατικό KPart. +Comment[es]=Genera una aplicación KDE compleja con un contenedor KParts y un componente KPart. +Comment[et]=Keerulise KDE rakenduse loomine KParts-shelliga ja KPart-komponendiga. +Comment[eu]=KDE aplikazio konplexu bat sortzen du KParts shellbat eta KPart osagai batekin. +Comment[fa]=یک کاربرد پیچیدۀ KDE با یک پوستۀ KParts و یک مؤلفۀ KPart تولید می‌کند. +Comment[fr]=Génère une application KDE évoluée comprenant un shell KParts et un composant KPart. +Comment[ga]=Cruthaíonn sé seo feidhmchlár casta KDE le blaosc KParts agus comhpháirt KPart. +Comment[gl]=Xera unha aplicación KDE complexa cun terminal KPart e unha compoñente KPart. +Comment[hu]=Létrehoz egy komplex, objektumok használatát támogató KDE-s alkalmazást és egy KPart objektumot. +Comment[it]=Genera un'applicazione complessa di KDE con una shell di KParts e un componente KPart. +Comment[nds]=Stellt en vigeliensch KDE-Programm mit en Konsool för KPart un en KPart-Komponent op. +Comment[ne]=केडीई भाग शेल र केडीई भाग अवयवसँग जटिल केडीई अनुप्रयोग उत्पन्न गर्दछ । +Comment[nl]=Genereert een complexe KDE-toepassing met een KParts-shell en een KPart-component. +Comment[pl]=Generuje złożony program z powłoką KParts i komponentem KPart. +Comment[pt]=Gera uma aplicação complexa do KDE com uma infra-estrutura de KParts, bem como um componente KPart. +Comment[pt_BR]=Gera uma aplicação complexa do KDE com uma infra-estrutura de KParts, bem como um componente KPart. +Comment[ru]=Создание полноценного приложения KDE на базе компонента KPart. +Comment[sk]=Vygeneruje komplexnú KDE aplikáciu s KParts shell a s KPart komponentom. +Comment[sr]=Прави сложени KDE програм са KParts шкољком и KPart компонентом. +Comment[sr@Latn]=Pravi složeni KDE program sa KParts školjkom i KPart komponentom. +Comment[sv]=Skapar ett komplext KDE-program med ett KPart-skal och en KPart-komponent. +Comment[tr]=Bir KParts kabuğu ve KParts bileşeni olan karmaşık bir KDE uygulaması yaratır. +Comment[zh_CN]=生成一个带 KParts 外壳和 KPart 组件的复杂 KDE 应用程序。 +Comment[zh_TW]=產生一個複雜的 KDE 應用程式,內含 KParts shell 與 KPart 元件。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}_part.cpp +Archive=kpartapp.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-part.desktop +Dest=%{dest}/src/%{APPNAMELC}_part.desktop + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE10] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE11] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE12] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE13] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE14] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE15] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE16] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE17] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE18] +Type=install +Source=%{src}/app_part.cpp +Dest=%{dest}/src/%{APPNAMELC}_part.cpp + +[FILE19] +Type=install +Source=%{src}/app_part.h +Dest=%{dest}/src/%{APPNAMELC}_part.h + +[FILE20] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE21] +Type=install +EscapeXML=true +Source=%{src}/app_part.rc +Dest=%{dest}/src/%{APPNAMELC}_part.rc + +[FILE22] +Type=install +EscapeXML=true +Source=%{src}/app_shell.rc +Dest=%{dest}/src/%{APPNAMELC}_shell.rc + +[MSG] +Type=message +Comment=A complex KDE application using KParts was created in %{dest} +Comment[ca]=Una complexa aplicació per al KDE usant KParts ha estat creada en %{dest} +Comment[da]=Et komplekst KDE-program ved brug af KParts blev oprettet i %{dest} +Comment[de]=Eine aufwändige KDE-Anwendung, die KParts verwendet, wurde in %{dest} erstellt. +Comment[el]=Μια πολύπλοκη εφαρμογή KDE που χρησιμοποιεί το KParts δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación compleja para KDE que usa KParts ha sido creada en %{dest} +Comment[et]=KParts'i kasutav keeruline KDE rakendus loodi asukohta %{dest} +Comment[eu]=KDE aplikazio konplexu bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد پیچیدۀ KDE با استفاده از KParts در %{dest} ایجاد شد +Comment[fr]=Une application KDE évoluée utilisant KParts a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár casta KDE a úsáideann KParts i %{dest} +Comment[gl]=Creouse unha aplicación KDE complexa usando KParts en %{dest} +Comment[hu]=Létrejött egy komplex, objektumok használatát támogató KDE-s alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KDE complessa usando KParts in %{dest} +Comment[ja]=KParts を使った複雑な KDE アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en vigeliensch KDE-Programm opstellt, dat "KParts" bruukt. +Comment[ne]=केडीई भाग प्रयोग गरेर जटिल केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een complexe KDE-toepassing gebruik makend van KParts is aangemaakt in %{dest} +Comment[pl]=Złożony program KDE używający KParts został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação complexa do KDE, que usa o KParts, em %{dest} +Comment[pt_BR]=Foi criada uma aplicação complexa do KDE, que usa o KParts, em %{dest} +Comment[ru]=Приложение KDE на базе компонента KPart создано в %{dest} +Comment[sk]=Komplexná KDE aplikácia používajúca KParts bola vytvorená v %{dest} +Comment[sr]=Сложени KDE програм на основу KParts направљен је у %{dest} +Comment[sr@Latn]=Složeni KDE program na osnovu KParts napravljen je u %{dest} +Comment[sv]=Ett komplext KDE-program som använder KParts skapades i %{dest} +Comment[tr]=KParts kullanan karmaşık bir KDE uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个使用 KParts 的复杂 KDE 应用程序 +Comment[zh_TW]=一個使用 KParts 的複雜 KDE 應用程式已建立於 %{dest} + diff --git a/languages/cpp/app_templates/kpartapp/kpartapp.png b/languages/cpp/app_templates/kpartapp/kpartapp.png new file mode 100644 index 00000000..5834ac9f Binary files /dev/null and b/languages/cpp/app_templates/kpartapp/kpartapp.png differ diff --git a/languages/cpp/app_templates/kpartapp/main.cpp b/languages/cpp/app_templates/kpartapp/main.cpp new file mode 100644 index 00000000..a7c0d2c4 --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/main.cpp @@ -0,0 +1,57 @@ + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE KPart Application"); + +static const char version[] = "%{VERSION}"; + +static KCmdLineOptions options[] = +{ + { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions( options ); + KApplication app; + + // see if we are starting with session management + if (app.isRestored()) + { + RESTORE(%{APPNAME}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + + if ( args->count() == 0 ) + { + %{APPNAME} *widget = new %{APPNAME}; + widget->show(); + } + else + { + int i = 0; + for (; i < args->count(); i++ ) + { + %{APPNAME} *widget = new %{APPNAME}; + widget->show(); + widget->load( args->url( i ) ); + } + } + args->clear(); + } + + return app.exec(); +} diff --git a/languages/cpp/app_templates/kpartapp/src-Makefile.am b/languages/cpp/app_templates/kpartapp/src-Makefile.am new file mode 100644 index 00000000..357e2d0b --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/src-Makefile.am @@ -0,0 +1,53 @@ +# set the include path for X, qt and KDE +INCLUDES = $(all_includes) + +# these are the headers for your project +noinst_HEADERS = %{APPNAMELC}.h %{APPNAMELC}_part.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + +KDE_ICON = AUTO + +# this Makefile creates both a KPart application and a KPart +######################################################################### +# APPLICATION SECTION +######################################################################### +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = %{APPNAMELC} + +# the application source, library search path, and link libraries +%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp +%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries) +%{APPNAMELC}_LDADD = $(LIB_KPARTS) + +# this is where the desktop file will go +shelldesktopdir = $(kde_appsdir)/Utilities +shelldesktop_DATA = %{APPNAMELC}.desktop + +# this is where the shell's XML-GUI resource file goes +shellrcdir = $(kde_datadir)/%{APPNAMELC} +shellrc_DATA = %{APPNAMELC}_shell.rc + +######################################################################### +# KPART SECTION +######################################################################### +kde_module_LTLIBRARIES = lib%{APPNAMELC}part.la + +# the Part's source, library search path, and link libraries +lib%{APPNAMELC}part_la_SOURCES = %{APPNAMELC}_part.cpp +lib%{APPNAMELC}part_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_PLUGIN) $(all_libraries) +lib%{APPNAMELC}part_la_LIBADD = $(LIB_KPARTS) $(LIB_KFILE) + +# this is where the desktop file will go +partdesktopdir = $(kde_servicesdir) +partdesktop_DATA = %{APPNAMELC}_part.desktop + +# this is where the part's XML-GUI resource file goes +partrcdir = $(kde_datadir)/%{APPNAMELC}part +partrc_DATA = %{APPNAMELC}_part.rc diff --git a/languages/cpp/app_templates/kpartapp/subdirs b/languages/cpp/app_templates/kpartapp/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kpartapp/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kpartplugin/.kdev_ignore b/languages/cpp/app_templates/kpartplugin/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kpartplugin/Makefile.am b/languages/cpp/app_templates/kpartplugin/Makefile.am new file mode 100644 index 00000000..170bdd6d --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h \ + plugin_app.rc hi16-action-plugin.png hi22-action-plugin.png \ + kpartplugin.png plugin.kdevelop subdirs + +templateName = kpartplugin + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png b/languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png new file mode 100644 index 00000000..e2d7bab8 Binary files /dev/null and b/languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png differ diff --git a/languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png b/languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png new file mode 100644 index 00000000..4082bf10 Binary files /dev/null and b/languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png differ diff --git a/languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate b/languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate new file mode 100644 index 00000000..f331c6cf --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate @@ -0,0 +1,204 @@ +# KDE Config File +[General] +Name=KHTMLPart plugin +Name[br]=Lugent KHTMLPart +Name[ca]=Connector per a KHTMLPart +Name[de]=KHTMLPart-Modul +Name[el]=Πρόσθετο KHTMLPart +Name[es]=Complemento para KHTMLPart +Name[eu]=KHTMLPart plugina +Name[fa]=وصلۀ KHTMLPart +Name[fr]=Module externe pour le composant KHTML +Name[ga]=Breiseán KHTMLPart +Name[gl]=Extensión para KHTMLPart +Name[hu]=KHTML-bővítőmodul +Name[it]=Plugin KHTMLPart +Name[ja]=KHTMLPart プラグイン +Name[nds]=KHTMLPart-Moduul +Name[ne]=KHTMLPart प्लगइन +Name[nl]=KHTMLPart-plugin +Name[pl]=Wtyczka do KHTMLPart +Name[pt]='Plugin' do KHTMLPart +Name[pt_BR]='Plugin' do KHTMLPart +Name[ru]=Модуль KHTMLPart +Name[sk]=KHTMLPart modul +Name[sl]=Vstavek za KHTMLPart +Name[sr]=Прикључак за део KHTML +Name[sr@Latn]=Priključak za deo KHTML +Name[sv]=Insticksprogram för KHTML-delprogram +Name[tr]=KHTMLPart Eklentisi +Name[zh_CN]=KHTMLPart 插件 +Name[zh_TW]=KHTMLPart 外掛程式 +Icon=kpartplugin.png +Category=C++/KDE +Comment=Generates a plugin for the KHTML part. +Comment[ca]=Genera un connector per a la part KHTML. +Comment[da]=Genererer et plugin for KHTML parten. +Comment[de]=Erstellt ein Modul für die Komponente KHTML +Comment[el]=Δημιουργεί ένα πρόσθετο για το τμήμα KHTML. +Comment[es]=Genera un complemento para KHTMLPart. +Comment[et]=KHTML-komponendi plugina loomine. +Comment[eu]=KHTML zatirako plugin bat sortzen du. +Comment[fa]=یک وصله برای جزء KHTML تولید می‌کند +Comment[fr]=Génère un module externe pour le composant KHTML. +Comment[gl]=Xera unha extensión para o 'part' KHTML. +Comment[hu]=Létrehoz egy KHTML-bővítőmodult. +Comment[it]=Genera un plugin per la part KHTML. +Comment[ja]=KHTML パートのためのプラグインを作成します +Comment[nds]=Stellt en Moduul för de Komponent KHTML op. +Comment[ne]=KHTML भागका लागि प्लगइन उत्पन्न गर्दछ । +Comment[nl]=Genereert een plugin voor de KHTML-part. +Comment[pl]=Generuje wtyczkę do KHTML part. +Comment[pt]=Gera um 'plugin' para a componente KHTML. +Comment[pt_BR]=Gera um 'plugin' para a componente KHTML. +Comment[ru]=Создание модуля для компонента KHTML. +Comment[sk]=Vygeneruje modul pre KHTML part. +Comment[sr]=Прави прикључак за део KHTML. +Comment[sr@Latn]=Pravi priključak za deo KHTML. +Comment[sv]=Skapar ett insticksprogram för KHTML-delprogrammet +Comment[zh_CN]=生成 KHTML 部件的插件。 +Comment[zh_TW]=產生一個 KHTML part 的外掛程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}.cpp +Archive=kpartplugin.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/plugin.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/plugin_app.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/plugin_app.h +Dest=%{dest}/src/plugin_%{APPNAMELC}.h + +[FILE14] +Type=install +EscapeXML=true +Source=%{src}/plugin_app.rc +Dest=%{dest}/src/plugin_%{APPNAMELC}.rc + +[FILE15] +Type=install +Source=%{src}/hi16-action-plugin.png +Dest=%{dest}/src/hi16-action-plugin.png +Process=false + +[FILE16] +Type=install +Source=%{src}/hi22-action-plugin.png +Dest=%{dest}/src/hi32-action-plugin.png +Process=false + +[MSG] +Type=message +Comment=A KHTMLPart plugin was created in %{dest} +Comment[ca]=Un connector per a KHTMLPart ha estat creat en %{dest} +Comment[da]=Et KHTMLPart plugin blev oprettet i %{dest} +Comment[de]=Ein Modul für die Komponente KHTML wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο τμήμα KHTML δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento para KHTMLPart ha sido creado en %{dest} +Comment[et]=KHTMLPart plugin loodi asukohta %{dest} +Comment[eu]=KHTMLPart plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ جزء KHTML در %{dest} ایجاد شد +Comment[fr]=Un module externe pour KHTMLPart a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán KHTMLPart i %{dest} +Comment[gl]=Creouse unha extensión para KHTMLPart en %{dest} +Comment[hu]=Létrejött egy KHTML-bővítőmodul itt: %{dest} +Comment[it]=È stato creato un plugin KHTMLPart in %{dest} +Comment[ja]=KHTMLPart プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KHTMLPart-Moduul opstellt +Comment[ne]=KHTMLPart प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een KHTMLPart-plugin is aangemaakt in %{dest} +Comment[pl]=Wtyczka do KHTMLPart została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' KHTMLPart em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' KHTMLPart em %{dest} +Comment[ru]=Модуль для компонента KHTML создан в %{dest} +Comment[sk]=KHTML modul bol vytvorený v %{dest} +Comment[sr]=Прикључак за део KHTML направљен је у %{dest} +Comment[sr@Latn]=Priključak za deo KHTML napravljen je u %{dest} +Comment[sv]=Ett insticksprogram för KHTML-delprogrammet skapades i %{dest} +Comment[tr]=Bir KHTMLPart eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 KHTMLPart 插件 +Comment[zh_TW]=一個 KHTML 外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kpartplugin/kpartplugin.png b/languages/cpp/app_templates/kpartplugin/kpartplugin.png new file mode 100644 index 00000000..7d90241a Binary files /dev/null and b/languages/cpp/app_templates/kpartplugin/kpartplugin.png differ diff --git a/languages/cpp/app_templates/kpartplugin/plugin.kdevelop b/languages/cpp/app_templates/kpartplugin/plugin.kdevelop new file mode 100644 index 00000000..dc1b3e25 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/plugin.kdevelop @@ -0,0 +1,114 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/lib%{APPNAMELC}.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kpartplugin/plugin_app.cpp b/languages/cpp/app_templates/kpartplugin/plugin_app.cpp new file mode 100644 index 00000000..a9ee55a3 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/plugin_app.cpp @@ -0,0 +1,109 @@ + +#include "plugin_%{APPNAMELC}.h" + +#include +#include +#include +#include +#include +#include + +Plugin%{APPNAME}::Plugin%{APPNAME}( QObject* parent, const char* name ) + : Plugin( parent, name ) +{ + // Instantiate all of your actions here. These will appear in + // Konqueror's menu and toolbars. + (void) new KAction( i18n("&Plugin Action"), "%{APPNAMELC}", 0, + this, SLOT(slotAction()), + actionCollection(), "plugin_action" ); +} + +Plugin%{APPNAME}::~Plugin%{APPNAME}() +{ +} + +void Plugin%{APPNAME}::slotAction() +{ + // This plugin assumes KHTMLPart. If your plugin can handle more + // than this or a different Part than this, simply delete or + // change the following block. + if ( !parent()->inherits("KHTMLPart") ) + { + QString title( i18n( "Cannot Translate Source" ) ); + QString text( i18n( "You cannot translate anything except web pages " + "with this plugin." ) ); + + KMessageBox::sorry( 0, text, title ); + return; + } + + // Get a handle on our parent so we may get the necessary data for + // processing + KHTMLPart *part = dynamic_cast(parent()); + + // This plugin only uses the URL. You may use whatever data you + // need. + KURL url( part->url() ); + + // This is a standard check to make sure we are dealing with a + // valid URL + if ( !url.isValid() ) + { + QString title( i18n( "Malformed URL" ) ); + QString text( i18n( "The URL you entered is not valid, please " + "correct it and try again" ) ); + + KMessageBox::sorry( 0, text, title ); + return; + } + +// The following block is very plugin specific. In this example, we +// translate the current page with AltaVista's BabelFish. You will +// definitely want to change this. +// BEGIN + KURL work( "http://babel.altavista.com/translate.dyn" ); + + QString query( "urltext=" ); + query += KURL::encode_string( url.url() ); + work.setQuery( query ); +// END + + // Finally, execute the request + part->openURL( work ); +} + +%{APPNAME}Factory::%{APPNAME}Factory() + : KLibFactory() +{ +} + +%{APPNAME}Factory::~%{APPNAME}Factory() +{ + delete s_instance; + s_instance = 0; +} + +QObject* %{APPNAME}Factory::createObject( QObject* parent, const char* name, const char*, const QStringList & ) +{ + return new Plugin%{APPNAME}( parent, name ); +} + +KInstance *%{APPNAME}Factory::instance() +{ + if ( !s_instance ) + s_instance = new KInstance( "%{APPNAMELC}" ); + return s_instance; +} + +extern "C" +{ + void* init_lib%{APPNAMELC}plugin() + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}Factory; + } +} + +KInstance* %{APPNAME}Factory::s_instance = 0L; + +#include "plugin_%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/kpartplugin/plugin_app.h b/languages/cpp/app_templates/kpartplugin/plugin_app.h new file mode 100644 index 00000000..e70ad1c1 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/plugin_app.h @@ -0,0 +1,34 @@ + +#ifndef _PLUGIN_%{APPNAMEUC}_H_ +#define _PLUGIN_%{APPNAMEUC}_H_ + +#include +#include + +class Plugin%{APPNAME} : public KParts::Plugin +{ + Q_OBJECT +public: + Plugin%{APPNAME}( QObject* parent = 0, const char* name = 0 ); + virtual ~Plugin%{APPNAME}(); + +public slots: + void slotAction(); +}; + +class %{APPNAME}Factory : public KLibFactory +{ + Q_OBJECT +public: + %{APPNAME}Factory(); + virtual ~%{APPNAME}Factory(); + + virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, const char* name = "QObject", const QStringList &args = QStringList() ); + + static KInstance* instance(); + +private: + static KInstance* s_instance; +}; + +#endif // _PLUGIN_%{APPNAMEUC}_H_ diff --git a/languages/cpp/app_templates/kpartplugin/plugin_app.rc b/languages/cpp/app_templates/kpartplugin/plugin_app.rc new file mode 100644 index 00000000..a38ee14e --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/plugin_app.rc @@ -0,0 +1,11 @@ + + + + &Tools + + + + + + + diff --git a/languages/cpp/app_templates/kpartplugin/src-Makefile.am b/languages/cpp/app_templates/kpartplugin/src-Makefile.am new file mode 100644 index 00000000..52e29c09 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/src-Makefile.am @@ -0,0 +1,22 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +KDE_ICON = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = lib%{APPNAMELC}plugin.la + +# This is all standard. Remove the LIB_KHTML reference if you are not +# using the KHTML Part +lib%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp +lib%{APPNAMELC}plugin_la_LIBADD = $(LIB_KPARTS) $(LIB_KHTML) +lib%{APPNAMELC}plugin_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_PLUGIN) $(all_libraries) + +# Install the .rc file in the Part's directory (in this case, the part +# is KHTMLPart) +pluginsdir = $(kde_datadir)/khtml/kpartplugins +plugins_DATA = plugin_%{APPNAMELC}.rc + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/kpartplugin/subdirs b/languages/cpp/app_templates/kpartplugin/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kscons_kmdi/INSTALL b/languages/cpp/app_templates/kscons_kmdi/INSTALL new file mode 100644 index 00000000..edeed594 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/INSTALL @@ -0,0 +1,83 @@ +REQUIREMENTS +------------ + +* KDE headers & libraries for kdelibs +* A Python interpreter for the compilation + +scons v0.96.1 or newer is recommended, but it's not required since a +minimum scons distribution is included in the package. + +BUILDING AND INSTALLING +----------------------- + +For configuring, compiling and installing the application and +if you do have Scons 0.96.1 or newer installed, just run: + +$ scons +$ scons install (as root user) + +In case you don't have Scons installed, you can use +the accompanying minimum scons by running: + +$ tar xjvf admin/scons-mini.tar.bz2 +$ ./scons +$ ./scons install + +ADVANCED BUILD FEATURES & DEINSTALLING +-------------------------------------- + +In case you want to execute many compilation jobs in parallel (because you +want to make use of a SMP system or a compile cluster, for instance), +you can use ('N' is the number of jobs which should be run in parallel): + +$ scons -jN + +A debug build of the program can be created by running: + +$ scons configure debug=1 +$ scons + +Finally, the software can be removed from your system by running + +$ scons -c install + +CONFIGURATION NOTES +------------------- + +The installation scripts are relying on the kde-config program. +The programs kde-config, qmake, uic and moc must be accesssible +through your PATH. + +Qt and kde may not be installed as expected (in QTDIR and KDEDIR) +So until kde-config is able to give that information, you may +have to give those paths. You may also want to tune the build. + +In these cases, you must first run "scons configure" with some options +before running "scons" and "scons install" + +Here are some examples : +On Fedora/Redhat +$ scons configure kdeincludes=/usr/include/kde/ +On Debian +$ scons configure qtincludes=/usr/include/qt/ kdeinclude=/usr/include/kde/ +To install in some particular location with additional include paths +$ scons configure prefix=~/tmp extraincludes=/tmp/include:/usr/local/include +For AMD64 and platforms where folders are like /usr/lib64 +$ scons configure libsuffix=64 + +For more options, run +scons --help + +The build system is based on bksys, a build system that replaces +autoconf, automake and make in a row. Feel free to report your opinion +about it to the bksys authors. + +PACKAGE CREATION +---------------- + +RPM packagers can use the DESTDIR environment variable +$ DESTDIR=/tmp/build-rpm/ scons install + +To use checkinstall, pass the following option +$ checkinstall --fstrans=no --nodoc scons install + diff --git a/languages/cpp/app_templates/kscons_kmdi/Makefile.am b/languages/cpp/app_templates/kscons_kmdi/Makefile.am new file mode 100644 index 00000000..aa6d9b53 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/Makefile.am @@ -0,0 +1,21 @@ +dataFiles = app.kcfg app.kdevelop appkmdi.cpp appkmdi.h appkmdiView.cpp \ +appkmdiView.h INSTALL kmdikonsole.cpp kmdikonsole.h main.cpp \ +messages.sh prefs.ui QUICKSTART README SConscript-doc SConscript-src \ +SConstruct settings.kcfgc tips VERSION \ +app_part.cpp app_part.h app_part.rc app_shell.rc + +templateName= kscons_kmdi + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/kscons_kmdi/QUICKSTART b/languages/cpp/app_templates/kscons_kmdi/QUICKSTART new file mode 100644 index 00000000..ceaf1bda --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/QUICKSTART @@ -0,0 +1,164 @@ +------------------------------------------ +SUMMARY : + +scons +scons install + + +The online documentation of bksys can be found at: +http://freehackers.org/~tnagy/bksys_manual.html + + ... and now for the quickstart: + +CONFIGURING AND COMPILING THE PROJECT(S) +SCONS TIPS +MOC PROCESSING +SCONS MINIMUM DISTRIBUTION +MORE TIPS + +------------------------------------------ +CONFIGURING AND COMPILING THE PROJECT(S) + +The program scons is usually launched as "scons" +When it is not intalled globally, one can run +"./scons" instead of "scons" (ie : to use the local scons +that comes with bksys - see below SCONS MINIMUM DISTRIBUTION +if you do not have scons already) + +To compile the project, you will then only need to launch +scons on the top-level directory, the scripts find and +cache the environment detected *automatically* : +-> scons + +To clean the project -> scons -c + +To install the project -> scons install +To install as root user -> su -c 'scons install' +To uninstall the project -> scons -c install +To uninstall (as root) -> su -c 'scons -c install' +To consult the help -> scons -h + +To (re)configure the project and give particular arguments, use : + -> scons configure debug=1 + +The variables are saved automatically after the first run +in files named *.cache.py (look at kde.cache.py, ..) + +------------------------------------------ +SCONS TIPS + +In a subdirectory, it is necessary to launch scons with the -u flag : +scons -u + +This is annoying and you probably want to add this to your .bashrc +export SCONSFLAGS=-u +and forget about it :) + +To make .deb or .rpm packages of your program, use : +checkinstall --fstrans=no --nodoc scons install +(if you have checkinstall on your system of course) + +To make scons run (much) faster, consult ./addons/README in bksys + +------------------------------------------ +MOC PROCESSING + +In qt programs, when a header 'foo.h' contains a class that has +signals and slots, then 'foo.h' must contain the macro Q_OBJECT +in order to compile. foo_moc.cpp is usually generated, and is +used to produce foo_moc.o which is linked with the +program or the library. + +In kde programs, 'foo.moc' is generated instead of foo_moc.cpp, +and it must be included at the very end of foo.cpp +(add #include "foo.moc" : this increases the speed of +compilation a *lot* and makes less object files. + +Both modes are provided though, see test6-mocfiesta/ + +------------------------------------------ +MINIMUM SCONS DISTRIBUTION + +A minimum scons distribution is included in the archive +for convenience to those who do not have scons packages +for their operating system or their linux +distribution. For a full and more recent version of scons, +please consult http://www.scons.org + +Including this scons distribution to your archive will add +about 63kb (compressed) , while including the necessary +kdescripts (admin/ directory, configure, autom4 cache stuff, +Makefile.in) can add easily 500kb (compressed). + +To compile with the scons distribution : +* unpack it with : + tar xjvf admin/scons-mini.tar.bz2 +* compile the program with : + ./scons (instead of just 'scons') +* install the program with : + ./scons install (instead of just 'scons install') + +More options : +* clean the object files with : + ./scons -c +* uninstall the program with with : + ./scons -c install +* create a package : + ./scons dist + +------------------------------------------ +MORE TIPS + +** static libraries ** +With Makefile.am, one had to make static libraries all the time +because it did not allow having source code in other directories. +This is not the case anymore with scons, so you can specify +sources in other directories relative to the sconscript file, ie: + test1_sources = ['mainfiles/main.cpp', 'otherfile/program.cpp'] + myenv.Program( target = "test1", source = test1_sources ) +To encourage you to switch to the new scheme, the static library +helper has been omitted (look at the end of kde.py if you need one) + +** libtool ** +The LaFile build tool is a cheat that allows klibloader to load +.so files without complaints. If you need real libtool support +you can have a look to the libtool directory : it can work but +remember that libtool is broken on many systems (invalid flags +among others), so when you can work without libtool +(small projects especially), just do it. + +** moc processing ** +As stated above, you should always add #include "foo.moc" +for your qt classes (Q_OBJECT) to save precious compilation time. + +** using a cache ** +It is a good idea to enable the cache feature in SConstruct, +especially if you are doing experiments (it saves your computer +from recompiling the same files over and over again ..). + +** threading ** +myenv.AppendUnique( CPPFLAGS = ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] ) + +** final notes *** +A medium-sized project containing several targets, libraries and data +files can be converted very quickly. +Also, remember that SConscript files are actually python scripts .. +you can use whatever python feature you want in them, ie: "for" loops, +this is how the kde helpers work (KDEprogram, KDEshlib ..). + +If you are stuck, you can also have a look at more complicated +bksys-based projects like kdissert or kshaderdesigner + +The scons man page and the wiki can be very useful, do not forget to +consult them when you encounter an issue + +------------------------------------------ + +I hope you will enjoy this alternative to the autotools +scripts for kde programming, at least as much as I do : +http://freehackers.org/~tnagy/kdissert/index.html + +Happy kde hacking, + +Thomas Nagy, 2004, 2005 + diff --git a/languages/cpp/app_templates/kscons_kmdi/README b/languages/cpp/app_templates/kscons_kmdi/README new file mode 100644 index 00000000..8085c7e7 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/README @@ -0,0 +1,111 @@ +----------------------------------------------- +Kde scons template quickstart +Author: Thomas Nagy +Date: 2005-04-04 +----------------------------------------------- + +This README file explains basic concepts necessary +for starting with this application template. + + +** Building and installing ** + +* To configure the application run "scons configure" + In some rare cases you may need to add flags: + scons configure qtincludes=/usr/include/qt3/include kdeincludes=/usr/lib/kde3/include + +* After building, launch the application and test the dcop + interface by using the command (search a bit) : + dcop + dcop appname-... + dcop appname-... instancenumber + dcop appname-... instancenumber switch_colors + dcop appname switch_colors + Or launch kdcop and search in the menus for your program + name and double-click on 'switch_colors()' + +* The usual targets call the following scons commands : + make -> scons + make clean -> scons -c + make install -> scons install + make uninstall -> scons -c install + make dist -> scons dist + +* To build apps, use KDEprogram, KDEshlib, etc. + these functions are documented at the bottom of kde.py + More information can be found in the QUICKSTART + +* The scons scripts for building kde applications originate + from the 'bksys' distribution. It contains several other examples + that detail the kpart building and the dcop interface + processing : + http://www.kde-apps.org/content/show.php?content=19243 + +* Extending the scons scripts for building the application : + The scons scripts are actually python scripts, so all the + usual tricks apply : 'for' and 'while' loops, 'if', 'else' .. + consult : + http://www.python.org for more information about python + http://www.scons.org for more informationabout scons + +* Simplify your life : install the project in your home directory for +testing purposes. +scons configure prefix=/home/user/dummyfolder/ +In the end when you finished the development you can +rm -rf /home/user/dummyfolder/ +without fear. + + +** Technologies ** + +* Build the menus of your application easily +kde applications now use an xml file (*ui.rc file) to build the menus. +This allow a great customization of the application. However, when +programming the menu is shown only after a "make install" + +For more details, consult : +http://devel-home.kde.org/~larrosa/tutorial/p9.html +http://developer.kde.org/documentation/tutorials/xmlui/preface.html + +* Use KConfig XT to create your configuration dialogs and make +them more maintainable. + +For that, you will need to write two simple configuration files +in the src directory : .kcfg and a .kcfgc +The configure.in.in will need to be modified : change the line #MIN_CONFIG(3.0.0) +into #MIN_CONFIG(3.2.0) + +Take an example on the many apps found in the kdegames source package and consult : +http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html + +* With KParts, you can embed other kde components in your program, or make your program +embeddable in other apps. For example, the kmplayer kpart can be called to play videos +in your app. + +For more details, consult : +http://www-106.ibm.com/developerworks/library/l-kparts/ +http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html +http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html + +* With dcop, you can control your app from other applications +Make sure to include K_DCOP and a kdcop: section in your .h file +http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html + + +** Documentation ** + +* For the translations : +refer to the file po/SConscript and po/messages.sh + +1. Download a patched gettext which can be found at: + http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/ +2. Install that gettext in ~/bin/ +3. cd ~/yourproject, export PATH=~/bin:$PATH, export +KDEDIR=/where_your_KDE3_is +4. make -f admin/Makefile.common package-messages +5. make package-messages +6. Translate the po files (not the pot!!) with kbabel or xemacs + +* Do not forget to write the documentation for your kde app +edit the documentation template index.docbook in doc/ + diff --git a/languages/cpp/app_templates/kscons_kmdi/SConscript-doc b/languages/cpp/app_templates/kscons_kmdi/SConscript-doc new file mode 100644 index 00000000..6769a359 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/SConscript-doc @@ -0,0 +1,92 @@ +#! /usr/bin/env python +## This script demonstrates to build and install +## the documentation of a kde program with scons +## +## Thomas Nagy, 2005 + +## This file can be reused freely for any project (see COPYING) + +## First load the environment set in the top-level SConstruct file +Import( 'env' ) +myenv=env.Copy() + +## The following looks complicated but it is not +## We first define a function to install all files as documentation +## The documentation is of course lying in subfolders from here +## * normal files are installed under KDEDOC/destination +## * meinproc files are not installed, but processed into a single +## index.cache.bz2 which is installed afterwards + +## This is far more maintainable to have *one* file than +## having lots of almost empty SConscript in several folders + +################################################################### +# COMMON PART FOR PROCESSING DOCUMENTATION FOLDERS +################################################################### + +import os +import sys +import glob +import SCons.Util + +## Define this to 1 if you are writing documentation else to 0 :) +i_am_a_documentation_writer = 0 + +## This function uses env imported above +def processfolder(folder, lang, destination=""): + # folder is the folder to process + # lang is the language + # destination is the subdirectory in KDEDOC + + docfiles = glob.glob(folder+"/???*.*") # file files that are at least 4 chars wide :) + + # warn about errors + #if len(lang) != 2: + # print "error, lang must be a two-letter string, like 'en'" + + # when the destination is not given, use the folder + if len(destination) == 0: + destination=folder + + docbook_list = [] + for file in docfiles: + + # do not process folders + if not os.path.isfile(file): + continue + # do not process the cache file + if file == 'index.cache.bz2': + continue + # ignore invalid files (TODO??) + if len( SCons.Util.splitext( file ) ) <= 1 : + continue + + ext = SCons.Util.splitext( file )[1] + + # docbook files are processed by meinproc + if ext == '.docbook': + docbook_list.append( file ) + continue + + myenv.KDEinstall('KDEDOC', lang+'/'+destination, file) + + # Now process the index.docbook files .. + if len(docbook_list) == 0: + return + if not os.path.isfile( folder+'/index.docbook' ): + print "Error, index.docbook was not found in "+folder+'/index.docbook' + return + if i_am_a_documentation_writer: + for file in docbook_list: + myenv.Depends( folder+'index.cache.bz2', file ) + myenv.Meinproc( folder+'/index.cache.bz2', folder+'/index.docbook' ) + myenv.KDEinstall( 'KDEDOC', lang+'/'+destination, folder+'/index.cache.bz2' ) + +################################################################### +# TELL WHICH FOLDERS TO PROCESS +################################################################### + +## Use processfolder for each documentation directory +processfolder('en/', 'en', '%{APPNAMELC}') +processfolder('fr/', 'fr', '%{APPNAMELC}') + diff --git a/languages/cpp/app_templates/kscons_kmdi/SConscript-src b/languages/cpp/app_templates/kscons_kmdi/SConscript-src new file mode 100644 index 00000000..746cdf98 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/SConscript-src @@ -0,0 +1,60 @@ +#! /usr/bin/env python +## This script is a quick test to demonstrate (and test) +## the bksys moc handling '#include "file.moc"' can be added .. or not +## +## Thomas Nagy, 2005 +## This file can be reused freely for any project (see COPYING) + +Import('env') +myenv=env.Copy() + +## First build : the shell +## Each tab in it will hold an instance of the part .. + +%{APPNAMELC}_sources=""" +main.cpp +%{APPNAMELC}kmdi.cpp +%{APPNAMELC}kmdiView.cpp +kmdikonsole.cpp +settings.kcfgc +prefs.ui +""" +# Now that we have our list of sources we can build the program +myenv.KDEprogram( '%{APPNAMELC}', %{APPNAMELC}_sources ) # main program +myenv.KDEaddpaths_includes( './ ../' ) # additional paths +myenv.KDEaddlibs( 'qt-mt kdecore kio kparts kmdi' ) # additional libraries + +## Next, the kpart library +## using KDEshlib, the .so and .la are installed automatically when needed + +myenv2=env.Copy() +%{APPNAMELC}part_sources = '%{APPNAMELC}_part.cpp' +myenv2.KDEshlib( 'lib%{APPNAMELC}part', %{APPNAMELC}part_sources) +myenv2.KDEaddpaths_includes( './ #/' ) # the '#' means the top-level directory +myenv2.KDEaddlibs( 'qt-mt kio kdecore kdeprint kparts' ) +# myenv2.KDEaddflags_link( '-DQT_THREAD_SUPPORT' ) + +############################# +## Data files to install + +## NOTE: KDEinstall( resource_type, subdir, list of files ) + +## the .kcfg file +myenv.KDEinstall( 'KDEKCFG', '', '%{APPNAMELC}.kcfg' ) + +## the program .desktop file +myenv.KDEinstall( 'KDEMENU', '/Utilities', '%{APPNAMELC}.desktop' ) + +## the rc file - named *_shell.rc instead of *ui.rc for kpart apps +myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}', '%{APPNAMELC}_shell.rc' ) + +## this servicetype desktop file goes in KDEXDG whether the other one goes in KDEMENU +myenv.KDEinstall( 'KDEXDG', '', '%{APPNAMELC}_part.desktop' ) + +## the kpart resource file +myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}part', '%{APPNAMELC}_part.rc' ) + +## Installing icons is easy (hi-16-app-%{APPNAMELC}.png, hi-22-app-%{APPNAMELC}.png) +#myenv.KDEicon() + +## do not forget that this is a python script so even loops are allowed... :) diff --git a/languages/cpp/app_templates/kscons_kmdi/SConstruct b/languages/cpp/app_templates/kscons_kmdi/SConstruct new file mode 100644 index 00000000..b82de4e1 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/SConstruct @@ -0,0 +1,112 @@ +#! /usr/bin/env python + +""" +help -> scons -h +compile -> scons +clean -> scons -c +install -> scons install +uninstall -> scons -c install +configure -> scons configure prefix=/tmp/ita debug=full extraincludes=/usr/local/include:/tmp/include prefix=/usr/local + +Run from a subdirectory -> scons -u +The variables are saved automatically after the first run (look at cache/kde.cache.py, ..) +""" + +################################################################### +# LOAD THE ENVIRONMENT AND SET UP THE TOOLS +################################################################### + +## Load the builders in config +env = Environment( tools=['default', 'generic', 'kde'], toolpath=['./', './admin']) +#env = Environment( tools=['default', 'generic', 'kde', 'othertool'], toolpath=['./', './admin']) + +env.KDEuse("environ rpath") +#env.KDEuse("environ rpath lang_qt thread nohelp") + +################################################################### +# SCRIPTS FOR BUILDING THE TARGETS +################################################################### + +dirs=""" +src +doc +""" +env.subdirs(dirs) + +## Process the translations in the po/ directory +env.KDElang('po/', '%{APPNAMELC}') + +################################################################### +# CONVENIENCE FUNCTIONS TO EMULATE 'make dist' and 'make distclean' +################################################################### + +### To make a tarball of your masterpiece, use 'scons dist' +if 'dist' in COMMAND_LINE_TARGETS: + + ## The target scons dist requires the python module shutil which is in 2.3 + env.EnsurePythonVersion(2, 3) + + import os + APPNAME = 'bksys' + VERSION = os.popen("cat VERSION").read().rstrip() + FOLDER = APPNAME+'-'+VERSION + ARCHIVE = FOLDER+'.tar.bz2' + + ## If your app name and version number are defined in 'version.h', use this instead: + ## (contributed by Dennis Schridde devurandom@gmx@net) + #import re + #INFO = dict( re.findall( '(?m)^#define\s+(\w+)\s+(.*)(?<=\S)', open(r"version.h","rb").read() ) ) + #APPNAME = INFO['APPNAME'] + #VERSION = INFO['VERSION'] + + import shutil + import glob + + ## check if the temporary directory already exists + if os.path.isdir(FOLDER): + shutil.rmtree(FOLDER) + if os.path.isfile(ARCHIVE): + os.remove(ARCHIVE) + + ## create a temporary directory + startdir = os.getcwd() + shutil.copytree(startdir, FOLDER) + + ## remove our object files first + os.popen("find "+FOLDER+" -name \"*cache*\" | xargs rm -rf") + os.popen("find "+FOLDER+" -name \"*.pyc\" | xargs rm -f") + #os.popen("pushd %s && scons -c " % FOLDER) # TODO + + ## CVS cleanup + os.popen("find "+FOLDER+" -name \"CVS\" | xargs rm -rf") + os.popen("find "+FOLDER+" -name \".cvsignore\" | xargs rm -rf") + + ## Subversion cleanup + os.popen("find %s -name .svn -type d | xargs rm -rf" % FOLDER) + + ## GNU Arch cleanup + os.popen("find "+FOLDER+" -name \"{arch}\" | xargs rm -rf") + os.popen("find "+FOLDER+" -name \".arch-i*\" | xargs rm -rf") + + ## Create the tarball (coloured output) + print "\033[92m"+"Writing archive "+ARCHIVE+"\033[0m" + os.popen("tar cjf "+ARCHIVE+" "+FOLDER) + + ## Remove the temporary directory + if os.path.isdir(FOLDER): + shutil.rmtree(FOLDER) + + env.Default(None) + env.Exit(0) + +### Emulate "make distclean" +if 'distclean' in COMMAND_LINE_TARGETS: + ## Remove the cache directory + import os, shutil + if os.path.isdir(env['CACHEDIR']): + shutil.rmtree(env['CACHEDIR']) + os.popen("find . -name \"*.pyc\" | xargs rm -rf") + + env.Default(None) + env.Exit(0) + diff --git a/languages/cpp/app_templates/kscons_kmdi/VERSION b/languages/cpp/app_templates/kscons_kmdi/VERSION new file mode 100644 index 00000000..2e293c30 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/VERSION @@ -0,0 +1 @@ +%{VERSION} diff --git a/languages/cpp/app_templates/kscons_kmdi/app.kcfg b/languages/cpp/app_templates/kscons_kmdi/app.kcfg new file mode 100644 index 00000000..f2c46b64 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/app.kcfg @@ -0,0 +1,12 @@ + + + + + + true + + + diff --git a/languages/cpp/app_templates/kscons_kmdi/app.kdevelop b/languages/cpp/app_templates/kscons_kmdi/app.kdevelop new file mode 100644 index 00000000..e6a14fff --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/app.kdevelop @@ -0,0 +1,169 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + . + false + + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + false + + + + + + + false + 1 + false + + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + true + false + false + true + + + false + true + + + + + + + + + + + + -f + + -dP + + -f + -u3 -p + + + + + + + false + + + .h + .cpp + true + + + + true + 2 + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.cpp b/languages/cpp/app_templates/kscons_kmdi/app_part.cpp new file mode 100644 index 00000000..71155138 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/app_part.cpp @@ -0,0 +1,159 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}_part.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +typedef KParts::GenericFactory<%{APPNAMELC}Part> %{APPNAMELC}PartFactory; +K_EXPORT_COMPONENT_FACTORY( lib%{APPNAMELC}part, %{APPNAMELC}PartFactory ); + +%{APPNAMELC}Part::%{APPNAMELC}Part( QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, const QStringList & /*args*/) + : KParts::ReadWritePart(parent) +{ + // we need an instance + setInstance( %{APPNAMELC}PartFactory::instance() ); + + // this should be your custom internal widget + m_widget = new QMultiLineEdit( parentWidget, widgetName ); + + // notify the part that this is our internal widget + setWidget(m_widget); + + // create our actions + KStdAction::open(this, SLOT(fileOpen()), actionCollection()); + KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); + KStdAction::save(this, SLOT(save()), actionCollection()); + + // set our XML-UI resource file + setXMLFile("%{APPNAMELC}_part.rc"); + + // we are read-write by default + setReadWrite(true); + + // we are not modified since we haven't done anything yet + setModified(false); +} + +%{APPNAMELC}Part::~%{APPNAMELC}Part() +{ +} + +KAboutData *%{APPNAMELC}Part::createAboutData() +{ + // The non-i18n name here must be the same as the directory in + // which the part's rc file is installed + KAboutData *aboutData = new KAboutData("%{APPNAMELC}part", I18N_NOOP("%{APPNAMELC}Part"), "0.0.1"); + aboutData->addAuthor("%{AUTHOR}", 0, "%{EMAIL}"); + return aboutData; +} + +void %{APPNAMELC}Part::setReadWrite(bool rw) +{ + // notify your internal widget of the read-write state + m_widget->setReadOnly(!rw); + if (rw) + connect(m_widget, SIGNAL(textChanged()), + this, SLOT(setModified())); + else + { + disconnect(m_widget, SIGNAL(textChanged()), + this, SLOT(setModified())); + } + + ReadWritePart::setReadWrite(rw); +} + +void %{APPNAMELC}Part::setModified(bool modified) +{ + // get a handle on our Save action and make sure it is valid + KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save)); + if (!save) + return; + + // if so, we either enable or disable it based on the current + // state + if (modified) + save->setEnabled(true); + else + save->setEnabled(false); + + // in any event, we want our parent to do it's thing + ReadWritePart::setModified(modified); +} + +bool %{APPNAMELC}Part::openFile() +{ + // m_file is always local so we can use QFile on it + QFile file(m_file); + if (file.open(IO_ReadOnly) == false) + return false; + + // our example widget is text-based, so we use QTextStream instead + // of a raw QDataStream + QTextStream stream(&file); + QString str; + while (!stream.eof()) + str += stream.readLine() + "\n"; + + file.close(); + + // now that we have the entire file, display it + m_widget->setText(str); + + // just for fun, set the status bar + emit setStatusBarText( m_url.prettyURL() ); + + return true; +} + +bool %{APPNAMELC}Part::saveFile() +{ + // if we aren't read-write, return immediately + if (isReadWrite() == false) + return false; + + // m_file is always local, so we use QFile + QFile file(m_file); + if (file.open(IO_WriteOnly) == false) + return false; + + // use QTextStream to dump the text to the file + QTextStream stream(&file); + stream << m_widget->text(); + + file.close(); + + return true; +} + +void %{APPNAMELC}Part::fileOpen() +{ + // this slot is called whenever the File->Open menu is selected, + // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar + // button is clicked + QString file_name = KFileDialog::getOpenFileName(); + + if (file_name.isEmpty() == false) + openURL(file_name); +} + +void %{APPNAMELC}Part::fileSaveAs() +{ + // this slot is called whenever the File->Save As menu is selected, + QString file_name = KFileDialog::getSaveFileName(); + if (file_name.isEmpty() == false) + saveAs(file_name); +} + +#include "%{APPNAMELC}_part.moc" diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.h b/languages/cpp/app_templates/kscons_kmdi/app_part.h new file mode 100644 index 00000000..e1dd002b --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/app_part.h @@ -0,0 +1,74 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}PART_H_ +#define _%{APPNAMEUC}PART_H_ + +#include +#include + +class QMultiLineEdit; +class QWidget; +class QPainter; +class KURL; +class KAboutData; + +/** + * This is a "Part". It that does all the real work in a KPart + * application. + * + * @short Main Part + * @author %{AUTHOR} + * @version %{VERSION} + */ +class %{APPNAMELC}Part : public KParts::ReadWritePart +{ + Q_OBJECT +public: + /** + * Default constructor + */ + %{APPNAMELC}Part(QWidget *parentWidget, const char *widgetName, + QObject *parent, const char *name, const QStringList & /*args*/); + + /** + * Destructor + */ + virtual ~%{APPNAMELC}Part(); + + /** + * This is a virtual function inherited from KParts::ReadWritePart. + * A shell will use this to inform this Part if it should act + * read-only + */ + virtual void setReadWrite(bool rw); + + /** + * Reimplemented to disable and enable Save action + */ + virtual void setModified(bool modified); + + /** + * About data for the part + */ + static KAboutData *createAboutData(); + +protected: + /** + * This must be implemented by each part + */ + virtual bool openFile(); + + /** + * This must be implemented by each read-write part + */ + virtual bool saveFile(); + +protected slots: + void fileOpen(); + void fileSaveAs(); + +private: + QMultiLineEdit *m_widget; +}; + +#endif // _%{APPNAMEUC}PART_H_ diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.rc b/languages/cpp/app_templates/kscons_kmdi/app_part.rc new file mode 100644 index 00000000..cec8ec5c --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/app_part.rc @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/languages/cpp/app_templates/kscons_kmdi/app_shell.rc b/languages/cpp/app_templates/kscons_kmdi/app_shell.rc new file mode 100644 index 00000000..c8b2bb98 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/app_shell.rc @@ -0,0 +1,33 @@ + + + + &File + + + + + + + + &View + + &Settings + + + + + + + + + + + + +Main Toolbar + + + + + + diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp b/languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp new file mode 100644 index 00000000..be5d8862 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp @@ -0,0 +1,394 @@ +%{CPP_TEMPLATE} + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "settings.h" +#include "prefs.h" +#include "%{APPNAMELC}kmdiView.h" +#include "kmdikonsole.h" +#include "%{APPNAMELC}kmdi.h" + +%{APPNAMELC}kmdi::%{APPNAMELC}kmdi(KMdi::MdiMode mode) + : KMdiMainFrm( 0, "%{APPNAMELC}", mode ) +{ + resize( 800, 600 ); // start at 800x600 the first time + + setManagedDockPositionModeEnabled(true); + setStandardMDIMenuEnabled(false); + + m_manager = new KParts::PartManager(this); + connect(m_manager, SIGNAL(activePartChanged(KParts::Part*)), + this, SLOT(createGUI(KParts::Part*)) ); + +#if KDE_IS_VERSION(3, 3, 0) + setToolviewStyle( KMdi::TextAndIcon ); + tabWidget()->setHoverCloseButton( false ); +#endif + + setMenuForSDIModeSysButtons( menuBar() ); + setManagedDockPositionModeEnabled(true); + + m_console = NULL; + + // accept dnd + setAcceptDrops(true); + + // then, setup our actions + setupActions(); + + //createShellGUI( true ); + + // and a status bar + statusBar()->show(); + + connect( this, SIGNAL( viewActivated( KMdiChildView * ) ), this, SLOT( currentChanged( KMdiChildView * ) ) ); + + m_console = new kmdikonsole(this, "konsole"); + m_console->setIcon( SmallIcon("konsole") ); + m_console->setCaption( i18n("Terminal") ); + addToolWindow( m_console, KDockWidget::DockBottom, getMainDockWidget(), 20 ); + + +#if KDE_IS_VERSION(3, 3, 0) + if (Settings::showCloseTabsButton()) + { + QToolButton *but = new QToolButton(tabWidget()); + but->setIconSet(SmallIcon("tab_remove")); + but->adjustSize(); + but->hide(); + connect(but, SIGNAL(clicked()), actionCollection()->action( "file_close" ), SIGNAL(activated())); + tabWidget()->setCornerWidget(but, TopRight); + } +#endif + + // apply the saved mainwindow settings, if any, and ask the mainwindow + // to automatically save settings if changed: window size, toolbar + // position, icon size, etc. + setAutoSaveSettings(); + + // Read the dock config only if the app was started at least only once - kmdi is tricky + KConfig *cfg = new KConfig("%{APPNAMELC}_dockposrc"); + if (cfg->readNumEntry("%{APPNAMELC}_main_dock_settings", 0) == 1) manager()->readConfig(cfg); + cfg->writeEntry("%{APPNAMELC}_main_dock_settings", 1); + delete cfg; + + showTipOnStart(); +} + +%{APPNAMELC}kmdi::~%{APPNAMELC}kmdi() +{ + // Write the dock config on exit + KConfig *cfg = new KConfig("%{APPNAMELC}_dockposrc"); + manager()->writeConfig(cfg); + delete cfg; + delete m_console; +} + +void %{APPNAMELC}kmdi::setupActions() +{ + setXMLFile("%{APPNAMELC}_shell.rc"); + + KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection()); + + KStdAction::tipOfDay( this, SLOT( showTip() ), actionCollection() + )->setWhatsThis(i18n("This shows useful tips on the use of this application.")); + + KStdAction::close(this, SLOT(slotFileClose()), actionCollection()); + KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection()); + + m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); + m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); + + KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + KAction* action = KStdAction::configureToolbars(this, + SLOT(optionsConfigureToolbars()), actionCollection()); + + createGUI( NULL ); +} + +void %{APPNAMELC}kmdi::showTip() +{ + KTipDialog::showTip(this,QString::null,true); +} + +void %{APPNAMELC}kmdi::showTipOnStart() +{ + KTipDialog::showTip(this); +} + +void %{APPNAMELC}kmdi::slotFileNew() +{ + %{APPNAMELC}kmdiView *view = new %{APPNAMELC}kmdiView(this); + m_manager->addPart( view->part() ); + + addWindow( view ); + + // add the tree view to the widget stack + m_views += view; + + currentChanged( view ); +} + +void %{APPNAMELC}kmdi::openURL(const KURL & url) +{ + // check if the url is not already opened first + QValueList<%{APPNAMELC}kmdiView*>::iterator it = m_views.begin(); + QValueList<%{APPNAMELC}kmdiView*>::iterator end = m_views.end(); + for (; it != end; ++it) + { + %{APPNAMELC}kmdiView *view = *it; + if (view->part()->url() == url) + { + activateView(view); + return; + } + } + + %{APPNAMELC}kmdiView *view = new %{APPNAMELC}kmdiView(this); + m_manager->addPart( view->part() ); + + addWindow( view ); + + m_views += view; + + view->part()->openURL(url); + currentChanged( view ); +} + +void %{APPNAMELC}kmdi::currentChanged( KMdiChildView *current ) +{ + //kdWarning()<<"current view changed"<setActivePart(NULL); + //setCaption("()"); + return; + } + + // switch to the corresponding document + if ( m_views.contains( (%{APPNAMELC}kmdiView*) current ) ) + { + %{APPNAMELC}kmdiView *view = (%{APPNAMELC}kmdiView*) current; + //view->updateCaption(); + m_manager->setActivePart( view->part() ); + } +} + +void %{APPNAMELC}kmdi::slotFileClose() +{ + requestClose( activeWindow() ); +} + +bool %{APPNAMELC}kmdi::requestClose(KMdiChildView* v) +{ + // kdWarning()<<"closing view"<part()->queryClose()) + { + m_manager->removePart( view->part() ); + + closeWindow( view ); + m_views.clear(); + setCaption("kdissert"); + return true; + } + return false; + } + return true; + } + + %{APPNAMELC}kmdiView *view = (%{APPNAMELC}kmdiView*) v; + if ( m_views.contains( view ) ) + { + m_views.remove( view ); + if ( view->part()->queryClose() ) + { + m_manager->removePart( view->part() ); + + closeWindow( view ); + return true; + } + return false; + } + return true; +} + +void %{APPNAMELC}kmdi::slotFileQuit() +{ + close(); +} + +void %{APPNAMELC}kmdi::optionsShowToolbar() +{ + if (m_toolbarAction->isChecked()) + toolBar()->show(); + else + toolBar()->hide(); +} + +void %{APPNAMELC}kmdi::optionsShowStatusbar() +{ + if (m_statusbarAction->isChecked()) + statusBar()->show(); + else + statusBar()->hide(); +} + +void %{APPNAMELC}kmdi::optionsConfigureKeys() +{ + //KKeyDialog::configure(actionCollection()); + KKeyDialog dlg( false, this ); + QPtrList clients = guiFactory()->clients(); + + for( QPtrListIterator it( clients ); it.current(); ++it ) + dlg.insert ( (*it)->actionCollection(), (*it)->instance()->aboutData()->programName() ); + + dlg.configure(); + + for (int i=0; ipart()->reloadXML(); + } +} + +void %{APPNAMELC}kmdi::optionsConfigureToolbars() +{ + //saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); +} + +void %{APPNAMELC}kmdi::newToolbarConfig() +{ + // This slot is called when user clicks "Ok" or "Apply" in the toolbar editor. + // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.) + //createGUI(); + //applyMainWindowSettings(KGlobal::config(), autoSaveGroup()); +} + +void %{APPNAMELC}kmdi::optionsPreferences() +{ + // The preference dialog is derived from prefs-base.ui which is subclassed into Prefs + // + // compare the names of the widgets in the .ui file + // to the names of the variables in the .kcfg file + if (KConfigDialog::showDialog("settings")) + return; + + KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow); + dialog->addPage(new prefs(), i18n("General"), "package_settings"); + connect(dialog, SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); + dialog->show(); +} + +void %{APPNAMELC}kmdi::settingsChanged() +{ + // propagate the changes to our views + /*QValueList<%{APPNAMELC}kmdiView*>::iterator it = m_views.begin(); + QValueList<%{APPNAMELC}kmdiView*>::iterator end = m_views.end(); + for (; it != end; ++it) + { + %{APPNAMELC}kmdiView *view = *it; + view->settingsChanged(); + }*/ +} + +void %{APPNAMELC}kmdi::changeStatusbar(const QString& text) +{ + // display the text on the statusbar + statusBar()->message(text, 2000); +} + +void %{APPNAMELC}kmdi::dragEnterEvent(QDragEnterEvent *event) +{ + // accept uri drops only + event->accept(KURLDrag::canDecode(event)); +} + +void %{APPNAMELC}kmdi::dropEvent(QDropEvent *event) +{ + KURL::List urls; + + // see if we can decode a URI.. if not, just ignore it + if (KURLDrag::decode(event, urls) && !urls.isEmpty()) + { + // okay, we have a URI.. process it + const KURL &url = urls.first(); + + // load in the file + openURL(url); + } +} + +bool %{APPNAMELC}kmdi::queryClose() +{ + QValueList<%{APPNAMELC}kmdiView*>::iterator it; + + // check if we can close all documents + for (it = m_views.begin(); it != m_views.end(); ++it) + { + // kdWarning()<<"searching for the part"<part()->queryClose()) + { + return false; + } + } + + // and now close the documents + for (it = m_views.begin(); it != m_views.end(); ++it) + { + // now close all views + %{APPNAMELC}kmdiView *view = *it; + + m_manager->removePart( view->part() ); + closeWindow( view ); + } + + return true; +} + +#include "%{APPNAMELC}kmdi.moc" diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdi.h b/languages/cpp/app_templates/kscons_kmdi/appkmdi.h new file mode 100644 index 00000000..370a3034 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/appkmdi.h @@ -0,0 +1,82 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}KMDI_H +#define _%{APPNAMEUC}KMDI_H + +#include + +#include +#include +#include + +class KToggleAction; +class KRecentFilesAction; + +class kmdikonsole; +class KMdiChildView; +class QWidgetStack; +class %{APPNAMELC}kmdiView; +class TextProperties; +class MiscProperties; + +/** + * This class serves as the main window for %{APPNAMELC}kmdi. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + */ +class %{APPNAMELC}kmdi : public KMdiMainFrm +{ + Q_OBJECT + public: + %{APPNAMELC}kmdi( KMdi::MdiMode mode ); + virtual ~%{APPNAMELC}kmdi(); + void showTipOnStart(); + + public slots: + void openURL( const KURL& ); + + protected: + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dropEvent(QDropEvent *event); + virtual bool queryClose(); + + private slots: + void slotFileNew(); + void slotFileClose(); + void slotFileQuit(); + + /// this is called when a new file is saved + void showTip(); + + void optionsShowToolbar(); + void optionsShowStatusbar(); + void optionsConfigureKeys(); + void optionsConfigureToolbars(); + void optionsPreferences(); + void newToolbarConfig(); + + + void changeStatusbar(const QString& text); + + void currentChanged( KMdiChildView *current ); + bool requestClose(KMdiChildView* view); + + void settingsChanged(); + + private: + void setupAccel(); + void setupActions(); + + QValueList<%{APPNAMELC}kmdiView*> m_views; + + KToggleAction *m_toolbarAction; + KToggleAction *m_statusbarAction; + + KParts::PartManager *m_manager; + + kmdikonsole *m_console; +}; + +#endif // _%{APPNAMEUC}KMDI_H + diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp new file mode 100644 index 00000000..c4cfbf65 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp @@ -0,0 +1,63 @@ +%{CPP_TEMPLATE} + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "%{APPNAMELC}kmdiView.h" + + + %{APPNAMELC}kmdiView::%{APPNAMELC}kmdiView( QWidget *parentWidget, const char *name ) +: KMdiChildView( parentWidget, name ) +{ + m_part = NULL; + + // this routine will find and load our Part. it finds the Part by + // name which is a bad idea usually.. but it's alright in this + // case since our Part is made for this Shell + KLibFactory *factory = KLibLoader::self()->factory("lib%{APPNAMELC}part"); + //KLibFactory *factory = KLibLoader::self()->factory("libkatepart"); + if (factory) + { + // now that the Part is loaded, we cast it to a Part to get + // our hands on it + m_part = static_cast(factory->create( + this, "katepart", "KParts::ReadWritePart" )); + + if (m_part) + { + part()->widget()->setFocus(); + setFocusProxy(part()->widget()); + + QBoxLayout* layout = new QHBoxLayout(this, 0, -1, "kdissertviewlayout" ); + part()->widget()->reparent( this, QPoint(0, 0) ); + layout->addWidget( part()->widget() ); + + // connect( m_part, SIGNAL(stateChanged()), this, SLOT(updateCaption()) ); + } + else + { + KMessageBox::error(this, i18n("Could not find our part.")); + } + } + else + { + // if we couldn't find our Part, we exit since the Shell by + // itself can't do anything useful + KMessageBox::error(this, i18n("Could not find our part.")); + return; + } +} + +%{APPNAMELC}kmdiView::~%{APPNAMELC}kmdiView() +{ + delete m_part->widget(); +} + +#include "%{APPNAMELC}kmdiView.moc" diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdiView.h b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.h new file mode 100644 index 00000000..66e5203b --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.h @@ -0,0 +1,29 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}KMDIVIEW_H +#define _%{APPNAMEUC}KMDIVIEW_H + +#include +#include +#include + +/** + * This class serves as the %{APPNAMELC}kmdi view. + * + * @short main view class + */ +class %{APPNAMELC}kmdiView : public KMdiChildView +{ + Q_OBJECT + public: + %{APPNAMELC}kmdiView( QWidget *parentWidget=0L, const char *name=0L ); + virtual ~%{APPNAMELC}kmdiView(); + + KParts::ReadWritePart *part() { return m_part; } + + private: + KParts::ReadWritePart *m_part; +}; + +#endif // _%{APPNAMEUC}KMDIVIEW_H + diff --git a/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp new file mode 100644 index 00000000..da41685f --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp @@ -0,0 +1,76 @@ +%{CPP_TEMPLATE} + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "kmdikonsole.h" + +kmdikonsole::kmdikonsole(QWidget *parent, const char *name) : QVBox(parent, name) +{ + m_haskonsole = false; + respawn(); +} + +kmdikonsole::~kmdikonsole() +{ +} + +void kmdikonsole::respawn() +{ + KLibFactory *factory = KLibLoader::self()->factory("libkonsolepart"); + + if (!factory) return; + m_part = (KParts::ReadOnlyPart *) factory->create(this); + + if (!m_part) return; + + if (m_part->widget()->inherits("QFrame")) + ((QFrame*)m_part->widget())->setFrameStyle(QFrame::Panel|QFrame::Sunken); + + m_haskonsole=true; + connect( m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) ); + + m_part->widget()->show(); + show(); +} + +void kmdikonsole::setDirectory(const QString &dirname) +{ + if (m_haskonsole) + { + KURL url(dirname); + if (m_part->url() != url) + m_part->openURL(url); + } +} + +void kmdikonsole::showEvent(QShowEvent *ev) +{ + QWidget::showEvent(ev); + activate(); +} + +void kmdikonsole::activate() +{ + if (m_haskonsole) + { + m_part->widget()->show(); + setFocusProxy(m_part->widget()); + m_part->widget()->setFocus(); + } +} + +void kmdikonsole::slotDestroyed() +{ + m_haskonsole=false; + respawn(); +} + +#include "kmdikonsole.moc" diff --git a/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h new file mode 100644 index 00000000..83adb417 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h @@ -0,0 +1,32 @@ +%{H_TEMPLATE} + +#ifndef KMDIKONSOLE_H +#define KMDIKONSOLE_H + +#include + +class kmdikonsole : public QVBox +{ + Q_OBJECT + + public: + kmdikonsole( QWidget* parent, const char* name=0); + ~kmdikonsole(); + + public slots: + void setDirectory(const QString & dir); + void activate(); + + private slots: + void slotDestroyed(); + void respawn(); + + protected: + void showEvent(QShowEvent *ev); + + private: + KParts::ReadOnlyPart *m_part; + bool m_haskonsole; +}; + +#endif // KMDIKONSOLE_H diff --git a/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate new file mode 100644 index 00000000..4f0f8856 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate @@ -0,0 +1,271 @@ +# KDE Config File +[General] +Name=Scons-based KMDI application +Name[ca]=Aplicació per a KMDI basada en Scons +Name[da]=Scons-baseret KMDI-program +Name[de]=Auf Scons basierende KMDI-Anwendung +Name[el]=Μια εφαρμογή KMDI βασισμένης στο Scons +Name[es]=Aplicación KMDI basada en Scons +Name[et]=KMDI rakendus Sconsi põhjal +Name[eu]=Scons-en oinarritutako KMDI aplikazioa +Name[fa]=کاربرد KMDI بر مبنای Scons +Name[fr]=Application KMDI basée sur Scons +Name[ga]=Feidhmchlár KMDI bunaithe ar Scons +Name[gl]=Aplicación KMDI baseada en Scons +Name[hu]=Scons-alapú KMDI-alkalmazás +Name[it]=Applicazione KMDI basata su scons +Name[ja]=Scons ベースの KMDI アプリケーション +Name[nds]=Op "scons" opbuut KMDI-Programm +Name[ne]=स्कोन-आधारित KMDI अनुप्रयोग +Name[nl]=Scons gebaseerde KMDI-toepassing +Name[pl]=Program KMDI wykorzystujący Scons +Name[pt]=Aplicação KMDI usando Scons +Name[pt_BR]=Aplicação KMDI usando Scons +Name[ru]=Многооконное приложение KDE на базе Scons +Name[sk]=KMDI aplikácia založená na Scons +Name[sr]=KMDI програм на основу Scons-а +Name[sr@Latn]=KMDI program na osnovu Scons-a +Name[sv]=Scons-baserat KMDI-program +Name[tr]=Scons tabanlı KMDI uygulaması +Name[zh_CN]=基于 Scons 的 KMDI 应用程序 +Name[zh_TW]=Scons 為基礎的 KMDI 應用程式 +Category=C++/KDE +Icon=kscons_kmdi.png +Comment=Generates a complex KMDI application. Scons scripts are provided for compiling and installing the application. +Comment[ca]=Genera una complexa aplicació per a KMDI. Els scripts en Scons són proveïts per a compilar i instal·lar l'aplicació. +Comment[da]=Genererer et komplekst KDE-program. Der sørges for scons-scripter til at kompilere og installere programmet. +Comment[de]=Erstellt eine aufwändige KMDI-Anwendung. Scons-Skripte zum Kompilieren und Installieren der Anwendung werden zur Verfügung gestellt. +Comment[el]=Δημιουργεί μια πολύπλοκη εφαρμογή KMDI. Προσφέρονται σενάρια Scons για τη μεταγλώττιση και εγκατάσταση της εφαρμογής. +Comment[es]=Genera una aplicación KMDI compleja. Se proporcionan guiones en Scons para compilar e instalar la aplicación. +Comment[et]=Keerulise KMDI rakenduse loomine. Luuakse ka Sconsi skriptid rakenduse kompileerimiseks ja paigaldamiseks. +Comment[eu]=KMDI aplikazio konplexu bat sortzen du. Aplikazioak konpilatu eta aplikazioa instalatzeko Scons script-ak sortzen ditu. +Comment[fa]=یک کاربرد پیچیدۀ KMDI تولید می‌کند. دست‌نوشته‌های Scons برای ترجمه و نصب کاربرد فراهم می‌شوند. +Comment[fr]=Génère une application KMDI évoluée. Des scripts Scons sont fournis pour compiler et installer l'application. +Comment[gl]=Xera unha aplicación complexa KMDI. Os scripts Scons proporciónanse para compilar e instalar a aplicación. +Comment[hu]=Létrehoz egy komplex KMDI alkalmazást. Az alkalmazás lefordításához és telepítéséhez Scons-szkriptek állnak rendelkezésre. +Comment[it]=Genera una applicazione KMDI complessa. Gli script scons sono forniti per compilare e istallare l'applicazione. +Comment[nds]=Stellt en vigeliensch KMDI-Programm op. Stellt Scons-Skripten för't Kompileren un Installeren vun't Programm praat. +Comment[ne]=जटिल KMDI अनुप्रयोग उत्पन्न गर्दछ । स्कोन स्क्रिप्टहरू अनुप्रयोग स्थापना र कम्पाइल गर्नका लागि प्रदान गरिन्छ । +Comment[nl]=Genereert een complexe KMDI-applicatie. Scons-scripts worden gebruikt voor compilatie en installatie. +Comment[pl]=Generuje złożony program z powłoką KMDI. Do kompilacji i instalacji wykorzystywany jest skrypt Scons. +Comment[pt]=Gera uma aplicação complexa com KMDI. Os ficheiros do Scons são fornecidos para compilar e instalar a aplicação. +Comment[pt_BR]=Gera uma aplicação complexa com KMDI. Os ficheiros do Scons são fornecidos para compilar e instalar a aplicação. +Comment[ru]=Создание полноценного многооконного приложения KDE. Для сборки и установки этого приложения будут использованы скрипты Scons. +Comment[sk]=Vygeneruje komplexnú KMDI aplikáciu. K dispozícii je Scons skriptna kompiláciu a inštaláciu aplikácie. +Comment[sr]=Прави сложени KMDI програм. Дате су Scons скрипте за превођење и инсталирање програма. +Comment[sr@Latn]=Pravi složeni KMDI program. Date su Scons skripte za prevođenje i instaliranje programa. +Comment[sv]=Skapar ett komplext KMDI-program. Scons-skript tillhandahålls för att kompilera och installera programmet. +Comment[tr]=Karmaşık bir KMDI uygulaması yaratır. Uygulamayı derlemek ve kurmak için scons betikleri sağlanmıştır. +Comment[zh_CN]=生成一个复杂的 KMDI 应用程序。此时会提供 Scons 脚本以供编译并安装应用程序。 +Comment[zh_TW]=產生一個複雜的 KMDI 應用程式。Scons 文稿是用於編譯與安裝應用程式。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/QUICKSTART +Archive=kscons_kmdi.tar.gz + +[SCONS] +Type=include +File=%{kdevelop}/template-common/scons.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{src}/SConscript-doc +Dest=%{dest}/doc/SConscript + +[FILE2] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE3] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE4] +Type=install +Source=%{src}/SConstruct +Dest=%{dest}/SConstruct + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE10] +Type=install +Source=%{src}/SConscript-src +Dest=%{dest}/src/SConscript + +[FILE11] +Type=install +Source=%{src}/appkmdi.cpp +Dest=%{dest}/src/%{APPNAMELC}kmdi.cpp + +[FILE12] +Type=install +Source=%{src}/appkmdi.h +Dest=%{dest}/src/%{APPNAMELC}kmdi.h + +[FILE13] +Type=install +EscapeXML=true +Source=%{src}/prefs.ui +Dest=%{dest}/src/prefs.ui + +[FILE14] +Type=install +Source=%{src}/appkmdiView.cpp +Dest=%{dest}/src/%{APPNAMELC}kmdiView.cpp + +[FILE15] +Type=install +Source=%{src}/appkmdiView.h +Dest=%{dest}/src/%{APPNAMELC}kmdiView.h + +[FILE19] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE20] +Type=install +EscapeXML=true +Source=%{src}/app_shell.rc +Dest=%{dest}/src/%{APPNAMELC}_shell.rc + +[FILE21] +Type=install +Source=%{src}/README +Dest=%{dest}/src/README + +[FILE22] +Type=install +Source=%{src}/app.kcfg +Dest=%{dest}/src/%{APPNAMELC}.kcfg + +[FILE23] +Type=install +Source=%{src}/settings.kcfgc +Dest=%{dest}/src/settings.kcfgc + +[FILE25] +Type=install +Source=%{src}/tips +Dest=%{dest}/src/tips + +[FILE27] +Type=install +Source=%{src}/VERSION +Dest=%{dest}/VERSION + +[FILE28] +Type=install +Source=%{src}/INSTALL +Dest=%{dest}/INSTALL + +[FILE29] +Type=install +Source=%{src}/QUICKSTART +Dest=%{dest}/QUICKSTART + +[FILE30] +Type=install +Source=%{src}/messages.sh +Dest=%{dest}/po/messages.sh + +[FILE31] +Type=install +Source=%{src}/kmdikonsole.cpp +Dest=%{dest}/src/kmdikonsole.cpp + +[FILE32] +Type=install +Source=%{src}/kmdikonsole.h +Dest=%{dest}/src/kmdikonsole.h + +[FILE34] +Type=install +Source=%{src}/app_part.cpp +Dest=%{dest}/src/%{APPNAMELC}_part.cpp + +[FILE35] +Type=install +Source=%{src}/app_part.h +Dest=%{dest}/src/%{APPNAMELC}_part.h + +[FILE36] +Type=install +Source=%{kdevelop}/template-common/kde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE37] +Type=install +Source=%{kdevelop}/template-common/kde-part.desktop +Dest=%{dest}/src/%{APPNAMELC}_part.desktop + +[FILE38] +Type=install +Source=%{src}/app_part.rc +Dest=%{dest}/src/%{APPNAMELC}_part.rc + +[MSG] +Type=message +Comment=A KDE application with scons scripts was created in %{dest} +Comment[ca]=Una aplicació per al KDE amb scripts en Scons ha estat creada e n %{dest} +Comment[da]=Et KDE program med scons-scripter blev oprette i %{dest} +Comment[de]=Eine KDE-Anwendung mit Scons-Skripten wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή KDE με σενάρια scons δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación para KDE con guiones de Scons ha sido creada en %{dest} +Comment[et]=KDE rakendus Sconsi skriptidega loodi asukohta %{dest} +Comment[eu]=Scons script-dun KDE aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد KDE با دست‌نوشته‌های scons در %{dest} ایجاد شد +Comment[fr]=Une application KDE comprenant des scripts Scons a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár KDE le scripteanna scons i %{dest} +Comment[gl]=Creouse unha aplicación KDE con scripts scons en %{dest} +Comment[hu]=Létrejött egy Scons-szkripteket használó KDE-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KDE con gli script scons in %{dest} +Comment[ja]=Scons スクリプトを使った KDE アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KDE-Programm mit scons-Skripten opstellt +Comment[ne]=स्कोन स्क्रिप्टसँग केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een KDE applicatie inclusief Scons-scripts is aangemaakt in %{dest} +Comment[pl]=Program KDE ze skryptami scons utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest} +Comment[ru]=Приложение KDE со скриптами Scons создано в %{dest} +Comment[sk]=KDE aplikácia so scons skriptom bola vytvorená v %{dest} +Comment[sr]=KDE програм са scons скриптама направљен је у %{dest} +Comment[sr@Latn]=KDE program sa scons skriptama napravljen je u %{dest} +Comment[sv]=Ett KDE-program med Scons-skript skapades i %{dest} +Comment[tr]=Scons betikleri olan bir KDE uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了带 scons 脚本的 KDE 应用程序 +Comment[zh_TW]=一個內含 scons 文稿的 KDE 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png new file mode 100644 index 00000000..72a347ee Binary files /dev/null and b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png differ diff --git a/languages/cpp/app_templates/kscons_kmdi/main.cpp b/languages/cpp/app_templates/kscons_kmdi/main.cpp new file mode 100644 index 00000000..7e43b0e7 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/main.cpp @@ -0,0 +1,60 @@ +%{CPP_TEMPLATE} + +#include +#include +#include +#include +#include + +#include "%{APPNAMELC}kmdi.h" + +static const char description[] = +I18N_NOOP("A simple kmdi app"); + +static const char version[] = "0.0.1"; + +static KCmdLineOptions options[] = +{ + { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}" ); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + + // warning, utf-8 char + //about.addCredit( "bksys authors", "Thomas Nagy, Julien Antille" ); + + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + + KApplication app; + + // see if we are starting with session management + /*if (app.isRestored()) + { + RESTORE((%{APPNAME}); + } else */ + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + + %{APPNAMELC}kmdi *widget = new %{APPNAMELC}kmdi( KMdi::IDEAlMode ); + + if (args->count() != 0) + { + for (int i=0; i < args->count(); i++) + { + widget->openURL( args->url( i ) ); + } + } + widget->show(); + args->clear(); + } + + return app.exec(); +} + diff --git a/languages/cpp/app_templates/kscons_kmdi/messages.sh b/languages/cpp/app_templates/kscons_kmdi/messages.sh new file mode 100755 index 00000000..a36f5c93 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/messages.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# Inspired by Makefile.common from coolo +# this script is used to update the .po files + +# To update the translations, you will need a specific gettext +# patched for kde and a lot of patience, tenacity, luck, time .. + + +# I guess one should only update the .po files when all .cpp files +# are generated (after a make or scons) + +# If you have a better way to do this, do not keep that info +# for yourself and help me to improve this script, thanks +# (tnagyemail-mail tat yahoo d0tt fr) + +SRCDIR=../test1-kconfigxt # srcdir is the directory containing the source code +TIPSDIR=$SRCDIR # tipsdir is the directory containing the tips + +KDEDIR=`kde-config --prefix` +EXTRACTRC=extractrc +KDEPOT=`kde-config --prefix`/include/kde.pot +XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x $KDEPOT " + +## check that kde.pot is available +if ! test -e $KDEPOT; then + echo "$KDEPOT does not exist, there is something wrong with your installation!" + XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale " +fi + +> rc.cpp + +## extract the strings +echo "extracting the strings" + +# process the .ui and .rc files +$EXTRACTRC `find $SRCDIR -iname *.rc` >> rc.cpp +$EXTRACTRC `find $SRCDIR -iname *.ui` >> rc.cpp +echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > $SRCDIR/_translatorinfo.cpp + +# process the tips - $SRCDIR is supposed to be where the tips are living +pushd $TIPSDIR; preparetips >tips.cpp; popd + +$XGETTEXT `find $SRCDIR -name "*.cpp"` -o kdissert.pot + +# remove the intermediate files +rm -f $TIPSDIR/tips.cpp +rm -f rc.cpp +rm -f $SRCDIR/_translatorinfo.cpp + +## now merge the .po files .. +echo "merging the .po files" + +for i in `ls *.po`; do + msgmerge $i kdissert.pot -o $i || exit 1 +done + +## finished +echo "Done" + diff --git a/languages/cpp/app_templates/kscons_kmdi/prefs.ui b/languages/cpp/app_templates/kscons_kmdi/prefs.ui new file mode 100644 index 00000000..5de638ef --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/prefs.ui @@ -0,0 +1,30 @@ + +prefs + + +prefs + + + +0 +0 +241 +47 + + + + +unnamed + + + +kcfg_showCloseTabsButton + + +Show close buttons on the right of tabs + + + + + + diff --git a/languages/cpp/app_templates/kscons_kmdi/settings.kcfgc b/languages/cpp/app_templates/kscons_kmdi/settings.kcfgc new file mode 100644 index 00000000..384510cd --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/settings.kcfgc @@ -0,0 +1,6 @@ +# Code generation options for kconfig_compiler +File=%{APPNAMELC}.kcfg +ClassName=Settings +Singleton=true +Mutators=col_background,col_foreground +# will create the necessary code for setting those variables diff --git a/languages/cpp/app_templates/kscons_kmdi/tips b/languages/cpp/app_templates/kscons_kmdi/tips new file mode 100644 index 00000000..56f29469 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kmdi/tips @@ -0,0 +1,6 @@ + + +

... that automake was not involved in building this kde application ?

+

The kdevelop template "kscons_kxt" was used instead.

+ +
diff --git a/languages/cpp/app_templates/kscons_kxt/INSTALL b/languages/cpp/app_templates/kscons_kxt/INSTALL new file mode 100644 index 00000000..edeed594 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/INSTALL @@ -0,0 +1,83 @@ +REQUIREMENTS +------------ + +* KDE headers & libraries for kdelibs +* A Python interpreter for the compilation + +scons v0.96.1 or newer is recommended, but it's not required since a +minimum scons distribution is included in the package. + +BUILDING AND INSTALLING +----------------------- + +For configuring, compiling and installing the application and +if you do have Scons 0.96.1 or newer installed, just run: + +$ scons +$ scons install (as root user) + +In case you don't have Scons installed, you can use +the accompanying minimum scons by running: + +$ tar xjvf admin/scons-mini.tar.bz2 +$ ./scons +$ ./scons install + +ADVANCED BUILD FEATURES & DEINSTALLING +-------------------------------------- + +In case you want to execute many compilation jobs in parallel (because you +want to make use of a SMP system or a compile cluster, for instance), +you can use ('N' is the number of jobs which should be run in parallel): + +$ scons -jN + +A debug build of the program can be created by running: + +$ scons configure debug=1 +$ scons + +Finally, the software can be removed from your system by running + +$ scons -c install + +CONFIGURATION NOTES +------------------- + +The installation scripts are relying on the kde-config program. +The programs kde-config, qmake, uic and moc must be accesssible +through your PATH. + +Qt and kde may not be installed as expected (in QTDIR and KDEDIR) +So until kde-config is able to give that information, you may +have to give those paths. You may also want to tune the build. + +In these cases, you must first run "scons configure" with some options +before running "scons" and "scons install" + +Here are some examples : +On Fedora/Redhat +$ scons configure kdeincludes=/usr/include/kde/ +On Debian +$ scons configure qtincludes=/usr/include/qt/ kdeinclude=/usr/include/kde/ +To install in some particular location with additional include paths +$ scons configure prefix=~/tmp extraincludes=/tmp/include:/usr/local/include +For AMD64 and platforms where folders are like /usr/lib64 +$ scons configure libsuffix=64 + +For more options, run +scons --help + +The build system is based on bksys, a build system that replaces +autoconf, automake and make in a row. Feel free to report your opinion +about it to the bksys authors. + +PACKAGE CREATION +---------------- + +RPM packagers can use the DESTDIR environment variable +$ DESTDIR=/tmp/build-rpm/ scons install + +To use checkinstall, pass the following option +$ checkinstall --fstrans=no --nodoc scons install + diff --git a/languages/cpp/app_templates/kscons_kxt/Makefile.am b/languages/cpp/app_templates/kscons_kxt/Makefile.am new file mode 100644 index 00000000..8cce001c --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/Makefile.am @@ -0,0 +1,21 @@ +dataFiles = app.cpp app.h main.cpp appui.rc app.kdevelop \ +appview.h appview.cpp appview_base.ui prefs-base.ui \ +prefs.cpp prefs.h app.kcfg settings.kcfgc messages.sh \ +SConstruct SConscript-doc SConscript-src tips VERSION \ +QUICKSTART INSTALL README + +templateName= kscons_kxt + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/kscons_kxt/QUICKSTART b/languages/cpp/app_templates/kscons_kxt/QUICKSTART new file mode 100644 index 00000000..ceaf1bda --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/QUICKSTART @@ -0,0 +1,164 @@ +------------------------------------------ +SUMMARY : + +scons +scons install + + +The online documentation of bksys can be found at: +http://freehackers.org/~tnagy/bksys_manual.html + + ... and now for the quickstart: + +CONFIGURING AND COMPILING THE PROJECT(S) +SCONS TIPS +MOC PROCESSING +SCONS MINIMUM DISTRIBUTION +MORE TIPS + +------------------------------------------ +CONFIGURING AND COMPILING THE PROJECT(S) + +The program scons is usually launched as "scons" +When it is not intalled globally, one can run +"./scons" instead of "scons" (ie : to use the local scons +that comes with bksys - see below SCONS MINIMUM DISTRIBUTION +if you do not have scons already) + +To compile the project, you will then only need to launch +scons on the top-level directory, the scripts find and +cache the environment detected *automatically* : +-> scons + +To clean the project -> scons -c + +To install the project -> scons install +To install as root user -> su -c 'scons install' +To uninstall the project -> scons -c install +To uninstall (as root) -> su -c 'scons -c install' +To consult the help -> scons -h + +To (re)configure the project and give particular arguments, use : + -> scons configure debug=1 + +The variables are saved automatically after the first run +in files named *.cache.py (look at kde.cache.py, ..) + +------------------------------------------ +SCONS TIPS + +In a subdirectory, it is necessary to launch scons with the -u flag : +scons -u + +This is annoying and you probably want to add this to your .bashrc +export SCONSFLAGS=-u +and forget about it :) + +To make .deb or .rpm packages of your program, use : +checkinstall --fstrans=no --nodoc scons install +(if you have checkinstall on your system of course) + +To make scons run (much) faster, consult ./addons/README in bksys + +------------------------------------------ +MOC PROCESSING + +In qt programs, when a header 'foo.h' contains a class that has +signals and slots, then 'foo.h' must contain the macro Q_OBJECT +in order to compile. foo_moc.cpp is usually generated, and is +used to produce foo_moc.o which is linked with the +program or the library. + +In kde programs, 'foo.moc' is generated instead of foo_moc.cpp, +and it must be included at the very end of foo.cpp +(add #include "foo.moc" : this increases the speed of +compilation a *lot* and makes less object files. + +Both modes are provided though, see test6-mocfiesta/ + +------------------------------------------ +MINIMUM SCONS DISTRIBUTION + +A minimum scons distribution is included in the archive +for convenience to those who do not have scons packages +for their operating system or their linux +distribution. For a full and more recent version of scons, +please consult http://www.scons.org + +Including this scons distribution to your archive will add +about 63kb (compressed) , while including the necessary +kdescripts (admin/ directory, configure, autom4 cache stuff, +Makefile.in) can add easily 500kb (compressed). + +To compile with the scons distribution : +* unpack it with : + tar xjvf admin/scons-mini.tar.bz2 +* compile the program with : + ./scons (instead of just 'scons') +* install the program with : + ./scons install (instead of just 'scons install') + +More options : +* clean the object files with : + ./scons -c +* uninstall the program with with : + ./scons -c install +* create a package : + ./scons dist + +------------------------------------------ +MORE TIPS + +** static libraries ** +With Makefile.am, one had to make static libraries all the time +because it did not allow having source code in other directories. +This is not the case anymore with scons, so you can specify +sources in other directories relative to the sconscript file, ie: + test1_sources = ['mainfiles/main.cpp', 'otherfile/program.cpp'] + myenv.Program( target = "test1", source = test1_sources ) +To encourage you to switch to the new scheme, the static library +helper has been omitted (look at the end of kde.py if you need one) + +** libtool ** +The LaFile build tool is a cheat that allows klibloader to load +.so files without complaints. If you need real libtool support +you can have a look to the libtool directory : it can work but +remember that libtool is broken on many systems (invalid flags +among others), so when you can work without libtool +(small projects especially), just do it. + +** moc processing ** +As stated above, you should always add #include "foo.moc" +for your qt classes (Q_OBJECT) to save precious compilation time. + +** using a cache ** +It is a good idea to enable the cache feature in SConstruct, +especially if you are doing experiments (it saves your computer +from recompiling the same files over and over again ..). + +** threading ** +myenv.AppendUnique( CPPFLAGS = ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] ) + +** final notes *** +A medium-sized project containing several targets, libraries and data +files can be converted very quickly. +Also, remember that SConscript files are actually python scripts .. +you can use whatever python feature you want in them, ie: "for" loops, +this is how the kde helpers work (KDEprogram, KDEshlib ..). + +If you are stuck, you can also have a look at more complicated +bksys-based projects like kdissert or kshaderdesigner + +The scons man page and the wiki can be very useful, do not forget to +consult them when you encounter an issue + +------------------------------------------ + +I hope you will enjoy this alternative to the autotools +scripts for kde programming, at least as much as I do : +http://freehackers.org/~tnagy/kdissert/index.html + +Happy kde hacking, + +Thomas Nagy, 2004, 2005 + diff --git a/languages/cpp/app_templates/kscons_kxt/README b/languages/cpp/app_templates/kscons_kxt/README new file mode 100644 index 00000000..8085c7e7 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/README @@ -0,0 +1,111 @@ +----------------------------------------------- +Kde scons template quickstart +Author: Thomas Nagy +Date: 2005-04-04 +----------------------------------------------- + +This README file explains basic concepts necessary +for starting with this application template. + + +** Building and installing ** + +* To configure the application run "scons configure" + In some rare cases you may need to add flags: + scons configure qtincludes=/usr/include/qt3/include kdeincludes=/usr/lib/kde3/include + +* After building, launch the application and test the dcop + interface by using the command (search a bit) : + dcop + dcop appname-... + dcop appname-... instancenumber + dcop appname-... instancenumber switch_colors + dcop appname switch_colors + Or launch kdcop and search in the menus for your program + name and double-click on 'switch_colors()' + +* The usual targets call the following scons commands : + make -> scons + make clean -> scons -c + make install -> scons install + make uninstall -> scons -c install + make dist -> scons dist + +* To build apps, use KDEprogram, KDEshlib, etc. + these functions are documented at the bottom of kde.py + More information can be found in the QUICKSTART + +* The scons scripts for building kde applications originate + from the 'bksys' distribution. It contains several other examples + that detail the kpart building and the dcop interface + processing : + http://www.kde-apps.org/content/show.php?content=19243 + +* Extending the scons scripts for building the application : + The scons scripts are actually python scripts, so all the + usual tricks apply : 'for' and 'while' loops, 'if', 'else' .. + consult : + http://www.python.org for more information about python + http://www.scons.org for more informationabout scons + +* Simplify your life : install the project in your home directory for +testing purposes. +scons configure prefix=/home/user/dummyfolder/ +In the end when you finished the development you can +rm -rf /home/user/dummyfolder/ +without fear. + + +** Technologies ** + +* Build the menus of your application easily +kde applications now use an xml file (*ui.rc file) to build the menus. +This allow a great customization of the application. However, when +programming the menu is shown only after a "make install" + +For more details, consult : +http://devel-home.kde.org/~larrosa/tutorial/p9.html +http://developer.kde.org/documentation/tutorials/xmlui/preface.html + +* Use KConfig XT to create your configuration dialogs and make +them more maintainable. + +For that, you will need to write two simple configuration files +in the src directory : .kcfg and a .kcfgc +The configure.in.in will need to be modified : change the line #MIN_CONFIG(3.0.0) +into #MIN_CONFIG(3.2.0) + +Take an example on the many apps found in the kdegames source package and consult : +http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html + +* With KParts, you can embed other kde components in your program, or make your program +embeddable in other apps. For example, the kmplayer kpart can be called to play videos +in your app. + +For more details, consult : +http://www-106.ibm.com/developerworks/library/l-kparts/ +http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html +http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html + +* With dcop, you can control your app from other applications +Make sure to include K_DCOP and a kdcop: section in your .h file +http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html + + +** Documentation ** + +* For the translations : +refer to the file po/SConscript and po/messages.sh + +1. Download a patched gettext which can be found at: + http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/ +2. Install that gettext in ~/bin/ +3. cd ~/yourproject, export PATH=~/bin:$PATH, export +KDEDIR=/where_your_KDE3_is +4. make -f admin/Makefile.common package-messages +5. make package-messages +6. Translate the po files (not the pot!!) with kbabel or xemacs + +* Do not forget to write the documentation for your kde app +edit the documentation template index.docbook in doc/ + diff --git a/languages/cpp/app_templates/kscons_kxt/SConscript-doc b/languages/cpp/app_templates/kscons_kxt/SConscript-doc new file mode 100644 index 00000000..6769a359 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/SConscript-doc @@ -0,0 +1,92 @@ +#! /usr/bin/env python +## This script demonstrates to build and install +## the documentation of a kde program with scons +## +## Thomas Nagy, 2005 + +## This file can be reused freely for any project (see COPYING) + +## First load the environment set in the top-level SConstruct file +Import( 'env' ) +myenv=env.Copy() + +## The following looks complicated but it is not +## We first define a function to install all files as documentation +## The documentation is of course lying in subfolders from here +## * normal files are installed under KDEDOC/destination +## * meinproc files are not installed, but processed into a single +## index.cache.bz2 which is installed afterwards + +## This is far more maintainable to have *one* file than +## having lots of almost empty SConscript in several folders + +################################################################### +# COMMON PART FOR PROCESSING DOCUMENTATION FOLDERS +################################################################### + +import os +import sys +import glob +import SCons.Util + +## Define this to 1 if you are writing documentation else to 0 :) +i_am_a_documentation_writer = 0 + +## This function uses env imported above +def processfolder(folder, lang, destination=""): + # folder is the folder to process + # lang is the language + # destination is the subdirectory in KDEDOC + + docfiles = glob.glob(folder+"/???*.*") # file files that are at least 4 chars wide :) + + # warn about errors + #if len(lang) != 2: + # print "error, lang must be a two-letter string, like 'en'" + + # when the destination is not given, use the folder + if len(destination) == 0: + destination=folder + + docbook_list = [] + for file in docfiles: + + # do not process folders + if not os.path.isfile(file): + continue + # do not process the cache file + if file == 'index.cache.bz2': + continue + # ignore invalid files (TODO??) + if len( SCons.Util.splitext( file ) ) <= 1 : + continue + + ext = SCons.Util.splitext( file )[1] + + # docbook files are processed by meinproc + if ext == '.docbook': + docbook_list.append( file ) + continue + + myenv.KDEinstall('KDEDOC', lang+'/'+destination, file) + + # Now process the index.docbook files .. + if len(docbook_list) == 0: + return + if not os.path.isfile( folder+'/index.docbook' ): + print "Error, index.docbook was not found in "+folder+'/index.docbook' + return + if i_am_a_documentation_writer: + for file in docbook_list: + myenv.Depends( folder+'index.cache.bz2', file ) + myenv.Meinproc( folder+'/index.cache.bz2', folder+'/index.docbook' ) + myenv.KDEinstall( 'KDEDOC', lang+'/'+destination, folder+'/index.cache.bz2' ) + +################################################################### +# TELL WHICH FOLDERS TO PROCESS +################################################################### + +## Use processfolder for each documentation directory +processfolder('en/', 'en', '%{APPNAMELC}') +processfolder('fr/', 'fr', '%{APPNAMELC}') + diff --git a/languages/cpp/app_templates/kscons_kxt/SConscript-src b/languages/cpp/app_templates/kscons_kxt/SConscript-src new file mode 100644 index 00000000..02432be5 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/SConscript-src @@ -0,0 +1,72 @@ +#! /usr/bin/env python +# SConscript for %{APPNAMELC} compilation and installation + +############################ +## Configuration + +## use the environment set in the top-level +## SConstruct file + +Import('env') +myenv=env.Copy() + +############################# +## Programs to build + +%{APPNAMELC}_sources=""" +settings.kcfgc +main.cpp +prefs.cpp +%{APPNAMELC}.skel +%{APPNAMELC}.cpp +%{APPNAMELC}view.cpp +prefs-base.ui +%{APPNAMELC}view_base.ui +""" + +# Our main program +# KDEprogram add the file to the install targets automatically, +# so you do not need to write myenv.KDEinstall( env['KDEBIN'], %{APPNAMELC}) +myenv.KDEprogram( "%{APPNAMELC}", %{APPNAMELC}_sources ) + +############################ +## Customization + +## Additional include paths for compiling the source files +## Always add '../' (top-level directory) because moc makes code that needs it +myenv.KDEaddpaths_includes( "./ ../" ) + +## Necessary libraries to link against +myenv.KDEaddlibs( "qt-mt kio kdecore kdeprint" ) + +## This shows how to add other link flags to the program +# myenv.KDEaddflags_link('-export-dynamic') + +## If you are using QThread, add this line +# myenv.KDEaddflags_link( '-DQT_THREAD_SUPPORT' ) + +############################# +## Installation + +## NOTE 1: The program is installed automatically +## NOTE 2: KDEinstall( resource_type, subdirectory, list_of_files ) + +## The ui.rc file and the tips go into datadir/appname/ +myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}', '%{APPNAMELC}ui.rc' ) +myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}', 'tips' ) + +## The kcfg file is installed in a global kcfg directory +myenv.KDEinstall( 'KDEKCFG', '', '%{APPNAMELC}.kcfg' ) + +## Warning : there is a difference between the normal destop file used for the menu +## and the servicetype desktop file, so they go in different directories +myenv.KDEinstall( 'KDEMENU', 'Utilities/', '%{APPNAMELC}.desktop' ) + +## Use this when you need to install a mimetype file +#myenv.KDEinstall( 'KDEMIME', 'application', 'x-%{APPNAMELC}.desktop' ) + +## Installing icons is easy (hi-16-app-%{APPNAMELC}.png, hi-22-app-%{APPNAMELC}.png) +#myenv.KDEicon() + +## do not forget that this is a python script so even loops are allowed... :) + diff --git a/languages/cpp/app_templates/kscons_kxt/SConstruct b/languages/cpp/app_templates/kscons_kxt/SConstruct new file mode 100644 index 00000000..b82de4e1 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/SConstruct @@ -0,0 +1,112 @@ +#! /usr/bin/env python + +""" +help -> scons -h +compile -> scons +clean -> scons -c +install -> scons install +uninstall -> scons -c install +configure -> scons configure prefix=/tmp/ita debug=full extraincludes=/usr/local/include:/tmp/include prefix=/usr/local + +Run from a subdirectory -> scons -u +The variables are saved automatically after the first run (look at cache/kde.cache.py, ..) +""" + +################################################################### +# LOAD THE ENVIRONMENT AND SET UP THE TOOLS +################################################################### + +## Load the builders in config +env = Environment( tools=['default', 'generic', 'kde'], toolpath=['./', './admin']) +#env = Environment( tools=['default', 'generic', 'kde', 'othertool'], toolpath=['./', './admin']) + +env.KDEuse("environ rpath") +#env.KDEuse("environ rpath lang_qt thread nohelp") + +################################################################### +# SCRIPTS FOR BUILDING THE TARGETS +################################################################### + +dirs=""" +src +doc +""" +env.subdirs(dirs) + +## Process the translations in the po/ directory +env.KDElang('po/', '%{APPNAMELC}') + +################################################################### +# CONVENIENCE FUNCTIONS TO EMULATE 'make dist' and 'make distclean' +################################################################### + +### To make a tarball of your masterpiece, use 'scons dist' +if 'dist' in COMMAND_LINE_TARGETS: + + ## The target scons dist requires the python module shutil which is in 2.3 + env.EnsurePythonVersion(2, 3) + + import os + APPNAME = 'bksys' + VERSION = os.popen("cat VERSION").read().rstrip() + FOLDER = APPNAME+'-'+VERSION + ARCHIVE = FOLDER+'.tar.bz2' + + ## If your app name and version number are defined in 'version.h', use this instead: + ## (contributed by Dennis Schridde devurandom@gmx@net) + #import re + #INFO = dict( re.findall( '(?m)^#define\s+(\w+)\s+(.*)(?<=\S)', open(r"version.h","rb").read() ) ) + #APPNAME = INFO['APPNAME'] + #VERSION = INFO['VERSION'] + + import shutil + import glob + + ## check if the temporary directory already exists + if os.path.isdir(FOLDER): + shutil.rmtree(FOLDER) + if os.path.isfile(ARCHIVE): + os.remove(ARCHIVE) + + ## create a temporary directory + startdir = os.getcwd() + shutil.copytree(startdir, FOLDER) + + ## remove our object files first + os.popen("find "+FOLDER+" -name \"*cache*\" | xargs rm -rf") + os.popen("find "+FOLDER+" -name \"*.pyc\" | xargs rm -f") + #os.popen("pushd %s && scons -c " % FOLDER) # TODO + + ## CVS cleanup + os.popen("find "+FOLDER+" -name \"CVS\" | xargs rm -rf") + os.popen("find "+FOLDER+" -name \".cvsignore\" | xargs rm -rf") + + ## Subversion cleanup + os.popen("find %s -name .svn -type d | xargs rm -rf" % FOLDER) + + ## GNU Arch cleanup + os.popen("find "+FOLDER+" -name \"{arch}\" | xargs rm -rf") + os.popen("find "+FOLDER+" -name \".arch-i*\" | xargs rm -rf") + + ## Create the tarball (coloured output) + print "\033[92m"+"Writing archive "+ARCHIVE+"\033[0m" + os.popen("tar cjf "+ARCHIVE+" "+FOLDER) + + ## Remove the temporary directory + if os.path.isdir(FOLDER): + shutil.rmtree(FOLDER) + + env.Default(None) + env.Exit(0) + +### Emulate "make distclean" +if 'distclean' in COMMAND_LINE_TARGETS: + ## Remove the cache directory + import os, shutil + if os.path.isdir(env['CACHEDIR']): + shutil.rmtree(env['CACHEDIR']) + os.popen("find . -name \"*.pyc\" | xargs rm -rf") + + env.Default(None) + env.Exit(0) + diff --git a/languages/cpp/app_templates/kscons_kxt/VERSION b/languages/cpp/app_templates/kscons_kxt/VERSION new file mode 100644 index 00000000..2e293c30 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/VERSION @@ -0,0 +1 @@ +%{VERSION} diff --git a/languages/cpp/app_templates/kscons_kxt/app.cpp b/languages/cpp/app_templates/kscons_kxt/app.cpp new file mode 100644 index 00000000..bc343554 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/app.cpp @@ -0,0 +1,177 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include "settings.h" +#include "prefs.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +%{APPNAME}::%{APPNAME}() + : KMainWindow( 0, "%{APPNAME}" ), + m_view(new %{APPNAME}View(this)), + m_printer(0) +{ + // accept dnd + setAcceptDrops(true); + + // tell the KMainWindow that this is indeed the main widget + setCentralWidget(m_view); + + // then, setup our actions + setupActions(); + + // and a status bar + statusBar()->show(); + + // apply the saved mainwindow settings, if any, and ask the mainwindow + // to automatically save settings if changed: window size, toolbar + // position, icon size, etc. + setAutoSaveSettings(); + + // allow the view to change the statusbar and caption + connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), + this, SLOT(changeStatusbar(const QString&))); + connect(m_view, SIGNAL(signalChangeCaption(const QString&)), + this, SLOT(changeCaption(const QString&))); + + showTipOnStart(); +} + +%{APPNAME}::~%{APPNAME}() +{ +} + +void %{APPNAME}::setupActions() +{ + KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + + m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); + m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); + + KStdAction::tipOfDay( this, SLOT( showTip() ), actionCollection() + )->setWhatsThis(i18n("This shows useful tips on the use of this application.")); + + KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + // custom menu and menu item - the slot is in the class %{APPNAME}View + KAction *custom = new KAction(i18n("Swi&tch Colors"), 0, + m_view, SLOT(switchColors()), + actionCollection(), "switch_action"); + + createGUI(); +} + +void %{APPNAME}::fileNew() +{ + // this slot is called whenever the File->New menu is selected, + // the New shortcut is pressed (usually CTRL+N) or the New toolbar + // button is clicked + + // create a new window + (new %{APPNAME})->show(); +} + +void %{APPNAME}::optionsShowToolbar() +{ + // this is all very cut and paste code for showing/hiding the + // toolbar + if (m_toolbarAction->isChecked()) + toolBar()->show(); + else + toolBar()->hide(); +} + +void %{APPNAME}::optionsShowStatusbar() +{ + // show/hide the statusbar + if (m_statusbarAction->isChecked()) + statusBar()->show(); + else + statusBar()->hide(); +} + +void %{APPNAME}::optionsConfigureKeys() +{ + KKeyDialog::configure(actionCollection()); +} + +void %{APPNAME}::optionsConfigureToolbars() +{ + // use the standard toolbar editor + saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); +} + +void %{APPNAME}::newToolbarConfig() +{ + // this slot is called when user clicks "Ok" or "Apply" in the toolbar editor. + // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.) + createGUI(); + + applyMainWindowSettings(KGlobal::config(), autoSaveGroup()); +} + +void %{APPNAME}::optionsPreferences() +{ + // The preference dialog is derived from prefs-base.ui which is subclassed into Prefs + // + // compare the names of the widgets in the .ui file + // to the names of the variables in the .kcfg file + KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow); + dialog->addPage(new Prefs(), i18n("General"), "package_settings"); + connect(dialog, SIGNAL(settingsChanged()), m_view, SLOT(settingsChanged())); + dialog->show(); +} + +void %{APPNAME}::changeStatusbar(const QString& text) +{ + // display the text on the statusbar + statusBar()->message(text, 2000); +} + +void %{APPNAME}::changeCaption(const QString& text) +{ + // display the text on the caption + setCaption(text); +} + +void %{APPNAME}::showTip() +{ + KTipDialog::showTip(this,QString::null,true); +} + +void %{APPNAME}::showTipOnStart() +{ + KTipDialog::showTip(this); +} + +void %{APPNAME}::switch_colors() +{ + if (!m_view) + return; + m_view->switchColors(); +} + +#include "%{APPNAMELC}.moc" + diff --git a/languages/cpp/app_templates/kscons_kxt/app.h b/languages/cpp/app_templates/kscons_kxt/app.h new file mode 100644 index 00000000..4f855793 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/app.h @@ -0,0 +1,73 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "%{APPNAMELC}view.h" + +class KPrinter; +class KToggleAction; +class KURL; + +/** + * This class serves as the main window for %{APPNAME}. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAME} : public KMainWindow, public DCOPObject +{ + K_DCOP + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAME}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAME}(); + +k_dcop: + virtual void switch_colors(); + +private slots: + void fileNew(); + void optionsShowToolbar(); + void optionsShowStatusbar(); + void optionsConfigureKeys(); + void optionsConfigureToolbars(); + void optionsPreferences(); + void newToolbarConfig(); + void showTip(); + + void changeStatusbar(const QString& text); + void changeCaption(const QString& text); + +private: + void setupAccel(); + void setupActions(); + void showTipOnStart(); + +private: + %{APPNAME}View *m_view; + + KPrinter *m_printer; + KToggleAction *m_toolbarAction; + KToggleAction *m_statusbarAction; +}; + +#endif // _%{APPNAMEUC}_H_ + diff --git a/languages/cpp/app_templates/kscons_kxt/app.kcfg b/languages/cpp/app_templates/kscons_kxt/app.kcfg new file mode 100644 index 00000000..d5325b92 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/app.kcfg @@ -0,0 +1,21 @@ + + + + + + + black + + + + yellow + + + + 2 + + + diff --git a/languages/cpp/app_templates/kscons_kxt/app.kdevelop b/languages/cpp/app_templates/kscons_kxt/app.kdevelop new file mode 100644 index 00000000..e6a14fff --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/app.kdevelop @@ -0,0 +1,169 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + . + false + + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + false + + + + + + + false + 1 + false + + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + true + false + false + true + + + false + true + + + + + + + + + + + + -f + + -dP + + -f + -u3 -p + + + + + + + false + + + .h + .cpp + true + + + + true + 2 + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kscons_kxt/appui.rc b/languages/cpp/app_templates/kscons_kxt/appui.rc new file mode 100644 index 00000000..06549878 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/appui.rc @@ -0,0 +1,8 @@ + + + + &Move + + + + diff --git a/languages/cpp/app_templates/kscons_kxt/appview.cpp b/languages/cpp/app_templates/kscons_kxt/appview.cpp new file mode 100644 index 00000000..7dc99f61 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/appview.cpp @@ -0,0 +1,41 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}view.h" +#include "settings.h" + +#include +#include + +%{APPNAME}View::%{APPNAME}View(QWidget *parent) + : %{APPNAME}view_base(parent) +{ + settingsChanged(); +} + +%{APPNAME}View::~%{APPNAME}View() +{ + +} + +void %{APPNAME}View::switchColors() +{ + // switch the foreground/background colors of the label + QColor color = Settings::col_background(); + Settings::setCol_background( Settings::col_foreground() ); + Settings::setCol_foreground( color ); + + settingsChanged(); +} + +void %{APPNAME}View::settingsChanged() +{ + sillyLabel->setPaletteBackgroundColor( Settings::col_background() ); + sillyLabel->setPaletteForegroundColor( Settings::col_foreground() ); + + // i18n : internationalization + sillyLabel->setText( i18n("This project is %1 days old").arg(Settings::val_time()) ); + emit signalChangeStatusbar( i18n("Settings changed") ); +} + +#include "%{APPNAMELC}view.moc" + diff --git a/languages/cpp/app_templates/kscons_kxt/appview.h b/languages/cpp/app_templates/kscons_kxt/appview.h new file mode 100644 index 00000000..86d097a4 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/appview.h @@ -0,0 +1,52 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}VIEW_H_ +#define _%{APPNAMEUC}VIEW_H_ + +#include + +#include "%{APPNAMELC}view_base.h" + +class QPainter; +class KURL; + +/** + * This is the main view class for %{APPNAME}. Most of the non-menu, + * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go + * here. + * + * @short Main view + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAME}View : public %{APPNAME}view_base +{ + Q_OBJECT +public: + /** + * Default constructor + */ + %{APPNAME}View(QWidget *parent); + + /** + * Destructor + */ + virtual ~%{APPNAME}View(); + +signals: + /** + * Use this signal to change the content of the statusbar + */ + void signalChangeStatusbar(const QString& text); + + /** + * Use this signal to change the content of the caption + */ + void signalChangeCaption(const QString& text); + +public slots: + void switchColors(); + void settingsChanged(); +}; + +#endif // _%{APPNAMEUC}VIEW_H_ diff --git a/languages/cpp/app_templates/kscons_kxt/appview_base.ui b/languages/cpp/app_templates/kscons_kxt/appview_base.ui new file mode 100644 index 00000000..6cd36d2c --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/appview_base.ui @@ -0,0 +1,35 @@ + +%{APPNAME}view_base +%{CPP_TEMPLATE} +%{AUTHOR} <%{EMAIL}> + + + %{APPNAME}view_base + + + + 0 + 0 + 268 + 164 + + + + %{APPNAME}_base + + + + unnamed + + + + sillyLabel + + + hello, world + + + + + + diff --git a/languages/cpp/app_templates/kscons_kxt/kscons_kxt.kdevtemplate b/languages/cpp/app_templates/kscons_kxt/kscons_kxt.kdevtemplate new file mode 100644 index 00000000..6236f905 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/kscons_kxt.kdevtemplate @@ -0,0 +1,253 @@ +# KDE Config File +[General] +Name=Scons-based KDE application +Name[ca]=Una aplicació per al KDE basada en Scons +Name[da]=Scons-baseret KDE program +Name[de]=Auf Scons basierende KDE-Anwendung +Name[el]=Μια εφαρμογή KMDI βασισμένης στο Scons +Name[es]=Aplicación para KDE basada en Scons +Name[et]=KDE rakendus Sconsi põhjal +Name[eu]=Scons-en oinarritutako KDE aplikazioa +Name[fa]=کاربرد KDE بر مبنای Scons +Name[fr]=Application KDE basée sur Scons +Name[ga]=Feidhmchlár KDE bunaithe ar Scons +Name[gl]=Aplicación KDE baseada en Scons +Name[hu]=Scons-alapú KDE-s alkalmazás +Name[it]=Un'applicazione KDE basata su scons +Name[ja]=Scons を使った KDE アプリケーション +Name[nds]=Op "Scons" opbuut KDE-Programm +Name[ne]=स्कोन-आधारित केडीई अनुप्रयोग +Name[nl]=Scons gebaseerde KDE-toepassing +Name[pl]=Program KDE wykorzystujący Scons +Name[pt]=Aplicação KDE usando Scons +Name[pt_BR]=Aplicação KDE usando Scons +Name[ru]=Приложение KDE на базе Scons +Name[sk]=KDE aplikácia založená na Scons +Name[sr]=KDE програм на основу Scons-а +Name[sr@Latn]=KDE program na osnovu Scons-a +Name[sv]=Scons-baserat KDE-program +Name[tr]=Scons-tabanlı KDE Uygulaması +Name[zh_CN]=基于 Scons 的 KDE 应用程序 +Name[zh_TW]=Scons 為基礎的 KDE 應用程式 +Category=C++/KDE +Icon=kscons_kxt.png +Comment=Generates a simple KDE application with one widget, a configuration dialog and a dcop interface. Scons scripts are provided for compiling and installing the application. +Comment[ca]=Genera una simple aplicació per al KDE amb un estri, un diàleg de configuració i una interfície dcop. Els scripts en Scons són proveïts per a compilar i instal·lar l'aplicació. +Comment[da]=Genererer et simpelt KDE program med en kontrol, en indstillingsdialog og en dcop-grænseflade. Der sørges for scons-scripter til at kompilere og installere programmet. +Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Widget, einem Einstellungsdialog und einer DCOP-Schnittstelle. Scons-Skripte zum Kompileren und Installieren der Anwendung werden zur Verfügung gestellt. +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό, ένα διάλογο ρύθμισης και μια διασύνδεση dcop. Προσφέρονται σενάρια Scons για τη μεταγλώττιση και εγκατάσταση της εφαρμογής. +Comment[en_GB]=Generates a simple KDE application with one widget, a configuration dialogue and a dcop interface. Scons scripts are provided for compiling and installing the application. +Comment[es]=Genera una sencilla aplicación para KDE con una ventana principal, un diálogo de configuración y una interfaz DCOP. Se proporcionan guiones en Scons para compilar e instalar la aplicación. +Comment[et]=Lihtsa KDE rakenduse loomine ühe vidina, seadistusdialoogi ja DCOP-liidesega. Luuakse ka Sconsi skriptid rakenduse kompileerimiseks ja paigaldamiseks. +Comment[eu]=KDE aplikazio sinple bat sortzen du trepeta bat, konfigurazio-elkarrizketa eta dcop interfaze batekin. Aplikazioa konpilatu eta instalatzeko Scons script-ak sortzen ditu. +Comment[fa]=یک کاربرد سادۀ KDE با یک عنصر، یک محاورۀ پیکربندی و یک واسط dcop تولید می‌کند. دست‌نوشته‌های Scons برای ترجمه و نصب کاربرد فراهم شده‌اند. +Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget), une boîte de dialogue de configuration et une interface DCOP. Des scripts Scons sont fournis pour compiler et installer l'application. +Comment[gl]=Xera unha aplicación sinxela KDE cunha compoñente, un diálogo de configuración e unha interface dcop. Os scripts scons proporciónanse para compilar e intalar a aplicación. +Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy főablakkal, beállítóablakkal és DCOP-felülettel. Az alkalmazás lefordításához és telepítéséhez Scons-szkriptek állnak rendelkezésre. +Comment[it]=Genera una semplice applicazione KDE con un elemento grafico, una finestra di configurazione e un'interfaccia DCOP. Gli script scons sono forniti per compilare e installare l'applicazione. +Comment[nds]=Stellt en eenfach KDE-Programm mit een Element, en Instelldialoog un en DCOP-Koppelsteed op. Stellt Scons-Skripten för't Kompileren un Installeren vun't Programm praat. +Comment[ne]=एउटा विगेट, कन्फिगरेसन संवाद र dcop इन्टरफेससँग एउटा साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ । स्कोन स्क्रिप्टहरू अनुप्रयोग स्थापना र कम्पाइल गर्नका लागि प्रदान गरिन्छ । +Comment[nl]=Genereert een eenvoudige KDE-toepassing met één toplevel widget, een configuratievenster en een DCOP-interface. Scons-scripts worden aangemaakt voor compilatie en installatie. +Comment[pl]=Generuje prosty program dla KDE widgetem, oknem konfiguracyjnym i interfejsem dcop. Do kompilacji i instalacji programu wykorzystywane są skrypty Scons. +Comment[pt]=Gera uma aplicação simples do KDE com uma janela principal, uma de configuração e uma interface de DCOP. Os ficheiros do 'scons' são oferecidos para compilar e instalar a aplicação. +Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela principal, uma de configuração e uma interface de DCOP. Os ficheiros do 'scons' são oferecidos para compilar e instalar a aplicação. +Comment[ru]=Создание простого приложения KDE с одним виджетом, окном настройки и интерфейсом DCOP. Сборка и установка осуществляется с помощью скриптов Scons. +Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom, konfiguračným dial=ogom a DCOP rozhraním. K dispozícii je Scons skriptna kompiláciu a inštaláciu aplikácie. +Comment[sr]=Прави једноставан KDE програм са једном контролом, дијалогом за подешавање и DCOP интерфејсом. Дате су Scons скрипте за превођење и инсталирање програма. +Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom, dijalogom za podešavanje i DCOP interfejsom. Date su Scons skripte za prevođenje i instaliranje programa. +Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent, en inställningsdialogruta och ett DCOP-gränssnitt. Scons-script tillhandahålls för att kompilera och installera programmet. +Comment[tr]=Bir parçacıklı, ayar pencereli ve bir dcop arayüzü olan basit bir KDE uygulaması yaratır. Uygulamayı derlemek ve kurmak için scons betikleri sağlanmıştır. +Comment[zh_CN]=生成一个带一个部件、一个配置对话框和一个 DCOP 接口的简单 KDE 应用程序。此时会提供 Scons 脚本以供编译并安装应用程序。 +Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含一個元件,一個設定對話框與一個 DCOP 介面。Scons 文稿可用於編譯與安裝應用程式。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/QUICKSTART +Archive=kscons_kxt.tar.gz + +[SCONS] +Type=include +File=%{kdevelop}/template-common/scons.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{src}/SConscript-doc +Dest=%{dest}/doc/SConscript + +[FILE2] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE3] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE4] +Type=install +Source=%{src}/SConstruct +Dest=%{dest}/SConstruct + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE10] +Type=install +Source=%{src}/SConscript-src +Dest=%{dest}/src/SConscript + +[FILE11] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE12] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE13] +Type=install +EscapeXML=true +Source=%{src}/appview_base.ui +Dest=%{dest}/src/%{APPNAMELC}view_base.ui + +[FILE14] +Type=install +Source=%{src}/appview.cpp +Dest=%{dest}/src/%{APPNAMELC}view.cpp + +[FILE15] +Type=install +Source=%{src}/appview.h +Dest=%{dest}/src/%{APPNAMELC}view.h + +[FILE16] +Type=install +EscapeXML=true +Source=%{src}/prefs-base.ui +Dest=%{dest}/src/prefs-base.ui + +[FILE17] +Type=install +Source=%{src}/prefs.cpp +Dest=%{dest}/src/prefs.cpp + +[FILE18] +Type=install +Source=%{src}/prefs.h +Dest=%{dest}/src/prefs.h + +[FILE19] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE20] +Type=install +EscapeXML=true +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}ui.rc + +[FILE21] +Type=install +Source=%{src}/README +Dest=%{dest}/src/README + +[FILE22] +Type=install +Source=%{src}/app.kcfg +Dest=%{dest}/src/%{APPNAMELC}.kcfg + +[FILE23] +Type=install +Source=%{src}/settings.kcfgc +Dest=%{dest}/src/settings.kcfgc + +[FILE24] +Type=install +Source=%{src}/tips +Dest=%{dest}/src/tips + +[FILE26] +Type=install +Source=%{src}/VERSION +Dest=%{dest}/VERSION + +[FILE29] +Type=install +Source=%{src}/INSTALL +Dest=%{dest}/INSTALL + +[FILE30] +Type=install +Source=%{src}/QUICKSTART +Dest=%{dest}/QUICKSTART + +[FILE31] +Type=install +Source=%{src}/messages.sh +Dest=%{dest}/po/messages.sh + +[MSG] +Type=message +Comment=A KDE application with scons scripts was created in %{dest} +Comment[ca]=Una aplicació per al KDE amb scripts en Scons ha estat creada e n %{dest} +Comment[da]=Et KDE program med scons-scripter blev oprette i %{dest} +Comment[de]=Eine KDE-Anwendung mit Scons-Skripten wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή KDE με σενάρια scons δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación para KDE con guiones de Scons ha sido creada en %{dest} +Comment[et]=KDE rakendus Sconsi skriptidega loodi asukohta %{dest} +Comment[eu]=Scons script-dun KDE aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد KDE با دست‌نوشته‌های scons در %{dest} ایجاد شد +Comment[fr]=Une application KDE comprenant des scripts Scons a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár KDE le scripteanna scons i %{dest} +Comment[gl]=Creouse unha aplicación KDE con scripts scons en %{dest} +Comment[hu]=Létrejött egy Scons-szkripteket használó KDE-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KDE con gli script scons in %{dest} +Comment[ja]=Scons スクリプトを使った KDE アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KDE-Programm mit scons-Skripten opstellt +Comment[ne]=स्कोन स्क्रिप्टसँग केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een KDE applicatie inclusief Scons-scripts is aangemaakt in %{dest} +Comment[pl]=Program KDE ze skryptami scons utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest} +Comment[ru]=Приложение KDE со скриптами Scons создано в %{dest} +Comment[sk]=KDE aplikácia so scons skriptom bola vytvorená v %{dest} +Comment[sr]=KDE програм са scons скриптама направљен је у %{dest} +Comment[sr@Latn]=KDE program sa scons skriptama napravljen je u %{dest} +Comment[sv]=Ett KDE-program med Scons-skript skapades i %{dest} +Comment[tr]=Scons betikleri olan bir KDE uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了带 scons 脚本的 KDE 应用程序 +Comment[zh_TW]=一個內含 scons 文稿的 KDE 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kscons_kxt/kscons_kxt.png b/languages/cpp/app_templates/kscons_kxt/kscons_kxt.png new file mode 100644 index 00000000..13e8eeff Binary files /dev/null and b/languages/cpp/app_templates/kscons_kxt/kscons_kxt.png differ diff --git a/languages/cpp/app_templates/kscons_kxt/main.cpp b/languages/cpp/app_templates/kscons_kxt/main.cpp new file mode 100644 index 00000000..95e54c47 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/main.cpp @@ -0,0 +1,57 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE Application"); + +static const char version[] = "%{VERSION}"; + +static KCmdLineOptions options[] = +{ + { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + KApplication app; + + // see if we are starting with session management + if (app.isRestored()) + { + RESTORE(%{APPNAME}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->count() == 0) + { + %{APPNAME} *widget = new %{APPNAME}; + widget->show(); + } + else + { + int i = 0; + for (; i < args->count(); i++) + { + %{APPNAME} *widget = new %{APPNAME}; + widget->show(); + } + } + args->clear(); + } + + return app.exec(); +} + diff --git a/languages/cpp/app_templates/kscons_kxt/messages.sh b/languages/cpp/app_templates/kscons_kxt/messages.sh new file mode 100755 index 00000000..a36f5c93 --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/messages.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# Inspired by Makefile.common from coolo +# this script is used to update the .po files + +# To update the translations, you will need a specific gettext +# patched for kde and a lot of patience, tenacity, luck, time .. + + +# I guess one should only update the .po files when all .cpp files +# are generated (after a make or scons) + +# If you have a better way to do this, do not keep that info +# for yourself and help me to improve this script, thanks +# (tnagyemail-mail tat yahoo d0tt fr) + +SRCDIR=../test1-kconfigxt # srcdir is the directory containing the source code +TIPSDIR=$SRCDIR # tipsdir is the directory containing the tips + +KDEDIR=`kde-config --prefix` +EXTRACTRC=extractrc +KDEPOT=`kde-config --prefix`/include/kde.pot +XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x $KDEPOT " + +## check that kde.pot is available +if ! test -e $KDEPOT; then + echo "$KDEPOT does not exist, there is something wrong with your installation!" + XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale " +fi + +> rc.cpp + +## extract the strings +echo "extracting the strings" + +# process the .ui and .rc files +$EXTRACTRC `find $SRCDIR -iname *.rc` >> rc.cpp +$EXTRACTRC `find $SRCDIR -iname *.ui` >> rc.cpp +echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > $SRCDIR/_translatorinfo.cpp + +# process the tips - $SRCDIR is supposed to be where the tips are living +pushd $TIPSDIR; preparetips >tips.cpp; popd + +$XGETTEXT `find $SRCDIR -name "*.cpp"` -o kdissert.pot + +# remove the intermediate files +rm -f $TIPSDIR/tips.cpp +rm -f rc.cpp +rm -f $SRCDIR/_translatorinfo.cpp + +## now merge the .po files .. +echo "merging the .po files" + +for i in `ls *.po`; do + msgmerge $i kdissert.pot -o $i || exit 1 +done + +## finished +echo "Done" + diff --git a/languages/cpp/app_templates/kscons_kxt/prefs-base.ui b/languages/cpp/app_templates/kscons_kxt/prefs-base.ui new file mode 100644 index 00000000..43ef8a5f --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/prefs-base.ui @@ -0,0 +1,129 @@ + +Prefs_base +%{CPP_TEMPLATE} +%{AUTHOR} <%{EMAIL}> + + + Prefs_base + + + + 0 + 0 + 282 + 156 + + + + + unnamed + + + + textLabel2_2 + + + Background color: + + + + + kcfg_col_background + + + + + + + + textLabel1 + + + Project age: + + + + + textLabel2 + + + Foreground color: + + + + + kcfg_col_foreground + + + + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 41 + 20 + + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 41 + 20 + + + + + + kcfg_val_time + + + 1 + + + 2 + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 41 + 20 + + + + + + + + kcolorbutton.h + + diff --git a/languages/cpp/app_templates/kscons_kxt/prefs.cpp b/languages/cpp/app_templates/kscons_kxt/prefs.cpp new file mode 100644 index 00000000..e7a46ddf --- /dev/null +++ b/languages/cpp/app_templates/kscons_kxt/prefs.cpp @@ -0,0 +1,12 @@ +%{CPP_TEMPLATE} + +#include "prefs.h" +#include + +Prefs::Prefs() + : Prefs_base() +{ +// debugging : +// kdWarning()<<"creating a pref dialog"< + +

... that automake was not involved in building this kde application ?

+

The kdevelop template "kscons_kxt" was used instead.

+ + diff --git a/languages/cpp/app_templates/kscreensaver/.kdev_ignore b/languages/cpp/app_templates/kscreensaver/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kscreensaver/Makefile.am b/languages/cpp/app_templates/kscreensaver/Makefile.am new file mode 100644 index 00000000..28747ace --- /dev/null +++ b/languages/cpp/app_templates/kscreensaver/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = kscreensaver.desktop kscreensaver.png kscreensaver.h \ + kscreensaverui.ui src-Makefile.am kscreensaver.cpp \ + kscreensaver.kdevelop subdirs + +templateName= kscreensaver + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz $(templateName).png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.cpp b/languages/cpp/app_templates/kscreensaver/kscreensaver.cpp new file mode 100644 index 00000000..f4418571 --- /dev/null +++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.cpp @@ -0,0 +1,107 @@ +%{CPP_TEMPLATE} + +#include +#include +#include +#include +#include +#include +#include +#include +#include "%{APPNAMELC}.h" +#include "%{APPNAMELC}ui.h" + +//! libkscreensaver interface +extern "C" +{ + const char *kss_applicationName = "%{APPNAMELC}.kss"; + const char *kss_description = I18N_NOOP( "%{APPNAME}" ); + const char *kss_version = "2.2.0"; + + %{APPNAME} *kss_create( WId id ) + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}( id ); + } + + QDialog *kss_setup() + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}Setup(); + } +} + +//----------------------------------------------------------------------------- +//! dialog to setup screen saver parameters +%{APPNAME}Setup::%{APPNAME}Setup( QWidget *parent, const char *name ) + : %{APPNAME}UI( parent, name, TRUE ) +{ + /// @todo + //Connect your signals and slots here to configure the screen saver. + connect( OkayPushButton, SIGNAL( released() ), + SLOT( slotOkPressed() ) ); + connect( CancelPushButton, SIGNAL( released() ), + SLOT( slotCancelPressed() ) ); +} + + +//! read settings from config file +void %{APPNAME}Setup::readSettings() +{ + KConfig *config = KGlobal::config(); + config->setGroup( "Settings" ); + /// @todo + // Add your config options here... + CheckBox1->setChecked(config->readBoolEntry( "somesetting", false )); +} + + +//! Ok pressed - save settings and exit +void %{APPNAME}Setup::slotOkPressed() +{ + KConfig *config = KGlobal::config(); + config->setGroup( "Settings" ); + /// @todo + // Add your config options here. + config->writeEntry( "somesetting", CheckBox1->isChecked() ); + config->sync(); + + accept(); +} + +void %{APPNAME}Setup::slotCancelPressed() +{ + reject(); +} +//----------------------------------------------------------------------------- + + +%{APPNAME}::%{APPNAME}( WId id ) : KScreenSaver( id ) +{ + readSettings(); + blank(); +} + +%{APPNAME}::~%{APPNAME}() +{} + + +//! read configuration settings from config file +void %{APPNAME}::readSettings() +{ + KConfig *config = KGlobal::config(); + config->setGroup( "Settings" ); + /// @todo + // Add your config options here... + bool somesetting = config->readBoolEntry( "somesetting", false ); +} + + +void %{APPNAME}::blank() +{ + /// @todo + //Add your code to render the screen. + setBackgroundColor( QColor(black) ); + // + erase(); +} diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.desktop b/languages/cpp/app_templates/kscreensaver/kscreensaver.desktop new file mode 100644 index 00000000..0743cc69 --- /dev/null +++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.desktop @@ -0,0 +1,124 @@ +[Desktop Entry] +Exec=%{APPNAMELC}.kss +Icon=kscreensaver +Type=Application +Actions=Setup;InWindow;Root; +X-KDE-Category=Miscellaneous +Name=%{APPNAME} + +[Desktop Action Setup] +Exec=%{APPNAMELC}.kss -setup +Name=Setup... +Name[br]=Kefluniadur ... +Name[ca]=Configuració... +Name[cy]=Gosod ... +Name[da]=Opsætning... +Name[de]=Einrichtung ... +Name[el]=Ρύθμιση... +Name[es]=Configuración... +Name[et]=Häälestus... +Name[eu]=Konfiguratu... +Name[fa]=برپایی... +Name[fr]=Configuration... +Name[ga]=Cumraigh... +Name[gl]=Configuración... +Name[hu]=Beállítások... +Name[it]=Imposta... +Name[ja]=設定... +Name[lt]=Nustatymas... +Name[ms]=Tetapan... +Name[nds]=Instellen... +Name[ne]=सेटअप... +Name[nl]=Instellen... +Name[pl]=Ustawienia... +Name[pt]=Configurar... +Name[pt_BR]=Configurar... +Name[ru]=Настроить... +Name[rw]=Iboneza... +Name[sk]=Nastavenie... +Name[sl]=Nastavi ... +Name[sr]=Постављање... +Name[sr@Latn]=Postavljanje... +Name[sv]=Inställning... +Name[tr]=Kurulum... +Name[zh_CN]=设置... +Name[zh_TW]=設定... +Icon=kscreensaver + +[Desktop Action InWindow] +Exec=%{APPNAMELC}.kss -window-id %w +Name=Display in Specified Window +Name[br]=Diskwel er prenestr spisaet +Name[ca]=Mostra a la finestra especificada +Name[cy]=Dangos mewn Ffenestr Benodol +Name[da]=Vis i specificeret vindue +Name[de]=Im angegebenen Fenster anzeigen +Name[el]=Προβολή στο ορισμένο παράθυρο +Name[es]=Mostrar en la ventana especificada +Name[et]=Kuva määratud aknas +Name[eu]=Bistaratu zehaztutako lehioan +Name[fa]=نمایش در پنجرۀ مشخص‌شده +Name[fr]=Afficher dans la fenêtre spécifiée +Name[ga]=Taispeáin san Fhuinneog Sonraithe +Name[gl]=Mostrar na xanela especificada +Name[hu]=Megjelenítés egy adott ablakban +Name[it]=Mostra in una finestra specificata +Name[ja]=指定したウィンドウに表示 +Name[lt]=Rodyti nurodytame lange +Name[ms]=Papar dalam Tetingkap Yang Dinyatakan +Name[nds]=Binnen angeven Finster wiesen +Name[ne]=निर्दिष्ट सञ्झ्यालमा प्रर्दशन +Name[nl]=Weergave in aangegeven venster +Name[pl]=Pokazywanie w podanym oknie +Name[pt]=Mostrar na Janela Indicada +Name[pt_BR]=Exibir na Janela Especificada +Name[ru]=Показать в указанном окне +Name[rw]=Kwerekana mu Idirishya Ryihariye +Name[sk]=Zobraziť v špecifickom okne +Name[sl]=Prikaži v določenem oknu +Name[sr]=Прикажи у наведеном прозору +Name[sr@Latn]=Prikaži u navedenom prozoru +Name[sv]=Visa i angivet fönster +Name[tr]=Belirtilen Pencerede Göster +Name[zh_CN]=在指定窗口中显示 +Name[zh_TW]=顯示在指定視窗 +NoDisplay=true + +[Desktop Action Root] +Exec=%{APPNAMELC}.kss -root +Name=Display in Root Window +Name[br]=Diskwel er prenestr gwrizienn +Name[ca]=Mostra a la finestra arrel +Name[cy]=Dangos mewn Ffenestr Wraidd +Name[da]=Vis i rod-vindue +Name[de]=Im Root-Fenster anzeigen +Name[el]=Προβολή στο βασικό παράθυρο +Name[es]=Mostrar en la ventana raíz +Name[et]=Kuva juuraknas +Name[eu]=Bistaratu erro-lehioan +Name[fa]=نمایش در پنجرۀ ریشه +Name[fr]=Afficher dans la fenêtre racine +Name[ga]=Taispeáin sa bhFréamhfhuinneog +Name[gl]=Mostrar na xanela raíz +Name[hu]=Megjelenítés a gyökérablakban +Name[it]=Mostra nella finestra radice +Name[ja]=ルートウィンドウに表示 +Name[lt]=Rodyti root lange +Name[ms]=Papar dalam Tetingkap Root +Name[nds]=Binnen Wörtelfinster wiesen +Name[ne]=रूट सञ्झ्यालमा प्रर्दशन +Name[nl]=Weergave in hoofdvenster +Name[pl]=Pokazywanie w głównym oknie +Name[pt]=Mostrar na Janela de Fundo +Name[pt_BR]=Exibir na Janela Raiz +Name[ru]=Показать в главном окне +Name[rw]=Kwerekana mu Idirishya Umuzi +Name[sk]=Zobraziť v koreňovom okne +Name[sl]=Prikaži v korenskem oknu +Name[sr]=Прикажи у кореном прозору +Name[sr@Latn]=Prikaži u korenom prozoru +Name[sv]=Visa i rotfönster +Name[tr]=Kök Pencerede Göster +Name[zh_CN]=在根窗口中显示 +Name[zh_TW]=顯示在根視窗 +NoDisplay=true diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.h b/languages/cpp/app_templates/kscreensaver/kscreensaver.h new file mode 100644 index 00000000..1301083d --- /dev/null +++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.h @@ -0,0 +1,35 @@ +%{CPP_TEMPLATE} + +#ifndef %{APPNAME}_H__ +#define %{APPNAME}_H__ + +#include "kscreensaver.h" +#include "%{APPNAMELC}ui.h" + +class %{APPNAME} : public KScreenSaver +{ + Q_OBJECT +public: + %{APPNAME}( WId drawable ); + virtual ~%{APPNAME}(); +private: + void readSettings(); + void blank(); +}; + +class %{APPNAME}Setup : public %{APPNAME}UI +{ + Q_OBJECT +public: + %{APPNAME}Setup( QWidget *parent = NULL, const char *name = NULL ); + +private slots: + void slotOkPressed(); + void slotCancelPressed(); + +private: + void readSettings(); + %{APPNAME} *saver; +}; + +#endif diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevelop b/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevelop new file mode 100644 index 00000000..e912518f --- /dev/null +++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + kioslave + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/lib%{APPNAMELC}.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevtemplate b/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevtemplate new file mode 100644 index 00000000..027ba4ea --- /dev/null +++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevtemplate @@ -0,0 +1,203 @@ +# KDE Config File +[General] +Name=KDE Screen Saver +Name[br]=Damanter skramm KDE +Name[ca]=Salvapantalles per al KDE +Name[da]=KDE pauseskærm +Name[de]=KDE-Bildschirmschoner +Name[el]=Προφύλαξη οθόνης του KDE +Name[es]=Salvapantallas para KDE +Name[et]=KDE ekraanisäästja +Name[eu]=KDE pantaila-babeslea +Name[fa]=محافظ صفحۀ KDE +Name[fr]=Écran de veille KDE +Name[ga]=Spárálaí Scáileáin KDE +Name[gl]=Salvapantallas KDE +Name[hu]=KDE-s képernyővédő +Name[it]=Salva schermo di KDE +Name[ja]=KDE スクリーンセーバー +Name[nds]=KDE-Pausschirm +Name[ne]=केडीई स्क्रिन सर्भर +Name[nl]=KDE-schermbeveiliging +Name[pl]=Wygaszacz ekranu KDE +Name[pt]=Protector de Ecrã do KDE +Name[pt_BR]=Protetor de tela do KDE +Name[ru]=Хранитель экрана для KDE +Name[sk]=KDE šetrič obrazovky +Name[sl]=Ohranjevalnik zaslona za KDE +Name[sr]=KDE чувар екрана +Name[sr@Latn]=KDE čuvar ekrana +Name[sv]=KDE-skärmsläckare +Name[tr]=KDE Ekran Koruyucusu +Name[zh_CN]= KDE 屏幕保护程序 +Name[zh_TW]=KDE 螢幕保護程式 +Icon=kscreensaver.png +Category=C++/KDE +Comment=Generates a framework for a KDE screensaver. +Comment[ca]=Genera una infraestructura per a un salvapantalles de KDE. +Comment[da]=Genererer et skelet for en KDE-pauseskærm. +Comment[de]=Erstellt das Gerüst für einen KDE-Bildschirmschoner. +Comment[el]=Δημιουργεί ένα πλαίσιο για μια προφύλαξη οθόνης του KDE. +Comment[es]=Genera una infraestructura para un salvapantallas de KDE +Comment[et]=KDE ekraanisäästja raamistiku loomine. +Comment[eu]=KDE-ren pantaila-babesle baten lan-marko bat sortzen du. +Comment[fa]=چارچوبی برای محافظ صفحۀ KDE تولید می‌کند. +Comment[fr]=Génère une infrastructure pour un écran de veille KDE. +Comment[gl]=Xera un contorno de traballo para un salvapantallas KDE. +Comment[hu]=Létrehoz egy alap KDE-s képernyővédőt. +Comment[it]=Genera l'infrastruttura per un salvaschermo di KDE. +Comment[ja]=KDE スクリーンセーバーのフレームワークを作成します +Comment[nds]=Stellt dat Rahmenwark för en KDE-Pausschirm op. +Comment[ne]=केडीई स्क्रिनसेभरका लागि फ्रेमवर्क उत्पन्न गर्दछ +Comment[nl]=Genereert een framework voor een KDE-schermbeveiliging. +Comment[pl]=Generuje szablon wygaszacza ekranu dla KDE. +Comment[pt]=Gera a plataforma para um protector de ecrã do KDE. +Comment[pt_BR]=Gera a plataforma para um protector de ecrã do KDE. +Comment[ru]=Создание инфраструктуры хранителя экрана для KDE. +Comment[sk]=Vygeneruje framework pre KDE šetrič obrazovky. +Comment[sl]=Ustvari ogrodje ohranjevalnika zaslona za KDE. +Comment[sr]=Прави радни оквир за KDE чувар екрана. +Comment[sr@Latn]=Pravi radni okvir za KDE čuvar ekrana. +Comment[sv]=Skapar ett ramverk för en KDE-skärmsläckare +Comment[tr]=Bir KDE ekran koruyucusu için bir çatı oluşturulur. +Comment[zh_CN]=生成 KDE 屏幕保护程序框架。 +Comment[zh_TW]=產生一個 KDE 螢幕保護程式的框架 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=kscreensaver.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/kscreensaver.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/kscreensaver.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/kscreensaver.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE14] +Type=install +Source=%{src}/kscreensaver.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE15] +Type=install +EscapeXML=true +Source=%{src}/kscreensaverui.ui +Dest=%{dest}/src/%{APPNAMELC}ui.ui + +[MSG] +Type=message +Comment=A screensaver application was created in %{dest} +Comment[ca]=Una aplicació de salvapantalles ha estat creada en %{dest} +Comment[da]=Et pauseskærmsprogram blev oprettet i %{dest} +Comment[de]=Ein Bildschirmschoner wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή προφύλαξης οθόνης δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación salvapantallas ha sido creada en %{dest} +Comment[et]=Ekraanisäästja rakendus loodi asukohta %{dest} +Comment[eu]=Pantaila-babesle baten aplikazioa sortu da hemen: %{dest} +Comment[fa]=یک کاربرد محافظ صفحه در %{dest} ایجاد شد +Comment[fr]=Une application écran de veille a été créé dans %{dest} +Comment[ga]=Cruthaíodh spárálaí scáileáin i %{dest} +Comment[gl]=Creouse unha aplicación salvapantallas en %{dest} +Comment[hu]=Létrejött egy alap képernyővédő program itt: %{dest} +Comment[it]=È stata creata un'applicazione salvaschermo in %{dest} +Comment[ja]=スクリーンセーバーアプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Pausschirm opstellt +Comment[ne]=स्क्रिनसेभर अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een schermbeveiligingstoepassing is aangemaakt in %{dest} +Comment[pl]=Program wygaszacza ekranu został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação protectora do ecrã em %{dest} +Comment[pt_BR]=Foi criada uma aplicação protectora do ecrã em %{dest} +Comment[ru]=Приложение хранителя экрана создано в %{dest} +Comment[sk]=Aplikácia šetriča obrazovky bola vytvorená v %{dest} +Comment[sl]=Program ohranjevalnika zaslona je bil ustvarjen v %{dest} +Comment[sr]=Програм чувара екрана направљен је у %{dest} +Comment[sr@Latn]=Program čuvara ekrana napravljen je u %{dest} +Comment[sv]=Ett skärmsläckarprogram skapades i %{dest} +Comment[tr]=Bir ekran koruyucusu uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了屏幕保护应用程序 +Comment[zh_TW]=一個螢幕保護程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.png b/languages/cpp/app_templates/kscreensaver/kscreensaver.png new file mode 100644 index 00000000..e91ec2e2 Binary files /dev/null and b/languages/cpp/app_templates/kscreensaver/kscreensaver.png differ diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaverui.ui b/languages/cpp/app_templates/kscreensaver/kscreensaverui.ui new file mode 100644 index 00000000..c4a843d0 --- /dev/null +++ b/languages/cpp/app_templates/kscreensaver/kscreensaverui.ui @@ -0,0 +1,79 @@ + +%{APPNAME}UI +This is the main UI for setting up your screen saver. +Ian Reinhart Geiser + + + %{APPNAMELC}cfg + + + + 0 + 0 + 257 + 58 + + + + Screen Saver Config + + + + Layout2 + + + + 5 + 0 + 255 + 57 + + + + + unnamed + + + + CheckBox1 + + + Set some setting + + + + + Layout1 + + + + unnamed + + + + + OkayPushButton + + + &OK + + + + + CancelPushButton + + + &Cancel + + + + + + + + + kdialog.h + + + + diff --git a/languages/cpp/app_templates/kscreensaver/src-Makefile.am b/languages/cpp/app_templates/kscreensaver/src-Makefile.am new file mode 100644 index 00000000..e19ffb77 --- /dev/null +++ b/languages/cpp/app_templates/kscreensaver/src-Makefile.am @@ -0,0 +1,24 @@ +# Makefile.am for %{APPNAMELC}. +# + +AM_CPPFLAGS = -UQT_NO_ASCII_CAST +METASOURCES = AUTO + +INCLUDES = $(all_includes) +LDFLAGS = $(all_libraries) $(KDE_RPATH) +LDADD = $(LIB_KDEUI) -lkscreensaver -lm +bin_PROGRAMS = %{APPNAMELC}.kss + +%{APPNAMELC}_kss_SOURCES = %{APPNAMELC}ui.ui %{APPNAMELC}.cpp +%{APPNAMELC}_kss_LDADD = $(LIB_QT) $(LIB_KDECORE) $(LDADD) $(LIB_KSYCOCA) + +#datadir = $(kde_datadir)/%{APPNAMELC} + +desktop_DATA = %{APPNAMELC}.desktop +desktopdir = $(kde_appsdir)/System/ScreenSavers + +EXTRA_DIST = $(desktop_DATA) + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/kscreensaver/subdirs b/languages/cpp/app_templates/kscreensaver/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kscreensaver/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/kxt/.kdev_ignore b/languages/cpp/app_templates/kxt/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kxt/Makefile.am b/languages/cpp/app_templates/kxt/Makefile.am new file mode 100644 index 00000000..07767961 --- /dev/null +++ b/languages/cpp/app_templates/kxt/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \ + subdirs app.desktop preview.png appview.h appview.cpp appview_base.ui \ + prefs-base.ui prefs.cpp prefs.h app.kcfg settings.kcfgc README \ + src-configure.in.in +templateName= kxt + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/kxt/README b/languages/cpp/app_templates/kxt/README new file mode 100644 index 00000000..74e23296 --- /dev/null +++ b/languages/cpp/app_templates/kxt/README @@ -0,0 +1,86 @@ +----------------------------------------------- +Kde templates quickstart +Author: Thomas Nagy +Date: 2004-03-22 +----------------------------------------------- + +This README file explains you basic things for starting with +this application template. + + +** Building and installing ** + +* Build the configure script by "make -f Makefile.cvs" + +* To clean, use "make clean", and to clean everything +(remove the makefiles, etc), use "make distclean" + +* To distribute your program, try "make dist". +This will make a compact tarball archive of your release with the +necessary scripts inside. + +* Modifying the auto-tools scripts +for automake scripts there is an excellent tutorial there : +http://developer.kde.org/documentation/other/makefile_am_howto.html + +* Simplify your life : install the project in your home directory for +testing purposes. +./configure --prefix=/home/user/dummyfolder/ +In the end when you finished the development you can +rm -rf /home/user/dummyfolder/ +without fear. + + +** Technologies ** + +* Build the menus of your application easily +kde applications now use an xml file (*ui.rc file) to build the menus. +This allow a great customization of the application. However, when +programming the menu is shown only after a "make install" + +For more details, consult : +http://devel-home.kde.org/~larrosa/tutorial/p9.html +http://developer.kde.org/documentation/tutorials/xmlui/preface.html + +* Use KConfig XT to create your configuration dialogs and make +them more maintainable. + +For that, you will need to write two simple configuration files +in the src directory : .kcfg and a .kcfgc +The configure.in.in will need to be modified : change the line #MIN_CONFIG(3.0.0) +into #MIN_CONFIG(3.2.0) + +Take an example on the many apps found in the kdegames source package and consult : +http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html + +* With KParts, you can embed other kde components in your program, or make your program +embeddable in other apps. For example, the kmplayer kpart can be called to play videos +in your app. + +For more details, consult : +http://www-106.ibm.com/developerworks/library/l-kparts/ +http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html +http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html + +* With dcop, you can control your app from other applications +Make sure to include K_DCOP and a kdcop: section in your .h file +http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html + + +** Documentation ** + +* For the translations : +1. Download a patched gettext which can be found at: + http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/ +2. Install that gettext in ~/bin/ +3. cd ~/yourproject, export PATH=~/bin:$PATH, export +KDEDIR=/where_your_KDE3_is +4. make -f admin/Makefile.common package-messages +5. make package-messages +6. Translate the po files (not the pot!!) with kbabel or xemacs + +* Do not forget to write the documentation for your kde app +edit the documentation template index.docbook in doc/ + + + diff --git a/languages/cpp/app_templates/kxt/app.cpp b/languages/cpp/app_templates/kxt/app.cpp new file mode 100644 index 00000000..6e2ce524 --- /dev/null +++ b/languages/cpp/app_templates/kxt/app.cpp @@ -0,0 +1,154 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include "settings.h" +#include "prefs.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +%{APPNAMELC}::%{APPNAMELC}() + : KMainWindow( 0, "%{APPNAMELC}" ), + m_view(new %{APPNAMELC}View(this)), + m_printer(0) +{ + // accept dnd + setAcceptDrops(true); + + // tell the KMainWindow that this is indeed the main widget + setCentralWidget(m_view); + + // then, setup our actions + setupActions(); + + // and a status bar + statusBar()->show(); + + // apply the saved mainwindow settings, if any, and ask the mainwindow + // to automatically save settings if changed: window size, toolbar + // position, icon size, etc. + setAutoSaveSettings(); + + // allow the view to change the statusbar and caption + connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), + this, SLOT(changeStatusbar(const QString&))); + connect(m_view, SIGNAL(signalChangeCaption(const QString&)), + this, SLOT(changeCaption(const QString&))); + +} + +%{APPNAMELC}::~%{APPNAMELC}() +{ +} + +void %{APPNAMELC}::setupActions() +{ + KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + + m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection()); + m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection()); + + KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + + // custom menu and menu item - the slot is in the class %{APPNAMELC}View + KAction *custom = new KAction(i18n("Swi&tch Colors"), 0, + m_view, SLOT(switchColors()), + actionCollection(), "switch_action"); + + createGUI(); +} + +void %{APPNAMELC}::fileNew() +{ + // this slot is called whenever the File->New menu is selected, + // the New shortcut is pressed (usually CTRL+N) or the New toolbar + // button is clicked + + // create a new window + (new %{APPNAMELC})->show(); +} + +void %{APPNAMELC}::optionsShowToolbar() +{ + // this is all very cut and paste code for showing/hiding the + // toolbar + if (m_toolbarAction->isChecked()) + toolBar()->show(); + else + toolBar()->hide(); +} + +void %{APPNAMELC}::optionsShowStatusbar() +{ + // show/hide the statusbar + if (m_statusbarAction->isChecked()) + statusBar()->show(); + else + statusBar()->hide(); +} + +void %{APPNAMELC}::optionsConfigureKeys() +{ + KKeyDialog::configure(actionCollection()); +} + +void %{APPNAMELC}::optionsConfigureToolbars() +{ + // use the standard toolbar editor + saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); +} + +void %{APPNAMELC}::newToolbarConfig() +{ + // this slot is called when user clicks "Ok" or "Apply" in the toolbar editor. + // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.) + createGUI(); + + applyMainWindowSettings(KGlobal::config(), autoSaveGroup()); +} + +void %{APPNAMELC}::optionsPreferences() +{ + // The preference dialog is derived from prefs-base.ui which is subclassed into Prefs + // + // compare the names of the widgets in the .ui file + // to the names of the variables in the .kcfg file + KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow); + dialog->addPage(new Prefs(), i18n("General"), "package_settings"); + connect(dialog, SIGNAL(settingsChanged()), m_view, SLOT(settingsChanged())); + dialog->show(); +} + +void %{APPNAMELC}::changeStatusbar(const QString& text) +{ + // display the text on the statusbar + statusBar()->message(text, 2000); +} + +void %{APPNAMELC}::changeCaption(const QString& text) +{ + // display the text on the caption + setCaption(text); +} +#include "%{APPNAMELC}.moc" + diff --git a/languages/cpp/app_templates/kxt/app.desktop b/languages/cpp/app_templates/kxt/app.desktop new file mode 100644 index 00000000..8b36e6e0 --- /dev/null +++ b/languages/cpp/app_templates/kxt/app.desktop @@ -0,0 +1,40 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} +Icon=%{APPNAMELC} +Type=Application +Comment=A simple KDE Application +Comment[br]=Ur meziant eeun evit KDE +Comment[ca]=Una simple aplicació per al KDE +Comment[da]=Et simpelt KDE program +Comment[de]=Eine einfache KDE-Anwendung +Comment[el]=Μια απλή εφαρμογή του KDE +Comment[es]=Una aplicación de KDE sencilla +Comment[et]=Lihtne KDE rakendus +Comment[eu]=KDE aplikazio simple bat +Comment[fa]=یک کاربرد سادۀ KDE +Comment[fr]=Une application simple pour KDE +Comment[ga]=Feidhmchlár Simplí KDE +Comment[gl]=Unha aplicación KDE sinxela +Comment[hi]=एक सादा केडीई अनुप्रयोग +Comment[hu]=Egyszerű KDE-alkalmazás +Comment[is]=Einfalt KDE forrit +Comment[it]=Una semplice applicazione KDE +Comment[ja]=簡単な KDE アプリケーション +Comment[nds]=En eenfach KDE-Programm +Comment[ne]=एउटा साधारण केडीई अनुप्रयोग +Comment[nl]=Een eenvoudige KDE-toepassing +Comment[pl]=Prosty program KDE +Comment[pt]=Uma aplicação simples do KDE +Comment[pt_BR]=Um simples Aplicativo do KDE +Comment[ru]=Простое приложение KDE +Comment[sk]=Jednoduchá KDE aplikácia +Comment[sl]=Preprost program za KDE +Comment[sr]=Једноставан KDE програм +Comment[sr@Latn]=Jednostavan KDE program +Comment[sv]=Ett enkelt KDE-program +Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு +Comment[tg]=Гузориши оддиKDE +Comment[tr]=Basit bir KDE Uygulaması +Comment[zh_CN]=一个简单的 KDE 应用程序 +Comment[zh_TW]=簡單的 KDE 應用程式 diff --git a/languages/cpp/app_templates/kxt/app.h b/languages/cpp/app_templates/kxt/app.h new file mode 100644 index 00000000..22037de2 --- /dev/null +++ b/languages/cpp/app_templates/kxt/app.h @@ -0,0 +1,66 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "%{APPNAMELC}view.h" + +class KPrinter; +class KToggleAction; +class KURL; + +/** + * This class serves as the main window for %{APPNAME}. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAMELC} : public KMainWindow +{ + Q_OBJECT +public: + /** + * Default Constructor + */ + %{APPNAMELC}(); + + /** + * Default Destructor + */ + virtual ~%{APPNAMELC}(); + +private slots: + void fileNew(); + void optionsShowToolbar(); + void optionsShowStatusbar(); + void optionsConfigureKeys(); + void optionsConfigureToolbars(); + void optionsPreferences(); + void newToolbarConfig(); + + void changeStatusbar(const QString& text); + void changeCaption(const QString& text); + +private: + void setupAccel(); + void setupActions(); + +private: + %{APPNAMELC}View *m_view; + + KPrinter *m_printer; + KToggleAction *m_toolbarAction; + KToggleAction *m_statusbarAction; +}; + +#endif // _%{APPNAMEUC}_H_ + diff --git a/languages/cpp/app_templates/kxt/app.kcfg b/languages/cpp/app_templates/kxt/app.kcfg new file mode 100644 index 00000000..686f25f2 --- /dev/null +++ b/languages/cpp/app_templates/kxt/app.kcfg @@ -0,0 +1,21 @@ + + + + + + + black + + + + yellow + + + + 2 + + + diff --git a/languages/cpp/app_templates/kxt/app.kdevelop b/languages/cpp/app_templates/kxt/app.kdevelop new file mode 100644 index 00000000..e6a14fff --- /dev/null +++ b/languages/cpp/app_templates/kxt/app.kdevelop @@ -0,0 +1,169 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + . + false + + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + false + + + + + + + false + 1 + false + + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + true + false + false + true + + + false + true + + + + + + + + + + + + -f + + -dP + + -f + -u3 -p + + + + + + + false + + + .h + .cpp + true + + + + true + 2 + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kxt/appui.rc b/languages/cpp/app_templates/kxt/appui.rc new file mode 100644 index 00000000..06549878 --- /dev/null +++ b/languages/cpp/app_templates/kxt/appui.rc @@ -0,0 +1,8 @@ + + + + &Move + + + + diff --git a/languages/cpp/app_templates/kxt/appview.cpp b/languages/cpp/app_templates/kxt/appview.cpp new file mode 100644 index 00000000..35e23682 --- /dev/null +++ b/languages/cpp/app_templates/kxt/appview.cpp @@ -0,0 +1,41 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}view.h" +#include "settings.h" + +#include +#include + +%{APPNAMELC}View::%{APPNAMELC}View(QWidget *parent) + : %{APPNAMELC}view_base(parent) +{ + settingsChanged(); +} + +%{APPNAMELC}View::~%{APPNAMELC}View() +{ + +} + +void %{APPNAMELC}View::switchColors() +{ + // switch the foreground/background colors of the label + QColor color = Settings::col_background(); + Settings::setCol_background( Settings::col_foreground() ); + Settings::setCol_foreground( color ); + + settingsChanged(); +} + +void %{APPNAMELC}View::settingsChanged() +{ + sillyLabel->setPaletteBackgroundColor( Settings::col_background() ); + sillyLabel->setPaletteForegroundColor( Settings::col_foreground() ); + + // i18n : internationalization + sillyLabel->setText( i18n("This project is %1 days old").arg(Settings::val_time()) ); + emit signalChangeStatusbar( i18n("Settings changed") ); +} + +#include "%{APPNAMELC}view.moc" + diff --git a/languages/cpp/app_templates/kxt/appview.h b/languages/cpp/app_templates/kxt/appview.h new file mode 100644 index 00000000..45a10de7 --- /dev/null +++ b/languages/cpp/app_templates/kxt/appview.h @@ -0,0 +1,52 @@ +%{H_TEMPLATE} + +#ifndef _%{APPNAMEUC}VIEW_H_ +#define _%{APPNAMEUC}VIEW_H_ + +#include + +#include "%{APPNAMELC}view_base.h" + +class QPainter; +class KURL; + +/** + * This is the main view class for %{APPNAME}. Most of the non-menu, + * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go + * here. + * + * @short Main view + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class %{APPNAMELC}View : public %{APPNAMELC}view_base +{ + Q_OBJECT +public: + /** + * Default constructor + */ + %{APPNAMELC}View(QWidget *parent); + + /** + * Destructor + */ + virtual ~%{APPNAMELC}View(); + +signals: + /** + * Use this signal to change the content of the statusbar + */ + void signalChangeStatusbar(const QString& text); + + /** + * Use this signal to change the content of the caption + */ + void signalChangeCaption(const QString& text); + +private slots: + void switchColors(); + void settingsChanged(); +}; + +#endif // _%{APPNAMEUC}VIEW_H_ diff --git a/languages/cpp/app_templates/kxt/appview_base.ui b/languages/cpp/app_templates/kxt/appview_base.ui new file mode 100644 index 00000000..626d95df --- /dev/null +++ b/languages/cpp/app_templates/kxt/appview_base.ui @@ -0,0 +1,33 @@ + +%{APPNAMELC}view_base + + +%{APPNAMELC}view_base + + + +0 +0 +268 +164 + + + +%{APPNAMELC}_base + + + +unnamed + + + +sillyLabel + + +hello, world + + + + + + diff --git a/languages/cpp/app_templates/kxt/kxt.kdevtemplate b/languages/cpp/app_templates/kxt/kxt.kdevtemplate new file mode 100644 index 00000000..a7a23298 --- /dev/null +++ b/languages/cpp/app_templates/kxt/kxt.kdevtemplate @@ -0,0 +1,269 @@ +# KDE Config File +[General] +Name=KConfig XT application +Name[ca]=Aplicació KConfig XT +Name[da]=KConfig XT program +Name[de]=KConfigXT-Anwendung +Name[el]=Εφαρμογή KConfig XT +Name[es]=Aplicación KConfig XT +Name[et]=KConfig XT rakendus +Name[eu]=KConfig XT aplikazioa +Name[fa]=کاربرد KConfig XT +Name[fr]=Application KConfig XT +Name[ga]=Feidhmchlár XT KConfig +Name[gl]=Aplicación KConfig XT +Name[hu]=KConfig XT-alapú alkalmazás +Name[it]=Applicazione KConfig XT +Name[ja]=KConfig XT アプリケーション +Name[nds]=KConfig-XT-Programm +Name[ne]=KConfig XT अनुप्रयोग +Name[nl]=KConfig XT-toepassing +Name[pl]=Program KConfig XT +Name[pt]=Aplicação do KConfig XT +Name[pt_BR]=Aplicação do KConfig XT +Name[ru]=Приложение KDE с KConfig XT +Name[sk]=KConfig XT aplikácia +Name[sr]=KConfig XT програм +Name[sr@Latn]=KConfig XT program +Name[sv]=KConfig XT-program +Name[tr]=KConfig XT uygulaması +Name[zh_CN]=KConfig XT 应用程序 +Name[zh_TW]=KConfig XT 應用程式 +Category=C++/KDE +Icon=kxt.png +Comment=Generates a simple KDE application with one widget and a configuration dialog +Comment[ca]=Genera una simple aplicació per al KDE amb un estri i un diàleg de configuració +Comment[da]=Genererer et simpelt KDE-program med en kontrol og en indstillingsdialog +Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Widget und einem Einstellungsdialog. +Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό, ένα διάλογο ρύθμισης +Comment[en_GB]=Generates a simple KDE application with one widget and a configuration dialogue +Comment[es]=Genera una sencilla aplicación para KDE con una ventana y un diálogo de configuración +Comment[et]=Lihtsa KDE rakenduse loomine ühe vidina ja seadistustedialoogiga. +Comment[eu]=Trepeta bat eta konfigurazio elkarrizketa-koadro bat duen KDE aplikazio sinple bat sortzen du +Comment[fa]=یک کاربرد سادۀ KDE، با یک عنصر و یک محاورۀ پیکربندی تولید می‌کند +Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget) et une boîte de dialogue de configuration +Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le giuirléid amháin agus dialóg chumraíochta +Comment[gl]=Xera unha aplicación KDE sinxela cunha compoñente e un diálogo de configuración +Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy grafikus elemmel és egy beállítóablakkal +Comment[it]=Genera una semplice applicazione KDE con un elemento grafico e una finestra di configurazione +Comment[ja]=一つのウィジェットと設定ダイアログを含む簡単な KDE アプリケーションを作成します +Comment[nds]=Stellt en eenfach KDE-Programm mit een Element un en Instelldialoog op +Comment[ne]=एउटा विगेट र कन्फिगरेसन संवादसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudige KDE-toepassing met één widget en een configuratiedialoog +Comment[pl]=Generuje prosty program KDE z jednym widgetem i oknem konfiguracyjnym +Comment[pt]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração +Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração +Comment[ru]=Создание приложения KDE с окном конфигурации +Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom a konfiguračným dialógom +Comment[sr]=Прави једноставан KDE програм са једном контролом и дијалогом за подешавање +Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom i dijalogom za podešavanje +Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent och en inställningsdialogruta +Comment[tr]=Bir parçacığı ve ayar penceresi olan basit bir KDE uygulaması yaratır. +Comment[zh_CN]=生成带一个部件和一个配置对话框的简单 KDE 应用程序 +Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含一個元件與一個設定對話框。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=kxt.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE10] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE11] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE12] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE13] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE14] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE15] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE16] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE17] +Type=install +EscapeXML=true +Source=%{src}/appview_base.ui +Dest=%{dest}/src/%{APPNAMELC}view_base.ui + +[FILE18] +Type=install +Source=%{src}/appview.cpp +Dest=%{dest}/src/%{APPNAMELC}view.cpp + +[FILE19] +Type=install +Source=%{src}/appview.h +Dest=%{dest}/src/%{APPNAMELC}view.h + +[FILE20] +Type=install +EscapeXML=true +Source=%{src}/prefs-base.ui +Dest=%{dest}/src/prefs-base.ui + +[FILE21] +Type=install +Source=%{src}/prefs.cpp +Dest=%{dest}/src/prefs.cpp + +[FILE22] +Type=install +Source=%{src}/prefs.h +Dest=%{dest}/src/prefs.h + +[FILE23] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE24] +Type=install +EscapeXML=true +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}ui.rc + +[FILE25] +Type=install +Source=%{src}/README +Dest=%{dest}/src/README + +[FILE26] +Type=install +Source=%{src}/app.kcfg +Dest=%{dest}/src/%{APPNAMELC}.kcfg + +[FILE27] +Type=install +Source=%{src}/settings.kcfgc +Dest=%{dest}/src/settings.kcfgc + +[FILE28] +Type=install +Source=%{src}/src-configure.in.in +Dest=%{dest}/configure.in.in + +[MSG] +Type=message +Comment=A KConfig XT application was created in %{dest} +Comment[ca]=Una aplicació KConfig XT ha estat creada en %{dest} +Comment[da]=Et KConfig XT-program blev oprettet i %{dest} +Comment[de]=Eine KConfig-XT-Anwendung wurde in %{dest} erstellt +Comment[el]=Μια εφαρμογή KConfig XT δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación KConfig XT ha sido creada en %{dest} +Comment[et]=A KConfig XT rakendus loodi asukohta %{dest} +Comment[eu]=KConfig XT aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد KConfig XT در %{dest} ایجاد شد +Comment[fr]=Une application KConfig XT a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár XT KConfig i %{dest} +Comment[gl]=Creouse unha aplicación KConfig XT en %{dest} +Comment[hu]=Létrejött egy KConfig XT-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione KConfig XT in %{dest} +Comment[ja]=KConfig XT アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KConfig-XT-Programm opstellt +Comment[ne]=KConfig XT अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een KConfig XT-toepassing is aangemaakt in %{dest} +Comment[pl]=Program KConfig XT został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do KConfig XT em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do KConfig XT em %{dest} +Comment[ru]=Приложение KDE с KConfig XT создано в %{dest} +Comment[sk]=KConfig XT aplikácia bola vytvorená v %{dest} +Comment[sr]=KConfig XT програм је направљен у %{dest} +Comment[sr@Latn]=KConfig XT program je napravljen u %{dest} +Comment[sv]=Ett KConfig XT-program skapades i %{dest} +Comment[tr]=Bir KConfig XT uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了 KConfig XT 应用程序 +Comment[zh_TW]=一個 KConfig XT 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kxt/kxt.png b/languages/cpp/app_templates/kxt/kxt.png new file mode 100644 index 00000000..5a4b6359 Binary files /dev/null and b/languages/cpp/app_templates/kxt/kxt.png differ diff --git a/languages/cpp/app_templates/kxt/main.cpp b/languages/cpp/app_templates/kxt/main.cpp new file mode 100644 index 00000000..66f038c9 --- /dev/null +++ b/languages/cpp/app_templates/kxt/main.cpp @@ -0,0 +1,57 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" +#include +#include +#include +#include + +static const char description[] = + I18N_NOOP("A KDE Application"); + +static const char version[] = "%{VERSION}"; + +static KCmdLineOptions options[] = +{ + { "+[URL]", I18N_NOOP( "Document to open" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) +{ + KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description, + KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" ); + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + KApplication app; + + // see if we are starting with session management + if (app.isRestored()) + { + RESTORE(%{APPNAMELC}); + } + else + { + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->count() == 0) + { + %{APPNAMELC} *widget = new %{APPNAMELC}; + widget->show(); + } + else + { + int i = 0; + for (; i < args->count(); i++) + { + %{APPNAMELC} *widget = new %{APPNAMELC}; + widget->show(); + } + } + args->clear(); + } + + return app.exec(); +} + diff --git a/languages/cpp/app_templates/kxt/prefs-base.ui b/languages/cpp/app_templates/kxt/prefs-base.ui new file mode 100644 index 00000000..5c0fc860 --- /dev/null +++ b/languages/cpp/app_templates/kxt/prefs-base.ui @@ -0,0 +1,127 @@ + +Prefs_base + + + Prefs_base + + + + 0 + 0 + 282 + 156 + + + + + unnamed + + + + textLabel2_2 + + + Background color: + + + + + kcfg_col_background + + + + + + + + textLabel1 + + + Project age: + + + + + textLabel2 + + + Foreground color: + + + + + kcfg_col_foreground + + + + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 41 + 20 + + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 41 + 20 + + + + + + kcfg_val_time + + + 1 + + + 2 + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 41 + 20 + + + + + + + + kcolorbutton.h + + diff --git a/languages/cpp/app_templates/kxt/prefs.cpp b/languages/cpp/app_templates/kxt/prefs.cpp new file mode 100644 index 00000000..e7a46ddf --- /dev/null +++ b/languages/cpp/app_templates/kxt/prefs.cpp @@ -0,0 +1,12 @@ +%{CPP_TEMPLATE} + +#include "prefs.h" +#include + +Prefs::Prefs() + : Prefs_base() +{ +// debugging : +// kdWarning()<<"creating a pref dialog"< rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + +KDE_ICON = AUTO + +# this is where the kdelnk file will go +kdelnkdir = $(kde_appsdir)/Utilities +kdelnk_DATA = %{APPNAMELC}.desktop + +# this is where the XML-GUI resource file goes +rcdir = $(kde_datadir)/%{APPNAMELC} +rc_DATA = %{APPNAMELC}ui.rc diff --git a/languages/cpp/app_templates/kxt/src-configure.in.in b/languages/cpp/app_templates/kxt/src-configure.in.in new file mode 100644 index 00000000..61d4a7fd --- /dev/null +++ b/languages/cpp/app_templates/kxt/src-configure.in.in @@ -0,0 +1,7 @@ + +#MIN_CONFIG(3.2.0) + +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + diff --git a/languages/cpp/app_templates/kxt/subdirs b/languages/cpp/app_templates/kxt/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kxt/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/makefileempty/Makefile.am b/languages/cpp/app_templates/makefileempty/Makefile.am new file mode 100644 index 00000000..87f1db69 --- /dev/null +++ b/languages/cpp/app_templates/makefileempty/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = makefileempty-Makefile \ + makefileempty.png app.kdevelop +templateName = makefileempty + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/makefileempty/app.kdevelop b/languages/cpp/app_templates/makefileempty/app.kdevelop new file mode 100644 index 00000000..a0b41f59 --- /dev/null +++ b/languages/cpp/app_templates/makefileempty/app.kdevelop @@ -0,0 +1,101 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevCustomProject + C++ + + C++ + Code + + + + + + + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/makefileempty/makefileempty-Makefile b/languages/cpp/app_templates/makefileempty/makefileempty-Makefile new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/makefileempty/makefileempty.kdevtemplate b/languages/cpp/app_templates/makefileempty/makefileempty.kdevtemplate new file mode 100644 index 00000000..bacfcae0 --- /dev/null +++ b/languages/cpp/app_templates/makefileempty/makefileempty.kdevtemplate @@ -0,0 +1,85 @@ +# KDE Config File +[General] +Name=Empty Custom Makefile Template +Name[ca]=Plantilla Makefile personalitzada buida +Name[da]=Tom brugertilpasset Makefile-skabelon +Name[de]=Leere Vorlage für benutzerdefiniertes Makefile +Name[el]=Κενό προσαρμοσμένο πρότυπο Makefile +Name[es]=Plantilla vacía para Makefile personalizado +Name[et]=Tühi kohandatud makefile'i mall +Name[hu]=Üres egyedi Makefile-ra épülő sablon +Name[it]=Modello di makefile personalizzato vuoto +Name[nds]=Egen leddig Makefile-Vörlaag +Name[nl]=Leeg aangepast Makefile-sjabloon +Name[pl]=Pusty własny szablon pliku Makefile +Name[pt]=Modelo de Makefile Personalizada Vazio +Name[pt_BR]=Modelo de Makefile Personalizada Vazio +Name[ru]=Пустой шаблон с пользовательским Makefile +Name[sk]=Prázdna šablóna pre vlastný Makefile +Name[sr]=Празан шаблон посебног справифајла +Name[sr@Latn]=Prazan šablon posebnog spravifajla +Name[sv]=Tom mall för egen byggfil +Name[zh_TW]=空的自訂 Makefile 樣板 +Icon=makefileempty.png +Category=C++ +Comment=Generate an empty Custom Makefile based application +Comment[ca]=Genera una aplicació personalitzada buida basada en Makefile +Comment[da]=Opretter et tomt brugertilpasset Makefile-baseret program +Comment[de]=Erstellt eine auf einem benutzerdefinierten Makefile basierende Anwendung +Comment[el]=Δημιουργία μίας κενής εφαρμογής βασισμένης σε προσαρμοσμένο Makefile +Comment[es]=Genera una aplicación vacía basada en un Makefile personalizado +Comment[et]=Tühja rakenduse loomine kohandatud makefile'i põhjal +Comment[hu]=Létrehoz egy egyedi Makefile-ra épülő alkalmazást +Comment[it]=Genera un'applicazione basata su makefile personalizzato +Comment[nds]=Stellt en leddig Programm op, dat op en egen Makefile opbuut +Comment[nl]=Genereer een leeg op een aangepast Makefile gebaseerd programma +Comment[pl]=Generuje pusty program z własnym plikiem Makefile +Comment[pt]=Gera uma aplicação baseada em Makefile's personalizadas +Comment[pt_BR]=Gera uma aplicação baseada em Makefile's personalizadas +Comment[ru]=Создание каркаса приложения, использующего пользовательский Makefile +Comment[sk]=Vygeneruje prázdnu aplikáciu založenú na vlastnom Makefile +Comment[sr]=Прави програм на основу посебног справифајла +Comment[sr@Latn]=Pravi program na osnovu posebnog spravifajla +Comment[sv]=Skapar ett tomt program baserat på en egen byggfil +Comment[zh_TW]=產生一個空的使用自訂 Makefile 的應用程式 +FileTemplates=h,CStyle,cpp,CStyle +Archive=makefileempty.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE2] +Type=install +Source=%{src}/makefileempty-Makefile +Dest=%{dest}/Makefile + +[MSG] +Type=message +Comment=A Custom Makefile based application was created in %{dest} +Comment[ca]=S'ha creat una aplicació basada en Makefile en %{dest} +Comment[da]=Et brugertilpasset Makefile-baseret program blev oprettet i %{dest} +Comment[de]=Eine auf einem benutzerdefinierten Makefile basierende Anwendung wurde in %{dest} erstellt. +Comment[el]=Δημιουργήθηκε μία εφαρμογή βασισμένη σε προσαρμοσμένο Makefile στο %{dest} +Comment[es]=Una aplicación basada en un Makefile personalizado ha sido creada en %{dest} +Comment[et]=Rakendus kohandatud makefile'i põhjal loodi asukohta %{dest} +Comment[hu]=Létrejött egy egyedi Makefile-ra épülő alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione basata su un makefile personalizzato in %{dest} +Comment[nds]=In %{dest} wöör en Programm opstellt, dat op en egen Makefile opbuut +Comment[nl]=Een op een aangepast Makefile gebaseerd programma is aangemaakt in %{dest} +Comment[pl]=Program używający własnego Makefile został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação baseada em Makefile's personalizadas em %{dest} +Comment[pt_BR]=Foi criada uma aplicação baseada em Makefile's personalizadas em %{dest} +Comment[ru]=Приложение с пользовательским Makefile создано в %{dest} +Comment[sk]=Aplikácia založená na vlastnom Makefile bola vytvorená v %{dest} +Comment[sr]=Програм на основу посебног справифајла направљен је у %{dest} +Comment[sr@Latn]=Program na osnovu posebnog spravifajla napravljen je u %{dest} +Comment[sv]=Ett program baserat på en egen byggfil skapades i %{dest} +Comment[zh_TW]=一個以自訂 Makefile 為基礎的應用程式已建立於 %{dest} + diff --git a/languages/cpp/app_templates/makefileempty/makefileempty.png b/languages/cpp/app_templates/makefileempty/makefileempty.png new file mode 100644 index 00000000..519c007b Binary files /dev/null and b/languages/cpp/app_templates/makefileempty/makefileempty.png differ diff --git a/languages/cpp/app_templates/noatunui/.kdev_ignore b/languages/cpp/app_templates/noatunui/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/noatunui/Makefile.am b/languages/cpp/app_templates/noatunui/Makefile.am new file mode 100644 index 00000000..29358f2f --- /dev/null +++ b/languages/cpp/app_templates/noatunui/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = src-Makefile.am plugin_app.cpp plugin_impl.cpp plugin_impl.h \ + noatunui.png plugin.plugin plugin.kdevelop subdirs +templateName = noatunui + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/noatunui/noatunui b/languages/cpp/app_templates/noatunui/noatunui new file mode 100644 index 00000000..631c4798 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/noatunui @@ -0,0 +1,8 @@ +# KDE Config File +[General] +Name=Noatun UI plugin +Icon=noatunui.png +Category=C++/KDE +Comment=Generates a simple user interface plugin for noatun. +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/plugin_APPNAMELC_impl.cpp diff --git a/languages/cpp/app_templates/noatunui/noatunui.kdevtemplate b/languages/cpp/app_templates/noatunui/noatunui.kdevtemplate new file mode 100644 index 00000000..394e71ed --- /dev/null +++ b/languages/cpp/app_templates/noatunui/noatunui.kdevtemplate @@ -0,0 +1,195 @@ +# KDE Config File +[General] +Name=Noatun UI plugin +Name[ca]=Connector d'interfície d'usuari per a Noatun +Name[de]=Noatun-UI-Modul +Name[el]=Πρόσθετο Noatun UI +Name[es]=Complemento de interfaz de usuario para Noatun +Name[et]=Noatuni kasutajaliidese plugin +Name[eu]=Noatun UI plugina +Name[fa]=وصلۀ Noatun UI +Name[fr]=Module externe d'interface utilisateur pour Noatun +Name[ga]=Breiseán Chomhéadan Noatun +Name[gl]=Extensión para a IU de Noatun +Name[hu]=Noatun UI-modul +Name[it]=Plugin UI di noatun +Name[ja]=Noatun UI プラグイン +Name[nds]=Böversiet-Moduul för Noatun +Name[ne]=नोअटन UI plugin +Name[nl]=Noatun UI-plugin +Name[pl]=Wtyczka do interfejsu użytkownika Noatun +Name[pt]='Plugin' de UI do Noatun +Name[pt_BR]='Plugin' de UI do Noatun +Name[ru]=Модуль интерфейса Noatun +Name[sk]=Noatun UI modul +Name[sr]=UI прикључак за Noatun +Name[sr@Latn]=UI priključak za Noatun +Name[sv]=Noatun-insticksprogram för användargränssnitt +Name[tr]=Noatun Arayüz eklentisi +Name[zh_CN]=Noatun 界面插件 +Name[zh_TW]=Noatun 使用者介面外掛程式 +Icon=noatunui.png +Category=C++/KDE +Comment=Generates a simple user interface plugin for noatun. +Comment[ca]=Genera un simple connector d'interfície d'usuari per a Noatun. +Comment[da]=Genererer en simpel brugergrænseflade-plugin for noatun. +Comment[de]=Erstellt ein einfaches Oberflächen-Modul für Noatun +Comment[el]=Δημιουργεί ένα απλό πρόσθετο γραφικού περιβάλλοντος για το noatun. +Comment[es]=Genera un complemento de interfaz de usuario para Noatun. +Comment[et]=Noatuni lihtsa kasutajaliidese plugina loomine. +Comment[eu]=Noatun-entzat erabiltzaile-interfazerako plugin sinple bat sortzen du. +Comment[fa]=یک وصلۀ واسط کاربر ساده برای noatun تولید می‌کند. +Comment[fr]=Génère un module externe d'interface utilisateur simple pour Noatun. +Comment[gl]=Xera unha extensión sinxela para a interface de usuario de noatun. +Comment[hu]=Létrehoz egy egyszerű felületbővítő modult a Noatun programhoz. +Comment[it]=Genera un semplice plugin di interfaccia per noatun. +Comment[nds]=Stellt en eenfach Böversietmoduul för Noatun op. +Comment[ne]=नोअटनका लागि साधारण इन्टरफेस प्लगइन उत्पन्न गर्दछ । +Comment[nl]=Genereert een eenvoudige gebruikersinterfaceplugin voor Noatun. +Comment[pl]=Generuje prostą wtyczkę do interfejsu użytkownika programu Noatun. +Comment[pt]=Gera um 'plugin' simples para a interface de utilizador do Noatun. +Comment[pt_BR]=Gera um 'plugin' simples para a interface de utilizador do Noatun. +Comment[ru]=Создание простого интерфейса для Noatun. +Comment[sk]=Vygeneruje jednoduchý modul užívateľského rozhrania pre Noatun +Comment[sr]=Прави једноставан прикључак корисничког интерфејса за Noatun. +Comment[sr@Latn]=Pravi jednostavan priključak korisničkog interfejsa za Noatun. +Comment[sv]=Skapar ett enkelt insticksprogram för användargränssnitt till Noatun. +Comment[tr]=Noatun için basit bir kullanıcı arayüzü eklentisi yaratır. +Comment[zh_CN]=生成 noatun 的简单用户界面插件。 +Comment[zh_TW]=產生一個簡單的 noatun 的使用者介面外掛程式。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp +Archive=noatunui.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/plugin.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/plugin_app.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/plugin_impl.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp + +[FILE14] +Type=install +Source=%{src}/plugin_impl.h +Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.h + +[FILE15] +Type=install +Source=%{src}/plugin.plugin +Dest=%{dest}/src/%{APPNAMELC}.plugin + +[MSG] +Type=message +Comment=A Noatun UI plugin was created in %{dest} +Comment[ca]=Un connector d'interfície d'usuari per a Noatun ha estat creat en %{dest} +Comment[da]=Et Noatun UI-plugin blev oprettet i %{dest} +Comment[de]=Ein Oberflächen-Modul für Noatun wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο Noatun UI δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento de interfaz de usuario para Noatun ha sido creado en %{dest} +Comment[et]=Noatuni kasutajaliidese plugin loodi asukohta %{dest} +Comment[eu]=Noatun UI plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ Noatun UI در %{dest} ایجاد شد +Comment[fr]=Un module externe d'interface utilisateur pour Noatun a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán chomhéadan Noatun i %{dest} +Comment[gl]=Creouse unha extensión para a IU de Noatun en %{dest} +Comment[hu]=Létrejött egy Noatun UI-modul itt: %{dest} +Comment[it]=È stato creato un plugin UI per noatun in %{dest} +Comment[ja]=Noatun UI プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Noatun-Böversietmoduul opstellt +Comment[ne]=नोअटन UI प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een Noatun UI-plugin is aangemaakt in %{dest} +Comment[pl]=Wtyczka do interfejsu Noatun została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' da UI do Noatun em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' da UI do Noatun em %{dest} +Comment[ru]=Модуль интерфейса для Noatun создан в %{dest} +Comment[sk]=Noatun UI modul bol vytvorený v %{dest} +Comment[sr]=UI прикључак за Noatun направљен је у %{dest} +Comment[sr@Latn]=UI priključak za Noatun napravljen je u %{dest} +Comment[sv]=Ett Noatun-insticksprogram för användargränssnitt skapades i %{dest} +Comment[tr]=Bir Noatun Arayüz eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 Noatun 界面插件 +Comment[zh_TW]=一個 Noatun 使用者介面外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/noatunui/noatunui.png b/languages/cpp/app_templates/noatunui/noatunui.png new file mode 100644 index 00000000..0d2c3e30 Binary files /dev/null and b/languages/cpp/app_templates/noatunui/noatunui.png differ diff --git a/languages/cpp/app_templates/noatunui/plugin.kdevelop b/languages/cpp/app_templates/noatunui/plugin.kdevelop new file mode 100644 index 00000000..f0cda142 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin.kdevelop @@ -0,0 +1,111 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/noatun_%{APPNAMELC}plugin.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/noatunui/plugin.plugin b/languages/cpp/app_templates/noatunui/plugin.plugin new file mode 100644 index 00000000..a7bb9170 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin.plugin @@ -0,0 +1,8 @@ +Filename=noatun_%{APPNAMELC}plugin.la +Author=%{AUTHOR} +Site=http://noatun.kde.org/ +Email=%{EMAIL} +Type=userinterface +License=$LICENSE$ +Name=%{APPNAME} +Comment=A UI for Noatun diff --git a/languages/cpp/app_templates/noatunui/plugin_app.cpp b/languages/cpp/app_templates/noatunui/plugin_app.cpp new file mode 100644 index 00000000..23067139 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin_app.cpp @@ -0,0 +1,15 @@ + +#include "plugin_%{APPNAMELC}_impl.h" + +#include +#include + +extern "C" +{ + Plugin *create_plugin() + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}UI; + } +} + diff --git a/languages/cpp/app_templates/noatunui/plugin_impl.cpp b/languages/cpp/app_templates/noatunui/plugin_impl.cpp new file mode 100644 index 00000000..1b5eea45 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin_impl.cpp @@ -0,0 +1,301 @@ + +#include "plugin_%{APPNAMELC}_impl.h" +#include "plugin_%{APPNAMELC}_impl.moc" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +//#include +//#include + +%{APPNAME}UI::%{APPNAME}UI() : QWidget(0,"%{APPNAME}UI"), UserInterface() +{ + setAcceptDrops(true); + static const int buttonSize=32; + + mBack=new QPushButton(this); + mBack->setFixedSize(buttonSize,buttonSize); + mBack->setPixmap(BarIcon("noatunback")); + connect(mBack, SIGNAL(clicked()), napp->player(), SLOT(back())); + QToolTip::add(mBack,i18n("Back")); + + mStop=new QPushButton(this); + mStop->setFixedSize(buttonSize,buttonSize); + mStop->setPixmap(BarIcon("noatunstop")); + connect(mStop, SIGNAL(clicked()), napp->player(), SLOT(stop())); + QToolTip::add(mStop, i18n("Stop")); + + mPlay=new QPushButton(this); + mPlay->setToggleButton(true); + mPlay->setFixedSize(buttonSize,buttonSize); + mPlay->setPixmap(BarIcon("noatunplay")); + connect(mPlay, SIGNAL(clicked()), napp->player(), SLOT(playpause())); + QToolTip::add(mPlay, i18n("Play")); + + mForward=new QPushButton(this); + mForward->setFixedSize(buttonSize,buttonSize); + mForward->setPixmap(BarIcon("noatunforward")); + connect(mForward, SIGNAL(clicked()), napp->player(), SLOT(forward())); + QToolTip::add(mForward, i18n("Forward")); + + mPlaylist=new QPushButton(this); + mPlaylist->setToggleButton(true); + mPlaylist->setFixedSize(buttonSize,buttonSize); + mPlaylist->setPixmap(BarIcon("noatunplaylist")); + connect(mPlaylist, SIGNAL(clicked()), napp->player(), SLOT(toggleListView())); + QToolTip::add(mPlaylist, i18n("Playlist")); + + mLoop=new QPushButton(this); + mLoop->setFixedSize(buttonSize,buttonSize); + mLoop->setPixmap(BarIcon("noatunloopnone")); + connect(mLoop, SIGNAL(clicked()), napp->player(), SLOT(loop())); + QToolTip::add(mLoop, i18n("Change loop style")); + + mPopup=new QPushButton(this); + mPopup->setFixedSize(buttonSize,buttonSize); + mPopup->setPixmap(BarIcon("noatun")); + connect(mPopup, SIGNAL(clicked()), SLOT(popup())); + + + mVolume=new L33tSlider(0,100,10,0, Horizontal, this); + mVolume->setValue(napp->player()->volume()); + mSeeker=new L33tSlider(0,1000,10,0, Horizontal, this); + + mStatusBar=new KStatusBar(this); + + + QGridLayout *l=new QGridLayout(this); + l->addWidget(mBack,0,0); + l->addWidget(mStop,0,1); + l->addWidget(mPlay,0,2); + l->addWidget(mForward,0,3); + l->addWidget(mPlaylist,0,4, Qt::AlignLeft); + l->addWidget(mLoop,0,5); + l->addWidget(mPopup,0,6); + l->addColSpacing(4, buttonSize+8); + + l->addMultiCellWidget(mVolume,1,1,0,6); + l->addMultiCellWidget(mSeeker,2,2,0,6); + l->addMultiCellWidget(mStatusBar,3,3,0,6); + + statusBar()->message(i18n("No File Loaded")); + statusBar()->insertItem("--:--/--:--", 1, 0, true); + + connect(napp, SIGNAL(hideYourself()), this, SLOT(hide()) ); + connect(napp, SIGNAL(showYourself()), this, SLOT(show()) ); + + connect(napp->player(), SIGNAL(playing()), this, SLOT(slotPlaying())); + connect(napp->player(), SIGNAL(stopped()), this, SLOT(slotStopped())); + connect(napp->player(), SIGNAL(paused()), this, SLOT(slotPaused())); + napp->player()->handleButtons(); + + connect(napp->player(), SIGNAL(timeout()), this, SLOT(slotTimeout())); + connect(napp->player(), SIGNAL(loopTypeChange(int)), this, SLOT(changeLoopType(int))); + + /* This skipToWrapper is needed to pass milliseconds to Player() as everybody + * below the GUI is based on milliseconds instead of some unprecise thingy + * like seconds or mille */ + connect(seeker(), SIGNAL(userChanged(int)), this, SLOT(skipToWrapper(int))); + connect(this, SIGNAL(skipTo(int)), napp->player(), SLOT(skipTo(int))); + connect(seeker(), SIGNAL(sliderMoved(int)), SLOT(sliderMoved(int))); + + connect(mVolume, SIGNAL(sliderMoved(int)), napp->player(), SLOT(setVolume(int))); + connect(mVolume, SIGNAL(userChanged(int)), napp->player(), SLOT(setVolume(int))); + + + connect(napp->player(), SIGNAL(playlistShown()), SLOT(playlistShown())); + connect(napp->player(), SIGNAL(playlistHidden()), SLOT(playlistHidden())); + + // Event Filter for the RMB + for (QPtrListIterator i(*children()); i.current(); ++i) + (*i)->installEventFilter(this); + + setCaption("Noatun"); + setIcon(BarIcon("noatun")); + show(); + + // What it is now, stay. + setFixedSize(minimumSize()); +} + +%{APPNAME}UI::~%{APPNAME}UI() +{ + /** save settings here */ +} + +void %{APPNAME}UI::closeEvent(QCloseEvent*) +{ + unload(); +} + +void %{APPNAME}UI::showEvent(QShowEvent*e) +{ + QWidget::showEvent(e); +} + +void %{APPNAME}UI::dragEnterEvent(QDragEnterEvent *event) +{ + // accept uri drops only + event->accept(KURLDrag::canDecode(event)); +} + +void %{APPNAME}UI::dropEvent(QDropEvent *event) +{ + KURL::List uri; + if (KURLDrag::decode(event, uri)) + { + for (KURL::List::Iterator i = uri.begin(); i != uri.end(); ++i) + napp->player()->openFile(*i, false); + } +} + +void %{APPNAME}UI::mouseReleaseEvent(QMouseEvent *e) +{ + QWidget::mouseReleaseEvent(e); + if (e->button()!=RightButton) return; + NoatunStdAction::ContextMenu::showContextMenu(); +} + +void %{APPNAME}UI::changeStatusbar(const QString& text, const QString &text2) +{ + if (!text2.isNull()) + statusBar()->changeItem(text2, 1); + + statusBar()->message(!text.isNull() ? text : napp->player()->current().title()); +} + +void %{APPNAME}UI::changeCaption(const QString& text) +{ + setCaption(text); +} + +void %{APPNAME}UI::popup() +{ + NoatunStdAction::ContextMenu::showContextMenu( + mapToGlobal(mPopup->geometry().bottomLeft()) ); +} + +void %{APPNAME}UI::slotPlaying() +{ + changeStatusbar(napp->player()->current().title(), napp->player()->lengthString()); + mPlay->setOn(true); + mStop->setEnabled(true); + mPlay->setPixmap(BarIcon("noatunpause")); +} + +void %{APPNAME}UI::slotStopped() +{ + if (!napp->player()->current()) return; + changeStatusbar(i18n("No File Loaded"), napp->player()->lengthString()); + mStop->setEnabled(false); + mPlay->setOn(false); + seeker()->setValue(0); + mPlay->setPixmap(BarIcon("noatunplay")); +} + +void %{APPNAME}UI::slotPaused() +{ + mStop->setEnabled(true); + mPlay->setOn(false); + mPlay->setPixmap(BarIcon("noatunplay")); +} + +void %{APPNAME}UI::slotTimeout() +{ + mVolume->setValue(napp->player()->volume()); + + if (!napp->player()->current()) return; + if (static_cast(seeker())->currentlyPressed()) return; + if (seeker()) + { + seeker()->setRange ( 0, (int)napp->player()->getLength()/1000 ); + seeker()->setValue ( (int)napp->player()->getTime()/1000 ); + } + changeStatusbar(0, napp->player()->lengthString()); +} + +void %{APPNAME}UI::sliderMoved(int seconds) +{ + if (napp->player()->current()) + changeStatusbar(0, napp->player()->lengthString(seconds*1000)); +} + +void %{APPNAME}UI::skipToWrapper(int second) +{ + emit skipTo((long)(second*1000)); +} + +void %{APPNAME}UI::changeLoopType(int t) +{ + static const int time=2000; + switch (t) + { + case(Player::None): + statusBar()->message(i18n("No looping"), time); + mLoop->setPixmap(BarIcon("noatunloopnone")); + break; + case(Player::Song): + statusBar()->message(i18n("Song looping"), time); + mLoop->setPixmap(BarIcon("noatunloopsong")); + break; + case(Player::Playlist): + statusBar()->message(i18n("Playlist looping"), time); + mLoop->setPixmap(BarIcon("noatunloopplaylist")); + break; + case(Player::Random): + statusBar()->message(i18n("Random play"), time); + mLoop->setPixmap(BarIcon("noatunlooprandom")); + } +} + +bool %{APPNAME}UI::eventFilter(QObject *o, QEvent *e) +{ + if ((e->type() == QEvent::MouseButtonRelease) + && ((static_cast(e))->button()==RightButton)) + { + mouseReleaseEvent(static_cast(e)); + return true; + } + + if (e->type() == QEvent::Wheel) + { + wheelEvent(static_cast(e)); + return true; + } + return QWidget::eventFilter(o, e); +} + +void %{APPNAME}UI::playlistShown() +{ + mPlaylist->setOn(true); +} + +void %{APPNAME}UI::playlistHidden() +{ + mPlaylist->setOn(false); +} + +void %{APPNAME}UI::wheelEvent(QWheelEvent *e) +{ + int delta=e->delta(); + mVolume->setValue(mVolume->value()+(delta/120)); + napp->player()->setVolume(mVolume->value()+(delta/120)); +} + diff --git a/languages/cpp/app_templates/noatunui/plugin_impl.h b/languages/cpp/app_templates/noatunui/plugin_impl.h new file mode 100644 index 00000000..970246d4 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/plugin_impl.h @@ -0,0 +1,78 @@ + +#ifndef %{APPNAMEUC}_IMPL_H +#define %{APPNAMEUC}_IMPL_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +// Pref dialog pointer global now for position saving +#include + +class Player; +class QSlider; +class QPushButton; +class KStatusBar; + +/** + * @short Main window class + * @author %{AUTHOR} <%{EMAIL}> + * @version 0.1 + * Note: You can user _every_ widget for implementing your userinterface. + */ +class %{APPNAME}UI : public QWidget, public UserInterface +{ +Q_OBJECT +public: + %{APPNAME}UI(); + virtual ~%{APPNAME}UI(); + void load(const QString& url); + +protected: + virtual void dragEnterEvent(QDragEnterEvent *event); + virtual void dropEvent(QDropEvent *event); + virtual void closeEvent(QCloseEvent*); + virtual void showEvent(QShowEvent*e); + /** RMB -> context menu */ + virtual void mouseReleaseEvent(QMouseEvent *); + virtual bool eventFilter(QObject*, QEvent*); + /** volume control */ + virtual void wheelEvent(QWheelEvent *e); + +protected: + QSlider *seeker() const { return mSeeker; } + KStatusBar *statusBar() const { return mStatusBar; } + +public slots: + void slotPlaying(); + void slotStopped(); + void slotPaused(); + + /** "show/hide playlist" button */ + void playlistShown(); + void playlistHidden(); + + void slotTimeout(); + void sliderMoved(int seconds); + void changeLoopType(int t); + void skipToWrapper(int second); + +signals: + void skipTo( int ); // emitted by skipToWrapper() + +private slots: + void changeStatusbar(const QString& text, const QString &text2=0); + void changeCaption(const QString& text); + void popup(); + +private: + QPushButton *mBack, *mStop, *mPlay, *mForward, *mPlaylist, *mPopup, *mLoop; + QSlider *mSeeker, *mVolume; + KStatusBar *mStatusBar; +}; + +#endif // %{APPNAMEUC}_IMPL_H + diff --git a/languages/cpp/app_templates/noatunui/src-Makefile.am b/languages/cpp/app_templates/noatunui/src-Makefile.am new file mode 100644 index 00000000..95506569 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/src-Makefile.am @@ -0,0 +1,24 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = noatun_%{APPNAMELC}plugin.la + +noatun_%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp plugin_%{APPNAMELC}_impl.cpp +noatun_%{APPNAMELC}plugin_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +noatun_%{APPNAMELC}plugin_la_LIBADD = $(LIB_KFILE) -lnoatun -lnoatuncontrols \ + -lqtmcop -lkmedia2_idl -lsoundserver_idl + +noinst_HEADERS = plugin_%{APPNAMELC}_impl.h + +# noatun_modules_uidir = $(kde_datadir)/noatun +# noatun_modules_ui_DATA = %{APPNAMELC}.plugin + +pluginsdir = $(kde_datadir)/noatun +plugins_DATA = %{APPNAMELC}.plugin + +# kde_services_DATA = %{APPNAMELC}.desktop + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/noatunui/subdirs b/languages/cpp/app_templates/noatunui/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/noatunui/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/noatunvisual/.kdev_ignore b/languages/cpp/app_templates/noatunvisual/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/noatunvisual/Makefile.am b/languages/cpp/app_templates/noatunvisual/Makefile.am new file mode 100644 index 00000000..0d6a43eb --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h plugin_impl.cpp \ + plugin_impl.h noatunvisual.png plugin.plugin plugin.kdevelop \ + subdirs noatunvisual-configure.in.in +templateName = noatunvisual + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/noatunvisual/noatunvisual b/languages/cpp/app_templates/noatunvisual/noatunvisual new file mode 100644 index 00000000..e0d0f7e0 --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/noatunvisual @@ -0,0 +1,8 @@ +# KDE Config File +[General] +Name=Noatun visualization plugin +Icon=noatunvisual.png +Category=C++/KDE +Comment=Generates a visualization plugin for noatun using SDL +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/plugin_APPNAMELC_impl.cpp diff --git a/languages/cpp/app_templates/noatunvisual/noatunvisual-configure.in.in b/languages/cpp/app_templates/noatunvisual/noatunvisual-configure.in.in new file mode 100644 index 00000000..b973abe8 --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/noatunvisual-configure.in.in @@ -0,0 +1,36 @@ +#MIN_CONFIG(3.0.0) + +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + +KDE_CHECK_HEADERS([noatun/plugin.h]) +KDE_CHECK_LIB([noatun],main, + [LIB_NOAUTUN="-lnoautun"]) +AC_SUBST(LIB_NOAUTUN) + +KDE_FIND_PATH(sdl-config, LIBSDL_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [ + AC_MSG_WARN([Could not find libsdl anywhere, check http://www.sdl.org]) +]) + +if test -n "$LIBSDL_CONFIG"; then + LIBSDL_LIBS="`$LIBSDL_CONFIG --libs`" + LIBSDL_RPATH= + for args in $LIBSDL_LIBS; do + case $args in + -L*) + LIBSDL_RPATH="$LIBSDL_RPATH $args" + ;; + esac + done + LIBSDL_RPATH=`echo $LIBSDL_RPATH | sed -e "s/-L/-R/g"` + LIBSDL_CFLAGS="`$LIBSDL_CONFIG --cflags`" + + AC_DEFINE_UNQUOTED(HAVE_LIBSDL, 1, [Defines if your system has the LIBSDL library]) +fi + + +AC_SUBST(LIBSDL_LIBS) +AC_SUBST(LIBSDL_CFLAGS) +AC_SUBST(LIBSDL_RPATH) + diff --git a/languages/cpp/app_templates/noatunvisual/noatunvisual.kdevtemplate b/languages/cpp/app_templates/noatunvisual/noatunvisual.kdevtemplate new file mode 100644 index 00000000..4c726194 --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/noatunvisual.kdevtemplate @@ -0,0 +1,205 @@ +# KDE Config File +[General] +Name=Noatun visualization plugin +Name[ca]=Connector de visualització per a Noatun +Name[da]=Noatun visualiserings-plugin +Name[de]=Noatun-Visualisierungs-Modul +Name[el]=Οπτικό πρόσθετο Noatun +Name[en_GB]=Noatun visualisation plugin +Name[es]=Complemento de visualización para Noatun +Name[et]=Noatuni visualiseerimisplugin +Name[eu]=Noatun bistaratze-plugina +Name[fa]=وصلۀ تجسم Noatun +Name[fr]=Module externe de visualisation pour Noatun +Name[ga]=Breiseán amharcléirithe Noatun +Name[gl]=Extensión de visualización para Noatun +Name[hu]=Noatun vizualizációs modul +Name[it]=Plugin di visualizzazione per noatun +Name[ja]=Noatun ビジュアライゼーションプラグイン +Name[nds]=Noatun-Filmmakermoduul +Name[ne]=नोअटन भिजुलाइजेसन प्लगइन +Name[nl]=Noatun visualisatieplugin +Name[pl]=Wtyczka wizualizacji do Noatun +Name[pt]='Plugin' de visualização do Noatun +Name[pt_BR]='Plugin' de visualização do Noatun +Name[ru]=Модуль визуализации Noatun +Name[sk]=Noatun vizualizačný modul +Name[sr]=Визуелизациони прикључак за Noatun +Name[sr@Latn]=Vizuelizacioni priključak za Noatun +Name[sv]=Noatun-insticksprogram för visningar +Name[tr]=Noatun görsellik eklentisi +Name[zh_CN]=Noatun 可视化插件 +Name[zh_TW]=Noatun 視覺化外掛程式 +Icon=noatunvisual.png +Category=C++/KDE +Comment=Generates a visualization plugin for noatun using SDL +Comment[ca]=Genera un connector de visualització per a Noatun usant SDL +Comment[da]=Generere et visualiserings-plugin for noatun ved brug af SDL +Comment[de]=Erstellt ein Visualisierungs-Modul für Noatun unter Verwendung der SDL. +Comment[el]=Δημιουργεί ένα οπτικό πρόσθετο για το noatun χρησιμοποιώντας το SDL +Comment[en_GB]=Generates a visualisation plugin for noatun using SDL +Comment[es]=Genera un complemento de visualización para Noatun que usa SDL +Comment[et]=Noatuni visualiseerimisplugina loomine SDL-i abil +Comment[eu]=SDL erabiliz, bistaratze-plugin bat sortzen du noatun-entzat +Comment[fa]=یک وصلۀ تجسم برای noatun با استفاده از SDL تولید می‌کند +Comment[fr]=Génère un module externe de visualisation pour Noatun utilisant SDL +Comment[ga]=Cruthaíonn sé seo breiseán amharcléirithe noatun le SDL +Comment[gl]=Xera unha extensión de visualización para noatun usando SDL +Comment[hu]=Létrehoz egy vizualizációs modult a Noatunhoz, SDL-ben +Comment[it]=Genera un plugin di visualizzazione per noatun usando SDL +Comment[nds]=Stellt mit SDL en Filmmakermoduul för Noatun op +Comment[ne]=SDL प्रयोग गरेर नोअटनका लागि भिजुलाइजेसन प्लगइन उत्पन्न गर्दछ +Comment[nl]=Genereert een visualisatieplugin voor Noatun met behulp van SDL +Comment[pl]=Generuje wtyczkę wizualizacji do Noatun. Używany jest SDL. +Comment[pt]=Gera um 'plugin' de visualização para o Noatun, que usa o SDL +Comment[pt_BR]=Gera um 'plugin' de visualização para o Noatun, que usa o SDL +Comment[ru]=Создание модуля визуализации для Noatun на основе SDL +Comment[sk]=Vygeneruje vizualizačný modul pre Noatun s použitím SDL +Comment[sr]=Прави визуелизациони прикључак за Noatun користећи SDL +Comment[sr@Latn]=Pravi vizuelizacioni priključak za Noatun koristeći SDL +Comment[sv]=Skapar ett Noatun-insticksprogram för visningar som använder SDL +Comment[tr]=SDL kullanarak noatun için bir görsellik eklentisi yaratır. +Comment[zh_CN]=使用 SDL 生成 noatun 的可视化插件 +Comment[zh_TW]=產生一個使用 SDL 的 Noatun 視覺化外掛程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp +Archive=noatunvisual.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +Source=%{src}/plugin.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{src}/noatunvisual-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/plugin_app.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/plugin_app.h +Dest=%{dest}/src/plugin_%{APPNAMELC}.h + +[FILE14] +Type=install +Source=%{src}/plugin_impl.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp + +[FILE15] +Type=install +Source=%{src}/plugin_impl.h +Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.h + +[FILE16] +Type=install +Source=%{src}/plugin.plugin +Dest=%{dest}/src/%{APPNAMELC}.plugin + +[MSG] +Type=message +Comment=A Noatun visualization plugin was created in %{dest} +Comment[ca]=Un connector de visualització per a Noatun ha estat creat en %{dest} +Comment[da]=Et Noatun visualiserings-plugin blev oprettet i %{dest} +Comment[de]=Ein Visualisierungs-Modul für Noatun wurde in %{dest} erstellt. +Comment[el]=Ένα οπτικό πρόσθετο Noatun δημιουργήθηκε στο %{dest} +Comment[en_GB]=A Noatun visualisation plugin was created in %{dest} +Comment[es]=Un complemento de visualización para Noatun ha sido creado en %{dest} +Comment[et]=Noatuni visualiseerimisplugin loodi asukohta %{dest} +Comment[eu]=Noatun-en bistaratze-plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ تجسم Noatun در %{dest} ایجاد شد +Comment[fr]=Un module externe de visualisation pour Noatun a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán amharcléirithe Noatun i %{dest} +Comment[gl]=Creouse unha extensión de visualización para Noatun en %{dest} +Comment[hu]=Létrejött egy Noatun vizualizációs modul itt: %{dest} +Comment[it]=È stato creato un plugin di visualizzazione per noatun in %{dest} +Comment[ja]=Noatun ビジュアライゼーションプラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Noatun-Filmmakermoduul opstellt +Comment[ne]=नोअटन भिजुलाइजेसन प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een Noatun-visualisatieplugin is aangemaakt in %{dest} +Comment[pl]=Wtyczka wizualizacji została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' de visualização do Noatun em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' de visualização do Noatun em %{dest} +Comment[ru]=Модуль визуализации Noatun создан в %{dest} +Comment[sk]=Noatun vizualizačný modul bol vytvorený v %{dest} +Comment[sr]=Визуелизациони прикључак за Noatun направљен је у %{dest} +Comment[sr@Latn]=Vizuelizacioni priključak za Noatun napravljen je u %{dest} +Comment[sv]=Ett Noatun-insticksprogram för visningar skapades i %{dest} +Comment[tr]=Bir Noatun görsellik eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了 Noatun 可视化插件 +Comment[zh_TW]=一個 Noatun 視覺化外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/noatunvisual/noatunvisual.png b/languages/cpp/app_templates/noatunvisual/noatunvisual.png new file mode 100644 index 00000000..4dcfce3d Binary files /dev/null and b/languages/cpp/app_templates/noatunvisual/noatunvisual.png differ diff --git a/languages/cpp/app_templates/noatunvisual/plugin.kdevelop b/languages/cpp/app_templates/noatunvisual/plugin.kdevelop new file mode 100644 index 00000000..281d095e --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/plugin.kdevelop @@ -0,0 +1,118 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/noatun_%{APPNAMELC}plugin.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + -lSDL + + + + + + + + + + + + + + + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/noatunvisual/plugin.plugin b/languages/cpp/app_templates/noatunvisual/plugin.plugin new file mode 100644 index 00000000..9dc32648 --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/plugin.plugin @@ -0,0 +1,8 @@ +Filename=noatun_%{APPNAMELC}plugin.la +Author=%{AUTHOR} +Site=http://noatun.kde.org/ +Email=%{EMAIL} +Type=visualization +License=$LICENSE$ +Name=%{APPNAME} +Comment=My scope visualization plugin diff --git a/languages/cpp/app_templates/noatunvisual/plugin_app.cpp b/languages/cpp/app_templates/noatunvisual/plugin_app.cpp new file mode 100644 index 00000000..442bdefd --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/plugin_app.cpp @@ -0,0 +1,58 @@ + +#include +#include + +#include "plugin_%{APPNAMELC}.h" +#include "plugin_%{APPNAMELC}_impl.h" + +#include +#include + +extern "C" +{ + Plugin *create_plugin() + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}Scope(); + } +} + +%{APPNAME}Scope::%{APPNAME}Scope() + : MonoScope(50), Plugin() +{ + setSamples(320); +} + +%{APPNAME}Scope::~%{APPNAME}Scope() +{ + ::close(mOutFd); + wait(0); +} + +void %{APPNAME}Scope::init() +{ + int pipes[2]; + ::pipe(pipes); + mOutFd=pipes[1]; + if (!fork()) + { + ::close(pipes[1]); + new %{APPNAME}View(pipes[0]); + exit(0); + } + else + { + fcntl(mOutFd, F_SETFL, fcntl(mOutFd, F_GETFL) & ~O_NONBLOCK); + ::close(pipes[0]); + MonoScope::start(); + } +} + +void %{APPNAME}Scope::scopeEvent(float *d, int size) +{ + if (::write(mOutFd, (char *)d, size * sizeof(float))==-1) + { + MonoScope::stop(); + unload(); + } +} diff --git a/languages/cpp/app_templates/noatunvisual/plugin_app.h b/languages/cpp/app_templates/noatunvisual/plugin_app.h new file mode 100644 index 00000000..a3cf91ea --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/plugin_app.h @@ -0,0 +1,36 @@ + +/** Note: You only have to change plugin_%{APPNAMELC}_impl.[h,cpp] */ + +#ifndef _PLUGIN_%{APPNAMEUC}_H_ +#define _PLUGIN_%{APPNAMEUC}_H_ + +#include +#include + +extern "C" +{ + #include + #include + #include +} + +class %{APPNAME}Scope : public MonoScope, public Plugin +{ +NOATUNPLUGIND + +public: + %{APPNAME}Scope(); + virtual ~%{APPNAME}Scope(); + + /** @short create a new child process (using fork) with %{APPNAME}View */ + void init(); + +protected: + virtual void scopeEvent(float *data, int bands); + +private: + int mOutFd; +}; + +#endif // _PLUGIN_%{APPNAMEUC}_H_ + diff --git a/languages/cpp/app_templates/noatunvisual/plugin_impl.cpp b/languages/cpp/app_templates/noatunvisual/plugin_impl.cpp new file mode 100644 index 00000000..a25f1fd2 --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/plugin_impl.cpp @@ -0,0 +1,276 @@ + +#include "plugin_%{APPNAMELC}_impl.h" + +#include +#include + +extern "C" +{ + #include + #include + #include +} + +#if 0 +#define TEST() cout << "At line " << __LINE__ << endl +#else +#define TEST() if(0) +#endif + +#define output ((unsigned char*)data) +template +inline void Bitmap::addPixel(int x, int y, int br1, int br2) +{ + if (x < 0 || x >= width || y < 0 || y >= height) return; + + register unsigned char *p = output+x*2+y*width*2; + if (p[0] < 255-br1) p[0] += br1; else p[0] = 255; + if (p[1] < 255-br2) p[1] += br2; else p[1] = 255; +} + +template +void Bitmap::addVertLine(int x, int y1, int y2, int br1, int br2) +{ + if(y1 < y2) + { + for(int y = y1; y <= y2; y++) + addPixel(x,y, br1, br2); + } + else if(y2 < y1) + { + for(int y = y2; y <= y1; y++) + addPixel(x, y, br1, br2); + } + else + { + addPixel(x, y1, br1, br2); + } +} + +template +void Bitmap::fadeStar() +{ + register unsigned long *ptr = (unsigned long*)output; + int i = width*height*2/4; + do + { + if (*ptr) + *(ptr++) -= ((*ptr & 0xf0f0f0f0ul) >> 4) + ((*ptr & 0xe0e0e0e0ul) >> 5); + else + ptr++; + } while(--i > 0); +} + +%{APPNAME}View::%{APPNAME}View(int in) : mFd(in), outputBmp(0), fullscreen(false) +{ + surface = 0; + width = 320; + height = width*6/8; + outputBmp.size(width, height); + TEST(); + + TEST(); + fcntl(mFd, F_SETFL, fcntl(mFd, F_GETFL) & ~O_NONBLOCK); + TEST(); + + + float *data = new float[width]; + TEST(); + + startVideo(); + setupPalette(); + TEST(); + + while(true) + { + checkInput(); + + if(!surface) exit(0); + + int bytestoread = width * sizeof(float); + int pos = 0; + while(pos < bytestoread) + { + char *d = (char *)data; + int r = read(mFd, d + pos, bytestoread - pos); + if(r > 0) pos += r; + else if (r==0) exit(0); + } + + outputBmp.fadeStar(); + outputBmp.fadeStar(); + + float *d = data; + float *end = data + width; + float heightHalf = height / 4.0; + int y = height / 2; + int x=0; + int oldy=(int)(*d * heightHalf); + while(d <= end) + { + int amp = (int)(*d * heightHalf); + amp+=y; + + outputBmp.addVertLine(x, oldy, amp, 255, 255); + oldy=amp; + + d++; + x++; + } + repaint(); + } +} + +static SDL_Surface *CreateScreen(Uint16 w, Uint16 h, Uint8 bpp, Uint32 flags) +{ + SDL_Surface *screen; + + // Set the video mode + screen = SDL_SetVideoMode(w, h, bpp, flags); + return screen; +} + +void %{APPNAME}View::startVideo() +{ + if(surface) + { + SDL_FreeSurface(surface); + surface = 0; + } + + Uint32 videoflags; + + /* Initialize SDL */ + if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) + exit(0); + + SDL_WM_SetCaption("%{APPNAME}","%{APPNAMELC}"); + + /* See if we try to get a hardware colormap */ + videoflags = SDL_SWSURFACE | (fullscreen?SDL_FULLSCREEN:0); + + surface = CreateScreen(width, height, 8, videoflags); + if (!surface) + exit(0); + + SDL_ShowCursor(0); + + if(!surface) + SDL_Quit(); + + SDL_WM_SetCaption("%{APPNAME}", 0); + SDL_ShowCursor(0); + +} + +void %{APPNAME}View::setupPalette(double) +{ +#define BOUND(x) ((x) > 255 ? 255 : (x)) +#define PEAKIFY(x) int(BOUND((x) - (x)*(255-(x))/255/2)) +#define MAX(x,y) ((x) > (y) ? (x) : (y)) + + int redMax=136; + int greenMax=136; + int blueMax=255; + + SDL_Color sdlPalette[256]; + + for(int i=0;i<256;i++) + { + // i + // 255 136 + sdlPalette[i].r = i*redMax/255; + sdlPalette[i].g = i*greenMax/255; + sdlPalette[i].b = i*blueMax/255; + } + + SDL_SetColors(surface, sdlPalette, 0, 256); + +#undef BOUND +#undef PEAKIFY +#undef MAX +} + +void %{APPNAME}View::checkInput() +{ + SDL_Event myEvent; + + while(SDL_PollEvent(&myEvent)) + { + switch(myEvent.type) + { + case SDL_KEYDOWN: + switch(myEvent.key.keysym.sym) + { + case SDLK_SPACE: +// fullscreen ^= true; +// startVideo(); + break; + default: + break; + } + break; + + case SDL_QUIT: + exit(0); + break; + } + } +} + +#define output2 ((unsigned char*)outputBmp.data) + +void %{APPNAME}View::repaint() +{ + SDL_LockSurface(surface); + TEST(); + + register unsigned long *ptr2 = (unsigned long*)output2; + unsigned long *ptr1 = (unsigned long*)( surface->pixels ); + int i = width*height/4; + TEST(); + + do { + // Asger Alstrup Nielsen's (alstrup@diku.dk) + // optimized 32 bit screen loop + register unsigned int const r1 = *(ptr2++); + register unsigned int const r2 = *(ptr2++); + + //if (r1 || r2) { +#ifdef LITTLEENDIAN + register unsigned int const v = + ((r1 & 0x000000f0ul) >> 4) + | ((r1 & 0x0000f000ul) >> 8) + | ((r1 & 0x00f00000ul) >> 12) + | ((r1 & 0xf0000000ul) >> 16); + *(ptr1++) = v | + ( ((r2 & 0x000000f0ul) << 12) + | ((r2 & 0x0000f000ul) << 8) + | ((r2 & 0x00f00000ul) << 4) + | ((r2 & 0xf0000000ul))); +#else + register unsigned int const v = + ((r2 & 0x000000f0ul) >> 4) + | ((r2 & 0x0000f000ul) >> 8) + | ((r2 & 0x00f00000ul) >> 12) + | ((r2 & 0xf0000000ul) >> 16); + *(ptr1++) = v | + ( ((r1 & 0x000000f0ul) << 12) + | ((r1 & 0x0000f000ul) << 8) + | ((r1 & 0x00f00000ul) << 4) + | ((r1 & 0xf0000000ul))); +#endif + //} else ptr1++; + } while (--i); + TEST(); + + SDL_UnlockSurface(surface); + SDL_UpdateRect(surface, 0, 0, 0, 0); + TEST(); + +} + +%{APPNAME}View::~%{APPNAME}View() +{ + ::close(mFd); +} diff --git a/languages/cpp/app_templates/noatunvisual/plugin_impl.h b/languages/cpp/app_templates/noatunvisual/plugin_impl.h new file mode 100644 index 00000000..2a7de7b1 --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/plugin_impl.h @@ -0,0 +1,77 @@ + +#ifndef %{APPNAMEUC}_IMPL_H +#define %{APPNAMEUC}_IMPL_H + +struct SDL_Surface; + +/** + * @short This class is used for painting and supports some effects. + * Note: This is used in Blurscope. Feel free to remove this and + * implement your own drawing routines! + */ +template class Bitmap +{ +public: + int width, height, extra; + Pixel *data; + + Bitmap(int e=0) : extra(e), data(0) { } + ~Bitmap() { delete[] data; } + + inline void addPixel(int x, int y, int bright1, int bright2); + void addVertLine(int x, int y, int y2, int br1, int br2); + + void fadeStar(); + + void size(int w,int h) + { + delete[] data; + width = w; + height = h; + data = new Pixel[w*h+extra]; + clear(); + } + + void clear() + { + memset(data,0,sizeof(Pixel)*(width*height+extra)); + } +}; + +/** + * @short This class does: + * o set up view + * o drawing routines. + */ +class %{APPNAME}View +{ +public: + %{APPNAME}View(int in); + ~%{APPNAME}View(); + +protected: + /** Screen initialization with SDL. Note, that you can initialize OpenGL with SDL! */ + void startVideo(); + /** SDL event queue */ + void checkInput(); + /** Used in Blurscope. Feel free to implement your own drawing routines! */ + void setupPalette(double dummy=0.0); + + /** Draw everything. */ + void repaint(); + +private: + /** used for pipelining */ + int mFd; + + /** SDL screen surface */ + SDL_Surface *surface; + Bitmap outputBmp; + + bool fullscreen; + int width; + int height; +}; + +#endif // %{APPNAMEUC}_IMPL_H + diff --git a/languages/cpp/app_templates/noatunvisual/src-Makefile.am b/languages/cpp/app_templates/noatunvisual/src-Makefile.am new file mode 100644 index 00000000..207fd8a8 --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/src-Makefile.am @@ -0,0 +1,19 @@ +INCLUDES= $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = noatun_%{APPNAMELC}plugin.la + +noatun_%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp plugin_%{APPNAMELC}_impl.cpp +noatun_%{APPNAMELC}plugin_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined $(LIBSDL_RPATH) +noatun_%{APPNAMELC}plugin_la_CXXFLAGS = $(LIBSDL_CFLAGS) +noatun_%{APPNAMELC}plugin_la_LIBADD = $(LIB_KFILE) $(LIBSDL_LIBS) -lnoatun -lm + +pluginsdir = $(kde_datadir)/noatun +plugins_DATA = %{APPNAMELC}.plugin + +# kde_services_DATA = %{APPNAMELC}.desktop + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/noatunvisual/subdirs b/languages/cpp/app_templates/noatunvisual/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/noatunvisual/subdirs @@ -0,0 +1,3 @@ +doc +po +src diff --git a/languages/cpp/app_templates/opieapp/.kdev_ignore b/languages/cpp/app_templates/opieapp/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/opieapp/Example.png b/languages/cpp/app_templates/opieapp/Example.png new file mode 100644 index 00000000..f63d0bc7 Binary files /dev/null and b/languages/cpp/app_templates/opieapp/Example.png differ diff --git a/languages/cpp/app_templates/opieapp/Makefile.am b/languages/cpp/app_templates/opieapp/Makefile.am new file mode 100644 index 00000000..643a1c29 --- /dev/null +++ b/languages/cpp/app_templates/opieapp/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = Example.png app.kdevelop example.desktop Makefile.am \ + app.pro example.cpp example.h examplebase.ui + +templateName = opieapp + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/opieapp/app.kdevelop b/languages/cpp/app_templates/opieapp/app.kdevelop new file mode 100644 index 00000000..69b6f2bc --- /dev/null +++ b/languages/cpp/app_templates/opieapp/app.kdevelop @@ -0,0 +1,143 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + C++ + Code + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + gtk + gnustep + python + php + perl + w3c-dom-level2-html + kdev3api + sdl + w3c-svg + w3c-uaag10 + + + Guide to the Qt Translation Tools + qmake User Guide + Qt Assistant Manual + Qt Designer Manual + Qt Referrence Documentation + + + bonobo-activation + gconf + gtksourceview + libbonobo + libbonoboui + + + + + + -qws + + true + false + false + + + false + true + + + + + true + + + + Applications + + %{APPNAMELC} + 0 +
opie/application
+ %{AUTHOR} %{EMAIL} + arm + task-opie-minimal + %{VERSION} + Empty +
+
+ + + + + ./%{APPNAMELC} + -qws + + +
+ + + + + + + + + + + + + + false + false + + + + false + + + .h + .cpp + true + + + + true + 2 + + + -f + + -dP + + -f + -u3 -p + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + +
diff --git a/languages/cpp/app_templates/opieapp/app.pro b/languages/cpp/app_templates/opieapp/app.pro new file mode 100644 index 00000000..f4111696 --- /dev/null +++ b/languages/cpp/app_templates/opieapp/app.pro @@ -0,0 +1,38 @@ +TEMPLATE = quick-template +CONFIG = qt qtopia warn_on release zecke-libqpe zecke-libopie +HEADERS = %{APPNAMELC}.h +SOURCES = %{APPNAMELC}.cpp +INTERFACES = %{APPNAMELC}base.ui +TARGET = %{APPNAMELC} + +QMAKE_LIBDIR = $(OPIEDIR)/lib +OPIE-SPEC=6 + +QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP) +contains( TEMPLATE, quick-template ){ + contains( QUICK_SPEC_FOO, quick-app-lib ){ + message( "foo" ) + system( rm $$TARGET ) + system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET) + DEFINES += OPIE_APP_INTERFACE + TEMPLATE = lib + CONFIG += dll + }else{ + LI = $$join( TARGET, "lib", "lib", ".so*" ) + system( rm $$LI ) + TEMPLATE = app + } +} + + +zecke-libqpe { + INCLUDEPATH += $(OPIEDIR)/include + LIBS += -lqpe + DEPENDPATH += $(OPIEDIR)/include +} + +zecke-libopie { + INCLUDEPATH += $(OPIEDIR)/include + DEPENDPATH += $(OPIEDIR)/include + LIBS += -lopie +} diff --git a/languages/cpp/app_templates/opieapp/example.cpp b/languages/cpp/app_templates/opieapp/example.cpp new file mode 100644 index 00000000..84f3f9d5 --- /dev/null +++ b/languages/cpp/app_templates/opieapp/example.cpp @@ -0,0 +1,32 @@ +#include "%{APPNAMELC}.h" +#include +#include + +typedef OApplicationFactory<%{APPNAME}> %{APPNAME}Factory; +OPIE_EXPORT_APP( %{APPNAME}Factory ) + +/* + * Constructs a %{APPNAME} which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +%{APPNAME}::%{APPNAME}( QWidget* parent, const char* name, WFlags fl ) + : %{APPNAME}Base( parent, name, fl ) +{ + connect(quit, SIGNAL(clicked()), this, SLOT(goodBye())); +} + +/* + * Destroys the object and frees any allocated resources + */ +%{APPNAME}::~%{APPNAME}() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * A simple slot... not very interesting. + */ +void %{APPNAME}::goodBye() +{ + close(); +} diff --git a/languages/cpp/app_templates/opieapp/example.desktop b/languages/cpp/app_templates/opieapp/example.desktop new file mode 100644 index 00000000..f6f04194 --- /dev/null +++ b/languages/cpp/app_templates/opieapp/example.desktop @@ -0,0 +1,37 @@ +[Desktop Entry] +Comment=An %{APPNAME} Program +Comment[ca]=Un programa per a %{APPNAME} +Comment[da]=Et %{APPNAME} program +Comment[de]=Ein %{APPNAME}-Program +Comment[el]=Ένα πρόγραμμα %{APPNAME} +Comment[es]=Un programa %{APPNAME} +Comment[et]=%{APPNAME} programm +Comment[eu]=%{APPNAME} programa bat +Comment[fa]=برنامۀ %{APPNAME} +Comment[fr]=Un programme %{APPNAME} +Comment[ga]=Clár %{APPNAME} +Comment[gl]=Un programa %{APPNAME} +Comment[hu]=%{APPNAME} program +Comment[it]=Un programma per %{APPNAME} +Comment[ja]=%{APPNAME} プログラム +Comment[nds]=En %{APPNAME}-Programm +Comment[ne]= %{APPNAME} कार्यक्रम +Comment[nl]=Een %{APPNAME} programma +Comment[pl]=Program %{APPNAME} +Comment[pt]=Um Programa %{APPNAME} +Comment[pt_BR]=Um Programa %{APPNAME} +Comment[ru]=Программа %{APPNAME} +Comment[sk]=%{APPNAME} program +Comment[sl]=Program %{APPNAME} +Comment[sr]=%{APPNAME} програм +Comment[sr@Latn]=%{APPNAME} program +Comment[sv]=Ett %{APPNAME}-program +Comment[ta]=ஒரு %{APPNAME} நிரல் +Comment[tg]=Барномаи %{APPNAME} +Comment[tr]=Bir %{APPNAME} Programı +Comment[zh_CN]=一个 %{APPNAME} 程序 +Comment[zh_TW]=一個 %{APPNAME} 程式 +Exec=%{APPNAMELC} +Icon=%{APPNAME} +Type=Application +Name=%{APPNAME} diff --git a/languages/cpp/app_templates/opieapp/example.h b/languages/cpp/app_templates/opieapp/example.h new file mode 100644 index 00000000..1ba8ead7 --- /dev/null +++ b/languages/cpp/app_templates/opieapp/example.h @@ -0,0 +1,20 @@ +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H +#include "%{APPNAMELC}base.h" + +class %{APPNAME} : public %{APPNAME}Base +{ + Q_OBJECT + +public: + static QString appName() { + return QString::fromLatin1("%{APPNAMELC}" ); + } + %{APPNAME}( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~%{APPNAME}(); + +private slots: + void goodBye(); +}; + +#endif // %{APPNAMEUC}_H diff --git a/languages/cpp/app_templates/opieapp/examplebase.ui b/languages/cpp/app_templates/opieapp/examplebase.ui new file mode 100644 index 00000000..b6b81b11 --- /dev/null +++ b/languages/cpp/app_templates/opieapp/examplebase.ui @@ -0,0 +1,49 @@ + +%{APPNAME}Base + + QWidget + + name + %{APPNAME}Base + + + geometry + + 0 + 0 + 196 + 245 + + + + caption + %{APPNAME} + + + + + QLabel + + name + TextLabel1 + + + text + <p>This is just an <i>%{APPNAMELC}</i>; it does not do anything interesting at all. + + + + QPushButton + + name + quit + + + text + Quit + + + + + + diff --git a/languages/cpp/app_templates/opieapp/opieapp.kdevtemplate b/languages/cpp/app_templates/opieapp/opieapp.kdevtemplate new file mode 100644 index 00000000..622ec9a6 --- /dev/null +++ b/languages/cpp/app_templates/opieapp/opieapp.kdevtemplate @@ -0,0 +1,149 @@ +# KDE Config File +[General] +Name=Opie Application +Name[br]=Meziant Opie +Name[ca]=Aplicació per a Opie +Name[da]=Opie-program +Name[de]=Opie-Anwendung +Name[el]=Εφαρμογή Opie +Name[es]=Aplicación para Opie +Name[et]=Opie rakendus +Name[eu]=Opie aplikazioa +Name[fa]=کاربرد Opie +Name[fr]=Application Opie +Name[ga]=Feidhmchlár Opie +Name[gl]=Aplicación Opie +Name[hu]=Opie-alkalmazás +Name[it]=Applicazione Opie +Name[ja]=Opie アプリケーション +Name[nds]=Opie-Programm +Name[ne]=ओपिइ अनुप्रयोग +Name[nl]=Opie-toepassing +Name[pl]=Program Opie +Name[pt]=Aplicação do Opie +Name[pt_BR]=Aplicação do Opie +Name[ru]=Приложение Opie +Name[sk]=Apie aplikácia +Name[sl]=Program za Opie +Name[sr]=Opie програм +Name[sr@Latn]=Opie program +Name[sv]=Opie-program +Name[tr]=Opie Uygulaması +Name[zh_CN]=Opie 应用程序 +Name[zh_TW]=Opie 應用程式 +Icon=qmakeapp.png +Category=C++/Embedded +Comment=Generate an Opie application. +Comment[ca]=Genera una aplicació per a Opie. +Comment[da]=Generér et Opie-program. +Comment[de]=Erstellt eine Opie-Anwendung +Comment[el]=Δημιουργία μιας εφαρμογής Opie. +Comment[es]=Genera una aplicación para Opie. +Comment[et]=Opie rakenduse loomine. +Comment[eu]=Sortu Opie aplikazio bat. +Comment[fa]=یک کاربرد Opie تولید می‌کند. +Comment[fr]=Génère une application Opie. +Comment[ga]=Cruthaigh feidhmchlár Opie. +Comment[hu]=Létrehoz egy Opie-alkalmazást. +Comment[it]=Genera un'applicazione Opie. +Comment[ja]=Opie アプリケーションを作成 +Comment[nds]=Stellt en Opie-Programm op. +Comment[ne]=ओपिइ अनुप्रयोग उत्पन्न गर्नुहोस् +Comment[nl]=Genereert een Opie-toepassing +Comment[pl]=Generuje program Opie. +Comment[pt]=Gera uma aplicação do Opie. +Comment[pt_BR]=Gera uma aplicação do Opie. +Comment[ru]=Создание приложение Opie. +Comment[sk]=Vygeneruje Opie aplikáciu. +Comment[sl]=Ustvari program za Opie +Comment[sr]=Прави Opie програм. +Comment[sr@Latn]=Pravi Opie program. +Comment[sv]=Skapa ett Opie-program. +Comment[tr]=Bir Opie uygulaması yarat +Comment[zh_CN]=生成一个 Opie 应用程序。 +Comment[zh_TW]=產生一個 Opie 應用程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp +Archive=opieapp.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir0] +Type=mkdir +Dir=%{dest}/pics + +[MkDir1] +Type=mkdir +Dir=%{dest}/pics/%{APPNAMELC} + +[FILE2] +Type=install +Source=%{src}/Example.png +Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png +Process=false + +[FILE3] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[FILE4] +Type=install +Source=%{src}/example.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/example.h +Dest=%{dest}/%{APPNAMELC}.h + +[FILE6] +Type=install +Source=%{src}/examplebase.ui +Dest=%{dest}/%{APPNAMELC}base.ui + +[MkDir2] +Type=mkdir +Dir=%{dest}/apps + +[FILE7] +Type=install +Source=%{src}/example.desktop +Dest=%{dest}/apps/%{APPNAMELC}.desktop + +[MSG] +Type=message +Comment=An opie application was created in %{dest} +Comment[ca]=Una aplicació per a Opie ha estat creada en %{dest} +Comment[da]=Et opie-program blev oprettet i %{dest} +Comment[de]=Eine Opie-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή opie δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación para Opie ha sido creada en %{dest} +Comment[et]=Opie rakendus loodi asukohta %{dest} +Comment[eu]=Opie aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد opie در %{dest} ایجاد شد +Comment[fr]=Une application Opie a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár opie i %{dest} +Comment[gl]=Creouse unha aplicación opie en %{dest} +Comment[hu]=Létrejött egy Opie-alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione Opie in %{dest} +Comment[ja]=Opie アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Opie-Programm opstellt +Comment[ne]=ओपिइ अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een Opie-toepassing is aangemaakt in %{dest} +Comment[pl]=Program Opie został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do Opie em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do Opie em %{dest} +Comment[ru]=Приложение Opie создано в %{dest} +Comment[sk]=Opie aplikácia bola vytvorená v %{dest} +Comment[sl]=Program za opie je bil ustvarjen v %{dest} +Comment[sr]=Opie програм је направљен у %{dest} +Comment[sr@Latn]=Opie program je napravljen u %{dest} +Comment[sv]=Ett Opie-program skapades i %{dest} +Comment[tr]=Bir opie uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 opie 应用程序 +Comment[zh_TW]=一個 opie 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/opieapp/opieapp.png b/languages/cpp/app_templates/opieapp/opieapp.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/opieapp/opieapp.png differ diff --git a/languages/cpp/app_templates/opieapplet/.kdev_ignore b/languages/cpp/app_templates/opieapplet/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/opieapplet/Example.png b/languages/cpp/app_templates/opieapplet/Example.png new file mode 100644 index 00000000..f63d0bc7 Binary files /dev/null and b/languages/cpp/app_templates/opieapplet/Example.png differ diff --git a/languages/cpp/app_templates/opieapplet/Makefile.am b/languages/cpp/app_templates/opieapplet/Makefile.am new file mode 100644 index 00000000..8faf4e32 --- /dev/null +++ b/languages/cpp/app_templates/opieapplet/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = Makefile.am Example.png app.kdevelop app.pro \ + simpleimpl.cpp simpleimpl.h + +templateName = opieapplet + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/opieapplet/app.kdevelop b/languages/cpp/app_templates/opieapplet/app.kdevelop new file mode 100644 index 00000000..eee2c55a --- /dev/null +++ b/languages/cpp/app_templates/opieapplet/app.kdevelop @@ -0,0 +1,158 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + C++ + Code + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + gtk + gnustep + python + php + perl + w3c-dom-level2-html + kdev3api + sdl + w3c-svg + w3c-uaag10 + + + Guide to the Qt Translation Tools + qmake User Guide + Qt Assistant Manual + Qt Designer Manual + Qt Referrence Documentation + + + bonobo-activation + gconf + gtksourceview + libbonobo + libbonoboui + + + + + + -qws + + true + false + false + + + false + true + + + + + true + + + + + %{APPNAMELC} + 0 +
opie/applets
+ %{AUTHOR} %{EMAIL} + arm + task-opie-minimal + %{VERSION} + Empty +
+ + #!/bin/sh +if pidof -s qpe >/dev/null; then + /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadApplets()" +else + exit 0 +fi + + #!/bin/sh +if pidof -s qpe >/dev/null; then + /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadApplets()" +else + exit 0 +fi + + +
+ + + + + ./%{APPNAMELC} + -qws + + +
+ + + + + + + + + + + + + + false + false + + + + false + + + .h + .cpp + true + + + + true + 2 + + + -f + + -dP + + -f + -u3 -p + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + +
diff --git a/languages/cpp/app_templates/opieapplet/app.pro b/languages/cpp/app_templates/opieapplet/app.pro new file mode 100644 index 00000000..e1cc1e3b --- /dev/null +++ b/languages/cpp/app_templates/opieapplet/app.pro @@ -0,0 +1,38 @@ +TEMPLATE = lib +CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-applet +HEADERS = %{APPNAMELC}.h +SOURCES = %{APPNAMELC}.cpp +TARGET = %{APPNAMELC} + + +QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP) +contains( TEMPLATE, quick-template ){ + contains( QUICK_SPEC_FOO, quick-app-lib ){ + message( "foo" ) + system( rm $$TARGET ) + system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET) + DEFINES += OPIE_APP_INTERFACE + TEMPLATE = lib + CONFIG += dll + }else{ + LI = $$join( TARGET, "lib", "lib", ".so*" ) + system( rm $$LI ) + TEMPLATE = app + } +} + + +QMAKE_LIBDIR= $$(OPIEDIR)/lib +OPIE-SPEC=6 + +zecke-libqpe { + INCLUDEPATH += $$(OPIEDIR)/include + LIBS += -lqpe + DEPENDPATH += $$(OPIEDIR)/include +} + +zecke-libopie { + INCLUDEPATH += $$(OPIEDIR)/include + DEPENDPATH += $$(OPIEDIR)/include + LIBS += -lopie +} diff --git a/languages/cpp/app_templates/opieapplet/opieapplet.kdevtemplate b/languages/cpp/app_templates/opieapplet/opieapplet.kdevtemplate new file mode 100644 index 00000000..7be33a95 --- /dev/null +++ b/languages/cpp/app_templates/opieapplet/opieapplet.kdevtemplate @@ -0,0 +1,135 @@ +# KDE Config File +[General] +Name=Opie Applet +Name[br]=Arloadig Opie +Name[ca]=Miniaplicació per a Opie +Name[da]=Opie-applet +Name[de]=Opie-Miniprogramm (Applet) +Name[el]=Μικροεφαρμογή Opie +Name[es]=Applet para Opie +Name[et]=Opie aplett +Name[eu]=Opie applet-a +Name[fa]=برنامک Opie +Name[fr]=Applet Opie +Name[ga]=Feidhmchláirín Opie +Name[gl]=Applet Opie +Name[hu]=Opie-s kisalkalmazás +Name[it]=Applet Opie +Name[ja]=Opie アプレット +Name[nds]=Opie-Lüttprogramm +Name[ne]=ओपिइ एप्लेट +Name[nl]=Opie-applet +Name[pl]=Aplet Opie +Name[pt]='Applet' do Opie +Name[pt_BR]='Applet' do Opie +Name[ru]=Аплет Opie +Name[sk]=Opie applet +Name[sl]=Vstavek za Opie +Name[sr]=Opie аплет +Name[sr@Latn]=Opie aplet +Name[sv]=Opie-miniprogram +Name[tr]=Opie Küçük Uygulaması +Name[zh_CN]=Opie 小程序 +Name[zh_TW]=Opie 小程式 +Icon=qmakeapp.png +Category=C++/Embedded +Comment=Generate an Opie applet. +Comment[ca]=Genera una miniaplicació per a Opie. +Comment[da]=Generér en Opie-applet. +Comment[de]=Erstellt ein Opie-Miniprogramm (Applet). +Comment[el]=Δημιουργία μίας μικροεφαρμογής Opie. +Comment[es]=Genera un applet para Opie. +Comment[et]=Opie apleti loomine. +Comment[eu]=Sortu Opie applet bat. +Comment[fa]=یک برنامک Opie تولید می‌کند. +Comment[fr]=Génère un applet Opie. +Comment[ga]=Cruthaigh feidhmchláirín Opie. +Comment[gl]=Xera un applet Opie. +Comment[hu]=Létrehoz egy Opie-s kisalkalmazást. +Comment[it]=Genera un'applet Opie. +Comment[ja]=Opie アプレットを作成 +Comment[nds]=Stellt en Opie-Lüttprogramm op. +Comment[ne]=ओपिइ एप्लेट उत्पन्न गर्दछ +Comment[nl]=Genereert een Opie-applet. +Comment[pl]=Generuje aplet Opie +Comment[pt]=Gera uma 'applet' do Opie. +Comment[pt_BR]=Gera uma 'applet' do Opie. +Comment[ru]=Создание аплета Opie. +Comment[sk]=Vygeneruje Opie applet. +Comment[sl]=Ustvari vstavek za Opie. +Comment[sr]=Прави Opie аплет. +Comment[sr@Latn]=Pravi Opie aplet. +Comment[sv]=Skapa ett Opie-miniprogram. +Comment[zh_CN]=生成一个 Opie 小程序。 +Comment[zh_TW]=產生一個 Opie 小程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp +Archive=opieapplet.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir0] +Type=mkdir +Dir=%{dest}/pics + +[MkDir1] +Type=mkdir +Dir=%{dest}/pics/%{APPNAMELC} + +[FILE2] +Type=install +Source=%{src}/Example.png +Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png +Process=false + +[FILE3] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[FILE4] +Type=install +Source=%{src}/simpleimpl.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/simpleimpl.h +Dest=%{dest}/%{APPNAMELC}.h + +[MSG] +Type=message +Comment=An opie applet was created in %{dest} +Comment[ca]=Una miniaplicació per a Opie ha estat creat en %{dest} +Comment[da]=En opie-applet blev oprettet i %{dest} +Comment[de]=Ein Opie-Miniprogramm (Applet) wurde in %{dest} erstellt. +Comment[el]=Μία μικροεφαρμογή opie δημιουργήθηκε στο %{dest} +Comment[es]=Un applet para Opie ha sido creado en %{dest} +Comment[et]=Opie aplett loodi asukohta %{dest} +Comment[eu]=Opie applet bat sortu da hemen: %{dest} +Comment[fa]=یک برنامک opie در %{dest} ایجاد شد +Comment[fr]=Un applet Opie a été créé dans %{dest} +Comment[ga]=Cruthaíodh feidhmchláirín opie i %{dest} +Comment[gl]=Creouse un applet opie en %{dset} +Comment[hu]=Létrejött egy Opie-s kisalkalmazás itt: %{dest} +Comment[it]=È stata creata un'applet Opie in %{dest} +Comment[ja]=Opie アプレットを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Opie-Lüttprogramm opstellt +Comment[ne]=ओपिइ एप्लेट %{dest} मा सिर्जना गरियो +Comment[nl]=Een Opie-applet is aangemaakt in %{dest} +Comment[pl]=Aplet Opie został utworzony w %{dest} +Comment[pt]=Foi criada uma 'applet' do Opie em %{dest} +Comment[pt_BR]=Foi criada uma 'applet' do Opie em %{dest} +Comment[ru]=Аплет Opie создан в %{dest} +Comment[sk]=Opie applet bol vytvorený v %{dest} +Comment[sl]=Vstavek za opie je bil ustvarjen v %{dest} +Comment[sr]=Opie аплет је направљен у %{dest} +Comment[sr@Latn]=Opie aplet je napravljen u %{dest} +Comment[sv]=Ett Opie-miniprogram skapades i %{dest} +Comment[tr]=Bir Opie küçük uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 opie 小程序 +Comment[zh_TW]=一個 Opie 小程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/opieapplet/opieapplet.png b/languages/cpp/app_templates/opieapplet/opieapplet.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/opieapplet/opieapplet.png differ diff --git a/languages/cpp/app_templates/opieapplet/simpleimpl.cpp b/languages/cpp/app_templates/opieapplet/simpleimpl.cpp new file mode 100644 index 00000000..1474a0e4 --- /dev/null +++ b/languages/cpp/app_templates/opieapplet/simpleimpl.cpp @@ -0,0 +1,162 @@ +#include +#include +#include + +#include // for AppLnk +#include // for Resource loading + +#include "%{APPNAMELC}.h" + + +%{APPNAME}::%{APPNAME}(QWidget *parent) + : QWidget( parent, "%{APPNAME} Applet" ) { +/* + * we will load an Image, scale it for the right usage + * remember your applet might be used by different + * resolutions. + * Then we will convert the image back to an Pixmap + * and draw this Pimxap. We need to use Image because its + * the only class that allows scaling. + */ + + QImage image = Resource::loadImage("%{APPNAMELC}/%{APPNAMELC}"); + /* + * smooth scale to AppLnk smallIconSize for applest + * smallIconSize gets adjusted to the resolution + * so on some displays like SIMpad and a C-750 the smallIconSize + * is greater than on a iPAQ h3870 + */ + image = image.smoothScale(AppLnk::smallIconSize(), AppLnk::smallIconSize() ); + + /* + * now we need to convert the Image to a Pixmap cause these + * can be drawn more easily + */ + m_pix = new QPixmap(); + m_pix->convertFromImage( image ); + + /* + * Now we will say that we don't want to be bigger than our + * Pixmap + */ + setFixedHeight(AppLnk::smallIconSize() ); + setFixedWidth( AppLnk::smallIconSize() ); + +} + +%{APPNAME}::~%{APPNAME}() { + delete m_pix; +} + + +/* + * here you would normal show or do something + * useful. If you want to show a widget at the top left + * of your icon you need to map your rect().topLeft() to + * global with mapToGlobal(). Then you might also need to + * move the widgets so it is visible + */ +void %{APPNAME}::mousePressEvent(QMouseEvent* ) { + QMessageBox::information(this, tr("No action taken"), + tr("This Plugin does not yet support anything usefule aye."), + QMessageBox::Ok ); + +} + +void %{APPNAME}::paintEvent( QPaintEvent* ) { + QPainter p(this); + + /* simpy draw the pixmap from the start of this widget */ + p.drawPixmap(0, 0, *m_pix ); +} + +/* + * Here comes the implementation of the interface + */ +%{APPNAME}Impl::%{APPNAME}Impl() { +} +/* needed cause until it is only pure virtual */ +%{APPNAME}Impl::~%{APPNAME}Impl() { + /* + * we will delete our applets as well + * setAUtoDelete makes the QList free + * the objects behind the pointers + */ + m_applets.setAutoDelete( true ); + m_applets.clear(); +} + +/* + * For the taskbar interface return a Widget + */ +QWidget* %{APPNAME}Impl::applet( QWidget* parent ) { + /* + * There are problems with ownership. So we add + * our ownlist and clear this; + */ + %{APPNAME}* ap = new %{APPNAME}( parent ); + m_applets.append( ap ); + + return ap; +} + +/* + * A small hint where the Applet Should be displayed + */ +int %{APPNAME}Impl::position()const { + return 1; +} + + +/* + * Now the important QUnkownInterface method without + * this one your applet won't load + * @param uuid The uuid of the interface + * @param iface The pointer to the interface ptr + */ +QRESULT %{APPNAME}Impl::queryInterface( const QUuid& uuid, QUnknownInterface** iface) { + /* set the pointer to the interface to 0 */ + *iface = 0; + + /* + * we check if we support the requested interface + * and then assign to the pointer. + * You may alos create another interface here so + * *iface = this is only in this simple case true you + * could also support more interfaces. + * But this example below is the most common use. + * Now the caller knows that the Interface Pointer + * is valid and the interface supported + */ + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_TaskbarApplet ) + *iface = this; + else + return QS_FALSE; + + if ( *iface ) + (*iface)->addRef(); + + return QS_OK; +} + + +/* + * Finally we need to export the Interface. + * CREATE_INSTANCE creates a interface and calls + * queryInterface for the QUnknownInterface once + * With out this function the applet can't be loaded. + * + * NOTE: If your applet does not load it's likely you've an + * unresolved symbol. Change the .pro TEMPLATE = lib to TEMPLATE= app + * and recompile. If the linker only complains about a missing + * main method the problem is more complex. In most cases it'll say + * you which symbols are missing and you can implement them. + * The main(int argc, char* argv[] ) does not need to be + * included in a library so it's ok that the linker complains + */ +Q_EXPORT_INTERFACE() { + Q_CREATE_INSTANCE( %{APPNAME}Impl ) +} + diff --git a/languages/cpp/app_templates/opieapplet/simpleimpl.h b/languages/cpp/app_templates/opieapplet/simpleimpl.h new file mode 100644 index 00000000..19475367 --- /dev/null +++ b/languages/cpp/app_templates/opieapplet/simpleimpl.h @@ -0,0 +1,75 @@ +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + + +/** + * Opie and Qtopia uses a component system called QCOM + * which was first part of the Qt 3.0 API but was made + * prviate during the betas. Opie and Qtopia still use it + * and we're happy with it. + * Every starts with the QUnknownInterface. It supports functions + * for reference counting and the most important one + * is for a query. Every QCOM interface got a global unique id ( GUID,UUID ) + * query is used to see if a interface is supported by + * a dynamic shared object ( dso / plugin ) + * For tasks like loading Applications, InputMethods, Today, MenuButton, + * Taskbar, Style, Email Client there are specefic Interfaces you + * need to implement. The interfaces inherits from QUnknownInterface and + * you'll need inherit from the interface. + * As example we will use the Taskbar interface + */ + + +/* + * The taskbar applet interfaces wants us to implement position() and applet() + * additionally we need to implement add(), release() and queryInterface for QUnknownInterface + * luckiy there is a macro for the reference counting + * We provide an Implementation of the interface. + */ +#include +#include + +#include + + +/* + * Because we only draw an Icon in a fixed width and height + * we declare and define %{APPNAME} here and you could use QLabel + * setPixmap or use QWidget and draw yourself. + * You might also want to reimplement mouse*Event to use some simple actions + */ +class %{APPNAME} : public QWidget { + Q_OBJECT +public: + %{APPNAME}(QWidget *parent); + ~%{APPNAME}(); +private: + void mousePressEvent( QMouseEvent* ); + void paintEvent( QPaintEvent* ); + QPixmap *m_pix; +}; + +class %{APPNAME}Impl : public TaskbarAppletInterface { +public: + + %{APPNAME}Impl(); + virtual ~%{APPNAME}Impl(); + + QRESULT queryInterface( const QUuid&, QUnknownInterface** ); + + QWidget *applet( QWidget* parent ); + int position()const; + + /* + * macro for reference countint + * if reference drops to zero + * delete this is called + */ + Q_REFCOUNT + +private: + QList<%{APPNAME}> m_applets; +}; + + +#endif diff --git a/languages/cpp/app_templates/opieinput/.kdev_ignore b/languages/cpp/app_templates/opieinput/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/opieinput/Example.png b/languages/cpp/app_templates/opieinput/Example.png new file mode 100644 index 00000000..f63d0bc7 Binary files /dev/null and b/languages/cpp/app_templates/opieinput/Example.png differ diff --git a/languages/cpp/app_templates/opieinput/Makefile.am b/languages/cpp/app_templates/opieinput/Makefile.am new file mode 100644 index 00000000..d748092c --- /dev/null +++ b/languages/cpp/app_templates/opieinput/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = Makefile.am Example.png app.kdevelop app.pro \ + simpleimpl.cpp simpleimpl.h +templateName = opieinput + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/opieinput/app.kdevelop b/languages/cpp/app_templates/opieinput/app.kdevelop new file mode 100644 index 00000000..639a3215 --- /dev/null +++ b/languages/cpp/app_templates/opieinput/app.kdevelop @@ -0,0 +1,159 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + C++ + Code + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + gtk + gnustep + python + php + perl + w3c-dom-level2-html + kdev3api + sdl + w3c-svg + w3c-uaag10 + + + Guide to the Qt Translation Tools + qmake User Guide + Qt Assistant Manual + Qt Designer Manual + Qt Referrence Documentation + + + bonobo-activation + gconf + gtksourceview + libbonobo + libbonoboui + + + + + + -qws + + true + false + false + + + false + true + + + + + false + + + + plugins/inputmethods + + %{APPNAMELC} + 0 +
opie/inputmethods
+ %{AUTHOR} %{EMAIL} + arm + task-opie-minimal + %{VERSION} + Empty +
+ + #!/bin/sh +if pidof -s qpe >/dev/null; then + /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadInputMethods()" +else + exit 0 +fi + + #!/bin/sh +if pidof -s qpe >/dev/null; then + /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadInputMethods()" +else + exit 0 +fi + + +
+ + + + + qpe + -qws + + +
+ + + + + + + + + + + + + + false + false + + + + false + + + .h + .cpp + true + + + + true + 2 + + + -f + + -dP + + -f + -u3 -p + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + +
diff --git a/languages/cpp/app_templates/opieinput/app.pro b/languages/cpp/app_templates/opieinput/app.pro new file mode 100644 index 00000000..1711c78f --- /dev/null +++ b/languages/cpp/app_templates/opieinput/app.pro @@ -0,0 +1,38 @@ +TEMPLATE = lib +CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-input +HEADERS = %{APPNAMELC}.h +SOURCES = %{APPNAMELC}.cpp +TARGET = %{APPNAMELC} + + +QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP) +contains( TEMPLATE, quick-template ){ + contains( QUICK_SPEC_FOO, quick-app-lib ){ + message( "foo" ) + system( rm $$TARGET ) + system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET) + DEFINES += OPIE_APP_INTERFACE + TEMPLATE = lib + CONFIG += dll + }else{ + LI = $$join( TARGET, "lib", "lib", ".so*" ) + system( rm $$LI ) + TEMPLATE = app + } +} + + +QMAKE_LIBDIR= $$(OPIEDIR)/lib +OPIE-SPEC=6 + +zecke-libqpe { + INCLUDEPATH += $$(OPIEDIR)/include + LIBS += -lqpe + DEPENDPATH += $$(OPIEDIR)/include +} + +zecke-libopie { + INCLUDEPATH += $$(OPIEDIR)/include + DEPENDPATH += $$(OPIEDIR)/include + LIBS += -lopie +} diff --git a/languages/cpp/app_templates/opieinput/opieinput.kdevtemplate b/languages/cpp/app_templates/opieinput/opieinput.kdevtemplate new file mode 100644 index 00000000..39250370 --- /dev/null +++ b/languages/cpp/app_templates/opieinput/opieinput.kdevtemplate @@ -0,0 +1,129 @@ +# KDE Config File +[General] +Name=Opie Input +Name[ca]=Entrada per a Opie +Name[da]=Opie-input +Name[de]=Opie-Eingabe +Name[el]=Μέθοδος εισαγωγής Opie +Name[es]=Entrada para Opie +Name[et]=Opie sisestus +Name[eu]=Opie sarrera +Name[fa]=ورودی Opie +Name[fr]=Entrée Opie +Name[ga]=Ionchur Opie +Name[gl]=Entrada Opie +Name[hu]=Opie-s bemeneti modul +Name[it]=Input di Opie +Name[ja]=Opie 入力 +Name[nds]=Opie-Ingaav +Name[ne]=ओपिइ आगत +Name[nl]=Opie-invoer +Name[pl]=Wejście Opie +Name[pt]=Introdução de Dados do Opie +Name[pt_BR]=Introdução de Dados do Opie +Name[ru]=Модуль ввода Opie +Name[sk]=Opie vstup +Name[sr]=Opie унос +Name[sr@Latn]=Opie unos +Name[sv]=Opie-inmatning +Name[tr]=Opie Girdisi +Name[zh_CN]=Opie 输入法 +Name[zh_TW]=Opie 輸入 +Icon=qmakeapp.png +Category=C++/Embedded +Comment=Generate an Opie input method plugin. +Comment[ca]=Genera un connector de mètode d'entrada per a Opie. +Comment[da]=Generér en Opie input-metode-plugin. +Comment[de]=Erstellt ein Eingabemethode-Modul für Opie. +Comment[el]=Δημιουργία ενός πρόσθετου μεθόδου εισαγωγής. +Comment[es]=Genera un complemento de método de entrada para Opie. +Comment[et]=Opie sisestusmeetodi plugina loomine. +Comment[eu]=Sortu Opie-ren sarrera-metodoaren plugin bat. +Comment[fa]=یک وصلۀ روش ورودی Opie تولید می‌کند. +Comment[fr]=Génère un module externe de méthode d'entrée Opie. +Comment[gl]=Xera unha extensión de método de entrada para Opie. +Comment[hu]=Létrehoz egy Opie-s bemeneti modult. +Comment[it]=Genera un plugin per il metodo di input Opie. +Comment[nds]=Stellt en Ingaavmetood-Moduul för Opie op. +Comment[ne]=ओपिइ आगत विधि प्लगइन उत्पन्न गर्नुहोस् +Comment[nl]=Genereert een Opie-invoermethode-plugin. +Comment[pl]=Generuje wtyczkę z metodą wejściową dla Opie. +Comment[pt]=Gera um 'plugin' de introdução de dados do Opie. +Comment[pt_BR]=Gera um 'plugin' de introdução de dados do Opie. +Comment[ru]=Создание модуля ввода данных для среды Opie. +Comment[sk]=Vygeneruje Opie vstupný modul. +Comment[sr]=Прави прикључак за Opie метод уноса. +Comment[sr@Latn]=Pravi priključak za Opie metod unosa. +Comment[sv]=Skapa ett insticksprogram för Opie-inmatning. +Comment[tr]=Bir Opie girdi yöntemi eklentisi yarat +Comment[zh_CN]=生成一个 Opie 输入法插件。 +Comment[zh_TW]=產生一個 Opie 輸入法外掛程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp +Archive=opieinput.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir0] +Type=mkdir +Dir=%{dest}/pics + +[MkDir1] +Type=mkdir +Dir=%{dest}/pics/%{APPNAMELC} + +[FILE2] +Type=install +Source=%{src}/Example.png +Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png +Process=false + +[FILE3] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[FILE4] +Type=install +Source=%{src}/simpleimpl.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/simpleimpl.h +Dest=%{dest}/%{APPNAMELC}.h + +[MSG] +Type=message +Comment=An opie input method plugin was created in %{dest} +Comment[ca]=Un connector de mètode d'entrada per a Opie ha estat creat en %{dest} +Comment[da]=At opie input-metode-plugin blev oprettet i %{dest} +Comment[de]=Ein Eingabemethode-Modul für Opie wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο μεθόδου εισαγωγής opie δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento de método de entrada para Opie ha sido creado en %{dest} +Comment[et]=Opie sisestusmeetodi plugin loodi asukohta %{dest} +Comment[eu]=Opie-ren sarrera-metodoaren plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ روش ورودی opie در %{dest} ایجاد شد +Comment[fr]=Un module externe de méthode d'entrée Opie a été créé dans %{dest} +Comment[gl]=Creouse unha extensión de método de entrada para opie en %{dest} +Comment[hu]=Létrejött egy Opie-s bemeneti modul itt: %{dest} +Comment[it]=È stato creato un plugin per il metodo di input Opie in %{dest} +Comment[nds]=In %{dest} wöör en Opie-Ingaavmetoodmoduul opstellt +Comment[ne]=ओपिइ आगत विधि प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een Opie-invoermethode-plugins is aangemaakt in %{dest} +Comment[pl]=Wtyczka z metodą wejściową dla Opie została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' de introdução de dados em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' de introdução de dados em %{dest} +Comment[ru]=Модуль ввода Opie создан в %{dest} +Comment[sk]=Opie vstupný modul bol vytvorený v %{dest} +Comment[sr]=Прикључак за Opie метод уноса направљен је у %{dest} +Comment[sr@Latn]=Priključak za Opie metod unosa napravljen je u %{dest} +Comment[sv]=Ett insticksprogram för Opie-inmatning skapades i %{dest} +Comment[tr]=Bir opie girdi yöntemi eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 opie 输入法 +Comment[zh_TW]=一個 Opie 輸入法外掛程式已建立於 %{dest} + diff --git a/languages/cpp/app_templates/opieinput/opieinput.png b/languages/cpp/app_templates/opieinput/opieinput.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/opieinput/opieinput.png differ diff --git a/languages/cpp/app_templates/opieinput/simpleimpl.cpp b/languages/cpp/app_templates/opieinput/simpleimpl.cpp new file mode 100644 index 00000000..6da986eb --- /dev/null +++ b/languages/cpp/app_templates/opieinput/simpleimpl.cpp @@ -0,0 +1,157 @@ +#include +#include +#include +#include +#include +#include + +#include "%{APPNAMELC}.h" + +%{APPNAME}::%{APPNAME}(QWidget* par, WFlags fl ) + : QHBox(par, "name", fl ) +{ + QCheckBox *box1 = new QCheckBox(tr("Alt"),this); + connect(box1,SIGNAL(toggled(bool)), + this,SLOT(slotAlt(bool))); + m_alt = box1; + box1 = new QCheckBox(tr("Shift"),this ); + connect(box1,SIGNAL(toggled(bool)), + this,SLOT(slotShift(bool))); + m_shi = box1; + box1 = new QCheckBox(tr("Ctrl","Control Shortcut on keyboard"),this ); + connect(box1,SIGNAL(toggled(bool)), + this,SLOT(slotCtrl(bool))); + m_ctrl = box1; + + QSignalMapper *map = new QSignalMapper(this); + QPushButton *btn = new QPushButton("a",this); + map->setMapping(btn,0); + connect(btn,SIGNAL(clicked()),map,SLOT(map())); + + btn = new QPushButton("b",this); + map->setMapping(btn,1); + connect(btn,SIGNAL(clicked()),map,SLOT(map())); + + btn = new QPushButton("c",this); + map->setMapping(btn,2); + connect(btn,SIGNAL(clicked()),map,SLOT(map())); + + connect(map,SIGNAL(mapped(int)), + this,SLOT(slotKey(int))); + resetState(); +} + +%{APPNAME}::~%{APPNAME}(){ +} + +void %{APPNAME}::resetState(){ + m_state = 0; + m_shi->setChecked(false); + m_ctrl->setChecked(false); + m_alt->setChecked(false); +} + +void %{APPNAME}::slotKey(int _ke){ + int ke = _ke + 0x61; // 0 + 65 = 0x41 == A + if(m_state & ShiftButton ) + ke -= 0x20; + + /* + * Send the key + * ke is the unicode + * _ke + 0x41 is the keycode + * m_state Normally the state + * down/up + * auto repeat + */ + emit key(ke, _ke +0x41,m_state,true,false); + emit key(ke, _ke + 0x41,m_state,false,false); +} + +void %{APPNAME}::slotShift(bool b){ + if(b) + m_state |= ShiftButton; + else + m_state &= ~ShiftButton; +} + +void %{APPNAME}::slotAlt(bool b){ + if(b) + m_state |= AltButton; + else + m_state &= ~AltButton; +} + +void %{APPNAME}::slotCtrl(bool b){ + if(b) + m_state |= ControlButton; + else + m_state &= ~ControlButton; +} + + + +%{APPNAME}Impl::%{APPNAME}Impl() + : m_pickboard(0), m_icn(0) +{ +} + +%{APPNAME}Impl::~%{APPNAME}Impl() +{ + delete m_pickboard; + delete m_icn; +} + +QWidget *%{APPNAME}Impl::inputMethod( QWidget *parent, Qt::WFlags f ) +{ + if ( !m_pickboard ) + m_pickboard = new %{APPNAME}( parent, f ); + return m_pickboard; +} + +void %{APPNAME}Impl::resetState() +{ + if ( m_pickboard ) + m_pickboard->resetState(); +} + +QPixmap *%{APPNAME}Impl::icon() +{ + if ( !m_icn ) + m_icn = new QPixmap(Resource::loadPixmap("Tux")); + return m_icn; +} + +QString %{APPNAME}Impl::name() +{ + return QObject::tr("Example Input"); +} + +void %{APPNAME}Impl::onKeyPress( QObject *receiver, const char *slot ) +{ + if ( m_pickboard ) + QObject::connect( m_pickboard, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot ); +} + +#ifndef QT_NO_COMPONENT +QRESULT %{APPNAME}Impl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) +{ + *iface = 0; + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_InputMethod ) + *iface = this; + else + return QS_FALSE; + + if ( *iface ) + (*iface)->addRef(); + return QS_OK; +} + +Q_EXPORT_INTERFACE() +{ + Q_CREATE_INSTANCE( %{APPNAME}Impl ) +} +#endif + diff --git a/languages/cpp/app_templates/opieinput/simpleimpl.h b/languages/cpp/app_templates/opieinput/simpleimpl.h new file mode 100644 index 00000000..362e59b3 --- /dev/null +++ b/languages/cpp/app_templates/opieinput/simpleimpl.h @@ -0,0 +1,50 @@ +#ifndef %{APPNAME}IMPL_H +#define %{APPNAME}IMPL_H + +#include + +#include + +class QPixmap; +class QCheckBox; +class %{APPNAME} : public QHBox { + Q_OBJECT +public: + %{APPNAME}( QWidget *par, WFlags f ); + ~%{APPNAME}(); + void resetState(); +private slots: + void slotKey(int); + void slotShift(bool); + void slotAlt(bool); + void slotCtrl(bool); +signals: + void key(ushort,ushort,ushort,bool,bool); +private: + int m_state; + QCheckBox *m_alt,*m_shi,*m_ctrl; +}; + +class %{APPNAME}Impl : public InputMethodInterface +{ +public: + %{APPNAME}Impl(); + virtual ~%{APPNAME}Impl(); + +#ifndef QT_NO_COMPONENT + QRESULT queryInterface( const QUuid&, QUnknownInterface** ); + Q_REFCOUNT +#endif + + virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); + virtual void resetState(); + virtual QPixmap *icon(); + virtual QString name(); + virtual void onKeyPress( QObject *receiver, const char *slot ); + +private: + %{APPNAME} *m_pickboard; + QPixmap *m_icn; +}; + +#endif diff --git a/languages/cpp/app_templates/opiemenu/.kdev_ignore b/languages/cpp/app_templates/opiemenu/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/opiemenu/Example.png b/languages/cpp/app_templates/opiemenu/Example.png new file mode 100644 index 00000000..f63d0bc7 Binary files /dev/null and b/languages/cpp/app_templates/opiemenu/Example.png differ diff --git a/languages/cpp/app_templates/opiemenu/Makefile.am b/languages/cpp/app_templates/opiemenu/Makefile.am new file mode 100644 index 00000000..c44b3f96 --- /dev/null +++ b/languages/cpp/app_templates/opiemenu/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = Makefile.am Example.png app.kdevelop app.pro \ + simpleimpl.cpp simpleimpl.h + +templateName = opiemenu + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/opiemenu/app.kdevelop b/languages/cpp/app_templates/opiemenu/app.kdevelop new file mode 100644 index 00000000..eee2c55a --- /dev/null +++ b/languages/cpp/app_templates/opiemenu/app.kdevelop @@ -0,0 +1,158 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + C++ + Code + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + gtk + gnustep + python + php + perl + w3c-dom-level2-html + kdev3api + sdl + w3c-svg + w3c-uaag10 + + + Guide to the Qt Translation Tools + qmake User Guide + Qt Assistant Manual + Qt Designer Manual + Qt Referrence Documentation + + + bonobo-activation + gconf + gtksourceview + libbonobo + libbonoboui + + + + + + -qws + + true + false + false + + + false + true + + + + + true + + + + + %{APPNAMELC} + 0 +
opie/applets
+ %{AUTHOR} %{EMAIL} + arm + task-opie-minimal + %{VERSION} + Empty +
+ + #!/bin/sh +if pidof -s qpe >/dev/null; then + /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadApplets()" +else + exit 0 +fi + + #!/bin/sh +if pidof -s qpe >/dev/null; then + /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadApplets()" +else + exit 0 +fi + + +
+ + + + + ./%{APPNAMELC} + -qws + + +
+ + + + + + + + + + + + + + false + false + + + + false + + + .h + .cpp + true + + + + true + 2 + + + -f + + -dP + + -f + -u3 -p + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + +
diff --git a/languages/cpp/app_templates/opiemenu/app.pro b/languages/cpp/app_templates/opiemenu/app.pro new file mode 100644 index 00000000..71bc208c --- /dev/null +++ b/languages/cpp/app_templates/opiemenu/app.pro @@ -0,0 +1,38 @@ +TEMPLATE = lib +CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-menuapplet +HEADERS = %{APPNAMELC}.h +SOURCES = %{APPNAMELC}.cpp +TARGET = %{APPNAMELC} + + +QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP) +contains( TEMPLATE, quick-template ){ + contains( QUICK_SPEC_FOO, quick-app-lib ){ + message( "foo" ) + system( rm $$TARGET ) + system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET) + DEFINES += OPIE_APP_INTERFACE + TEMPLATE = lib + CONFIG += dll + }else{ + LI = $$join( TARGET, "lib", "lib", ".so*" ) + system( rm $$LI ) + TEMPLATE = app + } +} + + +QMAKE_LIBDIR= $$(OPIEDIR)/lib +OPIE-SPEC=6 + +zecke-libqpe { + INCLUDEPATH += $$(OPIEDIR)/include + LIBS += -lqpe + DEPENDPATH += $$(OPIEDIR)/include +} + +zecke-libopie { + INCLUDEPATH += $$(OPIEDIR)/include + DEPENDPATH += $$(OPIEDIR)/include + LIBS += -lopie +} diff --git a/languages/cpp/app_templates/opiemenu/opiemenu.kdevtemplate b/languages/cpp/app_templates/opiemenu/opiemenu.kdevtemplate new file mode 100644 index 00000000..b32b13ed --- /dev/null +++ b/languages/cpp/app_templates/opiemenu/opiemenu.kdevtemplate @@ -0,0 +1,132 @@ +# KDE Config File +[General] +Name=Opie Menu Applet +Name[ca]=Una miniaplicació de menú per a Opie +Name[da]=Opie menu-applet +Name[de]=Opie-Menü-Miniprogramm (Applet) +Name[el]=Μικροεφαρμογή μενού Opie +Name[es]=Applet de menú para Opie +Name[et]=Opie menüüaplett +Name[eu]=Opie-ren menu applet-a +Name[fa]=برنامک گزینگان Opie +Name[fr]=Applet de menu Opie +Name[ga]=Feidhmchláirín Roghchláir Opie +Name[gl]=Applet de menú Opie +Name[hu]=Opie-s menü-kisalkalmazás +Name[it]=Applet di menu Opie +Name[ja]=Opie メニューアプレット +Name[nds]=Menü-Lüttprogramm för Opie +Name[ne]=ओपिइ मेनु एप्लेट +Name[nl]=Opie-menuapplet +Name[pl]=Aplet menu Opie +Name[pt]='Applet' do Menu do Opie +Name[pt_BR]='Applet' do Menu do Opie +Name[ru]=Аплет меню Opie +Name[sk]=Opie menu pplet +Name[sr]=Opie аплет менија +Name[sr@Latn]=Opie aplet menija +Name[sv]=Opie-menyminiprogram +Name[tr]=Opie Menü Küçük Uygulaması +Name[zh_CN]=Opie 菜单小程序 +Name[zh_TW]=Opie 選單小程式 +Icon=qmakeapp.png +Category=C++/Embedded +Comment=Generate an Opie menu applet. +Comment[ca]=Genera una miniaplicació de menú per a Opie. +Comment[da]=Generér en Opie menu-applet. +Comment[de]=Erstellt ein Opie-Menü-Miniprogramm (Applet). +Comment[el]=Δημιουργία μίας μικροεφαρμογής μενού Opie. +Comment[es]=Genera un applet de menú para Opie. +Comment[et]=Opie menüüapleti loomine. +Comment[eu]=Sortu Opie-ren menu applet bat. +Comment[fa]=یک برنامک گزینگان Opie تولید می‌کند. +Comment[fr]=Génère un applet de menu Opie. +Comment[gl]=Xera un applet de menu para Opie. +Comment[hu]=Létrehoz egy Opie-s menü-kisalkalmazást. +Comment[it]=Genera un'applet di menu Opie. +Comment[ja]=Opie メニューアプレットを作成 +Comment[nds]=Stellt en Menü-Lüttprogramm för Opie op. +Comment[ne]=ओपिइ मेनु एप्लेट उत्पन्न गर्नुहोस् +Comment[nl]=Genereert een Opie-menuapplet. +Comment[pl]=Generuje aplet menu Opie +Comment[pt]=Gera uma 'applet' do menu do Opie. +Comment[pt_BR]=Gera uma 'applet' do menu do Opie. +Comment[ru]=Создание аплета меню Opie. +Comment[sk]=Vygeneruje Opie menu applet. +Comment[sr]=Прави Opie аплет менија. +Comment[sr@Latn]=Pravi Opie aplet menija. +Comment[sv]=Skapa ett Opie-menyminiprogram. +Comment[tr]=Bir Opie menü küçük uygulaması yarat +Comment[zh_CN]=生成一个 Opie 菜单小程序。 +Comment[zh_TW]=產生一個 Opie 選單小程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp +Archive=opiemenu.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir0] +Type=mkdir +Dir=%{dest}/pics + +[MkDir1] +Type=mkdir +Dir=%{dest}/pics/%{APPNAMELC} + +[FILE2] +Type=install +Source=%{src}/Example.png +Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png +Process=false + +[FILE3] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[FILE4] +Type=install +Source=%{src}/simpleimpl.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/simpleimpl.h +Dest=%{dest}/%{APPNAMELC}.h + +[MSG] +Type=message +Comment=An opie menu applet was created in %{dest} +Comment[ca]=Una miniaplicació de menú per a Opie ha estat creat en %{dest} +Comment[da]=En opie menu-applet blev oprettet i %{dest} +Comment[de]=Ein Opie-Menü-Miniprogramm (Applet) wurde in %{dest} erstellt. +Comment[el]=Μία μικροεφαρμογή μενού opie δημιουργήθηκε στο %{dest} +Comment[es]=Un applet de menú para Opie ha sido creado en %{dest} +Comment[et]=Opie menüüaplett loodi asukohta %{dest} +Comment[eu]= Opie-ren menu applet bat sortu da hemen: %{dest} +Comment[fa]=یک برنامک گزینگان opie در %{dest} ایجاد شد +Comment[fr]=Un applet de menu Opie a été créé dans %{dest} +Comment[ga]=Cruthaíodh feidhmchláirín roghchláir opie i %{dest} +Comment[gl]=Creouse un applet de menu para opie en %{dest} +Comment[hu]=Létrejött egy Opie-s menü-kisalkalmazás itt: %{dest} +Comment[it]=È stata creata un'applet di menu Opie in %{dest} +Comment[ja]=Opie メニューアプレットを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Menü-Lüttprogramm för Opie opstellt +Comment[ne]=ओपिइ मेनु एप्लेट %{dest} मा सिर्जना गरियो +Comment[nl]=Een Opie-menuapplet is aangemaakt in %{dest} +Comment[pl]=Aplet menu Opie został utworzony w %{dest} +Comment[pt]=Foi criada uma 'applet' do menu do Opie em %{dest} +Comment[pt_BR]=Foi criada uma 'applet' do menu do Opie em %{dest} +Comment[ru]=Аплет меню Opie создан в %{dest} +Comment[sk]=Opie menu applet bol vytvorený v %{dest} +Comment[sr]=Opie аплет менија направљен је у %{dest} +Comment[sr@Latn]=Opie aplet menija napravljen je u %{dest} +Comment[sv]=Ett Opie-menyprogram skapades i %{dest} +Comment[tr]=Bir opie menü küçük uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 opie 菜单小程序 +Comment[zh_TW]=一個 Opie 選單小程式已建立於 %{dest} + diff --git a/languages/cpp/app_templates/opiemenu/opiemenu.png b/languages/cpp/app_templates/opiemenu/opiemenu.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/opiemenu/opiemenu.png differ diff --git a/languages/cpp/app_templates/opiemenu/simpleimpl.cpp b/languages/cpp/app_templates/opiemenu/simpleimpl.cpp new file mode 100644 index 00000000..95245661 --- /dev/null +++ b/languages/cpp/app_templates/opiemenu/simpleimpl.cpp @@ -0,0 +1,78 @@ +#include "%{APPNAMELC}.h" + +#include +#include + +/* QT */ +#include +#include +#include + + +%{APPNAME}::%{APPNAME}() + :QObject( 0, "%{APPNAME}" ) +{ +} + +%{APPNAME}::~%{APPNAME} ( ) +{} + +int %{APPNAME}::position() const +{ + return 3; +} + +QString %{APPNAME}::name() const +{ + return tr( "MenuApplet Example Name" ); +} + +QString %{APPNAME}::text() const +{ + return tr( "Click the white rabbit" ); +} + + +QIconSet %{APPNAME}::icon() const +{ + QPixmap pix; + QImage img = Resource::loadImage( "Tux" ); + if ( !img.isNull() ) + pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + return pix; +} + +QPopupMenu* %{APPNAME}::popup(QWidget*) const +{ + /* no subdir */ + return 0; +} + +void %{APPNAME}::activated() +{ + QMessageBox::information(0,tr("No white rabbit found"), + tr("No white rabbit was seen near Opie." + "Only the beautiful OpieZilla is available" + "for your pleassure")); +} + + +QRESULT %{APPNAME}::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) +{ + *iface = 0; + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_MenuApplet ) + *iface = this; + else + return QS_FALSE; + + if ( *iface ) + (*iface)->addRef(); + return QS_OK; +} + +Q_EXPORT_INTERFACE() +{ + Q_CREATE_INSTANCE( %{APPNAME} ) +} diff --git a/languages/cpp/app_templates/opiemenu/simpleimpl.h b/languages/cpp/app_templates/opiemenu/simpleimpl.h new file mode 100644 index 00000000..3961e3c4 --- /dev/null +++ b/languages/cpp/app_templates/opiemenu/simpleimpl.h @@ -0,0 +1,32 @@ +#ifndef %{APPNAME}_MENU_APPLET_H +#define %{APPNAME}_MENU_APPLET_H + +#include + +#include + +class %{APPNAME} : public QObject, public MenuAppletInterface +{ + + Q_OBJECT + +public: + %{APPNAME} ( ); + virtual ~%{APPNAME} ( ); + + QRESULT queryInterface( const QUuid&, QUnknownInterface** ); + Q_REFCOUNT + + virtual int position() const; + + virtual QString name ( ) const; + virtual QIconSet icon ( ) const; + virtual QString text ( ) const; + /* virtual QString tr( const char* ) const; + virtual QString tr( const char*, const char* ) const; + */ + virtual QPopupMenu *popup ( QWidget *parent ) const; + virtual void activated ( ); +}; + +#endif diff --git a/languages/cpp/app_templates/opienet/.kdev_ignore b/languages/cpp/app_templates/opienet/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/opienet/Example.png b/languages/cpp/app_templates/opienet/Example.png new file mode 100644 index 00000000..f63d0bc7 Binary files /dev/null and b/languages/cpp/app_templates/opienet/Example.png differ diff --git a/languages/cpp/app_templates/opienet/Makefile.am b/languages/cpp/app_templates/opienet/Makefile.am new file mode 100644 index 00000000..47dc4231 --- /dev/null +++ b/languages/cpp/app_templates/opienet/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = Makefile.am Example.png app.kdevelop app.pro \ + simpleiface.cpp simpleiface.h simplemodule.h \ + simplemodule.cpp + +templateName = opienet + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/opienet/app.kdevelop b/languages/cpp/app_templates/opienet/app.kdevelop new file mode 100644 index 00000000..660b7bee --- /dev/null +++ b/languages/cpp/app_templates/opienet/app.kdevelop @@ -0,0 +1,143 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + C++ + Code + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + gtk + gnustep + python + php + perl + w3c-dom-level2-html + kdev3api + sdl + w3c-svg + w3c-uaag10 + + + Guide to the Qt Translation Tools + qmake User Guide + Qt Assistant Manual + Qt Designer Manual + Qt Referrence Documentation + + + bonobo-activation + gconf + gtksourceview + libbonobo + libbonoboui + + + + + + -qws + + true + false + false + + + false + true + + + + + false + + + + plugins/networksettings + + %{APPNAMELC} + 0 +
opie/settings
+ %{AUTHOR} %{EMAIL} + arm + opie-networksettings + %{VERSION} + Empty +
+
+ + + + + qpe + -qws + + +
+ + + + + + + + + + + + + + false + false + + + + false + + + .h + .cpp + true + + + + true + 2 + + + -f + + -dP + + -f + -u3 -p + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + +
diff --git a/languages/cpp/app_templates/opienet/app.pro b/languages/cpp/app_templates/opienet/app.pro new file mode 100644 index 00000000..53fb6eea --- /dev/null +++ b/languages/cpp/app_templates/opienet/app.pro @@ -0,0 +1,39 @@ +TEMPLATE = lib +CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-network +HEADERS = %{APPNAMELC}module.h %{APPNAMELC}iface.h +SOURCES = %{APPNAMELC}module.cpp %{APPNAMELC}iface.cpp +TARGET = %{APPNAMELC} +LIBS += -linterfaces + + +QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP) +contains( TEMPLATE, quick-template ){ + contains( QUICK_SPEC_FOO, quick-app-lib ){ + message( "foo" ) + system( rm $$TARGET ) + system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET) + DEFINES += OPIE_APP_INTERFACE + TEMPLATE = lib + CONFIG += dll + }else{ + LI = $$join( TARGET, "lib", "lib", ".so*" ) + system( rm $$LI ) + TEMPLATE = app + } +} + + +QMAKE_LIBDIR= $$(OPIEDIR)/lib +OPIE-SPEC=6 + +zecke-libqpe { + INCLUDEPATH += $$(OPIEDIR)/include + LIBS += -lqpe + DEPENDPATH += $$(OPIEDIR)/include +} + +zecke-libopie { + INCLUDEPATH += $$(OPIEDIR)/include + DEPENDPATH += $$(OPIEDIR)/include + LIBS += -lopie +} diff --git a/languages/cpp/app_templates/opienet/opienet.kdevtemplate b/languages/cpp/app_templates/opienet/opienet.kdevtemplate new file mode 100644 index 00000000..4ab9ebbe --- /dev/null +++ b/languages/cpp/app_templates/opienet/opienet.kdevtemplate @@ -0,0 +1,142 @@ +# KDE Config File +[General] +Name=Opie Networksettings +Name[br]=Kefluniadur rouedad Opie +Name[ca]=Connector de preferències de xarxa per a Opie +Name[da]=Opie netværksopsætning +Name[de]=Opie-Netzwerkeinstellungen +Name[el]=Ρυθμίσεις δικτύου Opie +Name[es]=Preferencias de red para Opie +Name[et]=Opie võrguseadustused +Name[eu]=Opie-ren sare-ezarpenak +Name[fa]=تنظیمات شبکۀ Opie +Name[fr]=Paramètres réseau pour Opie +Name[ga]=Socruithe Líonra Opie +Name[hu]=Opie-s hálózati beállítómodul +Name[it]=Impostazioni di rete di Opie +Name[ja]=Opie ネットワーク設定 +Name[nds]=Opie-Nettwarkinstellen +Name[ne]=ओपिइ सञ्जाल सेटिङ +Name[nl]=Opie-netwerkinstellingen +Name[pl]=Ustawienia sieciowe Opie +Name[pt]=Configuração de rede do Opie +Name[pt_BR]=Configuração de rede do Opie +Name[ru]=Параметры сети Opie +Name[sk]=Opie sieťové nastavenia +Name[sr]=Opie мрежна подешавања +Name[sr@Latn]=Opie mrežna podešavanja +Name[sv]=Opie nätverksinställningar +Name[tr]=Opie Ağ Ayarları +Name[zh_CN]=Opie 网络设置 +Name[zh_TW]=Opie 網路設定 +Icon=qmakeapp.png +Category=C++/Embedded +Comment=Generate an Opie network config plugin. +Comment[ca]=Genera un connector de preferències de xarxa per a Opie. +Comment[da]=Generér en Opie netværks-config-plugin. +Comment[de]=Erstellt ein Modul für Opie-Netzwerkeinstellungen. +Comment[el]=Δημιουργία ενός πρόσθετου ρύθμισης δικτύου Opie. +Comment[es]=Genera un complemento de configuración de red para Opie. +Comment[et]=Opie võrguseadistuste plugina loomine. +Comment[eu]=Sortu Opie-ren sare-ezarpenetarako plugin bat. +Comment[fa]=یک وصلۀ پیکربندی شبکۀ Opie تولید می‌کند. +Comment[fr]=Génère un module externe de configuration réseau pour Opie. +Comment[ga]=Cruthaigh breiseán cumraíochta líonra Opie. +Comment[gl]=Xera unha extensión de configuración da rede para Opie. +Comment[hu]=Létrehoz egy Opie-s hálózati beállítómodult. +Comment[it]=Genera un plugin di configurazione di rete Opie. +Comment[ja]=Opie ネットワーク設定プラグインを作成 +Comment[nds]=Stellt en Moduul för Opie-Nettwarkinstellen op. +Comment[ne]=ओपिइ सञ्जाल कन्फिग प्लगइन उत्पन्न गर्नुहोस् +Comment[nl]=Genereert een Opie netwerkconfiguratieplugin. +Comment[pl]=Generuje wtyczkę do ustawień sieciowych Opie +Comment[pt]=Gera um 'plugin' de configuração da rede do Opie. +Comment[pt_BR]=Gera um 'plugin' de configuração da rede do Opie. +Comment[ru]=Создание модуля настройки сети Opie. +Comment[sk]=Vygeneruje Opie modul pre sieťovú konfiguráciu. +Comment[sr]=Прави прикључак за Opie мрежна подешавања. +Comment[sr@Latn]=Pravi priključak za Opie mrežna podešavanja. +Comment[sv]=Skapa ett Opie-insticksprogram för nätverksinställning. +Comment[tr]=Opie ağ ayar eklentisi yarat. +Comment[zh_CN]=生成一个 Opie 网络配置插件。 +Comment[zh_TW]=產生一個 Opie 網路設定外掛程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp +Archive=opienet.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir0] +Type=mkdir +Dir=%{dest}/pics + +[MkDir1] +Type=mkdir +Dir=%{dest}/pics/%{APPNAMELC} + +[FILE2] +Type=install +Source=%{src}/Example.png +Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png +Process=false + +[FILE3] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[FILE4] +Type=install +Source=%{src}/simplemodule.cpp +Dest=%{dest}/%{APPNAMELC}module.cpp + +[FILE5] +Type=install +Source=%{src}/simpleiface.cpp +Dest=%{dest}/%{APPNAMELC}iface.cpp + +[FILE6] +Type=install +Source=%{src}/simplemodule.h +Dest=%{dest}/%{APPNAMELC}module.h + +[FILE7] +Type=install +Source=%{src}/simpleiface.h +Dest=%{dest}/%{APPNAMELC}iface.h + +[MSG] +Type=message +Comment=An opie network settings plugin was created in %{dest} +Comment[ca]=Un connector de preferències de xarxa per a Opie ha estat creat en %{dest} +Comment[da]=En opie netværksopsætning-plugin blev oprettet i %{dest} +Comment[de]=Ein Modul für Opie-Netzwerkeinstellungen wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο ρύθμισης δικτύου του opie δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento de preferencias de red para Opie ha sido creado en %{dest} +Comment[et]=Opie võrguseadistuste plugin loodi asukohta %{dest} +Comment[eu]=Opie-ren sare-ezarpenetarako plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ تنظیمات شبکۀ opie در %{dest} ایجاد شد +Comment[fr]=Un module externe de configuration réseau pour Opie a été créé dans %{dest} +Comment[gl]=Creouse unha extensión de configuración da rede para opie en %{dest} +Comment[hu]=Létrejött egy Opie-s hálózati beállítómodul itt: %{dest} +Comment[it]=È stato creato un plugin per le impostazioni di rete di Opie in %{dest} +Comment[ja]=Opie ネットワーク設定プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Nettwarkinstellenmoduul för Opie opstellt +Comment[ne]=ओपिइ सञ्जाल सेटिङ प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een Opie netwerkconfiguratieplugin is aangemaakt in %{dest} +Comment[pl]=Wtyczka ustawień sieciowych Opie została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' de configuração da rede do Opie em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' de configuração da rede do Opie em %{dest} +Comment[ru]=Модуль настройки сети Opie создан в %{dest} +Comment[sk]=Opie module pre sieťové nastavenia bol vytvorený v %{dest} +Comment[sr]=Прикључак за Opie мрежна подешавања направљен је у %{dest} +Comment[sr@Latn]=Priključak za Opie mrežna podešavanja napravljen je u %{dest} +Comment[sv]=Ett Opie-insticksprogram för nätverksinställning skapades i %{dest} +Comment[tr]=Bir opie ağ ayar eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 opie 网络设置插件 +Comment[zh_TW]=一個 Opie 網路設定外掛程式已建立於 %{dest} + diff --git a/languages/cpp/app_templates/opienet/opienet.png b/languages/cpp/app_templates/opienet/opienet.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/opienet/opienet.png differ diff --git a/languages/cpp/app_templates/opienet/simmplemodule.h b/languages/cpp/app_templates/opienet/simmplemodule.h new file mode 100644 index 00000000..9158a7c8 --- /dev/null +++ b/languages/cpp/app_templates/opienet/simmplemodule.h @@ -0,0 +1,36 @@ +#ifndef %{APPNAME}_NETWORK_MODULE_H +#define %{APPNAME}_NETWORK_MODULE_H + +#include + +class VirtualModule : Module { + +signals: + void updateInterface(Interface* i ); + +public: + VirtualModule(); + ~VirtualModule(); + + const QString type() {return QString::fromLatin1("vpn" );} + void setProfile( const QString& ) {} + bool isOwner( Interface* ); + QWidget *configure( Interface* ); + QWidget *information( Interface* ); + QList getInterfaces(); + void possibleNewInterfaces( QMap& ); + Interface *addNewInterface( const QString& ); + bool remove( Interface* iface ); + QString getPixmapName( Interface* ) {return QString::fromLatin1("Tux"); } + void receive( const QCString&, const QByteArray& ar ) {} // don't listen +private: + QList m_interfaces; +}; + +extern "C" { + void* create_plugin() { + return new VirtualModule(); + } +}; + +#endif diff --git a/languages/cpp/app_templates/opienet/simpleiface.cpp b/languages/cpp/app_templates/opienet/simpleiface.cpp new file mode 100644 index 00000000..9182a2f9 --- /dev/null +++ b/languages/cpp/app_templates/opienet/simpleiface.cpp @@ -0,0 +1,43 @@ +#include "%{APPNAMELC}iface.h" + +%{APPNAME}Interface::%{APPNAME}Interface( QObject* parent, + const char* name, + bool status ) + : Interface(parent, name, status ) +{ +} + +%{APPNAME}Interface::~%{APPNAME}Interface() { +} + +bool %{APPNAME}Interface::refresh() { +/* we do VPN over ppp + * so replace the interfaceName with + * something actual existing + * I take wlan0 in my case + */ + QString old = getInterfaceName(); + qWarning("Interface name was " + old ); + setInterfaceName( "wlan0" ); + + bool b =Interface::refresh(); + setInterfaceName( old ); + +/* new and old interface name */ + emit updateInterface(this); + return b; +} + + +void %{APPNAME}Interface::start() { +// call pptp + setStatus(true); + refresh(); + emit updateMessage("VPN started"); +} + +void %{APPNAME}Interface::stop() { + setStatus(false ); + refresh(); + emit updateMessage("VPN halted"); +} diff --git a/languages/cpp/app_templates/opienet/simpleiface.h b/languages/cpp/app_templates/opienet/simpleiface.h new file mode 100644 index 00000000..f235c160 --- /dev/null +++ b/languages/cpp/app_templates/opienet/simpleiface.h @@ -0,0 +1,22 @@ +#ifndef EXAMPLE_IFACE_VPN_H +#define EXAMPLE_IFACE_VPN_H + +#include + +class %{APPNAME}Interface : public Interface { + Q_OBJECT + +public: + %{APPNAME}Interface(QObject* parent, const char* name = "vpn", bool up = false ); + ~%{APPNAME}Interface(); + +public slots: + bool refresh(); // refresh information + void start(); + void stop(); + +private: + bool m_isUp : 1; +}; + +#endif diff --git a/languages/cpp/app_templates/opienet/simplemodule.cpp b/languages/cpp/app_templates/opienet/simplemodule.cpp new file mode 100644 index 00000000..a67974a8 --- /dev/null +++ b/languages/cpp/app_templates/opienet/simplemodule.cpp @@ -0,0 +1,71 @@ +#include + +#include + +#include "%{APPNAMELC}iface.h" +#include "%{APPNAMELC}module.h" + +%{APPNAME}Module::%{APPNAME}Module() { + Interface* iface = new %{APPNAME}Interface( 0 ); + iface->setHardwareName( "vpn" ); + iface->setInterfaceName( "Test VPN" ); + m_interfaces.append( iface ); + +// If we set up VPN via pptp +// and networksettins was closed and now opened +// we need to hide the ppp device behind us +// One can do this by calling setHandledInterfaceNames +// setHandledInterfaceNames(); +} + +%{APPNAME}Module::~%{APPNAME}Module() { + m_interfaces.setAutoDelete( true ); + m_interfaces.clear(); +} + + +/* + * We're a VPN module + */ +bool %{APPNAME}Module::isOwner( Interface* iface ) { + /* check if it is our device */ + return m_interfaces.find( iface ) != -1; +} + +QWidget* %{APPNAME}Module::configure( Interface* ) { +/* We don't have any Config for now */ + return 0l; +} + +QWidget* %{APPNAME}Module::information( Interface* iface ) { + return new InterfaceInformationImp(0, "Interface info", iface ); +} + +QList %{APPNAME}Module::getInterfaces() { + return m_interfaces; +} + +void %{APPNAME}Module::possibleNewInterfaces( QMap& map) { + map.insert( QObject::tr("VPN PPTP"), + QObject::tr("Add new Point to Point Tunnel Protocol connection" ) ); +} + + +Interface* %{APPNAME}Module::addNewInterface( const QString& ) { + /* check the str if we support more interfaces */ +/* + Interface* iface = new %{APPNAME}Interface( 0 ); + iface->setModuleOwner( this ); + return iface;*/ + +// if we would support saving interfaces we could add +// them here + + return 0; +} + + +bool %{APPNAME}Module::remove( Interface* ) { +/* we do not support removing our interface */ + return false; +} diff --git a/languages/cpp/app_templates/opienet/simplemodule.h b/languages/cpp/app_templates/opienet/simplemodule.h new file mode 100644 index 00000000..1b02b688 --- /dev/null +++ b/languages/cpp/app_templates/opienet/simplemodule.h @@ -0,0 +1,36 @@ +#ifndef %{APPNAME}_NETWORK_MODULE_H +#define %{APPNAME}_NETWORK_MODULE_H + +#include + +class %{APPNAME}Module : Module { + +signals: + void updateInterface(Interface* i ); + +public: + %{APPNAME}Module(); + ~%{APPNAME}Module(); + + const QString type() {return QString::fromLatin1("vpn" );} + void setProfile( const QString& ) {} + bool isOwner( Interface* ); + QWidget *configure( Interface* ); + QWidget *information( Interface* ); + QList getInterfaces(); + void possibleNewInterfaces( QMap& ); + Interface *addNewInterface( const QString& ); + bool remove( Interface* iface ); + QString getPixmapName( Interface* ) {return QString::fromLatin1("Tux"); } + void receive( const QCString&, const QByteArray& ar ) {} // don't listen +private: + QList m_interfaces; +}; + +extern "C" { + void* create_plugin() { + return new %{APPNAME}Module(); + } +}; + +#endif diff --git a/languages/cpp/app_templates/opietoday/.kdev_ignore b/languages/cpp/app_templates/opietoday/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/opietoday/Example.png b/languages/cpp/app_templates/opietoday/Example.png new file mode 100644 index 00000000..f63d0bc7 Binary files /dev/null and b/languages/cpp/app_templates/opietoday/Example.png differ diff --git a/languages/cpp/app_templates/opietoday/Makefile.am b/languages/cpp/app_templates/opietoday/Makefile.am new file mode 100644 index 00000000..8854404d --- /dev/null +++ b/languages/cpp/app_templates/opietoday/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = Makefile.am Example.png app.kdevelop app.pro exampleplugin.cpp \ + examplepluginimpl.cpp examplepluginwidget.cpp exampleplugin.h \ + examplepluginimpl.h examplepluginwidget.h + +templateName = opietoday + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/opietoday/app.kdevelop b/languages/cpp/app_templates/opietoday/app.kdevelop new file mode 100644 index 00000000..f6e57207 --- /dev/null +++ b/languages/cpp/app_templates/opietoday/app.kdevelop @@ -0,0 +1,143 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + C++ + Code + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + gtk + gnustep + python + php + perl + w3c-dom-level2-html + kdev3api + sdl + w3c-svg + w3c-uaag10 + + + Guide to the Qt Translation Tools + qmake User Guide + Qt Assistant Manual + Qt Designer Manual + Qt Referrence Documentation + + + bonobo-activation + gconf + gtksourceview + libbonobo + libbonoboui + + + + + + -qws + + true + false + false + + + false + true + + + + + false + + + + plugins/today + + %{APPNAMELC} + 0 +
opie/plugins
+ %{AUTHOR} %{EMAIL} + arm + opie-today + %{VERSION} + Empty +
+
+ + + + + + -qws + + +
+ + + + + + + + + + + + + + false + false + + + + false + + + .h + .cpp + true + + + + true + 2 + + + -f + + -dP + + -f + -u3 -p + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + +
diff --git a/languages/cpp/app_templates/opietoday/app.pro b/languages/cpp/app_templates/opietoday/app.pro new file mode 100644 index 00000000..152dc6f6 --- /dev/null +++ b/languages/cpp/app_templates/opietoday/app.pro @@ -0,0 +1,38 @@ +TEMPLATE = lib +CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-todayplugin +HEADERS = %{APPNAMELC}.h %{APPNAMELC}widget.h %{APPNAMELC}impl.h +SOURCES = %{APPNAMELC}.cpp %{APPNAMELC}widget.cpp %{APPNAMELC}impl.cpp +TARGET = %{APPNAMELC} + + +QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP) +contains( TEMPLATE, quick-template ){ + contains( QUICK_SPEC_FOO, quick-app-lib ){ + message( "foo" ) + system( rm $$TARGET ) + system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET) + DEFINES += OPIE_APP_INTERFACE + TEMPLATE = lib + CONFIG += dll + }else{ + LI = $$join( TARGET, "lib", "lib", ".so*" ) + system( rm $$LI ) + TEMPLATE = app + } +} + + +QMAKE_LIBDIR= $$(OPIEDIR)/lib +OPIE-SPEC=6 + +zecke-libqpe { + INCLUDEPATH += $$(OPIEDIR)/include + LIBS += -lqpe + DEPENDPATH += $$(OPIEDIR)/include +} + +zecke-libopie { + INCLUDEPATH += $$(OPIEDIR)/include + DEPENDPATH += $$(OPIEDIR)/include + LIBS += -lopie +} diff --git a/languages/cpp/app_templates/opietoday/exampleplugin.cpp b/languages/cpp/app_templates/opietoday/exampleplugin.cpp new file mode 100644 index 00000000..3d32b274 --- /dev/null +++ b/languages/cpp/app_templates/opietoday/exampleplugin.cpp @@ -0,0 +1,60 @@ + +#include "%{APPNAMELC}.h" + +%{APPNAME}::%{APPNAME}() { + m_widget = 0l; +} + +%{APPNAME}::~%{APPNAME}() { + delete (%{APPNAME}Widget*)m_widget; +} + +QString %{APPNAME}::pluginName() const { + return QObject::tr( "%{APPNAME}" ); +} + +double %{APPNAME}::versionNumber() const { + return 0.1; +} + +// this sets the image that will be shown on the left side of the plugin +QString %{APPNAME}::pixmapNameWidget() const { + return QString::fromLatin1("%{APPNAMELC}/%{APPNAMELC}"); +} + +QWidget* %{APPNAME}::widget( QWidget * wid ) { + if(!m_widget) { + m_widget = new %{APPNAME}Widget( wid, "%{APPNAME}" ); + } + return m_widget; +} + + +// that would be the icon of the config widget in todays config view +QString %{APPNAME}::pixmapNameConfig() const { + return 0l; +} + +// No config widget yet, look at the datebook plugin for an example of that +TodayConfigWidget* %{APPNAME}::configWidget( QWidget* /*parent*/ ) { + return 0l; +} + +// add the binary name of the app to launch here +QString %{APPNAME}::appName() const { + return QString::null; +} + +// if the plugin should be excluded form the refresh cycles that can be set in the today app +bool %{APPNAME}::excludeFromRefresh() const { + return false; +} + +void %{APPNAME}::refresh() { + if ( m_widget ) { + m_widget->refresh(); + } +} + +void %{APPNAME}::reinitialize() { +} diff --git a/languages/cpp/app_templates/opietoday/exampleplugin.h b/languages/cpp/app_templates/opietoday/exampleplugin.h new file mode 100644 index 00000000..b321f434 --- /dev/null +++ b/languages/cpp/app_templates/opietoday/exampleplugin.h @@ -0,0 +1,34 @@ +#ifndef %{APPNAME}_PLUGIN_H +#define %{APPNAME}_PLUGIN_H + +#include +#include + +#include +#include + +#include "%{APPNAMELC}widget.h" + +// implementation of the today plugin interface +class %{APPNAME} : public TodayPluginObject { + +public: + %{APPNAME}(); + ~%{APPNAME}(); + + QString pluginName() const; + double versionNumber() const; + QString pixmapNameWidget() const; + QWidget* widget(QWidget *); + QString pixmapNameConfig() const; + TodayConfigWidget* configWidget(QWidget *); + QString appName() const; + bool excludeFromRefresh() const; + void refresh(); + void reinitialize(); + + private: + QGuardedPtr<%{APPNAME}Widget> m_widget; +}; + +#endif diff --git a/languages/cpp/app_templates/opietoday/examplepluginimpl.cpp b/languages/cpp/app_templates/opietoday/examplepluginimpl.cpp new file mode 100644 index 00000000..3a9481f1 --- /dev/null +++ b/languages/cpp/app_templates/opietoday/examplepluginimpl.cpp @@ -0,0 +1,30 @@ +#include "%{APPNAMELC}.h" +#include "%{APPNAMELC}impl.h" + +%{APPNAME}Impl::%{APPNAME}Impl() { + examplePlugin = new %{APPNAME}(); +} + +%{APPNAME}Impl::~%{APPNAME}Impl() { + delete examplePlugin; +} + + +TodayPluginObject* %{APPNAME}Impl::guiPart() { + return examplePlugin; +} + +QRESULT %{APPNAME}Impl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { + *iface = 0; + if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) { + *iface = this, (*iface)->addRef(); + }else + return QS_FALSE; + + return QS_OK; + +} + +Q_EXPORT_INTERFACE() { + Q_CREATE_INSTANCE( %{APPNAME}Impl ); +} diff --git a/languages/cpp/app_templates/opietoday/examplepluginimpl.h b/languages/cpp/app_templates/opietoday/examplepluginimpl.h new file mode 100644 index 00000000..ccb7c3b3 --- /dev/null +++ b/languages/cpp/app_templates/opietoday/examplepluginimpl.h @@ -0,0 +1,23 @@ +#ifndef %{APPNAME}_PLUGIN_IMPL_H +#define %{APPNAME}_PLUGIN_IMPL_H + +#include + +class %{APPNAME}; + +class %{APPNAME}Impl : public TodayPluginInterface{ + +public: + %{APPNAME}Impl(); + virtual ~%{APPNAME}Impl(); + + QRESULT queryInterface( const QUuid &, QUnknownInterface** ); + Q_REFCOUNT + + virtual TodayPluginObject *guiPart(); + +private: + %{APPNAME} *examplePlugin; +}; + +#endif diff --git a/languages/cpp/app_templates/opietoday/examplepluginwidget.cpp b/languages/cpp/app_templates/opietoday/examplepluginwidget.cpp new file mode 100644 index 00000000..b0cb0dcc --- /dev/null +++ b/languages/cpp/app_templates/opietoday/examplepluginwidget.cpp @@ -0,0 +1,55 @@ +#include +#include + +#include "%{APPNAMELC}widget.h" + +%{APPNAME}Widget::%{APPNAME}Widget( QWidget *parent, const char* name) + : QWidget(parent, name ) { + + m_exampleLabel = 0l; + m_layout = 0l; + + if ( m_exampleLabel ) { + delete m_exampleLabel; + } + + // since here a OClickableLabel is used, the plugin part will be clickable, and the actions + // that should be triggered when clicked are defined in slotClicked() + // of course also normal widgets can be used. + m_exampleLabel = new OClickableLabel( this ); + connect( m_exampleLabel, SIGNAL( clicked() ), this, SLOT( slotClicked() ) ); + + if ( m_layout ) { + delete m_layout; + } + m_layout = new QHBoxLayout( this ); + m_layout->setAutoAdd( true ); + + readConfig(); + getInfo(); +} + + +%{APPNAME}Widget::~%{APPNAME}Widget() { + delete m_exampleLabel; + delete m_layout; +} + + +void %{APPNAME}Widget::readConfig() { +// we dont have any config entries in this plugin +// normally this method is used after today config was used +} + + +void %{APPNAME}Widget::refresh() { + +} + +void %{APPNAME}Widget::getInfo() { + m_exampleLabel->setText( tr("%{APPNAME} text") ); +} + +void %{APPNAME}Widget::slotClicked() { + getInfo(); +} diff --git a/languages/cpp/app_templates/opietoday/examplepluginwidget.h b/languages/cpp/app_templates/opietoday/examplepluginwidget.h new file mode 100644 index 00000000..26a72128 --- /dev/null +++ b/languages/cpp/app_templates/opietoday/examplepluginwidget.h @@ -0,0 +1,28 @@ +#ifndef %{APPNAME}_PLUGIN_WIDGET_H +#define %{APPNAME}_PLUGIN_WIDGET_H + +#include + +#include + +class %{APPNAME}Widget : public QWidget { + + Q_OBJECT + +public: + %{APPNAME}Widget( QWidget *parent, const char *name ); + ~%{APPNAME}Widget(); + + void refresh(); + +private slots: + void slotClicked(); + +private: + OClickableLabel* m_exampleLabel; + QHBoxLayout* m_layout; + void readConfig(); + void getInfo(); +}; + +#endif diff --git a/languages/cpp/app_templates/opietoday/opietoday.kdevtemplate b/languages/cpp/app_templates/opietoday/opietoday.kdevtemplate new file mode 100644 index 00000000..25d8f42d --- /dev/null +++ b/languages/cpp/app_templates/opietoday/opietoday.kdevtemplate @@ -0,0 +1,151 @@ +# KDE Config File +[General] +Name=Opie Today Plugin +Name[ca]=Connector de tasques pendents per a Opie +Name[da]=Opie Today-plugin +Name[de]=Opie-Today-Modul +Name[el]=Πρόσθετο Σήμερα του Opie +Name[es]=Complemento de tareas pendientes para Opie +Name[et]=Opie Today plugin +Name[eu]=Opie-ren gaur-plugina +Name[fa]=وصلۀ Opie Today +Name[fr]=Module externe Opie « Today » +Name[ga]=Breiseán Inniu Opie +Name[gl]=Extensión 'today' para Opie +Name[hu]=Opie Today-modul +Name[it]=Plugin today di Opie +Name[ja]=Opie Today プラグイン +Name[nds]=Moduul för Opie-Today +Name[ne]=ओपिइ टुडे प्लगइन +Name[nl]=Opie Today-plugin +Name[pl]=Wtyczka Opie Dzisiaj +Name[pt]='Plugin' de Dados de Hoje do Opie +Name[pt_BR]='Plugin' de Dados de Hoje do Opie +Name[ru]=Модуль задач Opie +Name[sk]=Opie dnešný modul +Name[sr]=Прикључак за Opie данас +Name[sr@Latn]=Priključak za Opie danas +Name[sv]=Opie Idag-insticksprogram +Name[tr]=Opie Bugün Eklentisi +Name[zh_CN]=Opie 今日插件 +Name[zh_TW]=Opie 今天外掛程式 +Icon=qmakeapp.png +Category=C++/Embedded +Comment=Generate an Opie today plugin. +Comment[ca]=Genera un connector de tasques pendents per a Opie. +Comment[da]=Generér et Opie today-plugin. +Comment[de]=Erstellt ein Opie-Today-Modul +Comment[el]=Δημιουργία ενός πρόσθετου Σήμερα του Opie. +Comment[es]=Genera un complemento de tareas pendientes para Opie. +Comment[et]=Opie Today plugina loomine. +Comment[eu]=Sortu Opie-ren gaur plugin bat. +Comment[fa]=یک وصلۀ Opie today تولید می‌کند. +Comment[fr]=Génère un module externe Opie « Today ». +Comment[gl]=Xera unha extensión 'today' para Opie +Comment[hu]=Létrehoz egy Opie Today-modult. +Comment[it]=Genera un plugin today di Opie. +Comment[ja]=Opie today プラグインを作成 +Comment[nds]=Stellt en Moduul för Opie-Today op. +Comment[ne]=ओपिइ टुडे प्लगइन उत्पन्न गर्नुहोस् +Comment[nl]=Genereert een Opie today-plugin. +Comment[pl]=Generuje wtyczkę Opie "Dzisiaj". +Comment[pt]=Gera um 'plugin' para dados de hoje do Opie. +Comment[pt_BR]=Gera um 'plugin' para dados de hoje do Opie. +Comment[ru]=Создание модуля задач Opie. +Comment[sk]=Vygeneruje Opie dnešný modul. +Comment[sr]=Прави прикључак за Opie данас. +Comment[sr@Latn]=Pravi priključak za Opie danas. +Comment[sv]=Skapar ett Opie Idag-insticksprogram. +Comment[tr]=Bir Opie bugün eklentisi yarat +Comment[zh_CN]=生成一个 Opie 今日插件。 +Comment[zh_TW]=產生一個 Opie 今天外掛程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp +Archive=opietoday.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir0] +Type=mkdir +Dir=%{dest}/pics + +[MkDir1] +Type=mkdir +Dir=%{dest}/pics/%{APPNAMELC} + +[FILE2] +Type=install +Source=%{src}/Example.png +Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png +Process=false + +[FILE3] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[FILE4] +Type=install +Source=%{src}/exampleplugin.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/examplepluginwidget.cpp +Dest=%{dest}/%{APPNAMELC}widget.cpp + +[FILE6] +Type=install +Source=%{src}/examplepluginimpl.cpp +Dest=%{dest}/%{APPNAMELC}impl.cpp + +[FILE7] +Type=install +Source=%{src}/exampleplugin.h +Dest=%{dest}/%{APPNAMELC}.h + +[FILE8] +Type=install +Source=%{src}/examplepluginwidget.h +Dest=%{dest}/%{APPNAMELC}widget.h + +[FILE9] +Type=install +Source=%{src}/examplepluginimpl.h +Dest=%{dest}/%{APPNAMELC}impl.h + +[MSG] +Type=message +Comment=An opie today plugin was created in %{dest} +Comment[ca]=Un connector de tasques pendents per a Opie ha estat creat en %{dest} +Comment[da]=Et opie today-plugin blev oprettet i %{dest} +Comment[de]=Ein Opie-Today-Modul wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο Σήμερα του opie δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento de tareas pendientes para Opie ha sido creado en %{dest} +Comment[et]=Opie Today plugin loodi asukohta %{dest} +Comment[eu]=Opie-ren gaur plugin bat sortu da hemen %{dest} +Comment[fa]=یک وصلۀ opie today در %{dest} ایجاد شد +Comment[fr]=Un module externe Opie « Today » a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán inniu opie i %{dest} +Comment[gl]=Creouse unha extensión 'today' para opie en %{dest} +Comment[hu]=Létrejött egy Opie Today-modul itt: %{dest} +Comment[it]=È stato creato un plugin today di Opie in %{dest} +Comment[ja]=Opie today プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Moduul för Opie-Today opstellt +Comment[ne]=ओपिइ टुडे प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een Opie today-plugins is aangemaakt in %{dest} +Comment[pl]=Wtyczka Opie Dzisiaj została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' para dados de hoje do Opie em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' para dados de hoje do Opie em %{dest} +Comment[ru]=Модуль задач Opie создан в %{dest} +Comment[sk]=Opie dnešný modul bol vytvorený v %{dest} +Comment[sr]=Прикључак за opie данас направљен је у %{dest} +Comment[sr@Latn]=Priključak za opie danas napravljen je u %{dest} +Comment[sv]=Ett Opie Idag-insticksprogram skapades i %{dest} +Comment[tr]=Bir Opie bugün eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 opie 今日插件 +Comment[zh_TW]=一個 Opie 今天外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/opietoday/opietoday.png b/languages/cpp/app_templates/opietoday/opietoday.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/opietoday/opietoday.png differ diff --git a/languages/cpp/app_templates/prc-tool/.kdev_ignore b/languages/cpp/app_templates/prc-tool/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/prc-tool/Makefile.am b/languages/cpp/app_templates/prc-tool/Makefile.am new file mode 100644 index 00000000..3d4b5610 --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = prc-tool.png src-Makefile prc-tool.kdevelop callback.h \ + palmhello.c palmhello.pbitm palmhello.rcp palmhelloRsc.h +templateName = prc-tool + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/prc-tool/callback.h b/languages/cpp/app_templates/prc-tool/callback.h new file mode 100644 index 00000000..bf0ead45 --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/callback.h @@ -0,0 +1,24 @@ +#ifndef __CALLBACK_H__ +#define __CALLBACK_H__ + +/* This is a workaround for a bug in the current version of gcc: + + gcc assumes that no one will touch %a4 after it is set up in crt0.o. + This isn't true if a function is called as a callback by something + that wasn't compiled by gcc (like FrmCloseAllForms()). It may also + not be true if it is used as a callback by something in a different + shared library. + + We really want a function attribute "callback" which will insert this + progloue and epilogoue automatically. + + - Ian */ + +register void *reg_a4 asm("%a4"); + +#define CALLBACK_PROLOGUE \ + void *save_a4 = reg_a4; asm("move.l %%a5,%%a4; sub.l #edata,%%a4" : :); + +#define CALLBACK_EPILOGUE reg_a4 = save_a4; + +#endif diff --git a/languages/cpp/app_templates/prc-tool/palmhello.c b/languages/cpp/app_templates/prc-tool/palmhello.c new file mode 100644 index 00000000..0a34b6c4 --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/palmhello.c @@ -0,0 +1,117 @@ + +/* Main code for PalmHello */ + +#include +#include +#include "callback.h" + +#include "palmhelloRsc.h" + +static Boolean MainFormHandleEvent (EventPtr e) +{ + Boolean handled = false; + FormPtr frm; + + CALLBACK_PROLOGUE + + switch (e->eType) { + case frmOpenEvent: + frm = FrmGetActiveForm(); + FrmDrawForm(frm); + handled = true; + break; + + case menuEvent: + MenuEraseStatus(NULL); + + switch(e->data.menu.itemID) { + } + + handled = true; + break; + + case ctlSelectEvent: + switch(e->data.ctlSelect.controlID) { + } + break; + + default: + break; + } + + CALLBACK_EPILOGUE + + return handled; +} + +static Boolean ApplicationHandleEvent(EventPtr e) +{ + FormPtr frm; + Word formId; + Boolean handled = false; + + if (e->eType == frmLoadEvent) { + formId = e->data.frmLoad.formID; + frm = FrmInitForm(formId); + FrmSetActiveForm(frm); + + switch(formId) { + case MainForm: + FrmSetEventHandler(frm, MainFormHandleEvent); + break; + } + handled = true; + } + + return handled; +} + +/* Get preferences, open (or create) app database */ +static Word StartApplication(void) +{ + FrmGotoForm(MainForm); + return 0; +} + +/* Save preferences, close forms, close app database */ +static void StopApplication(void) +{ + FrmSaveAllForms(); + FrmCloseAllForms(); +} + +/* The main event loop */ +static void EventLoop(void) +{ + Word err; + EventType e; + + do { + EvtGetEvent(&e, evtWaitForever); + if (! SysHandleEvent (&e)) + if (! MenuHandleEvent (NULL, &e, &err)) + if (! ApplicationHandleEvent (&e)) + FrmDispatchEvent (&e); + } while (e.eType != appStopEvent); +} + +/* Main entry point; it is unlikely you will need to change this except to + handle other launch command codes */ +DWord PilotMain(Word cmd, Ptr cmdPBP, Word launchFlags) +{ + Word err; + + if (cmd == sysAppLaunchCmdNormalLaunch) { + + err = StartApplication(); + if (err) return err; + + EventLoop(); + StopApplication(); + + } else { + return sysErrParamErr; + } + + return 0; +} diff --git a/languages/cpp/app_templates/prc-tool/palmhello.pbitm b/languages/cpp/app_templates/prc-tool/palmhello.pbitm new file mode 100644 index 00000000..5291d5a4 --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/palmhello.pbitm @@ -0,0 +1,32 @@ +------------#######------------- +----------###########----------- +---------#############---------- +--------###############--------- +-------#################-------- +------###################------- +------###################------- +-----#####################------ +-----#####################------ +-----#####################------ +-----#####################------ +-----#####################------ +-----#####################------ +-----#####################------ +------###################------- +------###################------- +-------#################-------- +--------###############--------- +---------#############---------- +----------###########----------- +------------#######------------- +-------------------------------- +-------------------------------- +-------------------------------- +-------------------------------- +-------------------------------- +-------------------------------- +-------------------------------- +-------------------------------- +-------------------------------- +-------------------------------- +-------------------------------- diff --git a/languages/cpp/app_templates/prc-tool/palmhello.rcp b/languages/cpp/app_templates/prc-tool/palmhello.rcp new file mode 100644 index 00000000..0b37e81d --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/palmhello.rcp @@ -0,0 +1,11 @@ +#include "palmhelloRsc.h" + +FORM MainForm 1 1 158 158 +BEGIN + TITLE "PalmHello" +END + +APPLICATIONICONNAME 1000 "palmhello" +ICON "palmhello.pbitm" + +VERSION 1 "0.0.1" diff --git a/languages/cpp/app_templates/prc-tool/palmhelloRsc.h b/languages/cpp/app_templates/prc-tool/palmhelloRsc.h new file mode 100644 index 00000000..6dde2ec7 --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/palmhelloRsc.h @@ -0,0 +1 @@ +#define MainForm 1000 diff --git a/languages/cpp/app_templates/prc-tool/prc-tool b/languages/cpp/app_templates/prc-tool/prc-tool new file mode 100644 index 00000000..d856c80b --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/prc-tool @@ -0,0 +1,11 @@ +# KDE Config File +[General] +Name=Hello world program +Name[fr]=Un simple programme de test Hello world +Icon=chellogba.png +Category=C/PalmOS +Comment=Generates a template for palm application +Comment[fr]=Gnre un modle d'application pour l'environnement PALM. +#tShowFileAfterGeneration=README.devel +FileTemplates=h,CStyle,c,CStyle +ShowFilesAfterGeneration=APPNAME.c diff --git a/languages/cpp/app_templates/prc-tool/prc-tool.kdevelop b/languages/cpp/app_templates/prc-tool/prc-tool.kdevelop new file mode 100644 index 00000000..2c5a6c0a --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/prc-tool.kdevelop @@ -0,0 +1,51 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevCustomProject + C + + KDevDebugger + + + C + PalmOS + + + + + + + + + + + make test + + true + + + + + make + + + + true + 1 + false + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate b/languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate new file mode 100644 index 00000000..4216c466 --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate @@ -0,0 +1,136 @@ +# KDE Config File +[General] +Name=Hello world program +Name[ca]=Programa Hello world +Name[da]=Goddag verden program +Name[de]="Hello World"-Programm +Name[el]=Πρόγραμμα Γεια σου Κόσμε +Name[es]=Programa «Hola mundo» +Name[et]="Tere,maailm" programm +Name[eu]="Kaixo mundua" programa +Name[fa]=برنامۀ Hello world +Name[fr]=Programme « Bonjour monde » +Name[ga]=Ríomhchlár "Hello world" +Name[gl]=Programa Ola mundo +Name[it]=Programma di "Hello world" +Name[ja]=Hello world プログラム +Name[nds]="Moin Welt"-Programm +Name[ne]=हेल्डो वोल्ड कार्यक्रम +Name[nl]=Hello World-programma +Name[pl]=Program 'Witaj świecie' +Name[pt]=Programa 'Olá mundo' +Name[pt_BR]=Programa 'Olá mundo' +Name[ru]=Программа Hello world +Name[sk]=Ahoj svet program +Name[sl]=Program Hello world +Name[sr]=Програм „Здраво свете“ +Name[sr@Latn]=Program „Zdravo svete“ +Name[sv]=Hello world-program +Name[tr]=Merhaba Dünya Programı +Name[zh_CN]=Hello world 程序 +Name[zh_TW]=Hello world 程式 +Icon= # got none +Category=C/PalmOS +Comment=Generates a template for palm application +Comment[ca]=Genera una plantilla d'aplicació per a Palm +Comment[da]=Genererer en skabelon for et palm-program +Comment[de]=Erstellt das Gerüst für eine Palm-Anwendung +Comment[el]=Δημιουργία ενός προτύπου εφαρμογής για palm +Comment[es]=Genera una plantilla para una aplicación Palm +Comment[et]=Palmi rakenduse malli loomine. +Comment[eu]=Palm aplikazio baten txantiloi bat sortzen du +Comment[fa]=قالبی برای کاربرد palm تولید می‌کند +Comment[fr]=Génère un modèle pour une application Palm +Comment[gl]=Xera un modelo para aplicación palm +Comment[hu]=Létrehoz egy Palm-os alkalmazássablont +Comment[it]=Genera un modello per un'applicazione palm +Comment[ja]=Palm アプリケーションのためのテンプレートを作成します +Comment[nds]=Stellt dat Rahmenwark för en Palm-Programm op +Comment[ne]=पाम अनुप्रयोगका लागि टेम्प्लेट उत्पन्न गर्दछ +Comment[nl]=Genereert een sjabloon voor een Palm-toepassing +Comment[pl]=Generuje szablon programu dla Palma +Comment[pt]=Gera um modelo para aplicações do Palm +Comment[pt_BR]=Gera um modelo para aplicações do Palm +Comment[ru]=Создание простого приложения Palm +Comment[sk]=Vygeneruje šablónu pre Palm aplikáciu +Comment[sr]=Прави шаблон за palm програм +Comment[sr@Latn]=Pravi šablon za palm program +Comment[sv]=Skapar en mall för ett Palm-program +Comment[tr]=Bir avuçiçi uygulaması için bir şablon yaratır +Comment[zh_CN]=生成一个 Palm 应用程序的模板 +Comment[zh_TW]=產生一個 palm 應用程式樣本 +FileTemplates=h,CStyle,c,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAME}.c +Archive=prc-tool.tar.gz + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/prc-tool.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/src-Makefile +Dest=%{dest}/Makefile + +[FILE3] +Type=install +Source=%{src}/palmhello.c +Dest=%{dest}/%{APPNAME}.c + +[FILE4] +Type=install +Source=%{src}/palmhello.pbitm +Dest=%{dest}/%{APPNAME}.pbitm + +[FILE5] +Type=install +Source=%{src}/palmhello.rcp +Dest=%{dest}/%{APPNAME}.rcp + +[FILE6] +Type=install +Source=%{src}/palmhelloRsc.h +Dest=%{dest}/%{APPNAME}Rsc.h + +[FILE7] +Type=install +Source=%{src}/callback.h +Dest=%{dest}/callback.h + +[MSG] +Type=message +Comment=A palm application was created in %{dest} +Comment[ca]=Una aplicació per a Palm ha estat creada en %{dest} +Comment[da]=Et palm-program blev oprettet i %{dest} +Comment[de]=Eine Palm-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή palm δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación Palm ha sido creada en %{dest} +Comment[et]=Palmi rakendus loodi asukohta %{dest} +Comment[eu]=Palm aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد palm در %{dest} ایجاد شد +Comment[fr]=Une application Palm a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár Palm i %{dest} +Comment[gl]=Creouse unha aplicación palm en %{dest} +Comment[hu]=Létrejött egy Palmos alkalmazássablon itt: %{dest} +Comment[it]=È stata creata un'applicazione palm in %{dest} +Comment[ja]=Palm アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Palm-Programm opstellt +Comment[ne]=पाम अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een Palm-toepassing is aangemaakt in %{dest} +Comment[pl]=Program dla Palma został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do Palm em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do Palm em %{dest} +Comment[ru]=Приложение Palm создано в %{dest} +Comment[sk]=Palm aplikácia bola vytvorená v %{dest} +Comment[sr]=Palm програм је направљен у %{dest} +Comment[sr@Latn]=Palm program je napravljen u %{dest} +Comment[sv]=Ett Palm-program skapades i %{dest} +Comment[tr]=Bir avuçiçi uygulaması %{dest} içinde yaratıldı +Comment[zh_CN]=在 %{dest} 中创建了一个 Palme 应用程序 +Comment[zh_TW]=一個 palm 應用程式樣本已建立於 %{dest} diff --git a/languages/cpp/app_templates/prc-tool/src-Makefile b/languages/cpp/app_templates/prc-tool/src-Makefile new file mode 100644 index 00000000..a64d5cfa --- /dev/null +++ b/languages/cpp/app_templates/prc-tool/src-Makefile @@ -0,0 +1,63 @@ +## Makefile for PalmHello + +TARGET = palmhello +APPNAME = "PalmHello" +APPID = "0000" + +OBJS = $(TARGET).o +LIBS = + +target=m68k-palmos- + +CC = $(target)gcc + +CFLAGS = -Wall -g -O2 + +PILRC = pilrc +OBJRES = $(target)obj-res +NM = $(target)nm +BUILDPRC = build-prc +PILOTXFER = pilot-xfer + +all: $(TARGET).prc + +.S.o: + $(CC) $(TARGETFLAGS) -c $< + +.c.s: + $(CC) $(CSFLAGS) $< + +$(TARGET).prc: code0000.$(TARGET).grc code0001.$(TARGET).grc data0000.$(TARGET).grc pref0000.$(TARGET).grc rloc0000.$(TARGET).grc bin.res + $(BUILDPRC) $(TARGET).prc $(APPNAME) $(APPID) code0001.$(TARGET).grc code0000.$(TARGET).grc data0000.$(TARGET).grc *.bin pref0000.$(TARGET).grc rloc0000.$(TARGET).grc + +code0000.$(TARGET).grc: $(TARGET) + $(OBJRES) $(TARGET) + +code0001.$(TARGET).grc: code0000.$(TARGET).grc + +data0000.$(TARGET).grc: code0000.$(TARGET).grc + +pref0000.$(TARGET).grc: code0000.$(TARGET).grc + +rloc0000.$(TARGET).grc: code0000.$(TARGET).grc + +bin.res: $(TARGET).rcp $(TARGET).pbitm + $(PILRC) $(TARGET).rcp . + touch bin.res + +$(TARGET): $(OBJS) + $(CC) $(CFLAGS) $(OBJS) -o $(TARGET) $(LIBS) + ! $(NM) -u $(TARGET) | grep . + +send: $(TARGET).prc + $(PILOTXFER) -i $(TARGET).prc + +depend: + makedepend -Y -I. *.c + +clean: + -rm -f *.[oa] $(TARGET) *.bin bin.res *.grc Makefile.bak + +veryclean: clean + -rm -f $(TARGET).prc pilot.ram pilot.scratch + diff --git a/languages/cpp/app_templates/qmakeapp/.kdev_ignore b/languages/cpp/app_templates/qmakeapp/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/qmakeapp/Makefile.am b/languages/cpp/app_templates/qmakeapp/Makefile.am new file mode 100644 index 00000000..c70050fa --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = main.cpp qmakeapp.cpp qmakeapp.h qmakeapp.png qmakeapp.kdevelop \ + qmakeapp.pro src.pro filesave.xpm fileopen.xpm fileprint.xpm + +templateName = qmakeapp + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/qmakeapp/fileopen.xpm b/languages/cpp/app_templates/qmakeapp/fileopen.xpm new file mode 100644 index 00000000..880417ee --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/fileopen.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static const char *fileopen[] = { +" 16 13 5 1", +". c #040404", +"# c #808304", +"a c None", +"b c #f3f704", +"c c #f3f7f3", +"aaaaaaaaa...aaaa", +"aaaaaaaa.aaa.a.a", +"aaaaaaaaaaaaa..a", +"a...aaaaaaaa...a", +".bcb.......aaaaa", +".cbcbcbcbc.aaaaa", +".bcbcbcbcb.aaaaa", +".cbcb...........", +".bcb.#########.a", +".cb.#########.aa", +".b.#########.aaa", +"..#########.aaaa", +"...........aaaaa" +}; diff --git a/languages/cpp/app_templates/qmakeapp/fileprint.xpm b/languages/cpp/app_templates/qmakeapp/fileprint.xpm new file mode 100644 index 00000000..6ada912f --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/fileprint.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static const char *fileprint[] = { +" 16 14 6 1", +". c #000000", +"# c #848284", +"a c #c6c3c6", +"b c #ffff00", +"c c #ffffff", +"d c None", +"ddddd.........dd", +"dddd.cccccccc.dd", +"dddd.c.....c.ddd", +"ddd.cccccccc.ddd", +"ddd.c.....c....d", +"dd.cccccccc.a.a.", +"d..........a.a..", +".aaaaaaaaaa.a.a.", +".............aa.", +".aaaaaa###aa.a.d", +".aaaaaabbbaa...d", +".............a.d", +"d.aaaaaaaaa.a.dd", +"dd...........ddd" +}; diff --git a/languages/cpp/app_templates/qmakeapp/filesave.xpm b/languages/cpp/app_templates/qmakeapp/filesave.xpm new file mode 100644 index 00000000..bd6870f4 --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/filesave.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static const char *filesave[] = { +" 14 14 4 1", +". c #040404", +"# c #808304", +"a c #bfc2bf", +"b c None", +"..............", +".#.aaaaaaaa.a.", +".#.aaaaaaaa...", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".#.aaaaaaaa.#.", +".##........##.", +".############.", +".##.........#.", +".##......aa.#.", +".##......aa.#.", +".##......aa.#.", +"b............." +}; diff --git a/languages/cpp/app_templates/qmakeapp/main.cpp b/languages/cpp/app_templates/qmakeapp/main.cpp new file mode 100644 index 00000000..bd26f19a --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/main.cpp @@ -0,0 +1,13 @@ +%{CPP_TEMPLATE} + +#include +#include "%{APPNAMELC}.h" + +int main( int argc, char ** argv ) { + QApplication a( argc, argv ); + %{APPNAME} * mw = new %{APPNAME}(); + mw->setCaption( "%{APPNAME}" ); + mw->show(); + a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); + return a.exec(); +} diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp b/languages/cpp/app_templates/qmakeapp/qmakeapp new file mode 100644 index 00000000..51d73e69 --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/qmakeapp @@ -0,0 +1,11 @@ +# QMake application +[General] +Name=Application +Name[fr]=Une Application Qt / QMake +Icon=qmakeapp.png +Category=C++/QMake project +Category[fr]=C++/QMake +Comment=Generate a QMake/Qt based application (crossplatform compatible) +Comment[fr]=Gnre une application base sur Qt / QMake. Ce programme est multi platte-forme. +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/APPNAMELC.cpp diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp b/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp new file mode 100644 index 00000000..841f88d4 --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp @@ -0,0 +1,283 @@ +%{CPP_TEMPLATE} + +#include "%{APPNAMELC}.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "filesave.xpm" +#include "fileopen.xpm" +#include "fileprint.xpm" + +%{APPNAME}::%{APPNAME}() + : QMainWindow( 0, "%{APPNAME}", WDestructiveClose ) +{ + printer = new QPrinter; + QPixmap openIcon, saveIcon, printIcon; + + QToolBar * fileTools = new QToolBar( this, "file operations" ); + fileTools->setLabel( tr("File Operations") ); + + openIcon = QPixmap( fileopen ); + QToolButton * fileOpen + = new QToolButton( openIcon, tr("Open File"), QString::null, + this, SLOT(choose()), fileTools, "open file" ); + + saveIcon = QPixmap( filesave ); + QToolButton * fileSave + = new QToolButton( saveIcon, tr("Save File"), QString::null, + this, SLOT(save()), fileTools, "save file" ); + + printIcon = QPixmap( fileprint ); + QToolButton * filePrint + = new QToolButton( printIcon, tr("Print File"), QString::null, + this, SLOT(print()), fileTools, "print file" ); + + + (void)QWhatsThis::whatsThisButton( fileTools ); + + QString fileOpenText = tr("

" + "Click this button to open a new file.
" + "You can also select the Open command " + "from the File menu.

"); + + QWhatsThis::add( fileOpen, fileOpenText ); + + QMimeSourceFactory::defaultFactory()->setPixmap( "fileopen", openIcon ); + + QString fileSaveText = tr("

Click this button to save the file you " + "are editing. You will be prompted for a file name.\n" + "You can also select the Save command " + "from the File menu.

"); + + QWhatsThis::add( fileSave, fileSaveText ); + + QString filePrintText = tr("Click this button to print the file you " + "are editing.\n You can also select the Print " + "command from the File menu."); + + QWhatsThis::add( filePrint, filePrintText ); + + + QPopupMenu * file = new QPopupMenu( this ); + menuBar()->insertItem( tr("&File"), file ); + + + file->insertItem( tr("&New"), this, SLOT(newDoc()), CTRL+Key_N ); + + int id; + id = file->insertItem( openIcon, tr("&Open..."), + this, SLOT(choose()), CTRL+Key_O ); + file->setWhatsThis( id, fileOpenText ); + + id = file->insertItem( saveIcon, tr("&Save"), + this, SLOT(save()), CTRL+Key_S ); + file->setWhatsThis( id, fileSaveText ); + + id = file->insertItem( tr("Save &As..."), this, SLOT(saveAs()) ); + file->setWhatsThis( id, fileSaveText ); + + file->insertSeparator(); + + id = file->insertItem( printIcon, tr("&Print..."), + this, SLOT(print()), CTRL+Key_P ); + file->setWhatsThis( id, filePrintText ); + + file->insertSeparator(); + + file->insertItem( tr("&Close"), this, SLOT(close()), CTRL+Key_W ); + + file->insertItem( tr("&Quit"), qApp, SLOT( closeAllWindows() ), CTRL+Key_Q ); + + menuBar()->insertSeparator(); + + QPopupMenu * help = new QPopupMenu( this ); + menuBar()->insertItem( tr("&Help"), help ); + + help->insertItem( tr("&About"), this, SLOT(about()), Key_F1 ); + help->insertItem( tr("About &Qt"), this, SLOT(aboutQt()) ); + help->insertSeparator(); + help->insertItem( tr("What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1 ); + + e = new QTextEdit( this, "editor" ); + e->setFocus(); + setCentralWidget( e ); + statusBar()->message( tr("Ready"), 2000 ); + + resize( 450, 600 ); +} + + +%{APPNAME}::~%{APPNAME}() +{ + delete printer; +} + + + +void %{APPNAME}::newDoc() +{ + %{APPNAME} *ed = new %{APPNAME}; + ed->setCaption(tr("Qt Example - Application")); + ed->show(); +} + +void %{APPNAME}::choose() +{ + QString fn = QFileDialog::getOpenFileName( QString::null, QString::null, + this); + if ( !fn.isEmpty() ) + load( fn ); + else + statusBar()->message( tr("Loading aborted"), 2000 ); +} + + +void %{APPNAME}::load( const QString &fileName ) +{ + QFile f( fileName ); + if ( !f.open( IO_ReadOnly ) ) + return; + + QTextStream ts( &f ); + e->setText( ts.read() ); + e->setModified( FALSE ); + setCaption( fileName ); + statusBar()->message( tr("Loaded document %1").arg(fileName), 2000 ); +} + + +void %{APPNAME}::save() +{ + if ( filename.isEmpty() ) { + saveAs(); + return; + } + + QString text = e->text(); + QFile f( filename ); + if ( !f.open( IO_WriteOnly ) ) { + statusBar()->message( tr("Could not write to %1").arg(filename), + 2000 ); + return; + } + + QTextStream t( &f ); + t << text; + f.close(); + + e->setModified( FALSE ); + + setCaption( filename ); + + statusBar()->message( tr( "File %1 saved" ).arg( filename ), 2000 ); +} + + +void %{APPNAME}::saveAs() +{ + QString fn = QFileDialog::getSaveFileName( QString::null, QString::null, + this ); + if ( !fn.isEmpty() ) { + filename = fn; + save(); + } else { + statusBar()->message( tr("Saving aborted"), 2000 ); + } +} + + +void %{APPNAME}::print() +{ + // ###### Rewrite to use QSimpleRichText to print here as well + const int Margin = 10; + int pageNo = 1; + + if ( printer->setup(this) ) { // printer dialog + statusBar()->message( tr("Printing...") ); + QPainter p; + if( !p.begin( printer ) ) // paint on printer + return; + + p.setFont( e->font() ); + int yPos = 0; // y-position for each line + QFontMetrics fm = p.fontMetrics(); + QPaintDeviceMetrics metrics( printer ); // need width/height + // of printer surface + for( int i = 0 ; i < e->lines() ; i++ ) { + if ( Margin + yPos > metrics.height() - Margin ) { + QString msg( "Printing (page " ); + msg += QString::number( ++pageNo ); + msg += ")..."; + statusBar()->message( msg ); + printer->newPage(); // no more room on this page + yPos = 0; // back to top of page + } + p.drawText( Margin, Margin + yPos, + metrics.width(), fm.lineSpacing(), + ExpandTabs | DontClip, + e->text( i ) ); + yPos = yPos + fm.lineSpacing(); + } + p.end(); // send job to printer + statusBar()->message( tr("Printing completed"), 2000 ); + } else { + statusBar()->message( tr("Printing aborted"), 2000 ); + } +} + +void %{APPNAME}::closeEvent( QCloseEvent* ce ) +{ + if ( !e->isModified() ) { + ce->accept(); + return; + } + + switch( QMessageBox::information( this, tr("Qt Application Example"), + tr("Do you want to save the changes" + " to the document?"), + tr("Yes"), tr("No"), tr("Cancel"), + 0, 1 ) ) { + case 0: + save(); + ce->accept(); + break; + case 1: + ce->accept(); + break; + case 2: + default: // just for sanity + ce->ignore(); + break; + } +} + + +void %{APPNAME}::about() +{ + QMessageBox::about( this, tr("Qt Application Example"), + tr("This example demonstrates simple use of " + "QMainWindow,\nQMenuBar and QToolBar.")); +} + + +void %{APPNAME}::aboutQt() +{ + QMessageBox::aboutQt( this, tr("Qt Application Example") ); +} diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.h b/languages/cpp/app_templates/qmakeapp/qmakeapp.h new file mode 100644 index 00000000..2d372da9 --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.h @@ -0,0 +1,39 @@ +%{H_TEMPLATE} + +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + +#include + +class QTextEdit; + +class %{APPNAME}: public QMainWindow +{ + Q_OBJECT + +public: + %{APPNAME}(); + ~%{APPNAME}(); + +protected: + void closeEvent( QCloseEvent* ); + +private slots: + void newDoc(); + void choose(); + void load( const QString &fileName ); + void save(); + void saveAs(); + void print(); + + void about(); + void aboutQt(); + +private: + QPrinter *printer; + QTextEdit *e; + QString filename; +}; + + +#endif diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevelop b/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevelop new file mode 100644 index 00000000..ef24a34b --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevelop @@ -0,0 +1,112 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + true + 3 + 3 + EmbeddedKDevDesigner + %{QTDIR} + %{QMAKE} + + + + + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + KDE Libraries (Doxygen) + + + + + + + + /usr/bin/gdb + true + false + false + + + false + true + + + + + + ./bin/%{APPNAMELC} + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevtemplate b/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevtemplate new file mode 100644 index 00000000..2fab0758 --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevtemplate @@ -0,0 +1,182 @@ +# KDE Config File +[General] +Name=Qt3 Application +Name[br]=Meziant Qt3 +Name[ca]=Aplicació Qt3 +Name[da]=Qt3-Program +Name[de]=Qt3-Anwendung +Name[el]=Εφαρμογή Qt3 +Name[es]=Aplicación Qt3 +Name[et]=Qt3 rakendus +Name[fr]=Application Qt3 +Name[hu]=Qt3-alapú alkalmazások +Name[it]=Applicazione Qt3 +Name[ja]=Qt3 アプリケーション +Name[nds]=Qt3-Programm +Name[nl]=Qt3-toepassing +Name[pl]=Program Qt3 +Name[pt]=Aplicação do Qt3 +Name[pt_BR]=Aplicação do Qt3 +Name[ru]=Приложение Qt 3 +Name[sk]=Qt3 aplikácia +Name[sr]=Qt3 програм +Name[sr@Latn]=Qt3 program +Name[sv]=Qt3-program +Name[zh_TW]=Qt3 應用程式 +Icon=qmakeapp.png +Category=C++/QMake project +Category[fr]=C++/QMake +Comment=Generate a QMake/Qt3 based application (crossplatform compatible) +Comment[ca]=Genera una aplicació basada en QMake/Qt3 (multi plataforma) +Comment[da]=Generér et QMake/Qt3 baseret program (krydsplatform kompatibel) +Comment[de]=Erstellt eine auf QMake/Qt3 basierende Anwendung (plattformunabhängig) +Comment[el]=Δημιουργία μια εφαρμογής βασισμένης στα QMake/Qt3 (συμβατή με πολλαπλές πλατφόρμες) +Comment[es]=Genera una aplicación basada en QMake/Qt3 (con compatibilidad multiplataforma) +Comment[et]=Rakenduse loomine QMake'i/Qt3 põhjal (multiplatvormne) +Comment[fr]=Génère une application basée sur QMake / Qt3 (compatible multi-plateforme) +Comment[hu]=Létrehoz egy QMake/Qt3-alapú, keresztfordításra is alkalmas alkalmazást +Comment[it]=Genera un'applicazione basata su QMake/Qt3 (compatibile multipiattaforma) +Comment[ja]=QMake/Qt3 ベースのアプリケーションを作成 (クロスプラットフォーム) +Comment[nds]=Stellt en op QMake/Qt3 opbuut Programm op (över Bedriefümgeven weg kompatibel) +Comment[nl]=Genereert een Qmake/Qt3-gebaseerde toepassing (crossplatform compatible) +Comment[pl]=Generuje program używający QMake i Qt3 (wieloplatformowy) +Comment[pt]=Gera uma aplicação baseada no QMake/Qt3 (compatível com várias plataformas) +Comment[pt_BR]=Gera uma aplicação baseada no QMake/Qt3 (compatível com várias plataformas) +Comment[ru]=Создание использующее QMake кроссплатформенное приложение Qt 3 +Comment[sk]=Vygeneruje aplikáciu založenú na QMake/Qt3 (multiplatformovo kompatibilnú) +Comment[sr]=Прави програм на основи QMake/Qt3 (прекоплатформски компатибилан) +Comment[sr@Latn]=Pravi program na osnovi QMake/Qt3 (prekoplatformski kompatibilan) +Comment[sv]=Skapar ett Qmake/Qt3-baserat program (fungerar på andra plattformar) +Comment[zh_TW]=產生一個 QMake/Qt3 為基礎的應用程式(跨平台相容) +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=qmakeapp.tar.gz + +[FILE1] +Type=install +Source=%{src}/qmakeapp.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/qmakeapp.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE3] +Type=install +Source=%{src}/src.pro +Dest=%{dest}/src/src.pro + +[FILE4] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE5] +Type=install +Source=%{src}/qmakeapp.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE6] +Type=install +Source=%{src}/qmakeapp.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE7] +Type=install +Source=%{src}/fileopen.xpm +Dest=%{dest}/src/fileopen.xpm + +[FILE8] +Type=install +Source=%{src}/filesave.xpm +Dest=%{dest}/src/filesave.xpm + +[FILE9] +Type=install +Source=%{src}/fileprint.xpm +Dest=%{dest}/src/fileprint.xpm + +[MSG] +Type=message +Comment=A Qt3/Qmake based application was created in %{dest} +Comment[ca]=Una aplicació basada en Qt3/Qmake ha estat creada en %{dest} +Comment[da]=Et Qt3/Qmake baseret program blev oprettet i %{dest} +Comment[de]=Eine auf QMake/Qt3 basierende Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή βασισμένη στα Qt3/Qmake δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación basada en Qt3/Qmake ha sido creada en %{dest} +Comment[et]=Rakendus QMake'i põhjal loodi asukohta %{dest} +Comment[fr]=Une application basée sur Qt3 / Qmake a été créée dans %{dest} +Comment[hu]=Létrejött egy Qt3/Qmake-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione basata su Qt3/Qmake in %{dest} +Comment[ja]=Qt3/QMake ベースのアプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op Qt3/Qmake opbuut Programm opstellt +Comment[nl]=Een Qt3/Qmake-gebaseerde toepassing is aangemaakt in %{dest} +Comment[pl]=Program używający QMake i Qt3 został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação baseada no Qt3/Qmake em %{dest} +Comment[pt_BR]=Foi criada uma aplicação baseada no Qt3/Qmake em %{dest} +Comment[ru]=Использующее QMake приложение Qt 3 создано в %{dest} +Comment[sk]=Aplikácia založená na Qt3/Qmake bola vytvorená v %{dest} +Comment[sr]=Програм на основи Qt3/Qmake направљен је у %{dest} +Comment[sr@Latn]=Program na osnovi Qt3/Qmake napravljen je u %{dest} +Comment[sv]=Ett Qmake/Qt3-baserat program skapades i %{dest} +Comment[zh_TW]=一個 QMake/Qt3 為基礎的應用程式已建立於 %{dest} + +[QTDIR] +Type=value +ValueType=QString +Value=QTDIR +Comment=Directory where Qt3 is installed. +Comment[ca]=Directori a on està instal·lat Qt3. +Comment[da]=Katalog hvor Qt3 er installeret. +Comment[de]=Qt3-Verzeichnis +Comment[el]=Κατάλογος εγκατάστασης του Qt3. +Comment[es]=Carpeta donde se ha instalado Qt3. +Comment[et]=Kataloog, kuhu on paigaldatud Qt3. +Comment[fr]=Dossier où Qt3 est installé. +Comment[hu]=A Qt3 telepítési könyvtára +Comment[it]=Cartella in cui è installato Qt3. +Comment[ja]=Qt3 がインストールされているディレクトリ +Comment[nds]=Orner, woneem Qt3 installeert is. +Comment[nl]=Map waarin Qt3 is geïnstalleerd. +Comment[pl]=Katalog, w którym zainstalowane jest Qt3. +Comment[pt]=A pasta onde está instalado o Qt3. +Comment[pt_BR]=A pasta onde está instalado o Qt3. +Comment[ru]=Каталог с установленным Qt 3 +Comment[sk]=Priečinok kde je nainštalované Qt3. +Comment[sr]=Директоријум у коме је Qt3 инсталиран. +Comment[sr@Latn]=Direktorijum u kome je Qt3 instaliran. +Comment[sv]=Katalog där Qt3 är installerat. +Comment[zh_TW]=Qt3 的安裝目錄 +Default= +[QMAKE] +Type=value +ValueType=QString +Value=QMAKE +Comment=Absolute Path for QMake (Qt3). +Comment[ca]=Ruta absoluta per a QMake (Qt3). +Comment[da]=Absolut søgesti til QMake (Qt3). +Comment[de]=Absoluter Pfad für QMake (Qt3). +Comment[el]=Απόλυτη διαδρομή για το QMake (Qt3). +Comment[es]=Ruta completa para QMake (Qt3). +Comment[et]=QMake'i (Qt3) absoluutne asukoht. +Comment[fr]=Chemin absolu pour QMake (Qt3). +Comment[hu]=A QMake (Qt3) teljes elérési útja. +Comment[it]=Percorso assoluto per QMake (Qt3). +Comment[ja]= QMake (Qt3) の絶対パス +Comment[nds]=Afsluut Padd för QMake (Qt3) +Comment[nl]=Absoluut pad naar QMake (Qt3) +Comment[pl]=Ścieżka bezwzględna do QMake (Qt3). +Comment[pt]=Localização Absoluta do QMake (Qt3). +Comment[pt_BR]=Localização Absoluta do QMake (Qt3). +Comment[ru]=Абсолютный путь к QMake (Qt 3) +Comment[sk]=Absolútna cesta ku QMake (Qt3). +Comment[sr]=Апсолутна путања до QMake-ва (Qt3). +Comment[sr@Latn]=Apsolutna putanja do QMake-va (Qt3). +Comment[sv]=Absolut sökväg till Qmake (Qt3). +Comment[zh_TW]=QMake (Qt3) 的絕對路徑 +Default= diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.png b/languages/cpp/app_templates/qmakeapp/qmakeapp.png new file mode 100644 index 00000000..dda0a10b Binary files /dev/null and b/languages/cpp/app_templates/qmakeapp/qmakeapp.png differ diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.pro b/languages/cpp/app_templates/qmakeapp/qmakeapp.pro new file mode 100644 index 00000000..20f1cba4 --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.pro @@ -0,0 +1,6 @@ +SUBDIRS += src +TEMPLATE = subdirs +CONFIG += release \ + warn_on \ + qt \ + thread diff --git a/languages/cpp/app_templates/qmakeapp/src.pro b/languages/cpp/app_templates/qmakeapp/src.pro new file mode 100644 index 00000000..d72522f9 --- /dev/null +++ b/languages/cpp/app_templates/qmakeapp/src.pro @@ -0,0 +1,10 @@ +SOURCES += %{APPNAMELC}.cpp \ + main.cpp +HEADERS += %{APPNAMELC}.h +TEMPLATE = app +CONFIG += release \ + warn_on \ + thread \ + qt +TARGET = %{APPNAMELC} +DESTDIR = ../bin diff --git a/languages/cpp/app_templates/qmakeempty/Makefile.am b/languages/cpp/app_templates/qmakeempty/Makefile.am new file mode 100644 index 00000000..57677d88 --- /dev/null +++ b/languages/cpp/app_templates/qmakeempty/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = qmakeempty.kdevelop \ + qmakeempty.pro qmakeempty.png + +templateName = qmakeempty + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevelop b/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevelop new file mode 100644 index 00000000..cd633ede --- /dev/null +++ b/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + true + 4 + 4 + ExternalDesigner + %{QMAKE} + %{DESIGNER} + + + + + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + KDE Libraries (Doxygen) + + + + + + + + /usr/bin/gdb + true + false + false + + + false + true + + + + + + ./bin/%{APPNAMELC} + + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevtemplate b/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevtemplate new file mode 100644 index 00000000..cb108705 --- /dev/null +++ b/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevtemplate @@ -0,0 +1,131 @@ +# KDE Config File +[General] +Name=Empty QMake Template +Name[ca]=Plantilla QMake buida +Name[da]=Tom QMake-skabelon +Name[de]=Leere QMake-Vorlage +Name[el]=Κενό πρότυπο του QMake +Name[es]=Plantilla QMake vacía +Name[et]=Tühi QMake'i mall +Name[hu]=Üres QMake-alapú sablon +Name[it]=Modello di QMake vuoto +Name[nds]=Leddig QMake-Vörlaag +Name[nl]=Leeg QMake-sjabloon +Name[pl]=Pusty szablon QMake +Name[pt]=Modelo do QMake Vazio +Name[pt_BR]=Modelo do QMake Vazio +Name[ru]=Пустой шаблон QMake +Name[sk]=Prázdna šablóna založená na QMake +Name[sr]=Празан шаблон QMake-а +Name[sr@Latn]=Prazan šablon QMake-a +Name[sv]=Tom Qmake-mall +Name[zh_TW]=空的 QMake 樣本 +Icon=qmakeempty.png +Category=C++/QMake project +Comment=Generate an empty QMake based application (crossplatform compatible) - Needs Qt +Comment[ca]=Genera una aplicació buida basada en QMake (compatible plataforma creuada) - Necessita Qt +Comment[da]=Genererer et tomt QMake-baseret program (krydsplatformskompatibelt) - kræver Qt +Comment[de]=Erstellt eine leere auf QMake basierende Anwendung (plattformunabhängig). - Benötigt Qt +Comment[el]=Δημιουργία μιας κενής εφαρμογής βασισμένης στο QMake (crossplatform) - Βασίζεται στην Qt +Comment[es]=Genera una aplicación vacía basada en QMake (con compatibilidad multiplataforma) - Necesita Qt +Comment[et]=Tühja rakenduse loomine QMake'i põhjal (multiplatvormne) - vajalik on Qt +Comment[hu]=Létrehoz egy üres QMake-alapú, keresztfordításra is alkalmas alkalmazást - Qt-t igényel +Comment[it]=Genera un'applicazione basata su QMake vuoto (compatibile multipiattaforma) - serve Qt +Comment[nds]=Stellt en op QMake opbuut Programm op (över Bedriefümgeven weg kompatibel) - Qt deit noot +Comment[nl]=Genereer een leeg QMake-gebaseerd programma (crossplatform-compatible) - Heeft Qt nodig +Comment[pl]=Generuje program używający QMake (wieloplatformowy) - wymaga biblioteki Qt +Comment[pt]=Gera uma aplicação vazia baseada no QMake (compatível com várias plataformas) - Necessita do Qt4 +Comment[pt_BR]=Gera uma aplicação vazia baseada no QMake (compatível com várias plataformas) - Necessita do Qt4 +Comment[ru]=Создание каркаса кроссплатформенного приложения Qt, использующего QMake. +Comment[sk]=Vygeneruje aplikáciu založenú na QMake (multiplatformovo kompatibilnú) - vyžaduje Qt +Comment[sr]=Прави празан шаблон на основи QMake-а (прекоплатформски компатибилан) — захтева Qt +Comment[sr@Latn]=Pravi prazan šablon na osnovi QMake-a (prekoplatformski kompatibilan) — zahteva Qt +Comment[sv]=Skapar ett tomt Qmake-baserat program (fungerar på andra plattformar). Kräver Qt. +Comment[zh_TW]=產生一個空的以 QMake 為基礎的(跨平台相容)應用程式─需要 Qt +FileTemplates=h,CStyle,cpp,CStyle +Archive=qmakeempty.tar.gz + +[FILE1] +Type=install +Source=%{src}/qmakeempty.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/qmakeempty.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[MSG] +Type=message +Comment=A Qmake based application was created in %{dest} +Comment[ca]=Una aplicació basada en QMake ha estat creada en %{dest} +Comment[da]=Et Qmake-baseret program blev oprettet i %{dest} +Comment[de]=Eine auf Qmake basierende Anwendung wurde in %{dest} erstellt. +Comment[el]=Δημιουργήθηκε μια εφαρμογή βασισμένη σε Qmake στο %{dest} +Comment[es]=Una aplicación basada en QMake ha sido creada en %{dest} +Comment[et]=Rakendus QMake'i põhjal loodi asukohta %{dest} +Comment[hu]=Létrejött egy Qmake-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione basata su Qmake in %{dest} +Comment[nds]=In %{dest} wöör en op QMake opbuut Programm opstellt +Comment[nl]=Een Qmake-gebaseerd programma is aangemaakt in %{dest} +Comment[pl]=Program oparty na QMake został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação baseada no Qmake em %{dest} +Comment[pt_BR]=Foi criada uma aplicação baseada no Qmake em %{dest} +Comment[ru]=Использующее QMake приложение создано в %{dest} +Comment[sk]=Aplikácia založená na QMake bola vytvorená v %{dest} +Comment[sr]=Програм на основу QMake-а направљен је у %{dest} +Comment[sr@Latn]=Program na osnovu QMake-a napravljen je u %{dest} +Comment[sv]=Ett Qmake-baserat program skapades i %{dest} +Comment[zh_TW]=一個以 Qmake 為基礎的應用程式已建立於 %{dest} + +[QMAKE] +Type=value +ValueType=QString +Value=QMAKE +Comment=Absolute Path for QMake. +Comment[ca]=Ruta absoluta per a QMake. +Comment[da]=Absolut søgesti til QMake. +Comment[de]=Absoluter Pfad für QMake. +Comment[el]=Απόλυτη διαδρομή του QMake. +Comment[es]=Ruta completa para QMake. +Comment[et]=QMake absoluutne asukoht. +Comment[hu]=A QMake teljes elérési útja. +Comment[it]=Percorso assoluto per QMake. +Comment[nds]=Afsluut Padd för QMake +Comment[nl]=Absoluut pad voor Qmake. +Comment[pl]=Ścieżka bezwzględna do QMake. +Comment[pt]=Localização Absoluta do QMake. +Comment[pt_BR]=Localização Absoluta do QMake. +Comment[ru]=Полный путь к QMake. +Comment[sk]=Absolútna cesta ku QMake. +Comment[sr]=Апсолутна путања до QMake-а. +Comment[sr@Latn]=Apsolutna putanja do QMake-a. +Comment[sv]=Absolut sökväg till Qmake. +Comment[zh_TW]=QMake 的絕對路徑 +Default= + +[DESIGNER] +Type=value +ValueType=QString +Value=DESIGNER +Comment=Absolute Path for Designer. +Comment[ca]=Ruta absoluta per a Designer. +Comment[da]=Absolut søgesti til Designer +Comment[de]=Absoluter Pfad für Designer. +Comment[el]=Απόλυτη διαδρομή του Designer. +Comment[es]=Ruta completa para Designer. +Comment[et]=Disaineri absoluutne asukoht. +Comment[hu]=A Designer teljes elérési útja. +Comment[it]=Percorso assoluto per Designer. +Comment[nds]=Afsluut Padd för Designer +Comment[nl]=Absoluut pad voor Designer. +Comment[pl]=Ścieżka bezwzględna do Projektanta. +Comment[pt]=Localização Absoluta do Designer. +Comment[pt_BR]=Localização Absoluta do Designer. +Comment[ru]=Полный путь к Designer. +Comment[sk]=Absolútna cesta ku Designer. +Comment[sr]=Апсолутна путања до Designer-а. +Comment[sr@Latn]=Apsolutna putanja do Designer-a. +Comment[sv]=Absolut sökväg till Designer. +Comment[zh_TW]=設計家(Designer)的絕對路徑 +Default= diff --git a/languages/cpp/app_templates/qmakeempty/qmakeempty.png b/languages/cpp/app_templates/qmakeempty/qmakeempty.png new file mode 100644 index 00000000..332ea1c0 Binary files /dev/null and b/languages/cpp/app_templates/qmakeempty/qmakeempty.png differ diff --git a/languages/cpp/app_templates/qmakeempty/qmakeempty.pro b/languages/cpp/app_templates/qmakeempty/qmakeempty.pro new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/qmakesimple/.kdev_ignore b/languages/cpp/app_templates/qmakesimple/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/qmakesimple/Makefile.am b/languages/cpp/app_templates/qmakesimple/Makefile.am new file mode 100644 index 00000000..a187172f --- /dev/null +++ b/languages/cpp/app_templates/qmakesimple/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = main.cpp qmakesimple.png app.kdevelop app.pro src.pro +templateName = qmakesimple + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/qmakesimple/app.kdevelop b/languages/cpp/app_templates/qmakesimple/app.kdevelop new file mode 100644 index 00000000..a77f86f3 --- /dev/null +++ b/languages/cpp/app_templates/qmakesimple/app.kdevelop @@ -0,0 +1,100 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + + + + + + + + + + + + + 3 + true + 3 + EmbeddedKDevDesigner + %{QTDIR} + %{QMAKE} + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + KDE Libraries (Doxygen) + + + + + + /usr/bin/gdb + true + false + false + + + + + + ./bin/%{APPNAMELC} + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/qmakesimple/app.pro b/languages/cpp/app_templates/qmakesimple/app.pro new file mode 100644 index 00000000..8feb4aa4 --- /dev/null +++ b/languages/cpp/app_templates/qmakesimple/app.pro @@ -0,0 +1,2 @@ +TEMPLATE=subdirs +SUBDIRS=src diff --git a/languages/cpp/app_templates/qmakesimple/main.cpp b/languages/cpp/app_templates/qmakesimple/main.cpp new file mode 100644 index 00000000..e91f9f22 --- /dev/null +++ b/languages/cpp/app_templates/qmakesimple/main.cpp @@ -0,0 +1,15 @@ +%{CPP_TEMPLATE} + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +int main(int argc, char *argv[]) +{ + printf("Hello, world!\n"); + + return EXIT_SUCCESS; +} diff --git a/languages/cpp/app_templates/qmakesimple/qmakesimple b/languages/cpp/app_templates/qmakesimple/qmakesimple new file mode 100644 index 00000000..e476a7bf --- /dev/null +++ b/languages/cpp/app_templates/qmakesimple/qmakesimple @@ -0,0 +1,11 @@ +# KDE Config File +[General] +Name=Hello world program +Name[fr]=Un simple programme de test Hello world +Icon=qmakesimple.png +Category=C++/QMake project +Category[fr]=C++/QMake +Comment=Generates a simple Hello world program in C++ using QMake based project manager +Comment[fr]=Gnre un simple programme de test du type Hello world en utilisant QMake. +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/APPNAMELC.cpp diff --git a/languages/cpp/app_templates/qmakesimple/qmakesimple.kdevtemplate b/languages/cpp/app_templates/qmakesimple/qmakesimple.kdevtemplate new file mode 100644 index 00000000..1d7cc7b1 --- /dev/null +++ b/languages/cpp/app_templates/qmakesimple/qmakesimple.kdevtemplate @@ -0,0 +1,158 @@ +# KDE Config File +[General] +Name=Qt3 Hello world program +Name[ca]=Programa Hello world per a Qt3 +Name[da]=Qt3 Goddag verden program +Name[de]="Hello World"-Programm (Qt3) +Name[el]=Πρόγραμμα 'Γεια σου Κόσμε' για το Qt3 +Name[es]=Programa Qt3 «Hola mundo» +Name[et]=Qt3 "Tere,maailm" programm +Name[fr]=Programme « Bonjour monde » en Qt3 +Name[hu]=Qt3-alapú 'Hello world' program +Name[it]=Programma di "Hello world" fatto in Qt3 +Name[ja]=Qt3 Hello world プログラム +Name[nds]=Qt3-"Moin Welt"-Programm +Name[nl]=Qt3 Hello world-programma +Name[pl]=Program 'Witaj świecie' w Qt3 +Name[pt]=Programa 'Olá mundo' em Qt3 +Name[pt_BR]=Programa 'Olá mundo' em Qt3 +Name[ru]=Программа Qt 3 +Name[sk]=Qt3 Ahoj svet program +Name[sr]=Програм „Здраво свете“ за Qt3 +Name[sr@Latn]=Program „Zdravo svete“ za Qt3 +Name[sv]=Qt3 Hello world-program +Name[zh_TW]=Qt3 的 Hello world 程式 +Icon=qmakesimple.png +Category=C++/QMake project +Category[fr]=C++/QMake +Comment=Generates a simple Hello world program in C++ using QMake/Qt3 based project manager +Comment[ca]=Genera un simple programa de Hello world en C++ usant el gestor de projectes basat en QMake/Qt3 +Comment[da]=Genererer et simpelt Goddag verden program in C++ ved brug af QMake/Qt3 baseret projekthåndtering +Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C++ basierend auf dem QMake-Projektmanager und Qt3. +Comment[el]=Δημιουργεί ένα απλό πρόγραμμα 'Γεια σου Κόσμε' σε C++ χρησιμοποιώντας διαχειριστή έργου βασισμένο στο QMake/Qt3 +Comment[es]=Genera un sencillo programa «Hola mundo» en C++ que usa un gestor de proyecto basado en QMake/Qt3 +Comment[et]=Lihtsa "Tere, maailm" programmi loomine C++-s projektihalduriga QMake'i/Qt3 põhjal +Comment[fr]=Génère un programme « Bonjour monde » simple en C++ utilisant un gestionnaire de projet basé sur QMake / Qt3 +Comment[hu]=Létrehoz egy egyszerű 'Hello world' programot C++-ban, QMake/Qt3-alapú projektkezelővel +Comment[it]=Genera un semplice programma di "Hello world" in C++ usando il gestore di progetto QMake/Qt3 +Comment[ja]=QMake/Qt3 ベースのプロジェクトマネージャを使って簡単な Hello World プログラムを C++ で作成します +Comment[nds]=Stellt mit den op Qt3 un QMake opbuut Projektpleger en eenfach "Moin Welt"-Programm in C++ op +Comment[nl]=Genereert een eenvoudig Hello World-programma in C++ met behulp van de QMake/Qt3-gebaseerde projectbeheerder +Comment[pl]=Generuje prosty program "Witaj świecie" w C++ używając menedżera projektów QMake i Qt3 +Comment[pt]=Gera um programa simples Olá Mundo em C++, usando o gestor de projectos QMake/Qt3 +Comment[pt_BR]=Gera um programa simples Olá Mundo em C++, usando o gestor de projectos QMake/Qt3 +Comment[ru]=Создание простой программы на C++ с использованием QMake (Qt 3) +Comment[sk]=Vygeneruje jednoduchý Ahoj svet program v C++ s použitím QMake/Qt3 projektového manažéra +Comment[sr]=Прави једноставан „Здраво свете“ програм у C++-у помоћу менаџера пројекта на основу QMake/Qt3 +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C++-u pomoću menadžera projekta na osnovu QMake/Qt3 +Comment[sv]=Skapar ett enkelt Hello world-program i C++ baserat på QMake/Qt3 projekthantering +Comment[zh_TW]=產生一個使用 QMake/Qt3 專案管理員的簡單 C++ Hello world 程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=qmakesimple.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE3] +Type=install +Source=%{src}/src.pro +Dest=%{dest}/src/src.pro + +[FILE4] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[MSG] +Type=message +Comment=A Qmake/Qt3 based hello world program was created in %{dest} +Comment[ca]=Una programa de hello world basat en QMake/Qt3 ha estat creat en %{dest} +Comment[da]=et Qmake/Qt3 baseret Goddag verden program blev oprettet i %{dest} +Comment[de]=Ein auf QMake basierendes "Hello World"-Programm wurde in %{dest} erstellt. +Comment[el]=Ένα πρόγραμμα 'Γεια σου Κόσμε' βασισμένο στο Qmake/Qt3 δημιουργήθηκε στο %{dest} +Comment[es]=Un programa «Hola mundo» basado en QMake/Qt3 ha sido creado en %{dest} +Comment[et]="Tere, maailm" programm QMake'i/Qt3 põhjal loodi asukohta %{dest} +Comment[fr]=Un programme « Bonjour monde » basé sur QMake / Qt3 a été créé dans %{dest} +Comment[hu]=Létrejött egy Qmake/Qt3-alapú 'Hello world' program itt: %{dest} +Comment[it]=È stato creato un programma di "hello world" basato su Qmake/Qt3 in %{dest} +Comment[ja]=QMake/Qt3 ベースの hello world プログラムを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op Qt3 un QMake opbuut "Moin Welt"-Programm opstellt +Comment[nl]=Een Qmake/Qt3-gebaseerd Hello World-programma is aangemaakt in %{dest} +Comment[pl]=Prosty program używający Qmake/Qt3 został utworzony w %{dest} +Comment[pt]=Foi criado um programa Olá Mundo, baseado no Qmake/Qt3, em %{dest} +Comment[pt_BR]=Foi criado um programa Olá Mundo, baseado no Qmake/Qt3, em %{dest} +Comment[ru]=Программа на Qt 3, использующая QMake, создана в %{dest} +Comment[sk]=Ahoj svet program založený na Qmake/Qt3 bol vytvorený v %{dest} +Comment[sr]=„Здраво свете“ на основу Qmake/Qt3 направљен је у %{dest} +Comment[sr@Latn]=„Zdravo svete“ na osnovu Qmake/Qt3 napravljen je u %{dest} +Comment[sv]=Ett Qmake/Qt3-baserat Hello world-program skapades i %{dest} +Comment[zh_TW]=一個 Qmake/Qt3 為基礎的 hello world 程式已建立於 %{dest} + + +[QTDIR] +Type=value +ValueType=QString +Value=QTDIR +Comment=Directory where Qt3 is installed. +Comment[ca]=Directori a on està instal·lat Qt3. +Comment[da]=Katalog hvor Qt3 er installeret. +Comment[de]=Qt3-Verzeichnis +Comment[el]=Κατάλογος εγκατάστασης του Qt3. +Comment[es]=Carpeta donde se ha instalado Qt3. +Comment[et]=Kataloog, kuhu on paigaldatud Qt3. +Comment[fr]=Dossier où Qt3 est installé. +Comment[hu]=A Qt3 telepítési könyvtára +Comment[it]=Cartella in cui è installato Qt3. +Comment[ja]=Qt3 がインストールされているディレクトリ +Comment[nds]=Orner, woneem Qt3 installeert is. +Comment[nl]=Map waarin Qt3 is geïnstalleerd. +Comment[pl]=Katalog, w którym zainstalowane jest Qt3. +Comment[pt]=A pasta onde está instalado o Qt3. +Comment[pt_BR]=A pasta onde está instalado o Qt3. +Comment[ru]=Каталог с установленным Qt 3 +Comment[sk]=Priečinok kde je nainštalované Qt3. +Comment[sr]=Директоријум у коме је Qt3 инсталиран. +Comment[sr@Latn]=Direktorijum u kome je Qt3 instaliran. +Comment[sv]=Katalog där Qt3 är installerat. +Comment[zh_TW]=Qt3 的安裝目錄 +Default= +[QMAKE] +Type=value +ValueType=QString +Value=QMAKE +Comment=Absolute Path for QMake (Qt3). +Comment[ca]=Ruta absoluta per a QMake (Qt3). +Comment[da]=Absolut søgesti til QMake (Qt3). +Comment[de]=Absoluter Pfad für QMake (Qt3). +Comment[el]=Απόλυτη διαδρομή για το QMake (Qt3). +Comment[es]=Ruta completa para QMake (Qt3). +Comment[et]=QMake'i (Qt3) absoluutne asukoht. +Comment[fr]=Chemin absolu pour QMake (Qt3). +Comment[hu]=A QMake (Qt3) teljes elérési útja. +Comment[it]=Percorso assoluto per QMake (Qt3). +Comment[ja]= QMake (Qt3) の絶対パス +Comment[nds]=Afsluut Padd för QMake (Qt3) +Comment[nl]=Absoluut pad naar QMake (Qt3) +Comment[pl]=Ścieżka bezwzględna do QMake (Qt3). +Comment[pt]=Localização Absoluta do QMake (Qt3). +Comment[pt_BR]=Localização Absoluta do QMake (Qt3). +Comment[ru]=Абсолютный путь к QMake (Qt 3) +Comment[sk]=Absolútna cesta ku QMake (Qt3). +Comment[sr]=Апсолутна путања до QMake-ва (Qt3). +Comment[sr@Latn]=Apsolutna putanja do QMake-va (Qt3). +Comment[sv]=Absolut sökväg till Qmake (Qt3). +Comment[zh_TW]=QMake (Qt3) 的絕對路徑 +Default= diff --git a/languages/cpp/app_templates/qmakesimple/qmakesimple.png b/languages/cpp/app_templates/qmakesimple/qmakesimple.png new file mode 100644 index 00000000..494d83da Binary files /dev/null and b/languages/cpp/app_templates/qmakesimple/qmakesimple.png differ diff --git a/languages/cpp/app_templates/qmakesimple/src.pro b/languages/cpp/app_templates/qmakesimple/src.pro new file mode 100644 index 00000000..e7a46a76 --- /dev/null +++ b/languages/cpp/app_templates/qmakesimple/src.pro @@ -0,0 +1,4 @@ +SOURCES=%{APPNAMELC}.cpp +TARGET=%{APPNAMELC} +DESTDIR=../bin +TEMPLATE = app diff --git a/languages/cpp/app_templates/qt4hello/Makefile.am b/languages/cpp/app_templates/qt4hello/Makefile.am new file mode 100644 index 00000000..b285f781 --- /dev/null +++ b/languages/cpp/app_templates/qt4hello/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = main.cpp qt4hello.png qt4hello.kdevelop \ + qt4hello.pro src.pro ReadMe + +templateName = qt4hello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/qt4hello/ReadMe b/languages/cpp/app_templates/qt4hello/ReadMe new file mode 100644 index 00000000..87d23f71 --- /dev/null +++ b/languages/cpp/app_templates/qt4hello/ReadMe @@ -0,0 +1,11 @@ +READ THIS IN ORDER TO COMPILE THE Qt4 TEMPLATE +---------------------------------------------- + +Before compiling, check the Qt Options, go to +Project->Project Options->C++ Support and open the Qt Options tab. + +Check that the Qt installation directory is correct for the Qt version you've chosen. + +------------------ +Andreas Pakulat +July 2006 diff --git a/languages/cpp/app_templates/qt4hello/main.cpp b/languages/cpp/app_templates/qt4hello/main.cpp new file mode 100644 index 00000000..cbff1d3c --- /dev/null +++ b/languages/cpp/app_templates/qt4hello/main.cpp @@ -0,0 +1,11 @@ +%{CPP_TEMPLATE} + +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + qDebug("Hello from Qt 4!"); + return 0; +} + diff --git a/languages/cpp/app_templates/qt4hello/qt4hello.kdevelop b/languages/cpp/app_templates/qt4hello/qt4hello.kdevelop new file mode 100644 index 00000000..cd633ede --- /dev/null +++ b/languages/cpp/app_templates/qt4hello/qt4hello.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + true + 4 + 4 + ExternalDesigner + %{QMAKE} + %{DESIGNER} + + + + + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + KDE Libraries (Doxygen) + + + + + + + + /usr/bin/gdb + true + false + false + + + false + true + + + + + + ./bin/%{APPNAMELC} + + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/qt4hello/qt4hello.kdevtemplate b/languages/cpp/app_templates/qt4hello/qt4hello.kdevtemplate new file mode 100644 index 00000000..d1796a14 --- /dev/null +++ b/languages/cpp/app_templates/qt4hello/qt4hello.kdevtemplate @@ -0,0 +1,160 @@ +# KDE Config File +[General] +Name=Basic Qt4 Application +Name[ca]=Aplicació en Qt4 bàsica +Name[da]=Basalt Qt4-program +Name[de]=Einfache Qt4-Anwendung +Name[el]=Βασική εφαρμογή Qt4 +Name[es]=Aplicación Qt4 básica +Name[et]=Elementaarne Qt4 rakendus +Name[fr]=Application Qt4 de base +Name[hu]=Egyszerű Qt4-alapú alkalmazás +Name[it]=Applicazione Qt4 base +Name[ja]=基本的な Qt4 アプリケーション +Name[nds]=Eenfach Qt4-Programm +Name[nl]=Basis Qt4-toepassing +Name[pl]=Prosty program w Qt4 +Name[pt]=Aplicação Básica em Qt4 +Name[pt_BR]=Aplicação Básica em Qt4 +Name[ru]=Простое приложение Qt 4 +Name[sk]=Základná Qt4 aplikácia +Name[sr]=Основни Qt4 програм +Name[sr@Latn]=Osnovni Qt4 program +Name[sv]=Grundläggande Qt4-program +Name[zh_TW]=基本 Qt4 應用程式 +Icon=qt4hello.png +Category=C++/QMake project +Comment=Generate a very simple QMake/Qt4 based application (crossplatform compatible) - Needs Qt4 +Comment[ca]=Genera una aplicació molt simple basada en QMake/Qt4 (multi plataforma) -requereix Qt4- +Comment[da]=Generér et meget enkelt QMake/Qt4 baseret program (krydsplatform kompatibel) - behøver Qt4 +Comment[de]=Erstellt eine sehr einfache, auf QMake/Qt4 basierende Anwendung (plattformunabhängig). - Benötigt Qt4. +Comment[el]=Δημιουργία μια εφαρμογής βασισμένης στα QMake/Qt4 (συμβατή με πολλαπλές πλατφόρμες) -Απαιτεί το Qt4 +Comment[es]=Genera una aplicación muy sencilla basada en QMake/Qt4 (con compatibilidad multiplataforma) - Necesita Qt4 +Comment[et]=Väga lihtsa rakenduse loomine QMake'i/Qt4 põhjal (multiplatvormne) - vajalik on Qt4 +Comment[fr]=Génère une application basée sur QMake / Qt4 très simple (compatible multi-plateforme) - Nécessite Qt4 +Comment[hu]=Létrehoz egy QMake/Qt4-alapú, keresztfordításra is alkalmas alkalmazást - Qt4-et igényel +Comment[it]=Genera una semplice applicazione basata su QMake/Qt4 (compatibile multipiattaforma) - serve Qt4 +Comment[nds]=Stellt en op QMake un Qt4 opbuut Programm op (över Bedriefümgeven weg kompatibel) - Qt4 deit noot +Comment[nl]=Genereert een heel eenvoudig Qmake/Qt4-gebaseerde toepassing (crossplatform compatible) - heeft Qt4 nodig +Comment[pl]=Generuje program używający QMake i Qt4 (wieloplatformowy) +Comment[pt]=Gera uma aplicação baseada no QMake/Qt4 (compatível com várias plataformas) - Necessita do Qt4 +Comment[pt_BR]=Gera uma aplicação baseada no QMake/Qt4 (compatível com várias plataformas) - Necessita do Qt4 +Comment[ru]=Создание простого кроссплатформенного приложения Qt 4, использующего QMake. +Comment[sk]=Vygeneruje veľmi jednoduchú aplikáciu založenú na QMake/Qt4 (multiplatformovo kompatibilnú) - vyžaduje Qt4 +Comment[sr]=Прави једноставан програм на основи QMake/Qt4 (прекоплатформски компатибилан) — захтева Qt4 +Comment[sr@Latn]=Pravi jednostavan program na osnovi QMake/Qt4 (prekoplatformski kompatibilan) — zahteva Qt4 +Comment[sv]=Skapar ett mycket enkelt QMake/Qt4-baserat program (fungerar på andra plattformar). Kräver Qt4. +Comment[zh_TW]=產生一個以 QMake/Qt4 為基礎的簡單應用程式(跨平台相容)─需要使用 Qt4 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/main.cpp,%{dest}/src/ReadMe +Archive=qt4hello.tar.gz + +[FILE1] +Type=install +Source=%{src}/qt4hello.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/qt4hello.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE3] +Type=install +Source=%{src}/src.pro +Dest=%{dest}/src/src.pro + +[FILE4] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE5] +Type=install +Source=%{src}/ReadMe +Dest=%{dest}/src/ReadMe + +[MSG] +Type=message +Comment=A Qt4/Qmake based application was created in %{dest} +Comment[ca]=Una aplicació basada en Qt4/Qmake ha estat creada en %{dest} +Comment[da]=Et Qt4/Qmake baseret program blev oprettet i %{dest} +Comment[de]=Eine auf QMake/Qt4 basierende Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή βασισμένη στα Qt4/Qmake δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación basada en Qt4/Qmake ha sido creada en %{dest} +Comment[et]=Rakendus Qt4/QMake'i põhjal loodi asukohta %{dest} +Comment[fr]=Une application basée sur Qt4 / Qmake a été créée dans %{dest} +Comment[hu]=Létrejött egy Qt4/Qmake-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione basata su Qt4/Qmake in %{dest} +Comment[ja]=Qt4/QMake ベースのアプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op Qt4 un Qmake opbuut Programm opstellt +Comment[nl]=Een Qt4/Qmake gebaseerde toepassing is aangemaakt in %{dest} +Comment[pl]=Program używający QMake i Qt4 został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação baseada no Qt4/Qmake em %{dest} +Comment[pt_BR]=Foi criada uma aplicação baseada no Qt4/Qmake em %{dest} +Comment[ru]=Приложение Qt 4, использующее Qmake, создано в %{dest} +Comment[sk]=Aplikácia založená na Qt4/Qmake bola vytvorená v %{dest} +Comment[sr]=Програм на основу Qt4/Qmake направљен је у %{dest} +Comment[sr@Latn]=Program na osnovu Qt4/Qmake napravljen je u %{dest} +Comment[sv]=Ett QMake/Qt4-baserat program skapades i %{dest} +Comment[zh_TW]=一個 QMake/Qt4 為基礎的應用程式已建立於 %{dest} + +[QMAKE] +Type=value +ValueType=QString +Value=QMAKE +Comment=Absolute Path for QMake (Qt4). +Comment[ca]=Ruta absoluta per a QMake (Qt4). +Comment[da]=Absolut søgesti til QMake (Qt4). +Comment[de]=Absoluter Pfad für QMake (Qt4). +Comment[el]=Απόλυτη διαδρομή για το QMake (Qt4). +Comment[es]=Ruta completa para QMake (Qt4). +Comment[et]=QMake (Qt4) absoluutne asukoht. +Comment[fr]=Chemin absolu pour QMake (Qt4). +Comment[hu]=A QMake (Qt4) teljes elérési útja. +Comment[it]=Percorso assoluto per QMake (Qt4). +Comment[ja]=QMake (Qt4) の絶対パス +Comment[nds]=Afsluut Padd för QMake (Qt4) +Comment[nl]=Absoluut pad naar QMake (Qt4). +Comment[pl]=Ścieżka bezwzględna do QMake (Qt4). +Comment[pt]=Localização Absoluta do QMake (Qt4). +Comment[pt_BR]=Localização Absoluta do QMake (Qt4). +Comment[ru]=Полный путь к QMake (Qt 4). +Comment[sk]=Absolútna cesta ku QMake (Qt4). +Comment[sr]=Апсолутна путања до QMake-а (Qt4). +Comment[sr@Latn]=Apsolutna putanja do QMake-a (Qt4). +Comment[sv]=Absolut sökväg till QMake (Qt4). +Comment[zh_TW]=QMake(Qt4)的絕對路徑 +Default= + +[DESIGNER] +Type=value +ValueType=QString +Value=DESIGNER +Comment=Absolute Path for Designer (Qt4). +Comment[ca]=Ruta absoluta per a Designer (Qt4). +Comment[da]=Absolut søgesti til Designer (Qt4). +Comment[de]=Absoluter Pfad für Designer (Qt4). +Comment[el]=Απόλυτη διαδρομή για τον Σχεδιαστή (Qt4). +Comment[es]=Ruta completa para Designer (Qt4). +Comment[et]=Disaineri (Qt4) absoluutne asukoht. +Comment[fr]=Chemin absolu pour Designer (Qt4). +Comment[hu]=A Designer (Qt4) teljes elérési útja +Comment[it]=Percorso assoluto del Designer (Qt4). +Comment[ja]=Designer (Qt4) の絶対パス +Comment[nds]=Afsluut Padd för Designer (Qt4) +Comment[nl]=Absoluut pad naar Designer (Qt4). +Comment[pl]=Ścieżka bezwzględna do Designera (Qt4). +Comment[pt]=Localização Absoluta do Designer (Qt4). +Comment[pt_BR]=Localização Absoluta do Designer (Qt4). +Comment[ru]=Полный путь к Designer (Qt 4). +Comment[sk]=Absolútna cesta ku Designer (Qt4). +Comment[sr]=Апсолутна путања до Designer-а (Qt4). +Comment[sr@Latn]=Apsolutna putanja do Designer-a (Qt4). +Comment[sv]=Absolut sökväg till Designer (Qt4). +Comment[zh_TW]=設計家(Qt4)的絕對路徑 +Default= diff --git a/languages/cpp/app_templates/qt4hello/qt4hello.png b/languages/cpp/app_templates/qt4hello/qt4hello.png new file mode 100644 index 00000000..332ea1c0 Binary files /dev/null and b/languages/cpp/app_templates/qt4hello/qt4hello.png differ diff --git a/languages/cpp/app_templates/qt4hello/qt4hello.pro b/languages/cpp/app_templates/qt4hello/qt4hello.pro new file mode 100644 index 00000000..7177d225 --- /dev/null +++ b/languages/cpp/app_templates/qt4hello/qt4hello.pro @@ -0,0 +1,5 @@ +SUBDIRS += src +TEMPLATE = subdirs +CONFIG += warn_on \ + qt \ + thread \ No newline at end of file diff --git a/languages/cpp/app_templates/qt4hello/src.pro b/languages/cpp/app_templates/qt4hello/src.pro new file mode 100644 index 00000000..ae5bac37 --- /dev/null +++ b/languages/cpp/app_templates/qt4hello/src.pro @@ -0,0 +1,8 @@ +SOURCES += main.cpp +TEMPLATE = app +CONFIG += warn_on \ + thread \ + qt +TARGET = %{APPNAMELC} +DESTDIR = ../bin +QT -= gui diff --git a/languages/cpp/app_templates/qt4makeapp/Makefile.am b/languages/cpp/app_templates/qt4makeapp/Makefile.am new file mode 100644 index 00000000..62c4c120 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = main.cpp qt4makeapp.cpp qt4makeapp.h qt4makeapp.png qt4makeapp.kdevelop \ + qt4makeapp.pro src.pro application.qrc ReadMe filesave.xpm fileopen.xpm filenew.xpm \ + editcopy.xpm editpaste.xpm editcut.xpm + +templateName = qt4makeapp + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/qt4makeapp/ReadMe b/languages/cpp/app_templates/qt4makeapp/ReadMe new file mode 100644 index 00000000..87d23f71 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/ReadMe @@ -0,0 +1,11 @@ +READ THIS IN ORDER TO COMPILE THE Qt4 TEMPLATE +---------------------------------------------- + +Before compiling, check the Qt Options, go to +Project->Project Options->C++ Support and open the Qt Options tab. + +Check that the Qt installation directory is correct for the Qt version you've chosen. + +------------------ +Andreas Pakulat +July 2006 diff --git a/languages/cpp/app_templates/qt4makeapp/application.qrc b/languages/cpp/app_templates/qt4makeapp/application.qrc new file mode 100644 index 00000000..c35b0695 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/application.qrc @@ -0,0 +1,10 @@ + + + editcopy.xpm + editcut.xpm + filenew.xpm + fileopen.xpm + editpaste.xpm + filesave.xpm + + \ No newline at end of file diff --git a/languages/cpp/app_templates/qt4makeapp/editcopy.xpm b/languages/cpp/app_templates/qt4makeapp/editcopy.xpm new file mode 100644 index 00000000..8350ed0e --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/editcopy.xpm @@ -0,0 +1,193 @@ +/* XPM */ +static char *editcopy[] = { +/* columns rows colors chars-per-pixel */ +"32 32 155 2", +" c black", +". c #191000", +"X c #221700", +"o c #2E2300", +"O c #452E00", +"+ c #433200", +"@ c #493000", +"# c #553800", +"$ c #5D4600", +"% c #6B5000", +"& c #724B00", +"* c #7D5E00", +"= c #6E694F", +"- c #7E795F", +"; c #865900", +": c #8A5C00", +"> c #8B6800", +", c #936200", +"< c #926D00", +"1 c #926B1A", +"2 c #967000", +"3 c #9B721D", +"4 c #9B7625", +"5 c #9E792A", +"6 c #A47C00", +"7 c #AA7D00", +"8 c #A1761A", +"9 c #A57816", +"0 c #A4791D", +"q c #AD8200", +"w c #B28500", +"e c #AE8530", +"r c #B99626", +"t c #97906D", +"y c #B18D48", +"u c #B49049", +"i c #B89542", +"p c #BA9C4D", +"a c #BD9E52", +"s c #BFA053", +"d c #B8AE78", +"f c #BEB47E", +"g c #C49300", +"h c #C89600", +"j c #C19D2C", +"k c #C1A43F", +"l c #C09E4E", +"z c #CFB457", +"x c #C9B159", +"c c #CAB573", +"v c #D4BF7C", +"b c #FFDF62", +"n c #FFE064", +"m c #FFE16D", +"M c #FFE372", +"N c #FFE479", +"B c #A19D8E", +"V c #ABA89A", +"C c #BEB580", +"Z c #BDB488", +"A c #B8B496", +"S c #AEADAA", +"D c #B3AFA1", +"F c #BCBBB6", +"G c #BFBFB9", +"H c #C0B680", +"J c #C4BA85", +"K c #C6BD8B", +"L c #CBB589", +"P c #C8BE88", +"I c #C3BC90", +"U c #CBC18C", +"Y c #CCC493", +"T c #D7CB8C", +"R c #DAC786", +"E c #D8C789", +"W c #DAC98B", +"Q c #D0C690", +"! c #D4CA94", +"~ c #D4CC9B", +"^ c #D8CE98", +"/ c #DCD29C", +"( c #C6C3B7", +") c #C8C6BE", +"_ c #D5C5A5", +"` c #DBC8A1", +"' c #DBD4A2", +"] c #DED9AE", +"[ c #D9D5B1", +"{ c #E0CC82", +"} c #E8D98B", +"| c #E8D991", +" . c #E1D7A1", +".. c #E5DBA5", +"X. c #E4DCAB", +"o. c #E8DDAA", +"O. c #E1DCB2", +"+. c #E1DCB8", +"@. c #FFE683", +"#. c #FFE78A", +"$. c #FFE885", +"%. c #FFE88D", +"&. c #FFE992", +"*. c #FFEC9D", +"=. c #FFF09F", +"-. c #ECE2AC", +";. c #E5E0B6", +":. c #E5E1B8", +">. c #EBE4B6", +",. c #EAE5BC", +"<. c #F0E5A8", +"1. c #FFEDA3", +"2. c #FFEDA9", +"3. c #F1E8B8", +"4. c #FFEFB1", +"5. c #FFF1A5", +"6. c #FFF2AD", +"7. c #FFF2B4", +"8. c #FFF2BC", +"9. c #CAC8C2", +"0. c #D6D4CB", +"q. c #DFDAC5", +"w. c #D4D2D0", +"e. c #E0D7C5", +"r. c #E4DAC3", +"t. c #E8DEC7", +"y. c #E0DFD3", +"u. c #E6E2C2", +"i. c #E8E1C5", +"p. c #EBE3CB", +"a. c #EEE9C2", +"s. c #E8E6DC", +"d. c #F3EDC3", +"f. c #F2EDCB", +"g. c #F7F2CD", +"h. c #FFF3C3", +"j. c #FFF4CA", +"k. c #FFF8C5", +"l. c #FFF8CD", +"z. c #FDF5D2", +"x. c #FFF7D8", +"c. c #FFF9D4", +"v. c #FFF9DC", +"b. c #E9E8E7", +"n. c #F3EFE3", +"m. c #F2F0E3", +"M. c #F4F2EA", +"N. c #FBF7E6", +"B. c #FEF9E3", +"V. c #FFFBEC", +"C. c #F4F4F3", +"Z. c #F8F7F6", +"A. c #FEFCF4", +"S. c #FEFEFC", +"D. c None", +/* pixels */ +"D.D.D.D.D.D.D.D.D.D.D.D.h g g g g g g g g g g w * D.D.D.D.D.", +"D.D.D.D.D.D.D.D.D.D.D.D.g z.z.g.g.g.g.g.g.z.g.R 2 D.D.D.D.D.", +"D.D.D.D.D.D.D.D.D.D.D.D.g z.d.3.3.3.3.3.3.>.f.g.z < D.D.D.D.", +"D.D.D.D.D., : ; , : : : 7 a i a R -.-.-.-.' m.u.g.j > D.D.D.", +"D.D.D.D., u y y L L L L ` t.t.e.e v -.-.-.Y b.S.+.d.q D.D.D.", +"D.D.D.D., S.S.S.S.S.S.S.S.Z.b.S.e.i W o.o.K w.S.A.u.q D.D.D.", +"D.D.D.D., S.S.S.A.S.S.S.S.M.w.S.S._ a E ..K 0.S.S.q.7 D.D.D.", +"D.D.D.D., S.A.V.A.A.A.V.A.n.9.S.S.C._ a ..Y t = - A 6 D.D.D.", +"D.D.D.D., A.A.V.A.V.V.V.A.n.9.S.S.S.Z.3 ' ' K Z A ] 7 D.D.D.", +"D.D.D.D., A.V.B.V.V.B.V.V.n.( F S S G 5 ' | / / X.f.q D.D.D.", +"D.D.D.D., A.V.x.B.x.V.B.N.B.e.D B V ) 3 / / ^ ^ ' a.q D.D.D.", +"D.D.D.D., V.N.N.B.B.B.v.v.N.z.p.i.p.n.8 ^ / ! Q ' a.q D.D.D.", +"D.D.D.D., B.B.x.v.x.z.j.j.x.z.z.c.B.B.0 ! ! ! ^ ' ,.q D.D.D.", +"D.D.D.D., B.h.h.z.z.x.x.z.z.z.h.j.x.v.0 ! Q Y ! ~ ,.q D.D.D.", +"D.D.D.D., v.c.k.x.h.j.j.j.z.8.h.k.j.v.0 U T U U ~ ,.q D.D.D.", +"D.D.D.D., v.k.z.h.h.h.j.8.j.h.h.j.k.v.0 U U U U Y ;.q D.D.D.", +"D.D.D.D., x.h.8.8.h.j.8.8.4.h.4.8.h.x.8 P H P P ~ ;.q D.D.D.", +"D.D.D.D., v.h.4.4.8.8.4.1.z.h.8.4.h.c.8 H J H J Y ;.q D.D.D.", +"D.D.D.D., c.2.z.j.4.*.1.1.8.2.2.*.2.l.8 J J H J U ] q D.D.D.", +"D.D.D.D., l.h.2.4.4.1.%.1.&.2.4.8.7.k.8 f d f H U ] q D.D.D.", +"D.D.D.D., z.8.#.1.4.1.*.1.1.1.*.N 4.l.8 f f C K ~ :.q D.D.D.", +"D.D.D.D., 8.&.4.#.%.4.&.@.#.%.%.&.2.l.8 K K Y ~ ] ,.6 D.D.D.", +"D.D.D.D., h.&.#.*.1.1.%.N N #.&.*.1.l.0 ' ] T x r 6 % D.D.D.", +"D.D.D.D., 4.4.%.*.#.b &.N M b M 2.1.k.9 k 7 > $ o D.D.D.", +"D.D.D.D., 7.&.N 5.&.N @.*.b N M N =.k., + D.D.D.", +"D.D.D.D., 6.N N M M &.#.N 2.$.%.8.6.<.& D.D.D.D.D.", +"D.D.D.D., 5.&.7.n $.m M 1.7.7.o.c 5 & @ D.D.D.D.D.D.D.D.D.", +"D.D.D.D., 7.*.m %.=.&.7.} p 1 % # X D.D.D.D.D.D.D.D.D.D.", +"D.D.D.D., 6.5.5.5.| a 1 & + . D.D.D.D.D.D.D.D.D.D.", +"D.D.D.D., 6.-.a 1 & O . D.D.D.D.D.D.D.D.D.D.D.D.", +"D.D.D.D.; : % O . D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.", +"D.D.D.D. D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D." +}; diff --git a/languages/cpp/app_templates/qt4makeapp/editcut.xpm b/languages/cpp/app_templates/qt4makeapp/editcut.xpm new file mode 100644 index 00000000..9a118931 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/editcut.xpm @@ -0,0 +1,252 @@ +/* XPM */ +static char *editcut[] = { +/* columns rows colors chars-per-pixel */ +"32 32 214 2", +" c #000000", +". c #0B0B0B", +"X c #181300", +"o c #1D190B", +"O c #131313", +"+ c #1B1B1B", +"@ c #211E11", +"# c #26231A", +"$ c #2A2513", +"% c #2E2912", +"& c #2E2A19", +"* c #372E0B", +"= c #302A12", +"- c #312C1B", +"; c #3A320F", +": c #3C3415", +"> c #3C351B", +", c #232323", +"< c #2B2922", +"1 c #2C2C2C", +"2 c #302E26", +"3 c #353120", +"4 c #3F3B2D", +"5 c #313131", +"6 c #3A3A3A", +"7 c #423814", +"8 c #493E17", +"9 c #413D2F", +"0 c #423F32", +"q c #4F4319", +"w c #5C4A00", +"e c #5F4F0D", +"r c #514410", +"t c #554813", +"y c #4E472C", +"u c #444136", +"i c #4A483F", +"p c #534B2B", +"a c #504B37", +"s c #514C3A", +"d c #654F04", +"f c #604F0B", +"g c #665200", +"h c #675509", +"j c #6B5405", +"k c #6C5807", +"l c #6C590B", +"z c #745B04", +"x c #715D0A", +"c c #7B5B02", +"v c #625B3B", +"b c #7E6815", +"n c #6C643E", +"m c #4D4B42", +"M c #494949", +"N c #504D43", +"B c #54534C", +"V c #515151", +"C c #5D5B54", +"Z c #656048", +"A c #736A44", +"S c #726C54", +"D c #77725B", +"F c #696968", +"G c gray50", +"H c #826203", +"J c #806609", +"K c #836907", +"L c #8D6A03", +"P c #9A6F00", +"I c #9B7005", +"U c #9E730E", +"Y c #9C7511", +"T c #85732C", +"R c #88783B", +"E c #AE7C00", +"W c #A87B13", +"Q c #847B53", +"! c #827D64", +"~ c #9C862E", +"^ c #A98A1F", +"/ c #B28D0A", +"( c #B88D00", +") c #B2821A", +"_ c #B18E1B", +"` c #B3941C", +"' c #A88E2C", +"] c #A28C36", +"[ c #AE9224", +"{ c #89815E", +"} c #87826D", +"| c #858174", +" . c #888370", +".. c #8E8A7D", +"X. c #928C71", +"o. c #A28E44", +"O. c #AA9F74", +"+. c #B9A456", +"@. c #BDA85B", +"#. c #B2A068", +"$. c #C28700", +"%. c #CC8E00", +"&. c #C29A00", +"*. c #C4962F", +"=. c #CCA100", +"-. c #D6A800", +";. c #D1AC1B", +":. c #DDB31A", +">. c #D2A922", +",. c #D4AE2B", +"<. c #DBA12E", +"1. c #DBA433", +"2. c #DDB428", +"3. c #D2B23B", +"4. c #E6A200", +"5. c #E8A509", +"6. c #EAAF00", +"7. c #EFAC1E", +"8. c #F5A100", +"9. c #FFAD02", +"0. c #FCAF0D", +"q. c #FCB005", +"w. c #FFB60C", +"e. c #FFBD00", +"r. c #FFBD16", +"t. c #E3B432", +"y. c #E8BF3C", +"u. c #F6BE2F", +"i. c #C6A949", +"p. c #D9A948", +"a. c #D8AB52", +"s. c #DBBA45", +"d. c #C5B162", +"f. c #ECB74D", +"g. c #EFB841", +"h. c #EFBE4A", +"j. c #EABA55", +"k. c #FDC006", +"l. c #FFC10B", +"z. c #FFC800", +"x. c #FFC90D", +"c. c #FAC113", +"v. c #FBC11C", +"b. c #FDC910", +"n. c #EDC233", +"m. c #F5C32D", +"M. c #FFC728", +"N. c #F4C537", +"B. c #F6C63A", +"V. c #F5CB36", +"C. c #FFD73D", +"Z. c #E9C659", +"A. c #EAC85A", +"S. c #FFDA4B", +"D. c #FFDD5D", +"F. c #E9CD6B", +"G. c #FFD560", +"H. c #FFE06C", +"J. c gray56", +"K. c #959595", +"L. c gray62", +"P. c #A6A18A", +"I. c #A8A69E", +"U. c #AEA895", +"Y. c #B3AC8F", +"T. c #B8AF8B", +"R. c #B4AD96", +"E. c #B8B199", +"W. c #A4A4A4", +"Q. c #AAAAAA", +"!. c #B0ADA3", +"~. c #BBB6A3", +"^. c #B1B1B1", +"/. c #B9B9B6", +"(. c #BBBBBA", +"). c #C5BC9D", +"_. c #C2BCA2", +"`. c #C1BEB5", +"'. c #D2C38E", +"]. c #DCC78C", +"[. c #C7C0A7", +"{. c #C7C2AE", +"}. c #C7C3B2", +"|. c #C5C2B8", +" X c #CAC6B6", +".X c #CBC9BE", +"XX c #D9D3BB", +"oX c #E6D08A", +"OX c #E7DEBD", +"+X c #ECDEB3", +"@X c #FFF0B9", +"#X c #C5C5C5", +"$X c #CECCC7", +"%X c #D0CEC5", +"&X c #D0CFC8", +"*X c #D2D1CB", +"=X c #DBD6C5", +"-X c #DBD7C9", +";X c #D3D3D1", +":X c #DBDBDB", +">X c #E5E1D6", +",X c #E5E3DA", +".9.U r . . , T B.*.x qX + , Q !.Q. . + 1 [ m.p.k . qXqXqXqX , u O.W.;X! + ", +"4 8.j.` p 5 y ;.u.a.d % qXqXqXqXqXqX O , A P._., ", +"1 x <.f.m.x.b.y.a.g ; qXqXqXqXqXqXqXqX + 0 v O ", +" - h c W W W W z : qXqXqXqXqXqXqXqXqXqX . . ", +" * e l l f X qXqXqXqXqXqXqXqXqXqXqXqXqX ", +"qX qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX qX", +"qXqXqX qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX", +"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX", +"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX" +}; diff --git a/languages/cpp/app_templates/qt4makeapp/editpaste.xpm b/languages/cpp/app_templates/qt4makeapp/editpaste.xpm new file mode 100644 index 00000000..c29ad36b --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/editpaste.xpm @@ -0,0 +1,295 @@ +/* XPM */ +static char *editpaste[] = { +/* columns rows colors chars-per-pixel */ +"32 32 257 2", +" c black", +". c #0D0900", +"X c #191000", +"o c #221700", +"O c #2A1B00", +"+ c #332200", +"@ c #3E2900", +"# c #3A2804", +"$ c #4D3300", +"% c #4B3E15", +"& c #44391B", +"* c #543800", +"= c #5A3B00", +"- c #4D4015", +"; c #524E25", +": c #5A4F2C", +"> c #524E3D", +", c #58562F", +"< c #53503E", +"1 c #5E623B", +"2 c #634100", +"3 c #684500", +"4 c #6E4900", +"5 c #614F11", +"6 c #685416", +"7 c #734C00", +"8 c #784F00", +"9 c #755B00", +"0 c #7C5200", +"q c #7C5A00", +"w c #7B570F", +"e c #69562F", +"r c #786600", +"t c #7F6A00", +"y c #766300", +"u c #60613F", +"i c #7C6422", +"p c #545143", +"a c #54524B", +"s c gray32", +"d c #5D5D57", +"f c #616641", +"g c #67695D", +"h c #6B734D", +"j c #6C7553", +"k c #616261", +"l c #686A64", +"z c #6B7162", +"x c #727272", +"c c #003DFF", +"v c #0043FF", +"b c #004BFF", +"n c #0053FF", +"m c #015AFF", +"M c #0063FF", +"N c #046DFF", +"B c #0865FF", +"V c #0378FF", +"C c #1663FF", +"Z c #1576FF", +"A c #2678FF", +"S c #6F7B84", +"D c #77856D", +"F c #7B8B75", +"G c #0083FF", +"H c #0197FF", +"J c #0B92FF", +"K c #1385FF", +"L c #01A5FF", +"P c #0DB5FF", +"I c #3096FF", +"U c #2DADFF", +"Y c #2FBCFF", +"T c #22C6FF", +"R c #2AC5FF", +"E c #30D0FF", +"W c #38D5FF", +"Q c #4493F1", +"! c #5F83FF", +"~ c #5F8AFF", +"^ c #5290E4", +"/ c #5F92FF", +"( c #4CAAFE", +") c #40B8FF", +"_ c #779DCB", +"` c #6693E2", +"' c #6290FF", +"] c #649DFF", +"[ c #71A6E5", +"{ c #79A4FF", +"} c #7FB3FF", +"| c #68B8F3", +" . c #42DCFF", +".. c #47E0FF", +"X. c #58E9FF", +"o. c #64C0EB", +"O. c #6ADFEF", +"+. c #825600", +"@. c #845A00", +"#. c #8B5C00", +"$. c #905F00", +"%. c #8C6103", +"&. c #876807", +"*. c #8A6111", +"=. c #886E1B", +"-. c #887600", +";. c #8C7A00", +":. c #936200", +">. c #986800", +",. c #926C22", +"<. c #987A3F", +"1. c #A07200", +"2. c #A27511", +"3. c #A97D15", +"4. c #A77B14", +"5. c #998712", +"6. c #A68000", +"7. c #A78F00", +"8. c #AD8016", +"9. c #AC9600", +"0. c #BB8F00", +"q. c #A99B2A", +"w. c #B9A000", +"e. c #B3A63C", +"r. c #958D43", +"t. c #988F44", +"y. c #9A9346", +"u. c #9F9948", +"i. c #8B897C", +"p. c #958F6F", +"a. c #98937B", +"s. c #A68443", +"d. c #B08C41", +"f. c #AF9462", +"g. c #B39864", +"h. c #B2A850", +"j. c #BDB355", +"k. c #C3972F", +"l. c #C5A400", +"z. c #CCAC00", +"x. c #D7BB00", +"c. c #CCA030", +"v. c #CBB43E", +"b. c #E4AD0C", +"n. c #ECB600", +"m. c #EDB900", +"M. c #F2BB00", +"N. c #C1B84C", +"B. c #C1B757", +"V. c #C5BB58", +"C. c #C9BE5A", +"Z. c #C2A978", +"A. c #DFC000", +"S. c #FDCB00", +"D. c #F6C300", +"F. c #FFD100", +"G. c #FEDB00", +"H. c #FFDF0E", +"J. c #F5D500", +"K. c #FBCD39", +"L. c #FFE832", +"P. c #FFE432", +"I. c #CEC25C", +"U. c #D7C648", +"Y. c #DDC74B", +"T. c #D0C55E", +"R. c #D3C85F", +"E. c #D5C960", +"W. c #DDD264", +"Q. c #E0CA4C", +"!. c #E7D14E", +"~. c #EFDA51", +"^. c #F4D050", +"/. c #F9D452", +"(. c #FEDD53", +"). c #E2D765", +"_. c #E9DD69", +"`. c #E6DD68", +"'. c #FDDB6E", +"]. c #FFEE4F", +"[. c #FEE354", +"{. c #FEEA55", +"}. c #F7E153", +"|. c #FFF056", +" X c #ECE16A", +".X c #F1E56D", +"XX c #F7EA6F", +"oX c #F7EB70", +"OX c #F9EC70", +"+X c #FEF372", +"@X c #979486", +"#X c gray60", +"$X c #969596", +"%X c #8AA193", +"&X c #82A89B", +"*X c #8CAEA3", +"=X c #86A7A9", +"-X c #8BA2B1", +";X c #ACA580", +":X c #A5A291", +">X c #B3AF98", +",X c #B8B7AF", +".k.c.6 FXkXkXkXDXkXkXkXx i b.>.+ YXYXYXYXYXYXYXYXYXYX", +"YXYXYX:.'.K.=.hX1X1X1X1X1X1X1Xd &.0.%.* 7 #.#.:.$.#.2 YXYXYX", +"YXYXYX:./.M.%.$Xk k d s s s e w >.2.d.s.Z.9XrXlXxX0X7 YXYXYX", +"YXYXYX:.^.M.1.: % % - % 5 6 &.GXIXIXPXPXPXPXPXLXIXIXg.3 YXYX", +"YXYX#X:.^.m.v.y.r.r.r.r.h.h.2.IXPXPXKXKXPXKXHXxXUXIXIXf.4 YX", +"YXYX#X:.^.m.Y.I.B.j.j.j.V.I.4.PXKXJXKXJXKXKXmXjXFXIXIXUX+. YX", +"YXYX#X:.^.m.Y.E.I.j.j.j.I.R.8.PXKXSXJXJXJXSXnXeXDXIXIXUX<. YX", +"YXYXYX:./.M.!.W.R.I.T.R.E.W.8.UXJXJXSXSXSXSXnXeX:X@Xi.X@X@X,X4 ", +"YXYXYX:.(.S.}..X X X X X X X8.PXSXAXAXAXAXAXNXzXpXwXwXjX7 ", +"YXYXYX:.(.S.[.OXOXOXoXoXt.; O s a p p p p a.AXMXvXaXzXGX+. ", +"YXYXYX:.(.S.[.+X+X+XOX+X; 7X2X] / / ~ ! 2Xp MXNXNXNXSXKX+. YX", +"YXYXYX:.(.F.|.+X+X+X+X+Xy., _ A m b v c ! p MXMXgXMXAXKX+. YX", +"YXYXYX:.(.F.|.+X+X+X+X+X+Xj.& ^ B n b v ' < gXMXgXgXNXKX+. YX", +"YXYXYX:.(.F.U.W.+X+X+X+X).y.g Q N m n b ~ < gXgXgXgXAXJXq YX", +"YXYXYX:.[.l.j j y.I.j.r.1 =X( K N M m b ~ < gXgXgXgXNXKX+. YX", +"YXYXYX:.[.t 5X4X&XD F =X| U J G V Z A C / < fXgXgXgXMXHX+. YX", +"YXYXYX:.[.l.h 3XX...W T P L H K I [ S ` { < fXfXfXfXMXKX+. YX", +"YXYXYX:.[.G.e.1 *XO...E R Y Y | -Xd Z.k 6X> fXfXfXfXBXJX+. YX", +"YXYXYX:.[.G.{.`.u.1 F &X*X%Xz l a.uXfXp.> p.sXsXsXfXBXJX+. YX", +"YXYXYX:.{.G.|.+X+X XN.q.5.7.q cXvXsXsXsXsXsXsXsXsXsXBXKX+. YX", +"YXYXYX:.|.G.].|.L.H.G.G.G.A.1.JXvXsXsXsXsXsXsXsXfXdXCXPX+. YX", +"YXYXYX:.{.G.G.G.G.G.x.w.;.t :.HXdXsXsXsXsXsXdXvXBXZXLXtX= YX", +"YXYXYX:.{.G.J.x.9.;.r 9 q 0 #.KXvXsXaXsXvXBXCXHXiXg.*.= O YX", +"YXYXYX:.L.9.-.y 9 q 0 = + #.HXbXdXbXVXZXcX8X,.3 $ . YX", +"YXYXYX%.z.9 q 7 * o $.PXZXmXmX0Xs.0 $ X YX", +"YXYXYX8 0 = o :.IXpXg.*.= O YXYXYXYX", +"YXYXYX YXYX@.#.2 @ . YXYXYXYXYXYX", +"YXYXYX YXYXYXYXYX YXYXYXYXYXYXYXYXYX", +"YXYXYXYXYXYXYXYXYXYXYXYXYXYX YXYXYXYXYXYXYXYXYXYXYXYX" +}; diff --git a/languages/cpp/app_templates/qt4makeapp/filenew.xpm b/languages/cpp/app_templates/qt4makeapp/filenew.xpm new file mode 100644 index 00000000..85efceb2 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/filenew.xpm @@ -0,0 +1,216 @@ +/* XPM */ +static char *filenew[] = { +/* columns rows colors chars-per-pixel */ +"32 32 178 2", +" c black", +". c #191000", +"X c #221700", +"o c #452E00", +"O c #4A3100", +"+ c #4E3400", +"@ c #553800", +"# c #604000", +"$ c #6A4600", +"% c #6D4800", +"& c #704A00", +"* c #724C00", +"= c #744C00", +"- c #764E00", +"; c #785000", +": c #805500", +"> c #815500", +", c #835700", +"< c #865900", +"1 c #875A00", +"2 c #8A5B00", +"3 c #8A5C00", +"4 c #8B5C00", +"5 c #8C5D00", +"6 c #8D5D00", +"7 c #8F5E00", +"8 c #805911", +"9 c #905F00", +"0 c #906000", +"q c #926000", +"w c #946200", +"e c #956300", +"r c #966400", +"t c #976400", +"y c #956913", +"u c #926C22", +"i c #9B7732", +"p c #B18D48", +"a c #B28E49", +"s c #B4904A", +"d c #BAA373", +"f c #A1A195", +"g c #ABAB9F", +"h c #ADADAB", +"j c #AFAFAB", +"k c #B3B3A6", +"l c #BCBCB8", +"z c #BFBFBC", +"x c #CBB489", +"c c #CBB58A", +"v c #CDB78B", +"b c #CAB891", +"n c #C9BB9E", +"m c #CEBEA2", +"M c #C6C6BC", +"N c #D9C8A8", +"B c #E8E1BA", +"V c #E8E1BB", +"C c #FEFFA1", +"Z c #FFFFA0", +"A c #FEFFA3", +"S c #FEFFA4", +"D c #FEFFA6", +"F c #FEFFA8", +"G c #FEFFA9", +"H c #FFFFA8", +"J c #FEFFAA", +"K c #FEFFAB", +"L c #FFFFAB", +"P c #FEFFAC", +"I c #FFFFAC", +"U c #FEFFAE", +"Y c #FEFFAF", +"T c #FEFFB0", +"R c #FEFFB1", +"E c #FFFFB0", +"W c #FEFFB4", +"Q c #FEFFB5", +"! c #FFFFB4", +"~ c #FEFFB8", +"^ c #FEFFB9", +"/ c #FFFFB8", +"( c #FFFFB9", +") c #FEFFBB", +"_ c #FFFFBA", +"` c #FEFFBD", +"' c #FFFFBD", +"] c #FEFFBE", +"[ c #FFFFBE", +"{ c #C8C8C1", +"} c #CACAC4", +"| c #CBCBC6", +" . c #DBD2C1", +".. c #DEDFCF", +"X. c #D4D4D1", +"o. c #E1D5C1", +"O. c #E3D9C3", +"+. c #E5DCCC", +"@. c #E8E8D3", +"#. c #ECECD7", +"$. c #F0EBDA", +"%. c #FEFFC2", +"&. c #FEFFC3", +"*. c #FFFFC2", +"=. c #FEFFC7", +"-. c #FFFFC7", +";. c #FEFFCB", +":. c #FEFFCC", +">. c #FFFFCC", +",. c #FEFFCE", +"<. c #FEFFD0", +"1. c #FEFFD1", +"2. c #FFFFD0", +"3. c #FFFFD1", +"4. c #FFFFD3", +"5. c #FEFFD5", +"6. c #FFFFD5", +"7. c #FEFFD6", +"8. c #FEFFD7", +"9. c #FFFFD6", +"0. c #FFFFD8", +"q. c #FEFFDA", +"w. c #FFFFDA", +"e. c #FFFFDB", +"r. c #FFFFDC", +"t. c #FEFFDE", +"y. c #FEFFDF", +"u. c #FFFFDE", +"i. c #FFFFDF", +"p. c #E9E9E7", +"a. c #F3F3E9", +"s. c #F3F3EB", +"d. c #F5F5E8", +"f. c #F8F8E3", +"g. c #FEFFE0", +"h. c LightYellow", +"j. c #FFFFE1", +"k. c #FEFFE3", +"l. c #FFFFE3", +"z. c #FDFEE7", +"x. c #FEFFE4", +"c. c #FEFFE5", +"v. c #FFFFE4", +"b. c #FBFBE9", +"n. c #FEFFE8", +"m. c #FFFFE8", +"M. c #FFFFE9", +"N. c #FFFFEA", +"B. c #FEFFEC", +"V. c #FEFFED", +"C. c #FFFFEC", +"Z. c #FFFFED", +"A. c #FEFFEF", +"S. c #F4F4F0", +"D. c #F4F4F3", +"F. c #F5F5F4", +"G. c #F8F8F6", +"H. c ivory", +"J. c #FFFFF1", +"K. c #FEFFF3", +"L. c #FFFFF3", +"P. c #FEFFF4", +"I. c #FFFFF4", +"U. c #FEFFF7", +"Y. c #FFFFF6", +"T. c #FFFFF7", +"R. c #FBFBFB", +"E. c #FFFFF8", +"W. c #FFFFF9", +"Q. c #FFFFFA", +"!. c #FFFFFB", +"~. c gray99", +"^. c #FEFFFD", +"/. c #FFFFFC", +"(. c #FFFFFD", +"). c #FFFFFE", +"_. c gray100", +"`. c None", +/* pixels */ +"`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.`.w 2 1 w 4 4 4 6 w 9 6 - `.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.r s p p c c c c N O.+.o.y # `.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.r ).).).).).).).).F.p.). .& o `.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w ).E.).E.).E.E.E.S.X.).R.n $ + `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w E.Y.Y.E.Y.E.E.E.a.| ).).D.m % `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w E.Y.Y.J.Y.J.Y.Y.a.| ).).).D.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w Y.J.J.J.J.J.J.J.a.M l h h { ; `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w Y.B.B.B.N.N.B.B.b...k f h } ; `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w J.N.N.N.N.N.N.N.l.f.#.@.#.a.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w J.l.l.l.l.l.l.l.l.l.l.l.l.J.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w J.r.l.l.r.l.r.l.r.l.r.l.r.J.1 `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w B.r.r.q.q.q.q.q.q.r.q.q.r.B.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w N.5.5.5.5.q.5.5.5.5.5.5.5.B., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w N.<.<.<.<.<.<.<.5.<.<.<.<.N., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w l.,.;.;.;.,.;.,.;.,.;.;.;.l., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w l.-.-.-.-.-.-.;.-.-.-.-.;.l.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w l.-.%.%.%.%.%.%.%.%.%.%.%.l., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w r.' ' ' ' ' ) ' ' ' ' ' ' r., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w r.) ) W ) ) ) ) ) ) W ) ) q., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w q.W W W W W W W W W W W W q., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w 5.Y Y W Y Y Y Y Y Y Y Y Y 5., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w 5.J J J Y J Y Y J Y J J Y q., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w 5.J J D J J D J D J W ) ,.$.- `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w <.Z D D Z D J Y ' ,.B b i - O `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w <.Z Z Z Y ) <.B d u & @ X `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w ,.J ) ,.B d y & o . `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w Y.V d u & o . `.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.1 4 & o . `.`.`.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`. `.`.`.`.`.`.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`. `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`." +}; diff --git a/languages/cpp/app_templates/qt4makeapp/fileopen.xpm b/languages/cpp/app_templates/qt4makeapp/fileopen.xpm new file mode 100644 index 00000000..a6c33b62 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/fileopen.xpm @@ -0,0 +1,295 @@ +/* XPM */ +static char *fileopen[] = { +/* columns rows colors chars-per-pixel */ +"32 32 257 2", +" c black", +". c #0B0900", +"X c #130E00", +"o c #161100", +"O c #231A00", +"+ c #352600", +"@ c #3B311C", +"# c #433100", +"$ c #4F3B00", +"% c #4A3E16", +"& c #4A3D22", +"* c #4D421A", +"= c #54420D", +"- c #4E4529", +"; c #484338", +": c #484233", +"> c #5B4B24", +", c #624500", +"< c #674D00", +"1 c #6D4D00", +"2 c #6E4F17", +"3 c #6D5200", +"4 c #775500", +"5 c #745B0F", +"6 c #795200", +"7 c #7A5A00", +"8 c #715C18", +"9 c #764B0A", +"0 c #6C5423", +"q c #6D592E", +"w c #785E27", +"e c #735626", +"r c #665736", +"t c #7A631D", +"y c #7A672E", +"u c #776535", +"i c #5C5956", +"p c #78704F", +"a c #75726E", +"s c #8D4F00", +"d c #815700", +"f c #835A00", +"g c #8A5C00", +"h c #866400", +"j c #966100", +"k c #956F00", +"l c #9C6100", +"z c #9D7500", +"x c #856B2A", +"c c #8C752A", +"v c #8C723B", +"b c #977939", +"n c #A45D00", +"m c #A26100", +"M c #AA680D", +"N c #AB6700", +"B c #A07700", +"V c #A57B00", +"C c #AB7A00", +"Z c #AA7300", +"A c #AF721A", +"S c #B87E00", +"D c #B57B00", +"F c #B0731A", +"G c #B47C26", +"H c #B77E28", +"J c #897F59", +"K c #977C40", +"L c #927F58", +"P c #807A6C", +"I c #9C821D", +"U c #9F8A35", +"Y c #AC8000", +"T c #B28500", +"R c #B68800", +"E c #BB8B00", +"W c #A78337", +"Q c #A28B31", +"! c #AF9535", +"~ c #B58E3A", +"^ c #B88633", +"/ c #B49936", +"( c #BCA039", +") c #998445", +"_ c #978657", +"` c #8B8264", +"' c #8E8572", +"] c #978864", +"[ c #978C75", +"{ c #9F9072", +"} c #A38845", +"| c #A48952", +" . c #AA965C", +".. c #A89156", +"X. c #B5934D", +"o. c #B39D45", +"O. c #B49755", +"+. c #AB984A", +"@. c #AD9A65", +"#. c #A79778", +"$. c #A59874", +"%. c #A29B7A", +"&. c #A79775", +"*. c #BDA959", +"=. c #B3A46C", +"-. c #B1A07F", +";. c #B5A97A", +":. c #BEB37B", +">. c #C49200", +",. c #C89500", +"<. c #CC9800", +"1. c #C69812", +"2. c #D2A31C", +"3. c #C2A63E", +"4. c #D7AE37", +"5. c #C29840", +"6. c #C29B4E", +"7. c #C2A641", +"8. c #C6AA43", +"9. c #C8AC45", +"0. c #CBAF49", +"q. c #CAA746", +"w. c #C4A158", +"e. c #CAA65D", +"r. c #CEA857", +"t. c #CFA95A", +"y. c #C5AC50", +"u. c #CDB14B", +"i. c #CBB358", +"p. c #CAB152", +"a. c #D2AB59", +"s. c #D1B54D", +"d. c #D4B951", +"f. c #D6BC5B", +"g. c #DDB45E", +"h. c #D9BD56", +"j. c #D2B753", +"k. c #DAAB48", +"l. c #CEAE69", +"z. c #CCAD67", +"x. c #CCB662", +"c. c #CAB26B", +"v. c #C8B66B", +"b. c #CEB775", +"n. c #CEBE7F", +"m. c #D3AD66", +"M. c #D5BE64", +"N. c #D4BF6D", +"B. c #E4B34B", +"V. c #E0B75F", +"C. c #E1B85F", +"Z. c #E4BA61", +"A. c #E9BE63", +"S. c #DDC159", +"D. c #DAC269", +"F. c #D4C176", +"G. c #D8C67F", +"H. c #E1C55D", +"J. c #EFC05D", +"K. c #F1C15E", +"L. c #E0C264", +"P. c #E5C961", +"I. c #EDC164", +"U. c #E9CD65", +"Y. c #EFD36B", +"T. c #F2C564", +"R. c #F6C868", +"E. c #F8C760", +"W. c #FBCC6A", +"Q. c #FDCB63", +"!. c #F1D56D", +"~. c #FFD06C", +"^. c #F5D972", +"/. c #FED175", +"(. c #FADE77", +"). c #E4C87A", +"_. c #FEE27C", +"`. c #8F9192", +"'. c #9A9A96", +"]. c #A79F83", +"[. c #ADA583", +"{. c #A7A399", +"}. c #BBAC86", +"|. c #BDB088", +" X c #BBB298", +".X c #A7A8A6", +"XX c #ADAEB0", +"oX c #B5B6B4", +"OX c #BABCBC", +"+X c #C6B38E", +"@X c #D3BE80", +"#X c #D0BC95", +"$X c #C6BFA6", +"%X c #C5C29D", +"&X c #D2C283", +"*X c #DAC789", +"=X c #DBCA8B", +"-X c #D5C489", +";X c #DBCD94", +":X c #D6C699", +">X c #CFC8B1", +",X c #C8C6B7", +".L.ZXyXT.K.E.wX ..XKXKXR YXYX", +"YXYXYXYXYXYXYXYXYXYXYXYX V E 4.ZXsXW.K.I.Z.O.{.KXUXUXMXk YXYX", +"YXYXYXYXYXYX R E 7 YX< E 2.aXsX6XC.T.Z.w.[ xXUXUXUXUX2X3 YXYX", +"YXYXYXYX R >.).5X,.T ,.5XCX8XK.T.A.a.] OXUXUXUXUXUXUX2.O YXYX", +"YXYX Y E Z.ZXsX7XsX0XCXyXR.K.I.V._ .XUXUXUXUXUXLXKXJXV D N S 7 ", +" z E 4.fXsX/.K.~./.6X~.I.I.C...'.KXUXPXPXPXLXKXGXbXl.N m.SXm.D ", +" E 0XgX7XE.W.W.~.~.R.I.Z.w.' bXUXUXUXPXPXLXmXbX$X) ~ aXSXpXBXn ", +" <.CXT.Q.~.W.W.R.I.A.t._ hXUXUXUXUXPXLXGXnX,X .t XAXSXeX4Xl.Z ", +" <.sXB.W.W.W.T.A.g._ oXUXUXUXUXUXLXLXmXcX=.5 $.BXgXeX!.D.3Xm + ", +" <.sXB.R.R.A.V.| {.KXUXUXUXUXLXKXGXvX|.c u qXdXgX^.U.f.3XH f ", +" <.sXB.T.Z.m.[ nXUXUXUXUXPXKXHXbX,X) e X) y >XAXAX_.S.h.h.u.s.d.F.6.g YX", +" >.9X~ } u '.LXKXmXxX .5 [.IXAX_.!.S.h.h.d.8.s.D.n.j YXYX", +" >.:XW v & kXmXvX;.t ] BXAXrX!.U.u.S.9.u.3.7.i.;XM 1 YXYXYX", +" E #Xb u : nXcX_ u 1XSXgX^.U.H.S.d.8.s.d.u.b.-XG g YXYXYXYX", +" R +Xc r a zX[.= -XdX_.U.d.P.h.d.u.3.8.N.=Xw.l 1 YXYXYXYX", +" T }.x > `.oX> %.*.S.S.h.S.7.d.h.0.p.n.c.M d . YXYXYXYXYX", +" C ].w @ XXu p *.( h.S.s.u.u.u.p.N.*X^ g + YXYXYXYXYXYX", +" Z &.e ; ` * :.o.S.S.S.u.( 9.x.&XX.j , YXYXYXYXYXYX", +" B { 0 i % [.o.u.S.d.h.9.M.&Xz.M 6 YXYXYXYXYXYXYXYX", +" z { 0 - J *./ S.9.d.i.G.&XF g O YXYXYXYXYXYXYXYXYXYX", +" z $.2 w =.! s.d.p.N.;X^ l , YXYXYXYXYXYXYXYXYXYXYX", +" B &.9 ;.Q / j.x.@Xl.m 6 YXYXYXYXYXYXYXYXYXYXYXYXYX", +" h W @.+.I y.&Xb.F 7 O YXYXYXYXYXYXYXYXYXYXYXYXYXYXYX", +" $ s %XU F.=X^ j # YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX", +" g O. c #23224B", +", c #262353", +"< c #292655", +"1 c #2B2C54", +"2 c #2C2C5B", +"3 c #293746", +"4 c #2D304F", +"5 c #243243", +"6 c #2E315D", +"7 c #363647", +"8 c #303E4A", +"9 c #30325E", +"0 c #3C3C53", +"q c #2E2E60", +"w c #2F3160", +"e c #302E63", +"r c #313164", +"t c #363861", +"y c #353868", +"u c #384650", +"i c #284F6B", +"p c #2D547B", +"a c #3B486A", +"s c #36597D", +"d c #3D5D7C", +"f c #4C4C4C", +"g c #40405A", +"h c #414E56", +"j c #4B585E", +"k c #49545E", +"l c #555555", +"z c #4D4D6B", +"x c #434675", +"c c #4B5660", +"v c #4F5962", +"b c #41517E", +"n c #4B507D", +"m c #515C67", +"M c #505D6E", +"N c #5C5D7D", +"B c #546066", +"V c #54626D", +"C c #5B646D", +"Z c #55677A", +"A c #556B78", +"S c #5D6772", +"D c #6B6B6B", +"F c #646464", +"G c #616C73", +"H c #63707D", +"J c #6B7679", +"K c gray45", +"L c #00418E", +"P c #004494", +"I c #004894", +"U c #044F98", +"Y c #03509B", +"T c #0A5198", +"R c #13579C", +"E c #185DA1", +"W c #285888", +"Q c #2B6094", +"! c #396D9A", +"~ c #336A96", +"^ c #3D719B", +"/ c #226EB8", +"( c #326EA8", +") c #326BA3", +"_ c #3673AE", +"` c #3A76B4", +"' c #0B6FD1", +"] c #0F75D8", +"[ c #1479DA", +"{ c #1B7CDC", +"} c #466481", +"| c #42749C", +" . c #4A799E", +".. c #506A84", +"X. c #5F678D", +"o. c #576391", +"O. c #5A6592", +"+. c #5F6893", +"@. c #5B738B", +"#. c #507DA1", +"$. c #626283", +"%. c #636A94", +"&. c #656F98", +"*. c #657A8F", +"=. c #6B7299", +"-. c #717191", +";. c #797998", +":. c #687BA6", +">. c #2281DC", +",. c #3F81C0", +"<. c #3988D7", +"1. c #2785E1", +"2. c #2E8AE3", +"3. c #368FE5", +"4. c #3690E6", +"5. c #3D93E7", +"6. c #3D94E9", +"7. c #57839E", +"8. c #4787BC", +"9. c #5480A1", +"0. c #5B84A3", +"q. c #6E8496", +"w. c #6E8B9A", +"e. c #7D848E", +"r. c #728597", +"t. c #738598", +"y. c #768899", +"u. c #7B8B9B", +"i. c #6489A5", +"p. c #698EA7", +"a. c #6D8FA9", +"s. c #6E81AB", +"d. c #7683A6", +"f. c #768CB7", +"g. c #7395AD", +"h. c #7C96B0", +"j. c #4086CA", +"k. c #4986C3", +"l. c #4284C3", +"z. c #498ED2", +"x. c #4D95DB", +"c. c #548DC5", +"v. c #5D92C8", +"b. c #5593C9", +"n. c #5097DE", +"m. c #5198DE", +"M. c #4296E7", +"N. c #4895E2", +"B. c #4B99E5", +"V. c #4A9CEB", +"C. c #4599EB", +"Z. c #529DE6", +"A. c #589EE2", +"S. c #54A1EB", +"D. c #5AA1E6", +"F. c #5AA5EB", +"G. c #5EA8EF", +"H. c #53A3F1", +"J. c #5EAAF2", +"K. c #6699CB", +"L. c #799BC8", +"P. c #7EA6C9", +"I. c #60A2E5", +"U. c #65A7E8", +"Y. c #6BABE9", +"T. c #68ADF2", +"R. c #67B0F5", +"E. c #6DB3F6", +"W. c #70ADEA", +"Q. c #75B0E9", +"!. c #7CB5EB", +"~. c #73B9F8", +"^. c #7BBDFB", +"/. c #7CBAF6", +"(. c gray55", +"). c #828899", +"_. c #84949E", +"`. c #918E8A", +"'. c #949494", +"]. c #8F8FA9", +"[. c #8997A5", +"{. c #8A9AA9", +"}. c #9A9BAF", +"|. c #9399A9", +" X c #9FAAB5", +".X c #A29E9B", +"XX c #A7A7A7", +"oX c #ABABAB", +"OX c #A3A3B4", +"+X c #A8A8B7", +"@X c #A3ABB3", +"#X c #B4B5B5", +"$X c #B0B0BC", +"%X c #B7B9BC", +"&X c #BBB7B3", +"*X c #BBBBBB", +"=X c #82B1DB", +"-X c #81B7EC", +";X c #88BBED", +":X c #86BAED", +">X c #AEBBC8", +",X c #A6BDCD", +".U i 9 YXYX", +"YXYXYXo.2X] L C UXDXcXzXkXkXkXjXjXdXdX%X%X&X%X*XN.' ~ 6 YXYX", +"YXYXYXo.1X] P k hXoXXXXXoXoX#X#X*X%X&X%X%XdXkXxXx.[ ~ 6 YXYX", +"YXYXYXO.3X[ I m FXkXjXjXkXkXkXkXkXkXzXzXzXcXZXSXx.{ ! 6 YXYX", +"YXYXYXo.3X{ I S UXvXxXzXkXkXkXkXkXjXdX*X%X#X&X%XZ.1.^ 9 YXYX", +"YXYXYXO.4X>.U j jX#X#X#X%XdXdXkXzXkXzXzXcXvXDXJXA.1.| 6 YXYX", +"YXYXYXO.6X>.T V PXZXZXZXAXSXDXDXFXHXDXHXHXHXHXSXI.2.| 9 YXYX", +"YXYXYXO.6X2.T G UXLXDXDXAXZXZXAXZXvXcXzXkXkXkXgXY.3. .6 YXYX", +"YXYXYXO.9X4.R m zXdXdXkXzXvXAXDXHXLXPXPXIXUXUXUXQ.6. .9 YXYX", +"YXYXYXO.9X5.R H UXIXUXUXUXUXUXUXUXUXUXUXIXKXJXBX-XC.#.9 YXYX", +"YXYXYXO.eXM./ h.UXUXIXKXBXNXnXuXyXwX5X:X!.Y.Y.Y.D.H.9.6 YXYX", +"YXYXYX+.rXB.<.x.Q.;X-XQ.Y.U.U.D.Z.Z.B.B.C.V.V.B.B.T.0.9 YXYX", +"YXYXYX+.tXB.N.B.B.B.B.C.V.V.H.H.H.D.N.z.8._ ( <.D.R.0.9 YXYX", +"YXYXYX+.tXS.Z.F.D.m.z.l.` ) Q W p s } @.r.[. X>XG.E.0.9 YXYX", +"YXYXYX+.pXU.m.) p d ..*.u.|.+X @ o YXYXYXYXYXYXYXYXYXYXYXYX", +"YXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX", +"YXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX" +}; diff --git a/languages/cpp/app_templates/qt4makeapp/main.cpp b/languages/cpp/app_templates/qt4makeapp/main.cpp new file mode 100644 index 00000000..3416347e --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/main.cpp @@ -0,0 +1,14 @@ +%{CPP_TEMPLATE} + +#include +#include "%{APPNAMELC}.h" + +int main(int argc, char *argv[]) +{ + Q_INIT_RESOURCE(application); + QApplication app(argc, argv); + %{APPNAME} * mw = new %{APPNAME}(); + mw->show(); + return app.exec(); +} + diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp b/languages/cpp/app_templates/qt4makeapp/qt4makeapp new file mode 100644 index 00000000..9c856e8e --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp @@ -0,0 +1,11 @@ +# QMake application +[General] +Name=Qt4/QMake Application +Name[fr]=Une Application Qt4 / QMake +Icon=qt4makeapp.png +Category=C++/QMake project +Category[fr]=C++/QMake +Comment=Generate a QMake/Qt4 based application (crossplatform compatible)- Needs Qt4 +Comment[fr]=G��e une application bas� sur Qt / QMake. Ce programme est multi platte-forme. Nécessite Qt4. +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/APPNAMELC.cpp diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp new file mode 100644 index 00000000..af16391f --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp @@ -0,0 +1,285 @@ +%{CPP_TEMPLATE} + +#include +#include "%{APPNAMELC}.h" + +#include +#include +#include +#include + +%{APPNAME}::%{APPNAME}() +{ + textEdit = new QTextEdit; + setCentralWidget(textEdit); + + createActions(); + createMenus(); + createToolBars(); + createStatusBar(); + + readSettings(); + + connect(textEdit->document(), SIGNAL(contentsChanged()), + this, SLOT(documentWasModified())); + + setCurrentFile(""); +} + +void %{APPNAME}::closeEvent(QCloseEvent *event) +{ + if (maybeSave()) { + writeSettings(); + event->accept(); + } else { + event->ignore(); + } +} + +void %{APPNAME}::newFile() +{ + if (maybeSave()) { + textEdit->clear(); + setCurrentFile(""); + } +} + +void %{APPNAME}::open() +{ + if (maybeSave()) { + QString fileName = QFileDialog::getOpenFileName(this); + if (!fileName.isEmpty()) + loadFile(fileName); + } +} + +bool %{APPNAME}::save() +{ + if (curFile.isEmpty()) { + return saveAs(); + } else { + return saveFile(curFile); + } +} + +bool %{APPNAME}::saveAs() +{ + QString fileName = QFileDialog::getSaveFileName(this); + if (fileName.isEmpty()) + return false; + + return saveFile(fileName); +} + +void %{APPNAME}::about() +{ + QMessageBox::about(this, tr("About Application"), + tr("The Application example demonstrates how to " + "write modern GUI applications using Qt, with a menu bar, " + "toolbars, and a status bar.")); +} + +void %{APPNAME}::documentWasModified() +{ + setWindowModified(true); +} + +void %{APPNAME}::createActions() +{ + newAct = new QAction(QIcon(":/filenew.xpm"), tr("&New"), this); + newAct->setShortcut(tr("Ctrl+N")); + newAct->setStatusTip(tr("Create a new file")); + connect(newAct, SIGNAL(triggered()), this, SLOT(newFile())); + + openAct = new QAction(QIcon(":/fileopen.xpm"), tr("&Open..."), this); + openAct->setShortcut(tr("Ctrl+O")); + openAct->setStatusTip(tr("Open an existing file")); + connect(openAct, SIGNAL(triggered()), this, SLOT(open())); + + saveAct = new QAction(QIcon(":/filesave.xpm"), tr("&Save"), this); + saveAct->setShortcut(tr("Ctrl+S")); + saveAct->setStatusTip(tr("Save the document to disk")); + connect(saveAct, SIGNAL(triggered()), this, SLOT(save())); + + saveAsAct = new QAction(tr("Save &As..."), this); + saveAsAct->setStatusTip(tr("Save the document under a new name")); + connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs())); + + exitAct = new QAction(tr("E&xit"), this); + exitAct->setShortcut(tr("Ctrl+Q")); + exitAct->setStatusTip(tr("Exit the application")); + connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); + + cutAct = new QAction(QIcon(":/editcut.xpm"), tr("Cu&t"), this); + cutAct->setShortcut(tr("Ctrl+X")); + cutAct->setStatusTip(tr("Cut the current selection's contents to the " + "clipboard")); + connect(cutAct, SIGNAL(triggered()), textEdit, SLOT(cut())); + + copyAct = new QAction(QIcon(":/editcopy.xpm"), tr("&Copy"), this); + copyAct->setShortcut(tr("Ctrl+C")); + copyAct->setStatusTip(tr("Copy the current selection's contents to the " + "clipboard")); + connect(copyAct, SIGNAL(triggered()), textEdit, SLOT(copy())); + + pasteAct = new QAction(QIcon(":/editpaste.xpm"), tr("&Paste"), this); + pasteAct->setShortcut(tr("Ctrl+V")); + pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current " + "selection")); + connect(pasteAct, SIGNAL(triggered()), textEdit, SLOT(paste())); + + aboutAct = new QAction(tr("&About"), this); + aboutAct->setStatusTip(tr("Show the application's About box")); + connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); + + aboutQtAct = new QAction(tr("About &Qt"), this); + aboutQtAct->setStatusTip(tr("Show the Qt library's About box")); + connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); + + cutAct->setEnabled(false); + copyAct->setEnabled(false); + connect(textEdit, SIGNAL(copyAvailable(bool)), + cutAct, SLOT(setEnabled(bool))); + connect(textEdit, SIGNAL(copyAvailable(bool)), + copyAct, SLOT(setEnabled(bool))); +} + +void %{APPNAME}::createMenus() +{ + fileMenu = menuBar()->addMenu(tr("&File")); + fileMenu->addAction(newAct); + fileMenu->addAction(openAct); + fileMenu->addAction(saveAct); + fileMenu->addAction(saveAsAct); + fileMenu->addSeparator(); + fileMenu->addAction(exitAct); + + editMenu = menuBar()->addMenu(tr("&Edit")); + editMenu->addAction(cutAct); + editMenu->addAction(copyAct); + editMenu->addAction(pasteAct); + + menuBar()->addSeparator(); + + helpMenu = menuBar()->addMenu(tr("&Help")); + helpMenu->addAction(aboutAct); + helpMenu->addAction(aboutQtAct); +} + +void %{APPNAME}::createToolBars() +{ + fileToolBar = addToolBar(tr("File")); + fileToolBar->addAction(newAct); + fileToolBar->addAction(openAct); + fileToolBar->addAction(saveAct); + + editToolBar = addToolBar(tr("Edit")); + editToolBar->addAction(cutAct); + editToolBar->addAction(copyAct); + editToolBar->addAction(pasteAct); +} + +void %{APPNAME}::createStatusBar() +{ + statusBar()->showMessage(tr("Ready")); +} + +void %{APPNAME}::readSettings() +{ + QSettings settings("Trolltech", "Application Example"); + QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint(); + QSize size = settings.value("size", QSize(400, 400)).toSize(); + resize(size); + move(pos); +} + +void %{APPNAME}::writeSettings() +{ + QSettings settings("Trolltech", "Application Example"); + settings.setValue("pos", pos()); + settings.setValue("size", size()); +} + +bool %{APPNAME}::maybeSave() +{ + if (textEdit->document()->isModified()) { + int ret = QMessageBox::warning(this, tr("Application"), + tr("The document has been modified.\n" + "Do you want to save your changes?"), + QMessageBox::Yes | QMessageBox::Default, + QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); + if (ret == QMessageBox::Yes) + return save(); + else if (ret == QMessageBox::Cancel) + return false; + } + return true; +} + +void %{APPNAME}::loadFile(const QString &fileName) +{ + QFile file(fileName); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Application"), + tr("Cannot read file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + return; + } + + QTextStream in(&file); + QApplication::setOverrideCursor(Qt::WaitCursor); + textEdit->setPlainText(in.readAll()); + QApplication::restoreOverrideCursor(); + + setCurrentFile(fileName); + statusBar()->showMessage(tr("File loaded"), 2000); +} + +bool %{APPNAME}::saveFile(const QString &fileName) +{ + QFile file(fileName); + if (!file.open(QFile::WriteOnly | QFile::Text)) { + QMessageBox::warning(this, tr("Application"), + tr("Cannot write file %1:\n%2.") + .arg(fileName) + .arg(file.errorString())); + return false; + } + + QTextStream out(&file); + QApplication::setOverrideCursor(Qt::WaitCursor); + out << textEdit->toPlainText(); + QApplication::restoreOverrideCursor(); + + setCurrentFile(fileName); + statusBar()->showMessage(tr("File saved"), 2000); + return true; +} + +void %{APPNAME}::setCurrentFile(const QString &fileName) +{ + curFile = fileName; + textEdit->document()->setModified(false); + setWindowModified(false); + + QString shownName; + if (curFile.isEmpty()) + shownName = "untitled.txt"; + else + shownName = strippedName(curFile); + + setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("Application"))); +} + +QString %{APPNAME}::strippedName(const QString &fullFileName) +{ + return QFileInfo(fullFileName).fileName(); +} + +%{APPNAME}::~%{APPNAME}() +{ + +} + diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h new file mode 100644 index 00000000..cd470d00 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h @@ -0,0 +1,65 @@ +%{H_TEMPLATE} + +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H + +#include +#include + +class QAction; +class QMenu; +class QTextEdit; + +class %{APPNAME}:public QMainWindow +{ + Q_OBJECT + +public: + %{APPNAME}(); + ~%{APPNAME}(); + +protected: + void closeEvent(QCloseEvent *event); + +private slots: + void newFile(); + void open(); + bool save(); + bool saveAs(); + void about(); + void documentWasModified(); + +private: + void createActions(); + void createMenus(); + void createToolBars(); + void createStatusBar(); + void readSettings(); + void writeSettings(); + bool maybeSave(); + void loadFile(const QString &fileName); + bool saveFile(const QString &fileName); + void setCurrentFile(const QString &fileName); + QString strippedName(const QString &fullFileName); + + QTextEdit *textEdit; + QString curFile; + + QMenu *fileMenu; + QMenu *editMenu; + QMenu *helpMenu; + QToolBar *fileToolBar; + QToolBar *editToolBar; + QAction *newAct; + QAction *openAct; + QAction *saveAct; + QAction *saveAsAct; + QAction *exitAct; + QAction *cutAct; + QAction *copyAct; + QAction *pasteAct; + QAction *aboutAct; + QAction *aboutQtAct; +}; + +#endif diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevelop b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevelop new file mode 100644 index 00000000..cd633ede --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + true + 4 + 4 + ExternalDesigner + %{QMAKE} + %{DESIGNER} + + + + + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + KDE Libraries (Doxygen) + + + + + + + + /usr/bin/gdb + true + false + false + + + false + true + + + + + + ./bin/%{APPNAMELC} + + + + + + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevtemplate b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevtemplate new file mode 100644 index 00000000..ff91d477 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevtemplate @@ -0,0 +1,207 @@ +# KDE Config File +[General] +Name=Qt4 Application +Name[br]=Meziant Qt4 +Name[ca]=Aplicació Qt4 +Name[da]=Qt4-Program +Name[de]=Qt4-Anwendung +Name[el]=Εφαρμογή Qt4 +Name[es]=Aplicación Qt4 +Name[et]=Qt4 rakendus +Name[fr]=Application Qt4 +Name[hu]=Qt4-alapú alkalmazás +Name[it]=Applicazione Qt4 +Name[ja]=Qt4 アプリケーション +Name[nds]=Qt4-Programm +Name[nl]=Qt4-toepassing +Name[pl]=Program Qt4 +Name[pt]=Aplicação do Qt4 +Name[pt_BR]=Aplicação do Qt4 +Name[ru]=Приложение Qt 4 +Name[sk]=Qt4 aplikácia +Name[sr]=Qt4 програм +Name[sr@Latn]=Qt4 program +Name[sv]=Qt4-program +Name[zh_TW]=Qt4 應用程式 +Icon=qt4makeapp.png +Category=C++/QMake project +Category[fr]=C++/QMake +Comment=Generate a QMake/Qt4 based application (crossplatform compatible) - Needs Qt4 +Comment[ca]=Genera una aplicació basada en QMake/Qt4 (multi plataforma) -Necessita Qt4- +Comment[da]=Generér et QMake/Qt4 baseret program (krydsplatform kompatibel) - behøver Qt4 +Comment[de]=Erstellt eine auf QMake/Qt4 basierende Anwendung (plattformunabhängig). - Benötigt Qt4. +Comment[el]=Δημιουργία μια εφαρμογής βασισμένης στα QMake/Qt4 (συμβατή με πολλαπλές πλατφόρμες) +Comment[es]=Genera una aplicación basada en QMake/Qt4 (con compatibilidad multiplataforma) - Necesita Qt4 +Comment[et]=Rakenduse loomine QMake'i/Qt4 põhjal (multiplatvormne) +Comment[fr]=Génère une application basée sur QMake / Qt4 (compatible multi-plateforme) - Nécessite Qt4 +Comment[hu]=Létrehoz egy QMake/Qt4-alapú, keresztfordításra is alkalmas alkalmazást - Qt4-et igényel +Comment[it]=Genera un'applicazione basata su QMake/Qt4 (compatibile multipiattaforma) - serve Qt4 +Comment[nds]=Stellt en op QMake un Qt4 opbuut Programm op (över Bedriefümgeven weg kompatibel) - Qt4 deit noot +Comment[nl]=Genereer een Qmake/Qt4-gebaseerde toepassing (crossplatform compatible) - heeft Qt4 nodig +Comment[pl]=Generuje program używający QMake i Qt4 (wieloplatformowy) - wymaga biblioteki Qt4 +Comment[pt]=Gera uma aplicação baseada no QMake/Qt4 (compatível com várias plataformas) - Necessita do Qt4 +Comment[pt_BR]=Gera uma aplicação baseada no QMake/Qt4 (compatível com várias plataformas) - Necessita do Qt4 +Comment[ru]=Создание кроссплатформенного приложения Qt 4, использующего QMake +Comment[sk]=Vygeneruje aplikáciu založenú na QMake/Qt4 (multiplatformovo kompatibilnú) - vyžaduje Qt4 +Comment[sr]=Прави програм на основи QMake/Qt4 (прекоплатформски компатибилан) — захтева Qt4 +Comment[sr@Latn]=Pravi program na osnovi QMake/Qt4 (prekoplatformski kompatibilan) — zahteva Qt4 +Comment[sv]=Skapar ett QMake/Qt4-baserat program (fungerar på andra plattformar). Kräver Qt4. +Comment[zh_TW]=產生一個 QMake/Qt4 為基礎的應用程式(跨平台相容)─需要 Qt4 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp,%{dest}/src/ReadMe +Archive=qt4makeapp.tar.gz + +[FILE1] +Type=install +Source=%{src}/qt4makeapp.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/qt4makeapp.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE3] +Type=install +Source=%{src}/src.pro +Dest=%{dest}/src/src.pro + +[FILE4] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/src/main.cpp + +[FILE5] +Type=install +Source=%{src}/qt4makeapp.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE6] +Type=install +Source=%{src}/qt4makeapp.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE7] +Type=install +Source=%{src}/fileopen.xpm +Dest=%{dest}/src/fileopen.xpm + +[FILE8] +Type=install +Source=%{src}/filesave.xpm +Dest=%{dest}/src/filesave.xpm + +[FILE9] +Type=install +Source=%{src}/filenew.xpm +Dest=%{dest}/src/filenew.xpm + +[FILE10] +Type=install +Source=%{src}/editcopy.xpm +Dest=%{dest}/src/editcopy.xpm + +[FILE11] +Type=install +Source=%{src}/editpaste.xpm +Dest=%{dest}/src/editpaste.xpm + +[FILE12] +Type=install +Source=%{src}/editcut.xpm +Dest=%{dest}/src/editcut.xpm + +[FILE13] +Type=install +Source=%{src}/application.qrc +Dest=%{dest}/src/application.qrc + +[FILE14] +Type=install +Source=%{src}/ReadMe +Dest=%{dest}/src/ReadMe + +[MSG] +Type=message +Comment=A Qt4/Qmake based application was created in %{dest} +Comment[ca]=Una aplicació basada en Qt4/Qmake ha estat creada en %{dest} +Comment[da]=Et Qt4/Qmake baseret program blev oprettet i %{dest} +Comment[de]=Eine auf QMake/Qt4 basierende Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή βασισμένη στα Qt4/Qmake δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación basada en Qt4/Qmake ha sido creada en %{dest} +Comment[et]=Rakendus Qt4/QMake'i põhjal loodi asukohta %{dest} +Comment[fr]=Une application basée sur Qt4 / Qmake a été créée dans %{dest} +Comment[hu]=Létrejött egy Qt4/Qmake-alapú alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione basata su Qt4/Qmake in %{dest} +Comment[ja]=Qt4/QMake ベースのアプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en op Qt4 un Qmake opbuut Programm opstellt +Comment[nl]=Een Qt4/Qmake gebaseerde toepassing is aangemaakt in %{dest} +Comment[pl]=Program używający QMake i Qt4 został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação baseada no Qt4/Qmake em %{dest} +Comment[pt_BR]=Foi criada uma aplicação baseada no Qt4/Qmake em %{dest} +Comment[ru]=Приложение Qt 4, использующее Qmake, создано в %{dest} +Comment[sk]=Aplikácia založená na Qt4/Qmake bola vytvorená v %{dest} +Comment[sr]=Програм на основу Qt4/Qmake направљен је у %{dest} +Comment[sr@Latn]=Program na osnovu Qt4/Qmake napravljen je u %{dest} +Comment[sv]=Ett QMake/Qt4-baserat program skapades i %{dest} +Comment[zh_TW]=一個 QMake/Qt4 為基礎的應用程式已建立於 %{dest} + +Comment= +[QMAKE] +Type=value +ValueType=QString +Value=QMAKE +Comment=Absolute Path for QMake (Qt4). +Comment[ca]=Ruta absoluta per a QMake (Qt4). +Comment[da]=Absolut søgesti til QMake (Qt4). +Comment[de]=Absoluter Pfad für QMake (Qt4). +Comment[el]=Απόλυτη διαδρομή για το QMake (Qt4). +Comment[es]=Ruta completa para QMake (Qt4). +Comment[et]=QMake (Qt4) absoluutne asukoht. +Comment[fr]=Chemin absolu pour QMake (Qt4). +Comment[hu]=A QMake (Qt4) teljes elérési útja. +Comment[it]=Percorso assoluto per QMake (Qt4). +Comment[ja]=QMake (Qt4) の絶対パス +Comment[nds]=Afsluut Padd för QMake (Qt4) +Comment[nl]=Absoluut pad naar QMake (Qt4). +Comment[pl]=Ścieżka bezwzględna do QMake (Qt4). +Comment[pt]=Localização Absoluta do QMake (Qt4). +Comment[pt_BR]=Localização Absoluta do QMake (Qt4). +Comment[ru]=Полный путь к QMake (Qt 4). +Comment[sk]=Absolútna cesta ku QMake (Qt4). +Comment[sr]=Апсолутна путања до QMake-а (Qt4). +Comment[sr@Latn]=Apsolutna putanja do QMake-a (Qt4). +Comment[sv]=Absolut sökväg till QMake (Qt4). +Comment[zh_TW]=QMake(Qt4)的絕對路徑 +Default= +[DESIGNER] +Type=value +ValueType=QString +Value=DESIGNER +Comment=Absolute Path for Designer (Qt4). +Comment[ca]=Ruta absoluta per a Designer (Qt4). +Comment[da]=Absolut søgesti til Designer (Qt4). +Comment[de]=Absoluter Pfad für Designer (Qt4). +Comment[el]=Απόλυτη διαδρομή για τον Σχεδιαστή (Qt4). +Comment[es]=Ruta completa para Designer (Qt4). +Comment[et]=Disaineri (Qt4) absoluutne asukoht. +Comment[fr]=Chemin absolu pour Designer (Qt4). +Comment[hu]=A Designer (Qt4) teljes elérési útja +Comment[it]=Percorso assoluto del Designer (Qt4). +Comment[ja]=Designer (Qt4) の絶対パス +Comment[nds]=Afsluut Padd för Designer (Qt4) +Comment[nl]=Absoluut pad naar Designer (Qt4). +Comment[pl]=Ścieżka bezwzględna do Designera (Qt4). +Comment[pt]=Localização Absoluta do Designer (Qt4). +Comment[pt_BR]=Localização Absoluta do Designer (Qt4). +Comment[ru]=Полный путь к Designer (Qt 4). +Comment[sk]=Absolútna cesta ku Designer (Qt4). +Comment[sr]=Апсолутна путања до Designer-а (Qt4). +Comment[sr@Latn]=Apsolutna putanja do Designer-a (Qt4). +Comment[sv]=Absolut sökväg till Designer (Qt4). +Comment[zh_TW]=設計家(Qt4)的絕對路徑 +Default= diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.png b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.png new file mode 100644 index 00000000..96a7e0bf Binary files /dev/null and b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.png differ diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.pro b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.pro new file mode 100644 index 00000000..7177d225 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.pro @@ -0,0 +1,5 @@ +SUBDIRS += src +TEMPLATE = subdirs +CONFIG += warn_on \ + qt \ + thread \ No newline at end of file diff --git a/languages/cpp/app_templates/qt4makeapp/src.pro b/languages/cpp/app_templates/qt4makeapp/src.pro new file mode 100644 index 00000000..fa8baae6 --- /dev/null +++ b/languages/cpp/app_templates/qt4makeapp/src.pro @@ -0,0 +1,10 @@ +SOURCES += %{APPNAMELC}.cpp \ + main.cpp +HEADERS += %{APPNAMELC}.h +TEMPLATE = app +CONFIG += warn_on \ + thread \ + qt +TARGET = %{APPNAMELC} +DESTDIR = ../bin +RESOURCES = application.qrc diff --git a/languages/cpp/app_templates/qtopia4app/Example.png b/languages/cpp/app_templates/qtopia4app/Example.png new file mode 100644 index 00000000..f63d0bc7 Binary files /dev/null and b/languages/cpp/app_templates/qtopia4app/Example.png differ diff --git a/languages/cpp/app_templates/qtopia4app/Makefile.am b/languages/cpp/app_templates/qtopia4app/Makefile.am new file mode 100644 index 00000000..57785690 --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = Example.png app.kdevelop example.desktop \ + example.html main.cpp Makefile.am app.pro example.cpp \ + example.h examplebase.ui + +templateName = qtopia4app + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + gzip -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/qtopia4app/app.kdevelop b/languages/cpp/app_templates/qtopia4app/app.kdevelop new file mode 100644 index 00000000..465fd677 --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/app.kdevelop @@ -0,0 +1,163 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + KDE Libraries (Doxygen) + + + + + libtool + + + true + false + false + + + false + true + + + + + + + + ./%{APPNAMELC} + -qws + + + + + + + + + + + true + false + 1 + false + + 0 + + + + + + + + + + + + + + + + + false + false + + + + false + + + .h + .cpp + true + + + + true + 2 + + + -f + + -dP + + -f + -u3 -p + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + + + true + 4 + 4 + /usr/lib/qt3 + ExternalDesigner + /opt/Qtopia/SDK/4.2.4/x86/bin/qtopiamake + /opt/Qtopia/SDK/4.2.4/x86/bin/designer + + + + diff --git a/languages/cpp/app_templates/qtopia4app/app.pro b/languages/cpp/app_templates/qtopia4app/app.pro new file mode 100644 index 00000000..05a0bb9c --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/app.pro @@ -0,0 +1,31 @@ +qtopia_project(qtopia app) # see buildsystem.html for more project keywords +TARGET=%{APPNAMELC} +CONFIG+=qtopia_main +CONFIG+=no_singleexec +CONFIG+=no_quicklaunch +CONFIG+=no_tr + +FORMS=%{APPNAMELC}base.ui +HEADERS=%{APPNAMELC}.h +SOURCES=main.cpp %{APPNAMELC}.cpp + +desktop.files=%{APPNAMELC}.desktop +desktop.path=/apps/Applications +desktop.hint=desktop + +pics.files=pics/* +pics.path=/pics/%{APPNAMELC} +pics.hint=pics + +help.source=help +help.files=%{APPNAME}.html +help.hint=help + +INSTALLS+=desktop pics help + +pkg.name=%{APPNAME} +pkg.desc=%{APPNAME} Application +pkg.version=1.0.0-1 +pkg.maintainer=%{AUTHOR} %{EMAIL} +pkg.license=GPL +pkg.domain=window diff --git a/languages/cpp/app_templates/qtopia4app/example.cpp b/languages/cpp/app_templates/qtopia4app/example.cpp new file mode 100644 index 00000000..a35d57cb --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/example.cpp @@ -0,0 +1,40 @@ + +#include "%{APPNAMELC}.h" +#include + +%{APPNAME}Base::%{APPNAME}Base( QWidget *parent, Qt::WFlags f ) + : QWidget( parent, f ) +{ + setupUi( this ); +} + +%{APPNAME}Base::~%{APPNAME}Base() +{ +} + +/* + * Constructs a %{APPNAME} which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +%{APPNAME}::%{APPNAME}( QWidget *parent, Qt::WFlags f ) + : %{APPNAME}Base( parent, f ) +{ + connect(quit, SIGNAL(clicked()), this, SLOT(goodBye())); +} + +/* + * Destroys the object and frees any allocated resources + */ +%{APPNAME}::~%{APPNAME}() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * A simple slot... not very interesting. + */ +void %{APPNAME}::goodBye() +{ + close(); +} + diff --git a/languages/cpp/app_templates/qtopia4app/example.desktop b/languages/cpp/app_templates/qtopia4app/example.desktop new file mode 100644 index 00000000..f6f04194 --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/example.desktop @@ -0,0 +1,37 @@ +[Desktop Entry] +Comment=An %{APPNAME} Program +Comment[ca]=Un programa per a %{APPNAME} +Comment[da]=Et %{APPNAME} program +Comment[de]=Ein %{APPNAME}-Program +Comment[el]=Ένα πρόγραμμα %{APPNAME} +Comment[es]=Un programa %{APPNAME} +Comment[et]=%{APPNAME} programm +Comment[eu]=%{APPNAME} programa bat +Comment[fa]=برنامۀ %{APPNAME} +Comment[fr]=Un programme %{APPNAME} +Comment[ga]=Clár %{APPNAME} +Comment[gl]=Un programa %{APPNAME} +Comment[hu]=%{APPNAME} program +Comment[it]=Un programma per %{APPNAME} +Comment[ja]=%{APPNAME} プログラム +Comment[nds]=En %{APPNAME}-Programm +Comment[ne]= %{APPNAME} कार्यक्रम +Comment[nl]=Een %{APPNAME} programma +Comment[pl]=Program %{APPNAME} +Comment[pt]=Um Programa %{APPNAME} +Comment[pt_BR]=Um Programa %{APPNAME} +Comment[ru]=Программа %{APPNAME} +Comment[sk]=%{APPNAME} program +Comment[sl]=Program %{APPNAME} +Comment[sr]=%{APPNAME} програм +Comment[sr@Latn]=%{APPNAME} program +Comment[sv]=Ett %{APPNAME}-program +Comment[ta]=ஒரு %{APPNAME} நிரல் +Comment[tg]=Барномаи %{APPNAME} +Comment[tr]=Bir %{APPNAME} Programı +Comment[zh_CN]=一个 %{APPNAME} 程序 +Comment[zh_TW]=一個 %{APPNAME} 程式 +Exec=%{APPNAMELC} +Icon=%{APPNAME} +Type=Application +Name=%{APPNAME} diff --git a/languages/cpp/app_templates/qtopia4app/example.h b/languages/cpp/app_templates/qtopia4app/example.h new file mode 100644 index 00000000..7d58c7d8 --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/example.h @@ -0,0 +1,24 @@ + +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H +#include "ui_%{APPNAMELC}base.h" + +class %{APPNAME}Base : public QWidget, public Ui_%{APPNAME}Base +{ +public: + %{APPNAME}Base( QWidget *parent = 0, Qt::WFlags f = 0 ); + virtual ~%{APPNAME}Base(); +}; + +class %{APPNAME} : public %{APPNAME}Base +{ + Q_OBJECT +public: + %{APPNAME}( QWidget *parent = 0, Qt::WFlags f = 0 ); + virtual ~%{APPNAME}(); + +private slots: + void goodBye(); +}; + +#endif // %{APPNAMEUC}_H diff --git a/languages/cpp/app_templates/qtopia4app/example.html b/languages/cpp/app_templates/qtopia4app/example.html new file mode 100644 index 00000000..279a6106 --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/example.html @@ -0,0 +1,15 @@ + +

%{APPNAME}

+ +

This is the help for the %{APPNAME} program. + +

To user this application: + +

    +
  1. Press the icon in the Qtopia launcher. +
  2. Read the label. +
  3. Press the button. +
  4. Read the source code provided. +
+ +Now you know how to make a Qtopia application! diff --git a/languages/cpp/app_templates/qtopia4app/examplebase.ui b/languages/cpp/app_templates/qtopia4app/examplebase.ui new file mode 100644 index 00000000..17d6bc20 --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/examplebase.ui @@ -0,0 +1,44 @@ + + + + + %{APPNAME}Base + + + + 0 + 0 + 196 + 245 + + + + %{APPNAME} + + + + 11 + + + 6 + + + + + This is just an %{APPNAME}. It doesn't do anything interesting at all. + + + true + + + + + + + Quit + + + + + + diff --git a/languages/cpp/app_templates/qtopia4app/main.cpp b/languages/cpp/app_templates/qtopia4app/main.cpp new file mode 100644 index 00000000..43dbb4ac --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/main.cpp @@ -0,0 +1,7 @@ + +#include "%{APPNAMELC}.h" +#include + +QTOPIA_ADD_APPLICATION("%{APPNAMELC}", %{APPNAME}) +QTOPIA_MAIN + diff --git a/languages/cpp/app_templates/qtopia4app/qtopia4app.kdevtemplate b/languages/cpp/app_templates/qtopia4app/qtopia4app.kdevtemplate new file mode 100644 index 00000000..298407f5 --- /dev/null +++ b/languages/cpp/app_templates/qtopia4app/qtopia4app.kdevtemplate @@ -0,0 +1,193 @@ +# KDE Config File +[General] +Name=Qtopia 4 Application +Name[ca]=Aplicació per a Qtopia 4 +Name[da]=Qtopia4-program +Name[de]=Qtopia 4-Anwendung +Name[el]=Εφαρμογή Qtopia 4 +Name[es]=Aplicación para Qtopia 4 +Name[et]=Qtopia 4 rakendus +Name[hu]=Qtopia 4-alapú alkalmazás +Name[it]=Applicazione Qtopia 4 +Name[nds]=Qtopia 4-Programm +Name[nl]=Qtopia4-programma +Name[pl]=Program wykorzystujący Qtopię 4 +Name[pt]=Aplicação do Qtopia 4 +Name[pt_BR]=Aplicação do Qtopia 4 +Name[ru]=Приложение Qtopia 4 +Name[sk]=Qtopia 4 aplikácia +Name[sr]=Qtopia 4 програм +Name[sr@Latn]=Qtopia 4 program +Name[sv]=Qtopia 4-program +Name[zh_TW]=Qtopia 4 應用程式 +Icon=qmakeapp4.png +Category=C++/Embedded +Comment=Generate a Qmake/Qt based application for Qtopia 4.x +Comment[ca]=Genera una aplicació basada en Qmake/Qt per a Qtopia 4.x +Comment[da]=Genererer et QMake-/Qt-baseret program til Qtopia 4.x +Comment[de]=Erstellt eine auf QMake/Qt basierende Anwendung für Qtopia 4.x +Comment[el]=Δημιουργία μιας εφαρμογής βασισμένης στο Qmake/Qt για το Qtopia 4.x +Comment[es]=Genera una aplicación basada en Qmake/Qt para Qtopia 4.x +Comment[et]=Qtopia 4.x rakenduse loomine QMake'i/Qt põhjal +Comment[hu]=Létrehoz egy QMake/Qt-alapú alkalmazást a Qtopia 4.x rendszerhez +Comment[it]=Genera un'applicazione basata su QMake/Qt per Qtopia 4.x +Comment[nds]=Stellt en op QMake/Qt opbuut Programm för Qtopia 4.x op +Comment[nl]=Genereer een Qmake/Qt-gebaseerd programma voor Qtopia 4.x +Comment[pl]=Generuje program wykorzystujący QMake/Qt dla Qtopii 4.x +Comment[pt]=Gera uma aplicação, baseada no QMake/Qt, para o Qtopia 4.x +Comment[pt_BR]=Gera uma aplicação, baseada no QMake/Qt, para o Qtopia 4.x +Comment[ru]=Создание приложения Qt, использующего QMake, для Qtopia 4.x +Comment[sk]=Vygeneruje aplikáciu založenú na QMake/Qt pre Qtopia 4.x +Comment[sr]=Прави програм за Qtopia-у 4.x на основу QMake-а/Qt-а +Comment[sr@Latn]=Pravi program za Qtopia-u 4.x na osnovu QMake-a/Qt-a +Comment[sv]=Skapa ett Qmake/Qt-baserat program för Qtopia 4.x +Comment[zh_TW]=產生一個以 Qmake/Qt 為基礎的 Qtopia 4.x 應用程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp +Archive=qtopia4app.tar.gz + +[MkDir0] +Type=mkdir +Dir=%{dest}/help + +[MkDir1] +Type=mkdir +Dir=%{dest}/help/html + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/Example.png +Dest=%{dest}/%{APPNAME}.png +Process=false + +[FILE3] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[FILE4] +Type=install +Source=%{src}/example.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/example.h +Dest=%{dest}/%{APPNAMELC}.h + +[FILE6] +Type=install +EscapeXML=true +Source=%{src}/examplebase.ui +Dest=%{dest}/%{APPNAMELC}base.ui + +[FILE7] +Type=install +Source=%{src}/example.desktop +Dest=%{dest}/%{APPNAMELC}.desktop + +[FILE8] +Type=install +EscapeXML=true +Source=%{src}/example.html +Dest=%{dest}/%{APPNAMELC}.html + +[FILE9] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/main.cpp + +[MSG] +Type=message +Comment=A Qtopia application was created in %{dest} +Comment[ca]=Una aplicació basada en Qtopia ha estat creada en %{dest} +Comment[da]=Et Qtopia program blev oprettet i %{dest} +Comment[de]=Eine Qtopia-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή Qtopia δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación para Qtopia ha sido creada en %{dest} +Comment[et]=Qtopia rakendus loodi asukohta %{dest} +Comment[eu]=Qtopia aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد Qtopia در %{dest} ایجاد شد +Comment[fr]=Une application Qtopia a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár Qtopia i %{dest} +Comment[gl]=Creouse unha aplicación Qtopia en %{dest} +Comment[hu]=Létrejött egy Qtopia-alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione Qtopia in %{dest} +Comment[ja]=Qtopia アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Qtopia-Programm opstellt +Comment[ne]=Qtopia अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een Qtopia-toepassing is aangemaakt in %{dest} +Comment[pl]=Program wykorzystujący Qtopię został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do Qtopia em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do Qtopia em %{dest} +Comment[ru]=Приложение Qtopia создано в %{dest} +Comment[sk]=Qtopia aplikácia bola vytvorená v %{dest} +Comment[sr]=Qtopia програм је направљен у %{dest} +Comment[sr@Latn]=Qtopia program je napravljen u %{dest} +Comment[sv]=Ett Qtopia-program skapades i %{dest} +Comment[tr]=Bir Qtopia uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 创建了 Qtopia 应用程序 +Comment[zh_TW]=一個 Qtopia 應用程式已建立於 %{dest} + +[QMAKE] +Type=value +ValueType=QString +Value=QMAKE +Comment=Absolute Path for QMake (Qt4). +Comment[ca]=Ruta absoluta per a QMake (Qt4). +Comment[da]=Absolut søgesti til QMake (Qt4). +Comment[de]=Absoluter Pfad für QMake (Qt4). +Comment[el]=Απόλυτη διαδρομή για το QMake (Qt4). +Comment[es]=Ruta completa para QMake (Qt4). +Comment[et]=QMake (Qt4) absoluutne asukoht. +Comment[fr]=Chemin absolu pour QMake (Qt4). +Comment[hu]=A QMake (Qt4) teljes elérési útja. +Comment[it]=Percorso assoluto per QMake (Qt4). +Comment[ja]=QMake (Qt4) の絶対パス +Comment[nds]=Afsluut Padd för QMake (Qt4) +Comment[nl]=Absoluut pad naar QMake (Qt4). +Comment[pl]=Ścieżka bezwzględna do QMake (Qt4). +Comment[pt]=Localização Absoluta do QMake (Qt4). +Comment[pt_BR]=Localização Absoluta do QMake (Qt4). +Comment[ru]=Полный путь к QMake (Qt 4). +Comment[sk]=Absolútna cesta ku QMake (Qt4). +Comment[sr]=Апсолутна путања до QMake-а (Qt4). +Comment[sr@Latn]=Apsolutna putanja do QMake-a (Qt4). +Comment[sv]=Absolut sökväg till QMake (Qt4). +Comment[zh_TW]=QMake(Qt4)的絕對路徑 +Default=/opt/Qtopia/SDK/4.2.4/x86/bin/qtopiamake +[DESIGNER] +Type=value +ValueType=QString +Value=DESIGNER +Comment=Absolute Path for Designer (Qt4). +Comment[ca]=Ruta absoluta per a Designer (Qt4). +Comment[da]=Absolut søgesti til Designer (Qt4). +Comment[de]=Absoluter Pfad für Designer (Qt4). +Comment[el]=Απόλυτη διαδρομή για τον Σχεδιαστή (Qt4). +Comment[es]=Ruta completa para Designer (Qt4). +Comment[et]=Disaineri (Qt4) absoluutne asukoht. +Comment[fr]=Chemin absolu pour Designer (Qt4). +Comment[hu]=A Designer (Qt4) teljes elérési útja +Comment[it]=Percorso assoluto del Designer (Qt4). +Comment[ja]=Designer (Qt4) の絶対パス +Comment[nds]=Afsluut Padd för Designer (Qt4) +Comment[nl]=Absoluut pad naar Designer (Qt4). +Comment[pl]=Ścieżka bezwzględna do Designera (Qt4). +Comment[pt]=Localização Absoluta do Designer (Qt4). +Comment[pt_BR]=Localização Absoluta do Designer (Qt4). +Comment[ru]=Полный путь к Designer (Qt 4). +Comment[sk]=Absolútna cesta ku Designer (Qt4). +Comment[sr]=Апсолутна путања до Designer-а (Qt4). +Comment[sr@Latn]=Apsolutna putanja do Designer-a (Qt4). +Comment[sv]=Absolut sökväg till Designer (Qt4). +Comment[zh_TW]=設計家(Qt4)的絕對路徑 +Default=/opt/Qtopia/SDK/4.2.4/x86/bin/designer + + diff --git a/languages/cpp/app_templates/qtopia4app/qtopia4app.png b/languages/cpp/app_templates/qtopia4app/qtopia4app.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/qtopia4app/qtopia4app.png differ diff --git a/languages/cpp/app_templates/qtopiaapp/.kdev_ignore b/languages/cpp/app_templates/qtopiaapp/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/qtopiaapp/Example.png b/languages/cpp/app_templates/qtopiaapp/Example.png new file mode 100644 index 00000000..f63d0bc7 Binary files /dev/null and b/languages/cpp/app_templates/qtopiaapp/Example.png differ diff --git a/languages/cpp/app_templates/qtopiaapp/Makefile.am b/languages/cpp/app_templates/qtopiaapp/Makefile.am new file mode 100644 index 00000000..c250d5fa --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = Example.png app.kdevelop example.control example.desktop \ + example.html main.cpp Makefile.am app.pro example.cpp \ + example.h examplebase.ui qtopiaapp + +templateName = qtopiaapp + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/qtopiaapp/app.kdevelop b/languages/cpp/app_templates/qtopiaapp/app.kdevelop new file mode 100644 index 00000000..9db37db3 --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/app.kdevelop @@ -0,0 +1,131 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTMakeProject + C++ + + Qt + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + wxwidgets_bugs + + + KDE Libraries (Doxygen) + + + + + libtool + + + true + false + false + + + false + true + + + + + + + + ./%{APPNAMELC} + -qws + + + + + + + + + + + + + false + false + + + + false + + + .h + .cpp + true + + + + true + 2 + + + -f + + -dP + + -f + -u3 -p + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/qtopiaapp/app.pro b/languages/cpp/app_templates/qtopiaapp/app.pro new file mode 100644 index 00000000..c625020d --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/app.pro @@ -0,0 +1,10 @@ +TEMPLATE = app +CONFIG = qt warn_on release +HEADERS = %{APPNAMELC}.h +SOURCES = main.cpp %{APPNAMELC}.cpp +INTERFACES = %{APPNAMELC}base.ui +TARGET = %{APPNAMELC} +INCLUDEPATH += $(QPEDIR)/include +DEPENDPATH += $(QPEDIR)/include +LIBS += -lqpe + diff --git a/languages/cpp/app_templates/qtopiaapp/example.control b/languages/cpp/app_templates/qtopiaapp/example.control new file mode 100644 index 00000000..d04f87ec --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/example.control @@ -0,0 +1,11 @@ +Files: bin/%{APPNAMELC} apps/Applications/%{APPNAMELC}.desktop pics/%{APPNAME}.png help/html/%{APPNAMELC}.html +Priority: optional +Section: qpe/applications +Maintainer: Your Name +Architecture: $CPU_ARCH +Arch: $DEVICE_ARCH +Version: 1.0.0 +License: Public Domain +Description: %{APPNAME} program + An %{APPNAMELC} program for the Qtopia environment. + Does nothing interesting. diff --git a/languages/cpp/app_templates/qtopiaapp/example.cpp b/languages/cpp/app_templates/qtopiaapp/example.cpp new file mode 100644 index 00000000..939f708e --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/example.cpp @@ -0,0 +1,29 @@ + +#include "%{APPNAMELC}.h" +#include + +/* + * Constructs a %{APPNAME} which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +%{APPNAME}::%{APPNAME}( QWidget* parent, const char* name, WFlags fl ) + : %{APPNAME}Base( parent, name, fl ) +{ + connect(quit, SIGNAL(clicked()), this, SLOT(goodBye())); +} + +/* + * Destroys the object and frees any allocated resources + */ +%{APPNAME}::~%{APPNAME}() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * A simple slot... not very interesting. + */ +void %{APPNAME}::goodBye() +{ + close(); +} diff --git a/languages/cpp/app_templates/qtopiaapp/example.desktop b/languages/cpp/app_templates/qtopiaapp/example.desktop new file mode 100644 index 00000000..f6f04194 --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/example.desktop @@ -0,0 +1,37 @@ +[Desktop Entry] +Comment=An %{APPNAME} Program +Comment[ca]=Un programa per a %{APPNAME} +Comment[da]=Et %{APPNAME} program +Comment[de]=Ein %{APPNAME}-Program +Comment[el]=Ένα πρόγραμμα %{APPNAME} +Comment[es]=Un programa %{APPNAME} +Comment[et]=%{APPNAME} programm +Comment[eu]=%{APPNAME} programa bat +Comment[fa]=برنامۀ %{APPNAME} +Comment[fr]=Un programme %{APPNAME} +Comment[ga]=Clár %{APPNAME} +Comment[gl]=Un programa %{APPNAME} +Comment[hu]=%{APPNAME} program +Comment[it]=Un programma per %{APPNAME} +Comment[ja]=%{APPNAME} プログラム +Comment[nds]=En %{APPNAME}-Programm +Comment[ne]= %{APPNAME} कार्यक्रम +Comment[nl]=Een %{APPNAME} programma +Comment[pl]=Program %{APPNAME} +Comment[pt]=Um Programa %{APPNAME} +Comment[pt_BR]=Um Programa %{APPNAME} +Comment[ru]=Программа %{APPNAME} +Comment[sk]=%{APPNAME} program +Comment[sl]=Program %{APPNAME} +Comment[sr]=%{APPNAME} програм +Comment[sr@Latn]=%{APPNAME} program +Comment[sv]=Ett %{APPNAME}-program +Comment[ta]=ஒரு %{APPNAME} நிரல் +Comment[tg]=Барномаи %{APPNAME} +Comment[tr]=Bir %{APPNAME} Programı +Comment[zh_CN]=一个 %{APPNAME} 程序 +Comment[zh_TW]=一個 %{APPNAME} 程式 +Exec=%{APPNAMELC} +Icon=%{APPNAME} +Type=Application +Name=%{APPNAME} diff --git a/languages/cpp/app_templates/qtopiaapp/example.h b/languages/cpp/app_templates/qtopiaapp/example.h new file mode 100644 index 00000000..883cb27d --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/example.h @@ -0,0 +1,18 @@ + +#ifndef %{APPNAMEUC}_H +#define %{APPNAMEUC}_H +#include "%{APPNAMELC}base.h" + +class %{APPNAME} : public %{APPNAME}Base +{ + Q_OBJECT + +public: + %{APPNAME}( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~%{APPNAME}(); + +private slots: + void goodBye(); +}; + +#endif // %{APPNAMEUC}_H diff --git a/languages/cpp/app_templates/qtopiaapp/example.html b/languages/cpp/app_templates/qtopiaapp/example.html new file mode 100644 index 00000000..279a6106 --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/example.html @@ -0,0 +1,15 @@ + +

%{APPNAME}

+ +

This is the help for the %{APPNAME} program. + +

To user this application: + +

    +
  1. Press the icon in the Qtopia launcher. +
  2. Read the label. +
  3. Press the button. +
  4. Read the source code provided. +
+ +Now you know how to make a Qtopia application! diff --git a/languages/cpp/app_templates/qtopiaapp/examplebase.ui b/languages/cpp/app_templates/qtopiaapp/examplebase.ui new file mode 100644 index 00000000..b6b81b11 --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/examplebase.ui @@ -0,0 +1,49 @@ + +%{APPNAME}Base + + QWidget + + name + %{APPNAME}Base + + + geometry + + 0 + 0 + 196 + 245 + + + + caption + %{APPNAME} + + + + + QLabel + + name + TextLabel1 + + + text + <p>This is just an <i>%{APPNAMELC}</i>; it does not do anything interesting at all. + + + + QPushButton + + name + quit + + + text + Quit + + + + + + diff --git a/languages/cpp/app_templates/qtopiaapp/main.cpp b/languages/cpp/app_templates/qtopiaapp/main.cpp new file mode 100644 index 00000000..0311a32e --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/main.cpp @@ -0,0 +1,13 @@ + +#include "%{APPNAMELC}.h" +#include + +int main( int argc, char ** argv ) +{ + QPEApplication a( argc, argv ); + + %{APPNAME} mw; + a.showMainWidget( &mw ); + + return a.exec(); +} diff --git a/languages/cpp/app_templates/qtopiaapp/qtopiaapp b/languages/cpp/app_templates/qtopiaapp/qtopiaapp new file mode 100644 index 00000000..e07d8627 --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/qtopiaapp @@ -0,0 +1,11 @@ +# TMake application +[General] +Name=Qtopia Application +Name[fr]=Une Application Qtopia +Icon=qmakeapp.png +Category=C++/Embedded +Category[fr]=C++/Environnement embarqu +Comment=Generate a TMake/Qt based application for Qtopia 1.x +Comment[fr]=Gnre une application base sur Qt / TMake pour l'environnement Qtopia 1.x. +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=APPNAMELC.cpp diff --git a/languages/cpp/app_templates/qtopiaapp/qtopiaapp.kdevtemplate b/languages/cpp/app_templates/qtopiaapp/qtopiaapp.kdevtemplate new file mode 100644 index 00000000..45479b04 --- /dev/null +++ b/languages/cpp/app_templates/qtopiaapp/qtopiaapp.kdevtemplate @@ -0,0 +1,153 @@ +# KDE Config File +[General] +Name=Qtopia Application +Name[ca]=Aplicació per a Qtopia +Name[da]=Qtopia-program +Name[de]=Qtopia-Anwendung +Name[el]=Εφαρμογή Qtopia +Name[es]=Aplicación para Qtopia +Name[et]=Qtopia rakendus +Name[eu]=Qtopia aplikazioa +Name[fa]=کاربرد Qtopia +Name[fr]=Application Qtopia +Name[ga]=Feidhmchlár Qtopia +Name[gl]=Aplicación Qtopia +Name[hu]=Qtopia-alkalmazás +Name[it]=Applicazione Qtopia +Name[ja]=Qtopia アプリケーション +Name[nds]=Qtopia-Programm +Name[ne]=Qtopia अनुप्रयोग +Name[nl]=Qtopia-toepassing +Name[pl]=Program wykorzystujący Qtopię +Name[pt]=Aplicação do Qtopia +Name[pt_BR]=Aplicação do Qtopia +Name[ru]=Приложение Qtopia +Name[sk]=Qtopia aplikácia +Name[sl]=Program za Qtopio +Name[sr]=Qtopia програм +Name[sr@Latn]=Qtopia program +Name[sv]=Qtopia-program +Name[tr]=Qtopia Uygulaması +Name[zh_CN]=Qtopia 应用程序 +Name[zh_TW]=Qtopia 應用程式 +Icon=qmakeapp.png +Category=C++/Embedded +Category[fr]=C++/Environnement embarqu +Comment=Generate a TMake/Qt based application for Qtopia 1.x +Comment[ca]=Genera una aplicació basada en TMake/Qt per a Qtopia 1.x +Comment[da]=Generér et TMake/Qt baseret program for Qtopia 1.x +Comment[de]=Erstellt eine auf TMake/Qt basierende Anwendung für Qtopia 1.x +Comment[el]=Δημιουργία μιας εφαρμογής βασισμένης στα TMake/Qt για το Qtopia 1.x +Comment[es]=Genera una aplicación basada en TMake/Qt para Qtopia 1.x +Comment[et]=Qtopia 1.x rakenduse loomine TMake'i/Qt põhjal +Comment[eu]= Sortu TMake/Qt software-ean oinarritutako Qtopia 1.x aplikazio bat +Comment[fa]=یک کاربرد بر مبنای TMake/Qt برای Qtopia 1.x تولید می‌کند +Comment[fr]=Génère une application basée sur TMake / Qt pour Qtopia 1.x +Comment[ga]=Cruthaigh feidhmchlár bunaithe ar TMake/Qt le haghaidh Qtopia 1.x +Comment[gl]=Xera unha aplicación baseada en TMake/Qt para Qtopia 1.x +Comment[hu]=Létrehoz egy TMake/Qt-alapú alkalmazást a Qtopia 1.x rendszerhez +Comment[it]=Genera un'applicazione basata su TMake/Qt per Qtopia 1.x +Comment[ja]=Qtopia 1.x 用の TMake/Qt ベースのアプリケーションを作成 +Comment[nds]=Stellt en op TMake/Qt opbuut Programm för Qtopia 1.x op +Comment[ne]= Qtopia 1.x का लागि TMake/Qt आधारित अनुप्रयोग उत्पन्न गर्नुहोस् +Comment[nl]=Genereert een Tmake/Qt-gebaseerde toepassing voor Qtopie 1.x +Comment[pl]=Generuje program wykorzystujący TMake i Qt dla Qtopii 1.x +Comment[pt]=Gera uma aplicação, baseada no TMake/Qt, para o Qtopia 1.x +Comment[pt_BR]=Gera uma aplicação, baseada no TMake/Qt, para o Qtopia 1.x +Comment[ru]=Создание приложения Qt со сборкой посредством TMake для Qtopia 1.x +Comment[sk]=Vygeneruje aplikáciu založenú na TMake/Qt pre Qtopia 1.x +Comment[sr]=Прави програм за Qtopia-у 1.x на основуTMake-а/Qt-а +Comment[sr@Latn]=Pravi program za Qtopia-u 1.x na osnovuTMake-a/Qt-a +Comment[sv]=Skapa ett TMake/Qt-baserat program för Qtopia 1.x +Comment[tr]=Qtopia 1.x için TMake/Qt tabanlı bir uygulama yarat +Comment[zh_CN]=生成适用于 Qtopia 1.x 基于 TMake/Qt 的应用程序 +Comment[zh_TW]=產生一個 Qtopia 1.x 的 TMake/Qt 應用程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp +Archive=qtopiaapp.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/Example.png +Dest=%{dest}/%{APPNAME}.png +Process=false + +[FILE3] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[FILE4] +Type=install +Source=%{src}/example.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/example.h +Dest=%{dest}/%{APPNAMELC}.h + +[FILE6] +Type=install +EscapeXML=true +Source=%{src}/examplebase.ui +Dest=%{dest}/%{APPNAMELC}base.ui + +[FILE7] +Type=install +Source=%{src}/example.control +Dest=%{dest}/%{APPNAMELC}.control + +[FILE8] +Type=install +Source=%{src}/example.desktop +Dest=%{dest}/%{APPNAMELC}.desktop + +[FILE9] +Type=install +EscapeXML=true +Source=%{src}/example.html +Dest=%{dest}/%{APPNAMELC}.html + +[FILE10] +Type=install +Source=%{src}/main.cpp +Dest=%{dest}/main.cpp + +[MSG] +Type=message +Comment=A Qtopia application was created in %{dest} +Comment[ca]=Una aplicació basada en Qtopia ha estat creada en %{dest} +Comment[da]=Et Qtopia program blev oprettet i %{dest} +Comment[de]=Eine Qtopia-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια εφαρμογή Qtopia δημιουργήθηκε στο %{dest} +Comment[es]=Una aplicación para Qtopia ha sido creada en %{dest} +Comment[et]=Qtopia rakendus loodi asukohta %{dest} +Comment[eu]=Qtopia aplikazio bat sortu da hemen: %{dest} +Comment[fa]=یک کاربرد Qtopia در %{dest} ایجاد شد +Comment[fr]=Une application Qtopia a été créée dans %{dest} +Comment[ga]=Cruthaíodh feidhmchlár Qtopia i %{dest} +Comment[gl]=Creouse unha aplicación Qtopia en %{dest} +Comment[hu]=Létrejött egy Qtopia-alkalmazás itt: %{dest} +Comment[it]=È stata creata un'applicazione Qtopia in %{dest} +Comment[ja]=Qtopia アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Qtopia-Programm opstellt +Comment[ne]=Qtopia अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Een Qtopia-toepassing is aangemaakt in %{dest} +Comment[pl]=Program wykorzystujący Qtopię został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação do Qtopia em %{dest} +Comment[pt_BR]=Foi criada uma aplicação do Qtopia em %{dest} +Comment[ru]=Приложение Qtopia создано в %{dest} +Comment[sk]=Qtopia aplikácia bola vytvorená v %{dest} +Comment[sr]=Qtopia програм је направљен у %{dest} +Comment[sr@Latn]=Qtopia program je napravljen u %{dest} +Comment[sv]=Ett Qtopia-program skapades i %{dest} +Comment[tr]=Bir Qtopia uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 创建了 Qtopia 应用程序 +Comment[zh_TW]=一個 Qtopia 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/qtopiaapp/qtopiaapp.png b/languages/cpp/app_templates/qtopiaapp/qtopiaapp.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/qtopiaapp/qtopiaapp.png differ diff --git a/languages/cpp/app_templates/win32gui/.kdev_ignore b/languages/cpp/app_templates/win32gui/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/win32gui/Makefile.am b/languages/cpp/app_templates/win32gui/Makefile.am new file mode 100644 index 00000000..66931bfd --- /dev/null +++ b/languages/cpp/app_templates/win32gui/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = app.cpp src-Makefile.am win32gui-Makefile.am win32gui-Makefile.cvs \ + win32gui-configure.in win32gui.png app.kdevelop + +templateName = win32gui + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/win32gui/app.cpp b/languages/cpp/app_templates/win32gui/app.cpp new file mode 100644 index 00000000..a875b28b --- /dev/null +++ b/languages/cpp/app_templates/win32gui/app.cpp @@ -0,0 +1,12 @@ +#ifdef HAVE_CONFIG_H +#include +#endif +#include + +int STDCALL +WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) +{ + MessageBox (NULL, "Hello, Windows!", "Hello", MB_OK); + return 0; +} + diff --git a/languages/cpp/app_templates/win32gui/app.kdevelop b/languages/cpp/app_templates/win32gui/app.kdevelop new file mode 100644 index 00000000..f9dc8145 --- /dev/null +++ b/languages/cpp/app_templates/win32gui/app.kdevelop @@ -0,0 +1,192 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + + . + false + + + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC}.exe + false + executable + / + + true + + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + + + + + + + + + + + + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + + + + + + + + + + kdevgccoptions + kdevgppoptions + kdevpgf77options + + + + + + + + + + + + + + true + 1 + false + + 0 + + + + + clanlib + opengl + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + + + + false + false + + + *.o,*.lo,CVS + false + + + + + .h + .cpp + + + + + true + true + true + false + true + true + true + 250 + 400 + 250 + + + Qt + KDElibs + ksjembed + + + + + + + + + + + true + false + false + + + false + true + 10 + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/win32gui/src-Makefile.am b/languages/cpp/app_templates/win32gui/src-Makefile.am new file mode 100644 index 00000000..21f6d7c8 --- /dev/null +++ b/languages/cpp/app_templates/win32gui/src-Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp + +# set the include path found by configure +INCLUDES= $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = -mwindows $(all_libraries) diff --git a/languages/cpp/app_templates/win32gui/win32gui-Makefile.am b/languages/cpp/app_templates/win32gui/win32gui-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/cpp/app_templates/win32gui/win32gui-Makefile.am @@ -0,0 +1,5 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +SUBDIRS = src diff --git a/languages/cpp/app_templates/win32gui/win32gui-Makefile.cvs b/languages/cpp/app_templates/win32gui/win32gui-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/cpp/app_templates/win32gui/win32gui-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/cpp/app_templates/win32gui/win32gui-configure.in b/languages/cpp/app_templates/win32gui/win32gui-configure.in new file mode 100644 index 00000000..612ce0d5 --- /dev/null +++ b/languages/cpp/app_templates/win32gui/win32gui-configure.in @@ -0,0 +1,10 @@ +AC_INIT(configure.in) + +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) + +AC_LANG_CPLUSPLUS +AC_PROG_CXX +AM_PROG_LIBTOOL + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/cpp/app_templates/win32gui/win32gui.kdevtemplate b/languages/cpp/app_templates/win32gui/win32gui.kdevtemplate new file mode 100644 index 00000000..0a600294 --- /dev/null +++ b/languages/cpp/app_templates/win32gui/win32gui.kdevtemplate @@ -0,0 +1,137 @@ +# KDE Config File +[General] +Name=Simple Win32 GUI App. +Name[ca]=Simple aplicació per a Win32. +Name[da]=Simpelt Win32 GUI-program. +Name[de]=Einfache Win32-GUI-Anwendung +Name[el]=Απλή εφαρμογή γραφικού περιβάλλοντος Win32. +Name[es]=Aplicación sencilla para Win32 +Name[et]=Lihtne Win32 graafilise kasutajaliidese rakendus +Name[eu]=Win32 GUI aplikazio sinplea. +Name[fa]=کاربرد سادۀ ونک Win32 +Name[fr]=Interface graphique Win32 simple. +Name[ga]=Feidhmchlár Simplí Win32 le Comhéadan Grafach +Name[gl]=Aplicación sinxela Win32. +Name[hu]=Egyszerű Win32-alapú, grafikus felületű alkalmazás +Name[it]=Semplice applicazione GUI Win32. +Name[ja]=簡単な Win32 GUI アプリケーション +Name[nds]=Eenfach Win32-Böversietprogramm. +Name[ne]=साधारण Win32 GUI अनुप्रयोग +Name[nl]=Eenvoudige Win32 GUI-toepassing +Name[pl]=Prosty program Win32 +Name[pt]=Aplicação gráfica simples em Win32. +Name[pt_BR]=Aplicação gráfica simples em Win32. +Name[ru]=Простое графическое приложение Windows +Name[sk]=Jednoduchá Win32 GUI aplikácia +Name[sr]=Једноставан Win32 програм са GUI-јем. +Name[sr@Latn]=Jednostavan Win32 program sa GUI-jem. +Name[sv]=Enkelt Win32-program med grafiskt gränssnitt +Name[tr]=Basit Win32 Grafik Arayüz Uygulaması +Name[zh_CN]=简单的 Win32 GUI 应用程序 +Name[zh_TW]=簡單的 Win32 使用者介面應用程式 +Icon=win32gui.png +Category=C++ +Comment=Generates a shell project for crosscompiling Win32 projects. +Comment[ca]=Genera un projecte d'intèrpret de comandaments per a la compilació multi plataforma de projectes per a Win32. +Comment[da]=Genererer et skalprojekt for krydskompilering af Win32-projekter. +Comment[de]=Erstellt ein Shell-Projekt für plattformunabhängige Win32-Projekte. +Comment[el]=Δημιουργία ενός έργου κελύφους για μεταγλώττιση έργων Win32 σε διαφορετικές πλατφόρμες. +Comment[es]=Genera un proyecto de intérprete de órdenes para compilación multiplataforma de proyectos Win32. +Comment[et]=Shelliprojekti loomine Win32 projektide kompileerimiseks. +Comment[eu]=Win32 proiektuak konpilazio gurutzaturako shell proiektu bat sortzen du. +Comment[fa]=یک پروژۀ پوسته برای پروژه‌های Win32 ترجمۀ بین سکویی تولید می‌کند. +Comment[fr]=Génère un projet shell pour la compilation croisée de projets Win32. +Comment[gl]=Xera un proxecto shell para a compilación cruzada de proxectos Win32. +Comment[hu]=Létrehoz egy konzolos projektet Win32-projektek keresztfordításához. +Comment[it]=Genera un progetto di shell per progetti Win32 multi compilanti. +Comment[nds]=Stellt en Konsoolprojekt för't Krüüzkompileren vun Win32-Projekten op. +Comment[ne]=क्रसकम्पाइलिङ Win32 परियोजनाका लागि शेल परियोजना उत्पन्न गर्दछ +Comment[nl]=Genereert een shellproject voor crosscompilerende Win32-projecten. +Comment[pl]=Generuje powłokę do kompilacji projektów dla Win32. +Comment[pt]=Gera um projecto para poder compilar projectos em Win32. +Comment[pt_BR]=Gera um projecto para poder compilar projectos em Win32. +Comment[ru]=Создание проекта для кросс-компиляции проектов Win32. +Comment[sk]=Vygenruje shell projekt pre kompiláciu Win32 projektov. +Comment[sr]=Прави пројекат за прекопревођење Win32 пројеката. +Comment[sr@Latn]=Pravi projekat za prekoprevođenje Win32 projekata. +Comment[sv]=Skapar ett skalprojekt för korskompilering av Win32-projekt. +Comment[tr]=Win32 projelerini karşıderlemek için bir kabul projesi yarat. +Comment[zh_CN]=生成跨平台编译的 Win32 工程的外壳工程。 +Comment[zh_TW]=產生一個 shell 專案,可在 Win32 跨平台編譯。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/%{APPNAMELC}.cpp +Archive=win32gui.tar.gz + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/win32gui-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/win32gui-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE4] +Type=install +Source=%{src}/win32gui-configure.in +Dest=%{dest}/configure.in + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE6] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[MSG] +Type=message +Comment=For this project to compile and run you need both Wine and MinGW installed. +Comment[ca]=Per a compilar i executar aquest projecte us caldrà instal·lar Wine i MinGW. +Comment[da]=For at dette projekt skal kompilere og køre har du brug for at have både Wine og MinGW installeret. +Comment[de]=Um dieses Projekt kompilieren und ausführen zu können, muss sowohl Wine als auch MinGW installiert sein. +Comment[el]=Για να μεταγλωττιστεί και να εκτελεστεί αυτό το έργο χρειάζεστε τόσο το Wine όσο και το MinGW εγκατεστημένα. +Comment[es]=Para compilar y ejecutar este proyecto necesitará tener instalados Wine y MinGW. +Comment[et]=Selle projekti kompileerimiseks ja käivitamiseks peab olema paigaldatud nii Wine kui MinGW. +Comment[eu]=Proiektu hau konpilatzeko eta exekutatzeko Wine eta MinGw instalatuta izan behar dituzu. +Comment[fa]=برای ترجمه و اجرای این پروژه، هم نیاز به نصب Wine و هم نیاز به MinGW دارید. +Comment[fr]=Pour que ce projet compile et s'exécute, vous devez installer Wine et MinGW. +Comment[gl]=Para poder compilar e executar este proxecto necesita ter instalados Wine e MinGW. +Comment[hu]=A projekt lefordításához és futtatásához szükség van a Wine és a MinGW telepítésére. +Comment[it]=Per compilare ed eseguire questo progetto dei avere sia Wine che MinGW installati. +Comment[nds]=Wine un MinGW mööt installeert wesen, wenn Du dit Projekt kompileren un utföhren wullt. +Comment[ne]=यो परियोजनाका लागि कम्पाइल गर्न र चलाउन तपाईँले वाइन र MinGW स्थापना गरेको हुनुपर्दछ । +Comment[nl]=Om dit project te kunnen compileren en uitvoeren hebt u Wine en MinGW nodig. +Comment[pl]=Do kompilacji takiego projektu potrzebne są Wine oraz MinGW. +Comment[pt]=Para este projecto poder ser compilado e executado é necessário ter tanto o Wine como o MinGW instalados. +Comment[pt_BR]=Para este projecto poder ser compilado e executado é necessário ter tanto o Wine como o MinGW instalados. +Comment[ru]=Для сборки и запуска этого проекта вам необходимо установить Wine и MinGW . +Comment[sk]=Na kompiláciu tohoto projektu potrebujete mať nainštalované Wine a MinGW. +Comment[sr]=Да би се овај пројекат превео и покренуо, и Wine и MinGW морају бити инсталирани. +Comment[sr@Latn]=Da bi se ovaj projekat preveo i pokrenuo, i Wine i MinGW moraju biti instalirani. +Comment[sv]=För att projektet ska kompileras och köras behöver du ha installerat både Wine och MinGW. +Comment[tr]=Bu projenin derlenmesi için Wine ve MinGW'nin kurulu olması lazım. +Comment[zh_CN]=要让此工程能够编译并运行,您需要同时安装 Wine 和 MinGW。 +Comment[zh_TW]=這個專案要編譯,您需要安裝 Wine 與 MinGW。 + diff --git a/languages/cpp/app_templates/win32gui/win32gui.png b/languages/cpp/app_templates/win32gui/win32gui.png new file mode 100644 index 00000000..901ee474 Binary files /dev/null and b/languages/cpp/app_templates/win32gui/win32gui.png differ diff --git a/languages/cpp/app_templates/win32hello/.kdev_ignore b/languages/cpp/app_templates/win32hello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/win32hello/Makefile.am b/languages/cpp/app_templates/win32hello/Makefile.am new file mode 100644 index 00000000..d6c7dfad --- /dev/null +++ b/languages/cpp/app_templates/win32hello/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = app.cpp src-Makefile.am win32-Makefile.am win32-Makefile.cvs \ + win32-configure.in win32hello.png app.kdevelop + +templateName = win32hello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/win32hello/app.cpp b/languages/cpp/app_templates/win32hello/app.cpp new file mode 100644 index 00000000..10b02750 --- /dev/null +++ b/languages/cpp/app_templates/win32hello/app.cpp @@ -0,0 +1,16 @@ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +using namespace std; + +int main(int argc, char *argv[]) +{ + cout << "Hello, from Win32!" << endl; + + return EXIT_SUCCESS; +} diff --git a/languages/cpp/app_templates/win32hello/app.kdevelop b/languages/cpp/app_templates/win32hello/app.kdevelop new file mode 100644 index 00000000..33c1e97e --- /dev/null +++ b/languages/cpp/app_templates/win32hello/app.kdevelop @@ -0,0 +1,164 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + + . + false + + + + + + + src/%{APPNAMELC} + default + + + src/%{APPNAMELC}.exe + true + executable + / + + true + + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + + + + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + + + + + + true + 1 + false + + 0 + + + + + clanlib + opengl + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + + + + + + + + + + false + false + + + *.o,*.lo,CVS + false + + + + + .h + .cpp + + + + + true + true + true + false + true + true + true + 250 + 400 + 250 + + + Qt + KDElibs + ksjembed + + + + + + + + + + + true + false + false + + + false + true + 10 + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/win32hello/src-Makefile.am b/languages/cpp/app_templates/win32hello/src-Makefile.am new file mode 100644 index 00000000..21f6d7c8 --- /dev/null +++ b/languages/cpp/app_templates/win32hello/src-Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp + +# set the include path found by configure +INCLUDES= $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = -mwindows $(all_libraries) diff --git a/languages/cpp/app_templates/win32hello/win32-Makefile.am b/languages/cpp/app_templates/win32hello/win32-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/cpp/app_templates/win32hello/win32-Makefile.am @@ -0,0 +1,5 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +SUBDIRS = src diff --git a/languages/cpp/app_templates/win32hello/win32-Makefile.cvs b/languages/cpp/app_templates/win32hello/win32-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/cpp/app_templates/win32hello/win32-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/cpp/app_templates/win32hello/win32-configure.in b/languages/cpp/app_templates/win32hello/win32-configure.in new file mode 100644 index 00000000..612ce0d5 --- /dev/null +++ b/languages/cpp/app_templates/win32hello/win32-configure.in @@ -0,0 +1,10 @@ +AC_INIT(configure.in) + +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) + +AC_LANG_CPLUSPLUS +AC_PROG_CXX +AM_PROG_LIBTOOL + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/cpp/app_templates/win32hello/win32hello.kdevtemplate b/languages/cpp/app_templates/win32hello/win32hello.kdevtemplate new file mode 100644 index 00000000..b6fb54d2 --- /dev/null +++ b/languages/cpp/app_templates/win32hello/win32hello.kdevtemplate @@ -0,0 +1,136 @@ +# KDE Config File +[General] +Name=Simple Win32 Hello World +Name[ca]=Simple Hello World per a Win32 +Name[da]=Simpelt Win32 Goddag verden +Name[de]=Einfaches Win32-"Hello World"-Programm +Name[el]=Απλό Γεια σου Κόσμε Win32 +Name[es]=Sencillo programa «Hola mundo» para Win32 +Name[et]=Lihtne Win32 "Tere, maailm" +Name[eu]=Win32 "Kaixo mundua" aplikazio sinple bat +Name[fa]=Hello World سادۀ Win32 +Name[fr]=« Bonjour monde » Win32 simple +Name[ga]=Ríomhchlár simplí "Hello World" le haghaidh Win32 +Name[gl]=Aplicación Win32 sinxela Ola mundo +Name[hu]=Win32-alapú Hello world program +Name[it]=Semplice "Hello World" Win32 +Name[nds]=Eenfach Win32-"Moin Welt"-Programm +Name[ne]=साधारण Win32 हेल्लो वोल्ड +Name[nl]=Eenvoudige Win32 Hello World +Name[pl]=Prosty program Witaj świecie dla Win32 +Name[pt]=Olá Mundo Simples em Win32 +Name[pt_BR]=Olá Mundo Simples em Win32 +Name[ru]=Простое приложение Hello World для Windows +Name[sk]=Jenoduchý Ahoj svet Win32 program +Name[sr]=Једноставан Win32 „Здраво свете“ +Name[sr@Latn]=Jednostavan Win32 „Zdravo svete“ +Name[sv]=Enkelt Win32 Hello World +Name[tr]=Basit Win32 Merhaba Dünya +Name[zh_CN]=简单的 Win32 Hello World +Name[zh_TW]=簡單的 Win32 Hello World +Icon=win32hello.png +Category=C++ +Comment=Generates a shell project for crosscompiling Win32 projects. +Comment[ca]=Genera un projecte d'intèrpret de comandaments per a la compilació multi plataforma de projectes per a Win32. +Comment[da]=Genererer et skalprojekt for krydskompilering af Win32-projekter. +Comment[de]=Erstellt ein Shell-Projekt für plattformunabhängige Win32-Projekte. +Comment[el]=Δημιουργία ενός έργου κελύφους για μεταγλώττιση έργων Win32 σε διαφορετικές πλατφόρμες. +Comment[es]=Genera un proyecto de intérprete de órdenes para compilación multiplataforma de proyectos Win32. +Comment[et]=Shelliprojekti loomine Win32 projektide kompileerimiseks. +Comment[eu]=Win32 proiektuak konpilazio gurutzaturako shell proiektu bat sortzen du. +Comment[fa]=یک پروژۀ پوسته برای پروژه‌های Win32 ترجمۀ بین سکویی تولید می‌کند. +Comment[fr]=Génère un projet shell pour la compilation croisée de projets Win32. +Comment[gl]=Xera un proxecto shell para a compilación cruzada de proxectos Win32. +Comment[hu]=Létrehoz egy konzolos projektet Win32-projektek keresztfordításához. +Comment[it]=Genera un progetto di shell per progetti Win32 multi compilanti. +Comment[nds]=Stellt en Konsoolprojekt för't Krüüzkompileren vun Win32-Projekten op. +Comment[ne]=क्रसकम्पाइलिङ Win32 परियोजनाका लागि शेल परियोजना उत्पन्न गर्दछ +Comment[nl]=Genereert een shellproject voor crosscompilerende Win32-projecten. +Comment[pl]=Generuje powłokę do kompilacji projektów dla Win32. +Comment[pt]=Gera um projecto para poder compilar projectos em Win32. +Comment[pt_BR]=Gera um projecto para poder compilar projectos em Win32. +Comment[ru]=Создание проекта для кросс-компиляции проектов Win32. +Comment[sk]=Vygenruje shell projekt pre kompiláciu Win32 projektov. +Comment[sr]=Прави пројекат за прекопревођење Win32 пројеката. +Comment[sr@Latn]=Pravi projekat za prekoprevođenje Win32 projekata. +Comment[sv]=Skapar ett skalprojekt för korskompilering av Win32-projekt. +Comment[tr]=Win32 projelerini karşıderlemek için bir kabul projesi yarat. +Comment[zh_CN]=生成跨平台编译的 Win32 工程的外壳工程。 +Comment[zh_TW]=產生一個 shell 專案,可在 Win32 跨平台編譯。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=src/%{APPNAMELC}.cpp +Archive=win32hello.tar.gz + +[INCADMIN] +Type=include +File=%{kdevelop}/template-common/incadmin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE2] +Type=install +Source=%{src}/win32-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/win32-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE4] +Type=install +Source=%{src}/win32-configure.in +Dest=%{dest}/configure.in + +[MkDir1] +Type=mkdir +Dir=%{dest}/src + +[FILE5] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE6] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[MSG] +Type=message +Comment=For this project to compile and run you need both Wine and MinGW installed. +Comment[ca]=Per a compilar i executar aquest projecte us caldrà instal·lar Wine i MinGW. +Comment[da]=For at dette projekt skal kompilere og køre har du brug for at have både Wine og MinGW installeret. +Comment[de]=Um dieses Projekt kompilieren und ausführen zu können, muss sowohl Wine als auch MinGW installiert sein. +Comment[el]=Για να μεταγλωττιστεί και να εκτελεστεί αυτό το έργο χρειάζεστε τόσο το Wine όσο και το MinGW εγκατεστημένα. +Comment[es]=Para compilar y ejecutar este proyecto necesitará tener instalados Wine y MinGW. +Comment[et]=Selle projekti kompileerimiseks ja käivitamiseks peab olema paigaldatud nii Wine kui MinGW. +Comment[eu]=Proiektu hau konpilatzeko eta exekutatzeko Wine eta MinGw instalatuta izan behar dituzu. +Comment[fa]=برای ترجمه و اجرای این پروژه، هم نیاز به نصب Wine و هم نیاز به MinGW دارید. +Comment[fr]=Pour que ce projet compile et s'exécute, vous devez installer Wine et MinGW. +Comment[gl]=Para poder compilar e executar este proxecto necesita ter instalados Wine e MinGW. +Comment[hu]=A projekt lefordításához és futtatásához szükség van a Wine és a MinGW telepítésére. +Comment[it]=Per compilare ed eseguire questo progetto dei avere sia Wine che MinGW installati. +Comment[nds]=Wine un MinGW mööt installeert wesen, wenn Du dit Projekt kompileren un utföhren wullt. +Comment[ne]=यो परियोजनाका लागि कम्पाइल गर्न र चलाउन तपाईँले वाइन र MinGW स्थापना गरेको हुनुपर्दछ । +Comment[nl]=Om dit project te kunnen compileren en uitvoeren hebt u Wine en MinGW nodig. +Comment[pl]=Do kompilacji takiego projektu potrzebne są Wine oraz MinGW. +Comment[pt]=Para este projecto poder ser compilado e executado é necessário ter tanto o Wine como o MinGW instalados. +Comment[pt_BR]=Para este projecto poder ser compilado e executado é necessário ter tanto o Wine como o MinGW instalados. +Comment[ru]=Для сборки и запуска этого проекта вам необходимо установить Wine и MinGW . +Comment[sk]=Na kompiláciu tohoto projektu potrebujete mať nainštalované Wine a MinGW. +Comment[sr]=Да би се овај пројекат превео и покренуо, и Wine и MinGW морају бити инсталирани. +Comment[sr@Latn]=Da bi se ovaj projekat preveo i pokrenuo, i Wine i MinGW moraju biti instalirani. +Comment[sv]=För att projektet ska kompileras och köras behöver du ha installerat både Wine och MinGW. +Comment[tr]=Bu projenin derlenmesi için Wine ve MinGW'nin kurulu olması lazım. +Comment[zh_CN]=要让此工程能够编译并运行,您需要同时安装 Wine 和 MinGW。 +Comment[zh_TW]=這個專案要編譯,您需要安裝 Wine 與 MinGW。 + diff --git a/languages/cpp/app_templates/win32hello/win32hello.png b/languages/cpp/app_templates/win32hello/win32hello.png new file mode 100644 index 00000000..3f33a1b5 Binary files /dev/null and b/languages/cpp/app_templates/win32hello/win32hello.png differ diff --git a/languages/cpp/app_templates/wxhello/.kdev_ignore b/languages/cpp/app_templates/wxhello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/wxhello/Makefile.am b/languages/cpp/app_templates/wxhello/Makefile.am new file mode 100644 index 00000000..5f1a213a --- /dev/null +++ b/languages/cpp/app_templates/wxhello/Makefile.am @@ -0,0 +1,18 @@ +dataFiles = src-Makefile.am app.cpp app.h app.kdevelop subdirs \ + app.desktop wxhello.png + +templateName = wxhello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/wxhello/app.cpp b/languages/cpp/app_templates/wxhello/app.cpp new file mode 100644 index 00000000..6bcb3d47 --- /dev/null +++ b/languages/cpp/app_templates/wxhello/app.cpp @@ -0,0 +1,52 @@ +#include +#include "%{APPNAMELC}.h" + +BEGIN_EVENT_TABLE( %{APPNAME}Frame, wxFrame ) + EVT_MENU( Menu_File_Quit, %{APPNAME}Frame::OnQuit ) + EVT_MENU( Menu_File_About, %{APPNAME}Frame::OnAbout ) +END_EVENT_TABLE() + +IMPLEMENT_APP(%{APPNAME}app) + + +bool +%{APPNAME}app::OnInit() +{ + %{APPNAME}Frame *frame = new %{APPNAME}Frame( wxT( "Hello World" ), wxPoint(50,50), wxSize(450,340) ); + + frame->Show(TRUE); + SetTopWindow(frame); + return TRUE; +} + +%{APPNAME}Frame::%{APPNAME}Frame( const wxString& title, const wxPoint& pos, const wxSize& size ) + : wxFrame((wxFrame *)NULL, -1, title, pos, size) +{ + wxMenu *menuFile = new wxMenu; + + menuFile->Append( Menu_File_About, wxT( "&About..." ) ); + menuFile->AppendSeparator(); + menuFile->Append( Menu_File_Quit, wxT( "E&xit" ) ); + + wxMenuBar *menuBar = new wxMenuBar; + menuBar->Append( menuFile, wxT( "&File" ) ); + + SetMenuBar( menuBar ); + + CreateStatusBar(); + SetStatusText( wxT( "Welcome to Kdevelop wxWidgets app!" ) ); +} + +void +%{APPNAME}Frame::OnQuit( wxCommandEvent& WXUNUSED( event ) ) +{ + Close(TRUE); +} + +void +%{APPNAME}Frame::OnAbout( wxCommandEvent& WXUNUSED( event ) ) +{ + wxMessageBox( wxT( "This is a wxWidgets Hello world sample" ), + wxT( "About Hello World" ), wxOK | wxICON_INFORMATION, this ); +} + diff --git a/languages/cpp/app_templates/wxhello/app.desktop b/languages/cpp/app_templates/wxhello/app.desktop new file mode 100644 index 00000000..e87774fa --- /dev/null +++ b/languages/cpp/app_templates/wxhello/app.desktop @@ -0,0 +1,39 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} +Icon=%{APPNAMELC} +Type=Application +Comment=A simple wxWidgets Application +Comment[ca]=Una simple aplicació per a wxWidgets +Comment[da]=Et simpelt wxWidgets program +Comment[de]=Eine einfache wxWidgets-Anwendung +Comment[el]=Μια απλή εφαρμογή wxWidgets +Comment[es]=Una aplicación wxWidgets sencilla +Comment[et]=Lihtne wxWidgets rakendus +Comment[eu]=wxWidgets aplikazio sinple bat +Comment[fa]=یک کاربرد سادۀ wxWidgets +Comment[fr]=Une application avec wxWidgets simple +Comment[ga]=Feidhmchlár Simplí wxWidgets +Comment[gl]=Unha aplicación sinxela wxWidgets +Comment[hi]=एक सादा डब्ल्यूएक्स-विज़ेट्स अनुप्रयोग +Comment[hu]=Egyszerű wxWidgets-alkalmazás +Comment[is]=Einfalt wxWidgets forrit +Comment[it]=Semplice applicazione wxWidgets +Comment[ja]=シンプルな wxWidget アプリケーション +Comment[nds]=En eenfach wxWidgets-Programm +Comment[ne]=साधारण wxWidgets अनुप्रयोग +Comment[nl]=Een eenvoudige wxWidgets-toepassing +Comment[pl]=Prosty program wxWidgets +Comment[pt]=Uma aplicação simples de wxWidgets +Comment[pt_BR]=Um simples Aplicativo wxWidgets +Comment[ru]=Создание простого приложения wxWidgets +Comment[sk]=Jednoduchá wxWidgets aplikácia +Comment[sl]=Preprost program za wxWidgets +Comment[sr]=Једноставан wxWindows програм +Comment[sr@Latn]=Jednostavan wxWindows program +Comment[sv]=Ett enkelt wxWidgets-program +Comment[ta]=சாதாரண wxசாளரங்கள் பயன்பாடு +Comment[tg]=Гузориши оддии wxWidgets +Comment[tr]=Basit bir Merhaba wmWidgets Uygulaması +Comment[zh_CN]=一个简单的 wxWidgets 应用程序 +Comment[zh_TW]=簡單的 wxWidgets 應用程式 diff --git a/languages/cpp/app_templates/wxhello/app.h b/languages/cpp/app_templates/wxhello/app.h new file mode 100644 index 00000000..cb4be988 --- /dev/null +++ b/languages/cpp/app_templates/wxhello/app.h @@ -0,0 +1,36 @@ + +#ifndef _%{APPNAMEUC}_H_ +#define _%{APPNAMEUC}_H_ + +/** + * @short Application Main Window + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ + +class +%{APPNAME}app : public wxApp +{ + public: + virtual bool OnInit(); +}; + +class +%{APPNAME}Frame : public wxFrame +{ + public: + %{APPNAME}Frame( const wxString& title, const wxPoint& pos, const wxSize& size ); + void OnQuit( wxCommandEvent& event ); + void OnAbout( wxCommandEvent& event ); + + private: + DECLARE_EVENT_TABLE() +}; + +enum +{ + Menu_File_Quit = 100, + Menu_File_About +}; + +#endif // _%{APPNAMEUC}_H_ diff --git a/languages/cpp/app_templates/wxhello/app.kdevelop b/languages/cpp/app_templates/wxhello/app.kdevelop new file mode 100644 index 00000000..77835163 --- /dev/null +++ b/languages/cpp/app_templates/wxhello/app.kdevelop @@ -0,0 +1,114 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + C++ + + C++ + Code + wxWidgets + + + + + src/%{APPNAMELC} + debug + + + src/%{APPNAMELC} + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + w3c-dom-level2-html + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + w3c-svg + sw + w3c-uaag10 + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/wxhello/src-Makefile.am b/languages/cpp/app_templates/wxhello/src-Makefile.am new file mode 100644 index 00000000..f93393e6 --- /dev/null +++ b/languages/cpp/app_templates/wxhello/src-Makefile.am @@ -0,0 +1,14 @@ +# these are the headers for your project +noinst_HEADERS = %{APPNAMELC}.h + +######################################################################### +# APPLICATION SECTION +######################################################################### +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = %{APPNAMELC} + +# the application source, library search path, and link libraries +%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp +%{APPNAMELC}_LDFLAGS = $(WX_LIBS) + diff --git a/languages/cpp/app_templates/wxhello/subdirs b/languages/cpp/app_templates/wxhello/subdirs new file mode 100644 index 00000000..85de9cf9 --- /dev/null +++ b/languages/cpp/app_templates/wxhello/subdirs @@ -0,0 +1 @@ +src diff --git a/languages/cpp/app_templates/wxhello/wxhello b/languages/cpp/app_templates/wxhello/wxhello new file mode 100644 index 00000000..2e0d224f --- /dev/null +++ b/languages/cpp/app_templates/wxhello/wxhello @@ -0,0 +1,105 @@ +# wxWidgets Config File +[General] +Name=Simple Hello wxWidgets Application +Name[fr]=Un simple programme de test Hello world +Category=C++/wxWidgets +Comment=Generates a simple wxWidgets Hello application. +Comment[fr]=Gnre un simple programme de test du type Hello world en utilisant la bibliothque wxWidgets. +FileTemplates=h,CStyle,cpp,CStyle +Icon=wxhello.png +ShowFilesAfterGeneration=src/APPNAMELC.cpp + +[LICENSE] +Type=install +Source=%{src}/template-common/%{LICENSEFILE} +Dest=%{dest}/%{LICENSEFILE} + +[GNU] +Type=install archive +Source=%{src}/template-common/gnu.tar.gz +Dest=%{dest} + +[SRC] +Type= mkdir +Dir=%{dest}/src + +[DOCSDIR] +Type=mkdir +Dir=%{dest}/doc + +[DOCSDIREN] +Type=mkdir +Dir=%{dest}/doc/en + +[DOCSMAKEFILE.AM1] +Type=install +Source=%{src}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am +Option=INSTALL_DOCS + +[DOCSMAKEFILE.AM2] +Type=install +Source=%{src}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am +Option=INSTALL_DOCS + +[DOCS] +Type=install +Source=%{src}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook +Option=INSTALL_DOCS + +[PROJECT] +Type=install +Source=%{src}/template-wxhello/app.kdevelop +Dest=%{dest}/${APPNAMELC}.kdevelop + +[WXMAKEFILE.AM] +Type=install +Source=%${src}/template-common/wx-Makefile.am +Dest=%{dest}/Makefile.am + +[WXMAKEFILE.CVS] +Type=install +Source=%${src}/template-common/wx-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[WXCONFIGURE.IN] +Type=install +Source=%${src}/template-common/wx-configure.in +Dest=%{dest}/configure.in + +[APPICON.16] +Type=install +Source=%${src}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-${APPNAMELC}.png + +[APPICON.32] +Type=install +Source=%${src}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-${APPNAMELC}.png + +[SUBDIRS] +Type=install +Source=%${src}/template-wxhello/subdirs +Dest=%{dest}/subdirs + +[SRC.MAKEFILE.AM] +Type=install +Source=%${src}/template-wxhello/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[APP.CPP] +Type=install +Source=%${src}/template-wxhello/app.cpp +Dest=%{dest}/src/${APPNAMELC}.cpp + +[APP.H] +Type=install +Source=%${src}/template-wxhello/app.h +Dest=%{dest}/src/${APPNAMELC}.h + +[APP.DESKTOP] +Type=install +Source=%${src}/template-wxhello/app.desktop +Dest=%{dest}/src/${APPNAMELC}.desktop \ No newline at end of file diff --git a/languages/cpp/app_templates/wxhello/wxhello.kdevtemplate b/languages/cpp/app_templates/wxhello/wxhello.kdevtemplate new file mode 100644 index 00000000..48e605e1 --- /dev/null +++ b/languages/cpp/app_templates/wxhello/wxhello.kdevtemplate @@ -0,0 +1,192 @@ +# KDE Config File +[General] +Name=Simple Hello wxWidgets Application +Name[ca]=Simple aplicació de Hello per a wxWidgets +Name[da]=Simpelt Goddag wxWidgets program +Name[de]=Einfache wxWidgets-Anwendung +Name[el]=Απλή εφαρμογή Γεια σου wxWidgets +Name[es]=Una sencilla aplicación «Hola mundo» con wxWidgets +Name[et]=Lihtne wxWidgets'i tervitusrakendus +Name[eu]=wxWidgets-en "Kaixo mundua" aplikazio sinple bat +Name[fa]=کاربرد سادۀ Hello wxWidgets +Name[fr]=Application « Bonjour monde » simple avec wxWidgets +Name[gl]=Aplicación sinxela Ola en wxWidgets +Name[hu]=wxWidgets-alapú Hello world program +Name[it]=Semplice applicazione wxWidgets di "Hello" +Name[ja]=簡単な wxWidget アプリケーション +Name[nds]=Eenfach wxWidgets-Programm "Moin" +Name[ne]=साधारण हेल्लो wxWidgets अनुप्रयोग +Name[nl]=Eenvoudige Hello wxWidgets-toepassing +Name[pl]=Prosty program Witaj używający wxWidgets +Name[pt]=Aplicação Olá Mundo Simples do wxWidgets +Name[pt_BR]=Aplicação Olá Mundo Simples do wxWidgets +Name[ru]=Простое приложение wxWidgets +Name[sk]=Jednoduchá wxWidgets Ahoj svet aplikácia +Name[sr]=Једноставан „Здраво“ wxWidgets програм +Name[sr@Latn]=Jednostavan „Zdravo“ wxWidgets program +Name[sv]=Enkelt Hello-program för wxWidgets +Name[tr]=Basit Merhaba wxWidgets Uygulaması +Name[zh_CN]=一个简单的 wxWidgets 应用程序 +Name[zh_TW]=簡單的 Hello wxWidgets 應用程式 +Category=C++/wxWidgets +Comment=Generates a simple wxWidgets Hello application. +Comment[ca]=Genera una simple aplicació de Hello per a wxWidgets. +Comment[da]=Genererer et simpelt wxWidgets Goddag-program. +Comment[de]=Erstellt eine einfache wxWidgets-Anwendung +Comment[el]=Δημιουργεί μια απλή εφαρμογή Γεια σου wxWidgets. +Comment[es]=Genera una sencilla aplicación «Hola mundo» con wxWidgets +Comment[et]=Lihtsa wxWidgets'i tervitusrakenduse loomine. +Comment[eu]=wxWidgets-en "Kaixo mundua"aplikazio sinple bat sortzen du. +Comment[fa]=یک کاربرد سادۀ wxWidgets Hello تولید می‌کند. +Comment[fr]=Une application « Bonjour monde » simple avec wxWidgets. +Comment[gl]=Xera unha aplicación sinxela Ola en wxWidgets. +Comment[hu]=Létrehoz egy egyszerű wxWidgets-alkalmazást. +Comment[it]=Genera una semplice applicazione wxWidgets di "Hello". +Comment[ja]=簡単な wxWidget アプリケーションを作成します +Comment[nds]=Stellt mit wxWidgets en eenfach "Moin"-Programm op. +Comment[ne]=साधारण wxWidgets हेल्लो अनुप्रयोग उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudige wxWidget Hello-toepassing. +Comment[pl]=Generuje prosty program Witaj wykorzystujący wxWidgets +Comment[pt]=Gera uma aplicação simples de Olá Mundo do wxWidgets. +Comment[pt_BR]=Gera uma aplicação simples de Olá Mundo do wxWidgets. +Comment[ru]=Создание простого приложения wxWidgets. +Comment[sk]=Vygeneruje jednoduchú wxWidgets Ahoj svet aplikáciu. +Comment[sr]=Прави једноставан „Здраво“ wxWidgets програм. +Comment[sr@Latn]=Pravi jednostavan „Zdravo“ wxWidgets program. +Comment[sv]=Skapar ett enkelt Hello-program för wxWidgets. +Comment[tr]=Basit bir wxWidgets Merhaba uygulaması yaratır. +Comment[zh_CN]=生成一个简单的 wxWidgets Hello 应用程序。 +Comment[zh_TW]=產生一個簡單的 wxWidgets Hello 應用程式。 +FileTemplates=h,CStyle,cpp,CStyle +Icon=wxhello.png +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp +Archive=wxhello.tar.gz + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[WXARCH] +Type=install archive +Source=%{kdevelop}/template-common/wxwidgets.tar.gz +Dest=%{dest} + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[WX] +Type=include +File=%{kdevelop}/template-common/wx.kdevtemplate + +[FILE4] +Type=install +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/wx-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/wx-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/wx-configure.in +Dest=%{dest}/configure.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +#[FILE10] +#Type=install +#Source=%{src}/subdirs +#Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/app.cpp +Dest=%{dest}/src/%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/app.h +Dest=%{dest}/src/%{APPNAMELC}.h + +[FILE14] +Type=install +Source=%{src}/app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[MSG] +Type=message +Comment=Simple hello wxWidgets application was created in %{dest} +Comment[ca]=Simple aplicació de Hello per a wxWidgets ha estat creada en %{dest} +Comment[da]=Simpelt Goddag wxWidgets program blev oprettet i %{dest} +Comment[de]=Eine einfache wxWidgets-Anwendung wurde in %{dest} erstellt. +Comment[el]=Μια απλή εφαρμογή Γεια σου wxWidgets δημιουργήθηκε στο %{dest} +Comment[es]=Una sencilla aplicación «Hola mundo» con wxWidgets ha sido creada en %{dest} +Comment[et]=Lihtne wxWidgets'i tervitusrakendus loodi asukohta %{dest} +Comment[eu]=wxWidgets "Kaixo mundua" aplikazio sinple bat sortu da hemen: %{dest} +Comment[fa]=کاربرد سادۀ hello wxWidgets در %{dest} ایجاد شد +Comment[fr]=Une application « Bonjour monde » simple en wxWidgets a été créée dans %{dest} +Comment[gl]=Creouse unha aplicación sinxela Ola en wxWidgets en %{dest} +Comment[hu]=Létrejött egy egyszerű wxWidgets-alkalmazás itt: %{dest} +Comment[it]=È stata creata una semplice applicazione wxWidgets di "hello" in %{dest} +Comment[ja]=簡単な wxWidget アプリケーションを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach wxWidgets-Programm opstellt +Comment[ne]=साधारण हेल्लो wxWidgets अनुप्रयोग %{dest} मा सिर्जना गरियो +Comment[nl]=Eenvoudige hello wxWidget-toepassing is aangemaakt in %{dest} +Comment[pl]=Prosty program Witaj wykorzystujący wxWidgets został utworzony w %{dest} +Comment[pt]=Foi criada uma aplicação simples de wxWidgets em %{dest} +Comment[pt_BR]=Foi criada uma aplicação simples de wxWidgets em %{dest} +Comment[ru]=Простое приложение wxWidgets создано в %{dest} +Comment[sk]=Jedniduchá wxWidgets Ahoj svet aplikácia bola vytvorená v %{dest} +Comment[sr]=Једноставан „Здраво“ wxWidgets програм направљен је у %{dest} +Comment[sr@Latn]=Jednostavan „Zdravo“ wxWidgets program napravljen je u %{dest} +Comment[sv]=Ett enkelt Hello-program för wxWidgets.skapades i %{dest} +Comment[tr]=Basit merhaba wxWidgets uygulaması %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 创建了一个简单的 wxWidgets Hello 应用程序 +Comment[zh_TW]=一個簡單的 hello wxWidgets 應用程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/wxhello/wxhello.png b/languages/cpp/app_templates/wxhello/wxhello.png new file mode 100644 index 00000000..fbe48423 Binary files /dev/null and b/languages/cpp/app_templates/wxhello/wxhello.png differ diff --git a/languages/cpp/ast_utils.cpp b/languages/cpp/ast_utils.cpp new file mode 100644 index 00000000..d21f4782 --- /dev/null +++ b/languages/cpp/ast_utils.cpp @@ -0,0 +1,190 @@ +/*************************************************************************** +* Copyright (C) 2002 by Roberto Raggi * +* roberto@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#include "ast_utils.h" +#include "ast.h" + +#include +#include + +#include +#include +#include + +#include + +#include "cppsupport_utils.h" + +AST* findNodeAt( AST* node, int line, int column ) +{ + // kdDebug(9007) << "findNodeAt(" << node << ")" << endl; + + if ( !node ) + return 0; + + int startLine, startColumn; + int endLine, endColumn; + + node->getStartPosition( &startLine, &startColumn ); + node->getEndPosition( &endLine, &endColumn ); + + if ( ( line > startLine || ( line == startLine && column >= startColumn ) ) && + ( line < endLine || ( line == endLine && column < endColumn ) ) ) + { + + QPtrList children = node->children(); + QPtrListIterator it( children ); + while ( it.current() ) + { + AST * a = it.current(); + ++it; + + AST* r = findNodeAt( a, line, column ); + if ( r ) + return r; + } + + return node; + } + + return 0; +} + +void scopeOfNode( AST* ast, QStringList& scope ) +{ + if ( !ast ) + return ; + + if ( ast->parent() ) + scopeOfNode( ast->parent(), scope ); + + QString s; + switch ( ast->nodeType() ) + { + case NodeType_ClassSpecifier: + if ( ( ( ClassSpecifierAST* ) ast ) ->name() ) + { + s = ( ( ClassSpecifierAST* ) ast ) ->name() ->text(); + s = s.isEmpty() ? QString::fromLatin1( "" ) : s; + scope.push_back( s ); + } + break; + + case NodeType_Namespace: + { + AST* namespaceName = ( ( NamespaceAST* ) ast ) ->namespaceName(); + s = namespaceName ? namespaceName->text() : QString::fromLatin1( "" ); + scope.push_back( s ); + } + break; + + case NodeType_FunctionDefinition: + { + FunctionDefinitionAST* funDef = static_cast( ast ); + DeclaratorAST* d = funDef->initDeclarator() ->declarator(); + + // hotfix for bug #68726 + if ( !d->declaratorId() ) + break; + + QPtrList l = d->declaratorId() ->classOrNamespaceNameList(); + QPtrListIterator nameIt( l ); + while ( nameIt.current() ) + { + AST * name = nameIt.current() ->name(); + scope.push_back( name->text() ); + + ++nameIt; + } + } + break; + + default: + break; + } +} + + +QString typeSpecToString( TypeSpecifierAST* typeSpec ) /// @todo remove +{ + if ( !typeSpec ) + return QString::null; + + return typeSpec->text().replace( QRegExp( " :: " ), "::" ); +} + +QString declaratorToString( DeclaratorAST* declarator, const QString& scope, bool skipPtrOp ) +{ + if ( !declarator ) + return QString::null; + + QString text; + + if ( !skipPtrOp ) + { + QPtrList ptrOpList = declarator->ptrOpList(); + for ( QPtrListIterator it( ptrOpList ); it.current(); ++it ) + { + text += it.current() ->text(); + } + text += " "; + } + + text += scope; + + if ( declarator->subDeclarator() ) + text += QString::fromLatin1( "(" ) + declaratorToString( declarator->subDeclarator() ) + QString::fromLatin1( ")" ); + + if ( declarator->declaratorId() ) + text += declarator->declaratorId() ->text(); + + QPtrList arrays = declarator->arrayDimensionList(); + QPtrListIterator it( arrays ); + while ( it.current() ) + { + text += "[]"; + ++it; + } + + if ( declarator->parameterDeclarationClause() ) + { + text += formattedOpeningParenthesis(); + + ParameterDeclarationListAST* l = declarator->parameterDeclarationClause() ->parameterDeclarationList(); + if ( l != 0 ) + { + QPtrList params = l->parameterList(); + QPtrListIterator it( params ); + + while ( it.current() ) + { + QString type = typeSpecToString( it.current() ->typeSpec() ); + text += type; + if ( !type.isEmpty() ) + text += " "; + text += declaratorToString( it.current() ->declarator() ); + + ++it; + + if ( it.current() ) + text += ", "; + } + } + + text += formattedClosingParenthesis(); + + if ( declarator->constant() != 0 ) + text += " const"; + } + + return text.replace( QRegExp( " :: " ), "::" ).simplifyWhiteSpace(); +} +//kate: indent-mode csands; tab-width 4; space-indent off; diff --git a/languages/cpp/ast_utils.h b/languages/cpp/ast_utils.h new file mode 100644 index 00000000..ce9ec99f --- /dev/null +++ b/languages/cpp/ast_utils.h @@ -0,0 +1,34 @@ +/*************************************************************************** +* Copyright (C) 2002 by Roberto Raggi * +* roberto@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef __ast_utils_h +#define __ast_utils_h + +#include + +class AST; +class DeclaratorAST; +class TypeSpecifierAST; +class QStringList; + +namespace KTextEditor +{ + class EditInterface; +} + +AST* findNodeAt( AST* unit, int line, int column ); +void scopeOfNode( AST* ast, QStringList& ); +QString typeSpecToString( TypeSpecifierAST* typeSpec ); +QString declaratorToString( DeclaratorAST* declarator, const QString& scope = QString::null, bool skipPtrOp = false ); + +#endif // __ast_utils_h +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/backgroundparser.cpp b/languages/cpp/backgroundparser.cpp new file mode 100644 index 00000000..ed51d0c6 --- /dev/null +++ b/languages/cpp/backgroundparser.cpp @@ -0,0 +1,552 @@ +/*************************************************************************** +* Copyright (C) 2002 by Roberto Raggi * +* roberto@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#include "backgroundparser.h" +#include "cppsupportpart.h" +#include "cppsupport_events.h" +#include "codeinformationrepository.h" +#include "cppcodecompletion.h" +#include "ast_utils.h" +#include "kdevdeepcopy.h" +#include "kdevdriver.h" + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + + +class BackgroundKDevDriver : public KDevDriver { +public: + BackgroundKDevDriver( CppSupportPart* cppSupport, BackgroundParser* bp ) : KDevDriver( cppSupport, false ), m_backgroundParser(bp) { + } + virtual void fileParsed( ParsedFile& fileName ); + virtual void addDependence( const QString& fileName, const Dependence& dep ); +private: + BackgroundParser* m_backgroundParser; +}; + + +class KDevSourceProvider: public SourceProvider +{ +public: + //Deadlock is a mutex that is locked when KDevSourceProvider::contents(..) is used, and that should be unlocked before QApplication is locked(that way a deadlock where the thread that holds the QApplication-mutex and tries to lock the given mutex, while the thread that calls contents(..) and holds the given mutex and tries to lock the QApplication-mutex, cannot happen) + KDevSourceProvider( CppSupportPart* cppSupport, QMutex& deadlock ) + : m_cppSupport( cppSupport ), + m_readFromDisk( false ), + m_deadlock(deadlock) + {} + + void setReadFromDisk( bool b ) + { + m_readFromDisk = b; + } + bool readFromDisk() const + { + return m_readFromDisk; + } + + virtual QString contents( const QString& fileName ) + { + QString contents = QString::null; + + if ( !m_readFromDisk ) + { + m_deadlock.unlock(); + // GET LOCK + kapp->lock (); + + //kdDebug(9007) << "-------> kapp locked" << endl; + + QPtrList parts( *m_cppSupport->partController() ->parts() ); + QPtrListIterator it( parts ); + while ( it.current() ) + { + KTextEditor::Document * doc = dynamic_cast( it.current() ); + ++it; + + KTextEditor::EditInterface* editIface = dynamic_cast( doc ); + if ( !doc || !editIface || doc->url().path() != fileName ) + continue; + + contents = QString( editIface->text().ascii() ); // deep copy + + //kdDebug(9007) << "-------> kapp unlocked" << endl; + + break; + } + + // RELEASE LOCK + kapp->unlock(); + m_deadlock.lock(); + //kdDebug(9007) << "-------> kapp unlocked" << endl; + } + + if( m_readFromDisk || contents == QString::null ) + { + QFile f( fileName ); + if ( f.open( IO_ReadOnly ) ) + { + QTextStream stream( &f ); + contents = stream.read(); + f.close(); + } + } + + return contents; + } + + virtual bool isModified( const QString& fileName ) + { + bool ret = false; + m_deadlock.unlock(); + kapp->lock (); + + KParts::ReadOnlyPart *part = m_cppSupport->partController()->partForURL( KURL(fileName) ); + KTextEditor::Document * doc = dynamic_cast( part ); + + if ( doc ) + ret = doc->isModified(); + + kapp->unlock(); + m_deadlock.lock(); + return ret; + } + +private: + CppSupportPart* m_cppSupport; + bool m_readFromDisk; + QMutex& m_deadlock; +private: + KDevSourceProvider( const KDevSourceProvider& source ); + void operator = ( const KDevSourceProvider& source ); +}; + +typedef std::string SafeString; + +class SynchronizedFileList +{ + typedef std::list< QPair > ListType; +public: + SynchronizedFileList() + {} + + bool isEmpty() const + { + QMutexLocker locker( &m_mutex ); + return m_fileList.empty(); + } + + uint count() const + { + QMutexLocker locker( &m_mutex ); + return m_fileList.size(); + } + + QPair front() const + { + QMutexLocker locker( &m_mutex ); + return m_fileList.front(); + } + + void clear() + { + QMutexLocker locker( &m_mutex ); + m_fileList.clear(); + } + + void push_front( const QString& fileName, bool readFromDisk = false ) + { + SafeString s( fileName.ascii() ); + QMutexLocker locker( &m_mutex ); + m_fileList.push_front( qMakePair( s, readFromDisk ) ); + } + + void push_back( const QString& fileName, bool readFromDisk = false ) + { + SafeString s( fileName.ascii() ); + QMutexLocker locker( &m_mutex ); + m_fileList.push_back( qMakePair( s, readFromDisk ) ); + } + + void pop_front() + { + QMutexLocker locker( &m_mutex ); + m_fileList.pop_front(); + } + + int count( const QString& fileName ) const { + int c = 0; + + QMutexLocker locker( &m_mutex ); + ListType::const_iterator it = m_fileList.begin(); + while ( it != m_fileList.end() ) + { + if ( ( *it ).first.compare( fileName.ascii() ) == 0 ) + ++c; + ++it; + } + return c; + } + + QPair takeFront() + { + QMutexLocker locker( &m_mutex ); + QPair ret = m_fileList.front(); + m_fileList.pop_front(); + return ret; + } + + bool contains( const QString& fileName ) const + { + QMutexLocker locker( &m_mutex ); + ListType::const_iterator it = m_fileList.begin(); + while ( it != m_fileList.end() ) + { + if ( ( *it ).first.compare( fileName.ascii() ) == 0 ) + return true; + ++it; + } + return false; + } + + void remove( const QString& fileName ) + { + QMutexLocker locker( &m_mutex ); + ListType::iterator it = m_fileList.begin(); + while ( it != m_fileList.end() ) + { + if ( ( *it ).first.compare(fileName.ascii() ) == 0 ) + m_fileList.erase( it++ ); + else + ++it; + } + } + +private: + mutable QMutex m_mutex; + ListType m_fileList; +}; + +BackgroundParser::BackgroundParser( CppSupportPart* part, QWaitCondition* consumed ) +: m_consumed( consumed ), m_cppSupport( part ), m_close( false ), m_saveMemory( false ) +{ + m_fileList = new SynchronizedFileList(); + m_driver = new BackgroundKDevDriver( m_cppSupport, this ); + m_driver->setSourceProvider( new KDevSourceProvider( m_cppSupport, m_mutex ) ); + + QString conf_file_name = m_cppSupport->specialHeaderName(); + m_mutex.lock(); + if ( QFile::exists( conf_file_name ) ) + m_driver->parseFile( conf_file_name, true, true, true ); + m_mutex.unlock(); + + //disabled for now m_driver->setResolveDependencesEnabled( true ); +} + +BackgroundParser::~BackgroundParser() +{ + removeAllFiles(); + + delete( m_driver ); + m_driver = 0; + + delete m_fileList; + m_fileList = 0; +} + +void BackgroundParser::addFile( const QString& fileName, bool readFromDisk ) +{ + QString fn = deepCopy( fileName ); + + //bool added = false; + /*if ( !m_fileList->contains( fn ) ) + { + m_fileList->push_back( fn, readFromDisk ); + added = true; + }*/ + m_fileList->push_back( fn, readFromDisk ); + + //if ( added ) + m_canParse.wakeAll(); +} + +void BackgroundParser::addFileFront( const QString& fileName, bool readFromDisk ) +{ + QString fn = deepCopy( fileName ); + + bool added = false; + /*if ( m_fileList->contains( fn ) ) + m_fileList->remove( fn );*/ + + m_fileList->push_front( fn, readFromDisk ); + added = true; + + if ( added ) + m_canParse.wakeAll(); +} + +void BackgroundParser::removeAllFiles() +{ + kdDebug( 9007 ) << "BackgroundParser::removeAllFiles()" << endl; + QMutexLocker locker( &m_mutex ); + + QMap::Iterator it = m_unitDict.begin(); + while ( it != m_unitDict.end() ) + { + Unit * unit = it.data(); + ++it; + delete( unit ); + unit = 0; + } + m_unitDict.clear(); + m_driver->reset(); + m_fileList->clear(); + + m_isEmpty.wakeAll(); +} + +void BackgroundParser::removeFile( const QString& fileName ) +{ + QMutexLocker locker( &m_mutex ); + + Unit* unit = findUnit( fileName ); + if ( unit ) + { + m_driver->remove + ( fileName ); + m_unitDict.remove( fileName ); + delete( unit ); + unit = 0; + } + + if ( m_fileList->isEmpty() ) + m_isEmpty.wakeAll(); +} + +void BackgroundKDevDriver::addDependence( const QString& fileName, const Dependence& dep ) { + //give waiting threads a chance to perform their actions + m_backgroundParser->m_mutex.unlock(); + m_backgroundParser->m_mutex.lock(); + KDevDriver::addDependence( fileName, dep ); +} + +void BackgroundKDevDriver::fileParsed( ParsedFile& fileName ) { + m_backgroundParser->fileParsed( fileName ); +} + +void BackgroundParser::parseFile( const QString& fileName, bool readFromDisk, bool lock ) +{ + if( lock ) + m_mutex.lock(); + m_readFromDisk = readFromDisk; + static_cast( m_driver->sourceProvider() ) ->setReadFromDisk( readFromDisk ); + + m_driver->remove( fileName ); + m_driver->parseFile( fileName , false, true ); + if( !m_driver->isResolveDependencesEnabled() ) + m_driver->removeAllMacrosInFile( fileName ); // romove all macros defined by this + // translation unit. + if ( lock ) + m_mutex.unlock(); +} + +QValueList cloneProblemList( const QValueList& list ) { + QValueList ret; + for( QValueList::const_iterator it = list.begin(); it != list.end(); ++it ) { + ret << Problem( *it, true ); + } + return ret; +} + +void BackgroundParser::fileParsed( ParsedFile& file ) { + + ParsedFilePointer translationUnitUnsafe = m_driver->takeTranslationUnit( file.fileName() ); + //now file and translationUnitUnsafe are the same + ParsedFilePointer translationUnit; + //Since the lexer-cache keeps many QStrings like macro-names used in the background, everything must be copied here. The safest solution is just + //serializing and deserializing the whole thing(the serialization does not respect the AST, but that can be copied later because that's safe) + QMemArray data; + { + QDataStream stream( data, IO_WriteOnly ); + translationUnitUnsafe->write( stream ); + } + { + QDataStream stream( data, IO_ReadOnly ); + translationUnit = new ParsedFile( stream ); + } + + translationUnit->setTranslationUnit( translationUnitUnsafe->operator TranslationUnitAST *() ); //Copy the AST, doing that is thread-safe + translationUnitUnsafe->setTranslationUnit( 0 ); //Move the AST completely out of this thread's scope. Else it might crash on dual-core machines + file.setTranslationUnit(0); //just to be sure, set to zero on both + + Unit* unit = new Unit; + unit->fileName = file.fileName(); + unit->translationUnit = translationUnit; + unit->problems = cloneProblemList( m_driver->problems( file.fileName() ) ); + + static_cast( m_driver->sourceProvider() ) ->setReadFromDisk( false ); + + if ( m_unitDict.find( file.fileName() ) != m_unitDict.end() ) + { + Unit * u = m_unitDict[ file.fileName() ]; + m_unitDict.remove( file.fileName() ); + delete( u ); + u = 0; + } + + m_unitDict.insert( file.fileName(), unit ); + + KApplication::postEvent( m_cppSupport, new FileParsedEvent( file.fileName(), unit->problems, m_readFromDisk ) ); + + m_currentFile = QString::null; + + if ( m_fileList->isEmpty() ) + m_isEmpty.wakeAll(); +} + +Unit* BackgroundParser::findUnit( const QString& fileName ) +{ + QMap::Iterator it = m_unitDict.find( fileName ); + return it != m_unitDict.end() ? *it : 0; +} + +bool BackgroundParser::hasTranslationUnit( const QString& fileName ) { + QMap::Iterator it = m_unitDict.find( fileName ); + return it != m_unitDict.end(); +} + +ParsedFilePointer BackgroundParser::translationUnit( const QString& fileName ) +{ + Unit * u = findUnit( fileName ); + if ( u == 0 ) + { + return 0; + /*m_fileList->remove + ( fileName ); + u = parseFile( fileName, false );*/ + } + + return u->translationUnit; +} + +QValueList BackgroundParser::problems( const QString& fileName, bool readFromDisk, bool forceParse ) +{ + Q_UNUSED(readFromDisk); + Unit * u = findUnit( fileName ); + if ( u == 0 || forceParse ) + { + /* + m_fileList->remove + ( fileName ); + u = parseFile( fileName, readFromDisk ); */ + } + + return u ? u->problems : QValueList(); +} + +void BackgroundParser::close() +{ + { + QMutexLocker locker( &m_mutex ); + m_close = true; + m_canParse.wakeAll(); + } + kapp->unlock(); + + while ( running() ) + sleep( 1 ); + kapp->lock(); +} + +bool BackgroundParser::filesInQueue() +{ + QMutexLocker locker( &m_mutex ); + + return m_fileList->count() || !m_currentFile.isEmpty(); +} + +int BackgroundParser::countInQueue( const QString& file ) const { + return m_fileList->count( file ); +} + +void BackgroundParser::updateParserConfiguration() +{ + QMutexLocker locker( &m_mutex ); + + m_driver->setup(); + QString conf_file_name = m_cppSupport->specialHeaderName(); + m_driver->removeAllMacrosInFile( conf_file_name ); + m_driver->parseFile( conf_file_name, true, true, true ); +} + +void BackgroundParser::run() +{ + // (void) m_cppSupport->codeCompletion()->repository()->getEntriesInScope( QStringList(), false ); + + while ( !m_close ) + { + + while ( m_fileList->isEmpty() ) + { + if( m_saveMemory ) { + m_saveMemory = false; + m_driver->lexerCache()->saveMemory(); + } + + m_canParse.wait(); + + if ( m_close ) + break; + } + + if ( m_close ) + break; + + QPair entry = m_fileList->takeFront(); + QString fileName = entry.first.c_str(); + bool readFromDisk = entry.second; + m_currentFile = deepCopy(fileName); + + ( void ) parseFile( fileName, readFromDisk, true ); + + + m_currentFile = QString::null; + } + + kdDebug( 9007 ) << "!!!!!!!!!!!!!!!!!! BG PARSER DESTROYED !!!!!!!!!!!!" << endl; + +// adymo: commented to fix #88091 +// QThread::exit(); +} + +void BackgroundParser::saveMemory() { + m_saveMemory = true; //Delay the operation + m_canParse.wakeAll(); +} + + +//kate: indent-mode csands; tab-width 4; space-indent off; diff --git a/languages/cpp/backgroundparser.h b/languages/cpp/backgroundparser.h new file mode 100644 index 00000000..2bbf1173 --- /dev/null +++ b/languages/cpp/backgroundparser.h @@ -0,0 +1,122 @@ +/*************************************************************************** +* Copyright (C) 2002 by Roberto Raggi * +* roberto@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef BACKGROUNDPARSER_H +#define BACKGROUNDPARSER_H + +#include "ast.h" +#include "driver.h" + +#include +#include +#include +#include +#include + +class CppSupportPart; +class TranslationUnitAST; +class SynchronizedFileList; +class BackgroundKDevDriver; +class Unit +{ +public: + Unit() : translationUnit( 0 ) + {} + ~Unit() + { + translationUnit = 0; + } + + QString fileName; + QValueList problems; + ParsedFilePointer translationUnit; + +protected: + Unit( const Unit& source ); + void operator = ( const Unit& source ); +}; + +class BackgroundParser: public QThread +{ +public: + BackgroundParser( CppSupportPart*, QWaitCondition* consumed ); + virtual ~BackgroundParser(); + + QMutex& mutex() + { + return m_mutex; + } + void lock () + { + m_mutex.lock(); + } + void unlock() + { + m_mutex.unlock(); + } + + QWaitCondition& canParse() + { + return m_canParse; + } + QWaitCondition& isEmpty() + { + return m_isEmpty; + } + + bool filesInQueue(); + + int countInQueue( const QString& file ) const; + + void addFile( const QString& fileName, bool readFromDisk = false ); + void addFileFront( const QString& fileName, bool readFromDisk = false ); + void removeFile( const QString& fileName ); + void removeAllFiles(); + + bool hasTranslationUnit( const QString& fileName ); + ParsedFilePointer translationUnit( const QString& fileName ); + QValueList problems( const QString& fileName , bool readFromDisk = false, bool forceParse = false ); + void updateParserConfiguration(); + + ///Should be run on a regular basis(every X minutes). It reduces some caches etc. BackgroundParser must be locked before. + void saveMemory(); + + void close(); + + virtual void run(); + +protected: + friend class BackgroundKDevDriver; + void fileParsed( ParsedFile& fileName ); + Unit* findUnit( const QString& fileName ); + void parseFile( const QString& fileName, bool readFromDisk, bool lock = false ) + ; + +private: + class KDevDriver* m_driver; + QString m_currentFile; + QWaitCondition m_canParse; + QWaitCondition m_isEmpty; + QWaitCondition* m_consumed; + QMutex m_mutex; + SynchronizedFileList* m_fileList; + CppSupportPart* m_cppSupport; + bool m_close; + QMap m_unitDict; + bool m_saveMemory; //used to prevent blocking + + //State of parseFile(..): + bool m_readFromDisk; +}; + +#endif +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/bithelpers.h b/languages/cpp/bithelpers.h new file mode 100644 index 00000000..3cb74420 --- /dev/null +++ b/languages/cpp/bithelpers.h @@ -0,0 +1,37 @@ + +/*************************************************************************** + copyright : (C) 2006 by David Nolden + email : david.nolden.kdevelop@art-master.de +***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef __BITHELPERS_H__ +#define __BITHELPERS_H__ + +namespace BitHelpers { +template +inline Type addFlag( Type loc, Type add ) { + return (Type)( loc | add ); +} + +template +inline Type remFlag( Type loc, Type rem ) { + return (Type)( loc & (rem ^ 0xffffffff) ); +} + +template +inline Type bitInvert( Type val ) { + return (Type)(0xffffffff - (unsigned int)val); +} +} +#endif +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/ccconfigwidget.cpp b/languages/cpp/ccconfigwidget.cpp new file mode 100644 index 00000000..09b13938 --- /dev/null +++ b/languages/cpp/ccconfigwidget.cpp @@ -0,0 +1,590 @@ +/*************************************************************************** +* Copyright (C) 2001 by Daniel Engelschalt * +* daniel.engelschalt@gmx.net * +* Copyright (C) 2004 Jonas Jacobi * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ +// qt includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// kde includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// kdevelop includes +#include +#include +#include +#include +#include +// std includes +#include + +#include "cppsupportfactory.h" +#include "ccconfigwidget.h" +#include "qtbuildconfig.h" +#include "cppsupportpart.h" +#include "cppcodecompletionconfig.h" +#include "cppsplitheadersourceconfig.h" +#include "createpcsdialog.h" +#include "creategettersetterconfiguration.h" + +using namespace std; + + +CCConfigWidget::CCConfigWidget( CppSupportPart* part, QWidget* parent, const char* name ) + : CCConfigWidgetBase( parent, name ) +{ + m_pPart = part; + connect( m_pPart->codeRepository(), SIGNAL( catalogRegistered( Catalog* ) ), + this, SLOT( catalogRegistered( Catalog* ) ) ); + connect( m_pPart->codeRepository(), SIGNAL( catalogUnregistered( Catalog* ) ), + this, SLOT( catalogUnregistered( Catalog* ) ) ); + + connect( m_qtDir, SIGNAL(urlSelected(const QString &)), + this, SLOT(isValidQtDir(const QString &))); + connect( m_qtDir, SIGNAL(textChanged(const QString &)), + this, SLOT(isValidQtDir(const QString &))); + + initGeneralTab( ); + initQtTab(); + initCodeCompletionTab( ); + initGetterSetterTab( ); + initSplitTab(); + inputCodeCompletion->setRange( 0, 2000, 100, false ); + inputArgumentsHint->setRange( 0, 2000, 100, false ); +} + +void CCConfigWidget::initGeneralTab( ) +{ + QDomDocument dom = *m_pPart->projectDom(); + interface_suffix->setText( DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/interfacesuffix", ".h" ) ); + implementation_suffix->setText( DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/implementationsuffix", ".cpp" ) ); + + KConfig *config = CppSupportFactory::instance() ->config(); + if ( config ) + { + config->setGroup( "General" ); + m_switchShouldMatch->setChecked( config->readBoolEntry( "SwitchShouldMatch", true ) ); + m_showContextMenuExplosion->setChecked( config->readBoolEntry( "ShowContextMenuExplosion", false ) ); + } +} + +CCConfigWidget::~CCConfigWidget( ) +{} + +void CCConfigWidget::accept( ) +{ + saveFileTemplatesTab(); + saveQtTab(); + saveCodeCompletionTab(); + saveGetterSetterTab(); + saveSplitTab(); +} + +void CCConfigWidget::saveFileTemplatesTab( ) +{ + QDomDocument dom = *m_pPart->projectDom(); + DomUtil::writeEntry( dom, "/cppsupportpart/filetemplates/interfacesuffix", interface_suffix->text() ); + DomUtil::writeEntry( dom, "/cppsupportpart/filetemplates/implementationsuffix", implementation_suffix->text() ); + + KConfig *config = CppSupportFactory::instance() ->config(); + if ( config ) + { + config->setGroup( "General" ); + config->writeEntry( "SwitchShouldMatch", m_switchShouldMatch->isChecked() ); + config->writeEntry( "ShowContextMenuExplosion", m_showContextMenuExplosion->isChecked() ); + } +} + +void CCConfigWidget::initCodeCompletionTab( ) +{ + advancedOptions->header() ->hide(); + + CppCodeCompletionConfig* c = m_pPart->codeCompletionConfig(); + + inputCodeCompletion->setValue( c->codeCompletionDelay() ); + inputArgumentsHint->setValue( c->argumentsHintDelay() ); + checkAutomaticCodeCompletion->setChecked( c->automaticCodeCompletion() ); + checkAutomaticArgumentsHint->setChecked( c->automaticArgumentsHint() ); + + checkCompleteArgumentType->setChecked( c->processFunctionArguments() ); + checkCompleteReturnType->setChecked( c->processPrimaryTypes() ); + //checkShowOnlyAccessible->setChecked( c->showOnlyAccessibleItems() ); + + editNamespaceAlias->setText( c->namespaceAliases() ); + checkBox18->setChecked( c->showEvaluationContextMenu() ); + checkShowTypeEvaluationInStatusBar->setChecked( c->statusBarTypeEvaluation() ); + checkShowCommentInArgumentHint->setChecked( c->showCommentWithArgumentHint() ); + /* + switch( c->completionBoxItemOrder() ) { + case CppCodeCompletionConfig::ByAccessLevel: + radioGroupByAccess->setChecked( true ); + break; + case CppCodeCompletionConfig::ByClass: + radioGroupByClass->setChecked( true ); + break; + case CppCodeCompletionConfig::ByAlphabet: + radioGroupByAlphabet->setChecked( true ); + break; + }*/ + + QValueList catalogs = m_pPart->codeRepository() ->registeredCatalogs(); + for ( QValueList::Iterator it = catalogs.begin(); it != catalogs.end(); ++it ) + { + Catalog* c = *it; + QFileInfo dbInfo( c->dbName() ); + QCheckListItem* item = new QCheckListItem( advancedOptions, KURL::decode_string( dbInfo.baseName(true) ), QCheckListItem::CheckBox ); + item->setOn( c->enabled() ); + + m_catalogs[ item ] = c; + } + + checkPreprocessIncludedHeaders->setChecked( c->preProcessAllHeaders() && !c->parseMissingHeaders() ); + checkParseMissingHeaders->setChecked( c->parseMissingHeaders() ); + checkListGlobalItems->setChecked( c->alwaysIncludeNamespaces() ); + checkResolveIncludePaths->setChecked( c->resolveIncludePaths() ); + editIncludePaths->setText( c->customIncludePaths() ); +} + +void CCConfigWidget::saveCodeCompletionTab( ) +{ + CppCodeCompletionConfig * c = m_pPart->codeCompletionConfig(); + + c->setCodeCompletionDelay( inputCodeCompletion->value() ); + c->setArgumentsHintDelay( inputArgumentsHint->value() ); + + c->setAutomaticCodeCompletion( checkAutomaticCodeCompletion->isChecked() ); + c->setAutomaticArgumentsHint( checkAutomaticArgumentsHint->isChecked() ); + + c->setProcessFunctionArguments( checkCompleteArgumentType->isChecked() ); + c->setProcessPrimaryTypes( checkCompleteReturnType->isChecked() ); + //c->setShowOnlyAccessibleItems( checkShowOnlyAccessible->isChecked() ); + + c->setNamespaceAliases( editNamespaceAlias->text() ); + c->setShowEvaluationContextMenu( checkBox18->isChecked() ); + c->setStatusBarTypeEvaluation( checkShowTypeEvaluationInStatusBar->isChecked() ); + c->setShowCommentWithArgumentHint( checkShowCommentInArgumentHint->isChecked() ); + + /*if( radioGroupByAccess->isChecked() ) + c->setCompletionBoxItemOrder( CppCodeCompletionConfig::ByAccessLevel ); + + if( radioGroupByClass->isChecked() ) + c->setCompletionBoxItemOrder( CppCodeCompletionConfig::ByClass ); + + if( radioGroupByAlphabet->isChecked() ) + c->setCompletionBoxItemOrder( CppCodeCompletionConfig::ByAlphabet );*/ + + for ( QMap::Iterator it = m_catalogs.begin(); it != m_catalogs.end(); ++it ) + { + it.data() ->setEnabled( it.key() ->isOn() ); + } + + c->setPreProcessAllHeaders( checkPreprocessIncludedHeaders->isChecked() || checkParseMissingHeaders->isChecked() ); + c->setParseMissingHeaders( checkParseMissingHeaders->isChecked() ); + c->setAlwaysIncludeNamespaces( checkListGlobalItems->isChecked() ); + c->setResolveIncludePaths( checkResolveIncludePaths->isChecked() ); + c->setCustomIncludePaths( editIncludePaths->text() ); + + c->store(); +} + +void CCConfigWidget::slotNewPCS( ) +{ + CreatePCSDialog dlg( m_pPart, m_pPart->mainWindow() ->main() ); + dlg.importerListView->setFocus(); + dlg.exec(); +} + +void CCConfigWidget::slotRemovePCS() +{ + if ( !advancedOptions->selectedItem() ) + return ; + + QString db = advancedOptions->selectedItem() ->text( 0 ); + QString question = i18n( "Are you sure you want to delete the \"%1\" database?" ).arg( db ); + + KStandardDirs *dirs = m_pPart->instance() ->dirs(); + QString dbName = dirs->saveLocation( "data", "kdevcppsupport/pcs" ) + KURL::encode_string_no_slash( db ) + ".db"; + + if ( KMessageBox::Continue == KMessageBox::warningContinueCancel( 0, question, i18n( "Delete Database" ), KStdGuiItem::del() ) ) + { + m_pPart->removeCatalog( dbName ); + } +} + +void CCConfigWidget::catalogRegistered( Catalog * c ) +{ + QFileInfo dbInfo( c->dbName() ); + QCheckListItem* item = new QCheckListItem( advancedOptions, KURL::decode_string( dbInfo.baseName(true) ), QCheckListItem::CheckBox ); + item->setOn( c->enabled() ); + + m_catalogs[ item ] = c; +} + +void CCConfigWidget::catalogUnregistered( Catalog * c ) +{ + for ( QMap::Iterator it = m_catalogs.begin(); it != m_catalogs.end(); ++it ) + { + if ( it.data() == c ) + { + QCheckListItem * item = it.key(); + delete( item ); + m_catalogs.remove( it ); + break; + } + } +} + +void CCConfigWidget::initGetterSetterTab( ) +{ + CreateGetterSetterConfiguration * config = m_pPart->createGetterSetterConfiguration(); + + if ( config == 0 ) + return ; + + m_edtGet->setText( config->prefixGet() ); + m_edtSet->setText( config->prefixSet() ); + m_edtRemovePrefix->setText( config->prefixVariable().join( "," ) ); + m_edtParameterName->setText( config->parameterName() ); + + slotGetterSetterValuesChanged(); +} + +void CCConfigWidget::slotGetterSetterValuesChanged( ) +{ + bool hasError = false; + if ( m_edtParameterName->text().isEmpty() ) + { + m_lblParameterName->setPaletteForegroundColor( QColor( "red" ) ); + m_edtExampleGet->setText( "error, missing parametername" ); + m_edtExampleSet->setText( "error, missing parametername" ); + hasError = true; + } + + QString name = m_edtVariableName->text(); + if ( name.isEmpty() ) + { + m_lblVariableName->setPaletteForegroundColor( QColor( "red" ) ); + m_edtExampleGet->setText( "error, missing variablename" ); + m_edtExampleSet->setText( "error, missing variablename" ); + hasError = true; + } + + if ( hasError ) + { + m_edtExampleGet->setPaletteForegroundColor( QColor( "red" ) ); + m_edtExampleSet->setPaletteForegroundColor( QColor( "red" ) ); + + return ; + } + else + { + m_lblVariableName->setPaletteForegroundColor( QColor( "black" ) ); + m_lblParameterName->setPaletteForegroundColor( QColor( "black" ) ); + m_edtExampleGet->setPaletteForegroundColor( QColor( "black" ) ); + m_edtExampleSet->setPaletteForegroundColor( QColor( "black" ) ); + } + + QStringList prefixes = QStringList::split( ",", m_edtRemovePrefix->text().replace( " ", "" ) ); + unsigned int len = 0; + QStringList::ConstIterator theend = prefixes.end(); + for ( QStringList::ConstIterator ci = prefixes.begin(); ci != theend; ++ci ) + { + if ( name.startsWith( *ci ) && ( *ci ).length() > len ) + len = ( *ci ).length(); + } + + if ( len > 0 ) + name.remove( 0, len ); + + QString getName = name; + if ( !m_edtGet->text().isEmpty() ) + { + getName[ 0 ] = getName[ 0 ].upper(); + getName.prepend( m_edtGet->text() ); + } + + QString setName = name; + if ( !m_edtSet->text().isEmpty() ) + { + setName[ 0 ] = setName[ 0 ].upper(); + setName.prepend( m_edtSet->text() ); + } + + m_edtExampleGet->setText( "string " + getName + "() const;" ); + m_edtExampleSet->setText( "void " + setName + "(const string& " + m_edtParameterName->text() + ");" ); +} + +void CCConfigWidget::saveGetterSetterTab( ) +{ + if ( m_edtParameterName->text().isEmpty() || m_edtGet->text() == m_edtSet->text() ) + return ; + + CreateGetterSetterConfiguration* config = m_pPart->createGetterSetterConfiguration(); + if ( config == 0 ) + return ; + + config->setPrefixGet( m_edtGet->text() ); + config->setPrefixSet( m_edtSet->text() ); + config->setPrefixVariable( QStringList::split( ",", m_edtRemovePrefix->text().replace( " ", "" ) ) ); + config->setParameterName( m_edtParameterName->text() ); + config->store(); +} + +void CCConfigWidget::initSplitTab( ) +{ + CppSplitHeaderSourceConfig * config = m_pPart->splitHeaderSourceConfig(); + + if ( config == 0 ) + return ; + + m_splitEnable->setChecked( config->splitEnabled() ); + m_splitSync->setChecked( config->autoSync() ); + + QString o = config->orientation(); + m_splitVertical->setChecked( o == "Vertical" ); + m_splitHorizontal->setChecked( o == "Horizontal" ); +} + +void CCConfigWidget::saveSplitTab( ) +{ + CppSplitHeaderSourceConfig * config = m_pPart->splitHeaderSourceConfig(); + + if ( config == 0 ) + return ; + + config->setSplitEnable( m_splitEnable->isChecked() ); + config->setAutoSync( m_splitSync->isChecked() ); + + if ( m_splitVertical->isChecked() ) + config->setOrientation( "Vertical" ); + else if ( m_splitHorizontal->isChecked() ) + config->setOrientation( "Horizontal" ); + + config->store(); +} + +void CCConfigWidget::initQtTab() +{ + m_qtDir->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly); + + QtBuildConfig* c = m_pPart->qtBuildConfig(); + c->init(); + + m_qtUsed->setChecked( c->isUsed() ); + if( c->version() == 4 ) + { + m_versionQt4->setChecked( true ); + m_kdevembedded->setEnabled( false ); + m_kdevexternal->setEnabled( false ); + m_qtStyleVersion4->setEnabled( true ); + m_designerPath->setEnabled( true ); + m_qmakePath->setEnabled( true ); + m_qtDir->setEnabled( false ); + m_txtQtDir->setEnabled( false ); + m_txtDesigner->setEnabled( true ); + pluginPaths->setEnabled( true ); + } + else + { + m_versionQt3->setChecked( true ); + m_kdevembedded->setEnabled( true ); + m_kdevexternal->setEnabled( true ); + m_qtStyleVersion4->setEnabled( false ); + m_designerPath->setEnabled( true ); + m_qmakePath->setEnabled( true ); + m_qtDir->setEnabled( true ); + m_txtQtDir->setEnabled( true ); + m_txtDesigner->setEnabled( true ); + pluginPaths->setEnabled( false ); + } + if( c->includeStyle() == 4 ) + { + m_qtStyleVersion4->setChecked( true ); + }else + { + m_qtStyleVersion3->setChecked( true ); + } + m_qtDir->setURL( c->root() ); + isValidQtDir(m_qtDir->url()); + m_qmakePath->setURL( c->qmakePath() ); + isExecutable( m_qmakePath->url() ); + m_designerPath->setURL( c->designerPath() ); + isExecutable( m_designerPath->url() ); + if ( c->designerIntegration() == "EmbeddedKDevDesigner" ) + { + m_kdevembedded->setChecked( true ); + } + else if ( c->designerIntegration() == "ExternalKDevDesigner" ) + { + m_kdevexternal->setChecked( true ); + }else + { + m_qtdesigner->setChecked( true ); + } +} + +bool CCConfigWidget::isExecutable( const QString& path ) +{ + QFileInfo fi(path); + + return ( fi.exists() && fi.isExecutable() ); +} + +void CCConfigWidget::isQMakeExecutable( const QString& path ) +{ + if( !isExecutable( path ) ) + { + m_qmakePath->lineEdit()->setPaletteForegroundColor(QColor("#ff0000")); + }else + { + m_qmakePath->lineEdit()->unsetPalette(); + } +} + +void CCConfigWidget::isDesignerExecutable( const QString& path ) +{ + if( !isExecutable( path ) ) + { + m_designerPath->lineEdit()->setPaletteForegroundColor(QColor("#ff0000")); + }else + { + m_designerPath->lineEdit()->unsetPalette(); + } +} + +void CCConfigWidget::saveQtTab() +{ + QtBuildConfig* c = m_pPart->qtBuildConfig(); + + c->setUsed( m_qtUsed->isChecked() ); + if( m_versionQt4->isChecked() ) + { + c->setVersion( 4 ); + } + else + { + c->setVersion( 3 ); + } + if( m_qtStyleVersion4->isChecked() ) + { + c->setIncludeStyle( 4 ); + }else + { + c->setIncludeStyle( 3 ); + } + c->setRoot( m_qtDir->url() ); + c->setQMakePath( m_qmakePath->url() ); + c->setDesignerPath( m_designerPath->url() ); + if( m_kdevembedded->isChecked() ) + { + c->setDesignerIntegration( "EmbeddedKDevDesigner" ); + } + else if ( m_kdevexternal->isChecked() ) + { + c->setDesignerIntegration( "ExternalKDevDesigner" ); + }else + { + c->setDesignerIntegration( "ExternalDesigner" ); + } + c->store(); +} + +void CCConfigWidget::isValidQtDir( const QString &dir ) +{ + QFileInfo inc( dir + QString( QChar( QDir::separator() ) )+ + "include"+QString( QChar( QDir::separator() ) )+ + "qt.h" ); + if ( !m_versionQt4->isChecked() && !inc.exists() ) + { + m_qtDir->lineEdit()->setPaletteForegroundColor(QColor("#ff0000")); + }else + { + m_qtDir->lineEdit()->unsetPalette(); + } +} + +void CCConfigWidget::toggleQtVersion( bool ) +{ + if ( m_versionQt3->isChecked() ) + { + m_qtStyleVersion4->setEnabled( false ); + m_qtStyleVersion3->setChecked( true ); + m_kdevembedded->setEnabled( true ); + m_kdevexternal->setEnabled( true ); + pluginPaths->setEnabled( false ); + } + if ( m_versionQt4->isChecked() ) + { + m_qtStyleVersion4->setEnabled( true ); + m_qtdesigner->setChecked( true ); + m_kdevembedded->setEnabled( false ); + m_kdevexternal->setEnabled( false ); + pluginPaths->setEnabled( true ); + } + isValidQtDir( m_qtDir->url() ); + isQMakeExecutable( m_qmakePath->url() ); + isDesignerExecutable( m_designerPath->url() ); +} + +void CCConfigWidget::openPluginPaths() +{ + kdDebug(9024) << "Plugin paths opened" << endl; + QtBuildConfig* c = m_pPart->qtBuildConfig(); + KDialog d( this ); + QVBoxLayout* mainlayout = new QVBoxLayout( &d ); + KPushButton* ok = new KPushButton( KStdGuiItem::ok(), &d ); + connect( ok, SIGNAL(clicked()), &d, SLOT(accept())); + KPushButton* cancel = new KPushButton( KStdGuiItem::cancel(), &d ); + connect( cancel, SIGNAL(clicked()), &d, SLOT(reject())); + QHBoxLayout* btns = new QHBoxLayout( &d ); + btns->addItem( new QSpacerItem(10,10,QSizePolicy::Expanding) ); + btns->addWidget(ok); + btns->addWidget(cancel); + + d.setCaption( i18n( "Edit Qt4 Designer Plugin Paths" ) ); + KURLRequester * req = new KURLRequester( &d ); + req->setMode( KFile::Directory ); + KEditListBox* p = new KEditListBox( i18n( "Plugin Paths" ), req->customEditor(), &d ); + p->insertStringList( c->designerPluginPaths() ); + mainlayout->addWidget( p ); + mainlayout->addLayout( btns ); + d.resize( 450, 250 ); + if( d.exec() == QDialog::Accepted) + { + c->setDesignerPluginPaths( p->items() ); + } +} + +#include "ccconfigwidget.moc" + +//kate: indent-mode csands; tab-width 4; space-indent off; diff --git a/languages/cpp/ccconfigwidget.h b/languages/cpp/ccconfigwidget.h new file mode 100644 index 00000000..b8874ed2 --- /dev/null +++ b/languages/cpp/ccconfigwidget.h @@ -0,0 +1,74 @@ +/*************************************************************************** +* Copyright (C) 2001 by Daniel Engelschalt * +* daniel.engelschalt@gmx.net * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef _CCCONFIGWIDGET_H_ +#define _CCCONFIGWIDGET_H_ + +#include "ccconfigwidgetbase.h" +#include + +class CppSupportPart; +class Catalog; +class QCheckListItem; +class KEditListBox; + +class CCConfigWidget : public CCConfigWidgetBase +{ + Q_OBJECT + +public: + CCConfigWidget( CppSupportPart* part, QWidget* parent = 0, const char* name = 0 ); + virtual ~CCConfigWidget( ); + +public slots: + void accept( ); + void slotNewPCS(); + +protected slots: + void slotGetterSetterValuesChanged(); + virtual void slotRemovePCS(); + +private slots: + void catalogRegistered( Catalog* c ); + void catalogUnregistered( Catalog* c ); + void isValidQtDir( const QString & ); + void isDesignerExecutable( const QString& ); + void isQMakeExecutable( const QString& ); + void toggleQtVersion( bool ); + void openPluginPaths( ); + +private: + bool isExecutable( const QString & ); + + void initGeneralTab(); + void saveFileTemplatesTab(); + + void initQtTab(); + void saveQtTab(); + + void initCodeCompletionTab(); + void saveCodeCompletionTab(); + + void initGetterSetterTab(); + void saveGetterSetterTab(); + + void initSplitTab(); + void saveSplitTab(); + +private: + CppSupportPart* m_pPart; + QMap m_catalogs; + KEditListBox* m_designerPluginPaths; +}; + +#endif +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/ccconfigwidgetbase.ui b/languages/cpp/ccconfigwidgetbase.ui new file mode 100644 index 00000000..b7efc7d0 --- /dev/null +++ b/languages/cpp/ccconfigwidgetbase.ui @@ -0,0 +1,1798 @@ + +CCConfigWidgetBase + + + CCConfigWidgetBase + + + + 0 + 0 + 839 + 622 + + + + C++ Options + + + + unnamed + + + + cpp_options + + + + codeCompletionPage + + + &Code Completion + + + + unnamed + + + + layout11 + + + + unnamed + + + + groupBox4 + + + Code Completion Options + + + + unnamed + + + + checkAutomaticCodeCompletion + + + + 1 + 0 + 1 + 0 + + + + A&utomatic code completion: + + + true + + + Offer options to complete what you are typing. + + + + + layout13 + + + + unnamed + + + + spacer14 + + + Horizontal + + + Fixed + + + + 30 + 20 + + + + + + inputCodeCompletion + + + + 1 + 0 + 0 + 0 + + + + How long after a key press to offer suggestions + + + + + textLabel1 + + + + 1 + 5 + 0 + 0 + + + + msec + + + + + + + checkListGlobalItems + + + List &global items when +performing automatic completion + + + When this is checked, members of all +higher namespaces will be included in +the completion-list while performing +automatic completion. + +This may bloat the completion-list +and create a significant delay. + + + When this is checked, members of all +higher namespaces will be included in +the completion-list while performing +automatic completion. + +This may bloat the completion-list +and create a significant delay. + + + + + checkCompleteReturnType + + + &Do complete member-type-evaluation + + + Completely evaluate member-types of +template-classes (this includes types +of member-variables and return-types +of member-functions) in the +completion-box. + + + Completely evaluate member-types of +template-classes (this includes types +of member-variables and return-types +of member-functions) in the +completion-box. + + + + + checkCompleteArgumentType + + + Do complete argument-type-e&valuation + + + Completely evaluate the function-argument-types +of template-class member-functions in the +completion-box. + + + Completely evaluate the function-argument-types +of template-class member-functions in the +completion-box. + + + + + + + groupBox8_2 + + + Argument Hint Options + + + + unnamed + + + + checkAutomaticArgumentsHint + + + Auto&matic arguments hint: + + + true + + + + + layout14 + + + + unnamed + + + + spacer15 + + + Horizontal + + + Fixed + + + + 30 + 20 + + + + + + inputArgumentsHint + + + + 1 + 0 + 0 + 0 + + + + + + textLabel1_2 + + + + 1 + 5 + 0 + 0 + + + + msec + + + + + + + checkShowCommentInArgumentHint + + + Show comment with +argument hint + + + + + + + + + + + + layout12 + + + + unnamed + + + + buttonGroup6 + + + Incremental Parsing + + + + unnamed + + + + radioButton13 + + + Do not process included headers + + + true + + + + + checkParseMissingHeaders + + + Preprocess and parse included +headers into a database(experimental) + + + Parse preprocessed headers that are not part of this project +into a special completion-database. To reparse the headers delete +the database and reopen the project. + + + + + checkPreprocessIncludedHeaders + + + Preprocess included headers +(collect macros and visibility-information) + + + Try to locate all included files and preprocess them. +This makes macros and imported namespaces work correctly, and allows KDevelop +to know what code-items are visible from within which file. +Note: Parsing may become very slow when this is enabled +(It will become faster after some time). + + + + + + + groupBox5 + + + Code Completion Databases + + + <b>Code Completion Databases</b> are used to store the parsed headers for external libraries, to allow code completion for non-project classes and methods. + + + + unnamed + + + + + Column 1 + + + true + + + true + + + + advancedOptions + + + true + + + LastColumn + + + + + layout6 + + + + unnamed + + + + spacer12 + + + Vertical + + + Expanding + + + + 20 + 31 + + + + + + newPCSButton + + + &Add... + + + Click to start the Code Completion database creation wizard. + + + + + removePCSButton + + + &Delete + + + + + spacer13 + + + Vertical + + + Expanding + + + + 20 + 31 + + + + + + + + + + + + groupBox9_2 + + + Misc + + + + unnamed + + + + checkResolveIncludePaths + + + + 4 + 0 + 0 + 0 + + + + Advanced include-path resolution using make(e&xperimental) + + + Try to resolve the include-path by getting the command that would be used +for compiling the file and parsing the gcc-options. The build-system needs to be working, +test for problems by running "make -n -W myfile.cpp myfile.o" in the directory. +This also works with cmake, and maybe some other build-systems that build on make. +The project needs to be compiled or at least configured before this system may work. + + + + + checkShowTypeEvaluationInStatusBar + + + Show t&ype evaluation in status bar + + + + + editIncludePaths + + + src; + + + A semicolon-separated list of include-paths to be used while searching for headers. +Paths not starting with '/' will be interpreted as relative to the project-folder. + + + + + editNamespaceAlias + + + std=_GLIBCXX_STD + + + This line may contain a semicolon-separated list of namespace-aliases and namespace-imports. +example: "std<<_GLIBCXX_STD;NewNamespaceName=OldNamespaceName; << SomeGloballyImportedNamespace" (without paratheses). +"<<" means that the right namespace is imported into the left, while "=" means that both namespaces are treated as +if they were one("a=b" is equivalent to "a<<b;b<<a") + + + + + textLabel1_6 + + + Custom include paths: + + + + + textLabel1_3 + + + Namespace alias list: + + + + + + + spacer15_2 + + + Vertical + + + Expanding + + + + 20 + 16 + + + + + + + + navigationTab + + + &Navigation + + + + unnamed + + + + groupBox12 + + + Header/Source split (Highly Experimental) + + + + unnamed + + + + m_splitEnable + + + Enable split of Header/So&urce files + + + Check to have header and source appear in the same page. + + + Check to have header and source appear in the same page. + + + + + layout6 + + + + unnamed + + + + m_splitSync + + + false + + + Automatic S&ynchronize + + + Check to have the source file scroll as you +navigate the header and vice versa + + + Check to have the source file scroll as you +navigate the header and vice versa + + + + + + + m_splitOrientationBox + + + false + + + Orientation + + + true + + + Select which Qt version your project is using. + + + + unnamed + + + + m_splitVertical + + + &Vertical + + + true + + + Select this if your project is using Qt version 3.x. + + + + + m_splitHorizontal + + + Hori&zontal + + + Select this if your project is using Qt version 4.x. + + + + + + + + + spacer12_2_2 + + + Vertical + + + Expanding + + + + 20 + 400 + + + + + + groupBox21 + + + Context Menu + + + + unnamed + + + + m_switchShouldMatch + + + Switch Header/Implementation &matches current function + + + true + + + Check to have the <b>Switch Header/Implementation</b> +feature attempt to match the function under the +cursor with the matching declaration/definition. + + + + Check to have the <b>Switch Header/Implementation</b> +feature attempt to match the function under the +cursor with the matching declaration/definition. + + + + + + m_showContextMenuExplosion + + + Show Go To &Declaration/Definition submenus + + + Check to show two additional submenus +in the editor context menu containing +all the declarations and definitions +for the current file and its matching +header/implementation file. + + + Check to show two additional submenus +in the editor context menu containing +all the declarations and definitions +for the current file and its matching +header/implementation file. + + + + + checkBox18 + + + Show type evaluation &based navigation menus + + + Menus appear on the right mouse click context menu, +hows menu items to navigate. Needs the "Class View" +plugin enabled to have use all options. + + + Menus appear on the right mouse click context menu, +hows menu items to navigate. Needs the "Class View" +plugin enabled to have use all options. + + + + + + + + + classWizardPage + + + Class Wi&zard + + + + unnamed + + + + options + + + + 5 + 5 + 0 + 0 + + + + Filename options + + + These are the suffixes used by the Class Wizard when creating new classes.<br>Should be in the format: ".suffix" + + + + unnamed + + + + interface_suffix + + + + + implementation_suffix + + + + + TextLabel3 + + + &Interface suffix: + + + interface_suffix + + + + + TextLabel4 + + + I&mplementation suffix: + + + implementation_suffix + + + + + + + spacer12_2 + + + Vertical + + + Expanding + + + + 20 + 337 + + + + + + + + qtPage + + + &Qt Options + + + + unnamed + + + + m_qtUsed + + + Enable Qt opt&ions + + + + + m_qtVersionDirectoryBox + + + false + + + Qt Version, Directory and QMake Binary + + + true + + + Select which Qt version your project is using and where that Qt version is installed to. + +This option only applies to QMake projects. + + + + unnamed + + + + layout9 + + + + unnamed + + + + m_versionQt3 + + + Qt 3 + + + true + + + Use Qt version 3 (When this is changed the project needs to be closed and re-opened.) + + + Select this if your project is using Qt version 3.x.<br>When this is changed the project needs to be closed and re-opened. + + + + + m_versionQt4 + + + Qt 4 + + + Use Qt version 4 (When this is changed the project needs to be closed and re-opened.) + + + Select this if your project is using Qt version 4.x.<br>When this is changed the project needs to be closed and re-opened. + + + + + textLabel1_5 + + + (After changing the project needs to be re-opened) + + + AlignVCenter + + + + + spacer13_2 + + + Horizontal + + + Expanding + + + + 470 + 20 + + + + + + + + layout9 + + + + unnamed + + + + m_txtQtDir + + + Qt3 Directory: + + + This setting is only needed for Qt3 programs, for Qt4 just make sure the QMake Binary is set properly + + + + + m_qtDir + + + The Qt directory, will be red if it is not a valid Qt directory. This setting is only needed for Qt3 programs. + + + Choose the directory that Qt was installed to. If this is shown in red the directory is not a valid Qt directory. + + + + + + + layout8 + + + + unnamed + + + + m_txtQMake + + + QMake Binary: + + + + + m_qmakePath + + + The full path to the QMake executable to be used + + + + + + + + + m_qtStyleBox + + + false + + + Qt include syntax + + + true + + + Select which include style your project is using. + + + + unnamed + + + + m_qtStyleVersion3 + + + Qt &3 style (#include <qwidget.h>) + + + Alt+3 + + + true + + + Select this if your project is using include style as known from Qt version 3.x. + + + + + m_qtStyleVersion4 + + + Qt &4 style (#include <QWidget>) + + + Alt+4 + + + Select this if your project is using include style as known from Qt version 4.x. + + + + + + + m_designerBox + + + false + + + UI Designer Integration + + + false + + + true + + + + unnamed + + + + m_kdevembedded + + + &Use KDevelop's embedded designer + + + Start KDevelop's own designer embedded within KDevelop + + + KDevelop comes with its own UI designer that can either be embedded or be run as a separate program. Check this button if you wish to integrate the UI designer into KDevelop. + + + + + m_kdevexternal + + + Run &KDevelop's designer as a separate application + + + Start KDevelop's own designer externally + + + KDevelop comes with its own UI designer that can either be embedded or be run as a separate program. Check this button if you wish to run KDevelop's UI designer as a separate program. + + + + + m_qtdesigner + + + Run Qt &Designer + + + Use Qt Designer externally + + + Check this button if you wish to use Qt Designer rather than KDevelop's integrated designer. + + + + + layout9 + + + + unnamed + + + + m_txtDesigner + + + Designer Binary: + + + m_designerPath + + + + + m_designerPath + + + The full path to the Designer executable to be used + + + + + + + layout10 + + + + unnamed + + + + textLabel1_4 + + + Extra Plugin Paths for Qt4 Designer: + + + m_designerPrefix + + + + + pluginPaths + + + Change Plugin Paths + + + + + + + + + spacer14_2 + + + Vertical + + + Expanding + + + + 20 + 70 + + + + + + + + accessorPage + + + &Accessors + + + + unnamed + + + + groupBox8 + + + E&xample for Member Variable of Type String + + + + unnamed + + + + layout5_2 + + + + unnamed + + + + m_lblVariableName + + + Variable name: + + + + + m_edtVariableName + + + m_x + + + + + spacer4_3 + + + Horizontal + + + Expanding + + + + 61 + 20 + + + + + + + + m_edtExampleGet + + + int x() const; + + + true + + + + + m_edtExampleSet + + + void setX(const string& theValue); + + + true + + + + + textLabel7 + + + Get method: + + + + + textLabel8 + + + Set method: + + + + + + + groupBox9 + + + Settings + + + Will show as "Create Accessor Methods" in the +right mouse button context menu only when +you right click on a variable in a header file. + + + Will show as "Create Accessor Methods" in the +right mouse button context menu only when +you right click on a variable in a header file. + + + + unnamed + + + + m_edtGet + + + Will show as "Create Accessor Methods" in the +right mouse button context menu only when +you right click on a variable in a header file. + + + Will show as "Create Accessor Methods" in the +right mouse button context menu only when +you right click on a variable in a header file. + + + + + m_lblGet + + + Prefix for <b>get</b> methods: + + + + + m_edtSet + + + set + + + Will show as "Create Accessor Methods" in the +right mouse button context menu only when +you right click on a variable in a header file. + + + Will show as "Create Accessor Methods" in the +right mouse button context menu only when +you right click on a variable in a header file. + + + + + m_lblSet + + + Prefix for <b>set</b> methods: + + + + + m_edtRemovePrefix + + + m_ + + + + + m_lblRemovePrefix + + + Member <b>variable</b> prefix to remove: + + + + + m_edtParameterName + + + theValue + + + + + spacer5_2 + + + Horizontal + + + Expanding + + + + 87 + 20 + + + + + + m_lblParameterName + + + <b>Parametername</b> in set method: + + + + + spacer5 + + + Horizontal + + + Expanding + + + + 87 + 20 + + + + + + spacer8 + + + Horizontal + + + Expanding + + + + 92 + 20 + + + + + + spacer7 + + + Horizontal + + + Expanding + + + + 92 + 20 + + + + + + + + spacer36 + + + Vertical + + + Expanding + + + + 20 + 91 + + + + + + + + + + + + + newPCSButton + clicked() + CCConfigWidgetBase + slotNewPCS() + + + m_edtVariableName + textChanged(const QString&) + CCConfigWidgetBase + slotGetterSetterValuesChanged() + + + m_edtRemovePrefix + textChanged(const QString&) + CCConfigWidgetBase + slotGetterSetterValuesChanged() + + + m_edtGet + textChanged(const QString&) + CCConfigWidgetBase + slotGetterSetterValuesChanged() + + + m_edtSet + textChanged(const QString&) + CCConfigWidgetBase + slotGetterSetterValuesChanged() + + + m_edtParameterName + textChanged(const QString&) + CCConfigWidgetBase + slotGetterSetterValuesChanged() + + + checkAutomaticCodeCompletion + toggled(bool) + inputCodeCompletion + setEnabled(bool) + + + checkAutomaticArgumentsHint + toggled(bool) + inputArgumentsHint + setEnabled(bool) + + + removePCSButton + clicked() + CCConfigWidgetBase + slotRemovePCS() + + + m_splitEnable + toggled(bool) + CCConfigWidgetBase + slotEnableSplit(bool) + + + m_splitEnable + toggled(bool) + m_splitSync + setEnabled(bool) + + + m_qtUsed + toggled(bool) + m_qtStyleBox + setEnabled(bool) + + + m_qtUsed + toggled(bool) + m_qtVersionDirectoryBox + setEnabled(bool) + + + m_qtUsed + toggled(bool) + m_designerBox + setEnabled(bool) + + + m_splitEnable + toggled(bool) + m_splitOrientationBox + setEnabled(bool) + + + m_versionQt3 + toggled(bool) + CCConfigWidgetBase + toggleQtVersion(bool) + + + m_versionQt4 + toggled(bool) + CCConfigWidgetBase + toggleQtVersion(bool) + + + m_qtdesigner + toggled(bool) + m_txtDesigner + setEnabled(bool) + + + m_qtdesigner + toggled(bool) + m_designerPath + setEnabled(bool) + + + m_kdevexternal + toggled(bool) + m_txtDesigner + setDisabled(bool) + + + m_kdevembedded + toggled(bool) + m_txtDesigner + setDisabled(bool) + + + m_kdevexternal + toggled(bool) + m_designerPath + setDisabled(bool) + + + m_kdevembedded + toggled(bool) + m_designerPath + setDisabled(bool) + + + m_versionQt4 + toggled(bool) + m_qtDir + setDisabled(bool) + + + m_versionQt4 + toggled(bool) + m_txtQtDir + setDisabled(bool) + + + m_versionQt3 + toggled(bool) + m_txtQtDir + setEnabled(bool) + + + m_versionQt3 + toggled(bool) + m_qtDir + setEnabled(bool) + + + m_qtDir + textChanged(const QString&) + CCConfigWidgetBase + isValidQtDir(const QString&) + + + m_qmakePath + textChanged(const QString&) + CCConfigWidgetBase + isQMakeExecutable(const QString&) + + + m_qmakePath + urlSelected(const QString&) + CCConfigWidgetBase + isQMakeExecutable(const QString&) + + + m_qtDir + urlSelected(const QString&) + CCConfigWidgetBase + isValidQtDir(const QString&) + + + m_designerPath + textChanged(const QString&) + CCConfigWidgetBase + isDesignerExecutable(const QString&) + + + m_designerPath + urlSelected(const QString&) + CCConfigWidgetBase + isDesignerExecutable(const QString&) + + + m_versionQt4 + toggled(bool) + textLabel1_4 + setEnabled(bool) + + + pluginPaths + clicked() + CCConfigWidgetBase + openPluginPaths() + + + m_versionQt4 + toggled(bool) + pluginPaths + setEnabled(bool) + + + + cpp_options + checkAutomaticCodeCompletion + inputCodeCompletion + checkAutomaticArgumentsHint + inputArgumentsHint + newPCSButton + advancedOptions + + + kurlrequester.h + kdialog.h + + + implementationFile() + interfaceFile() + slotAddPPPath() + slotEnableCC() + slotEnableCH() + slotEnableChooseFiles( bool ) + slotEnablePCS() + slotEnablePP() + slotRemovePPPath() + slotSelectTemplateGroup( const QString & ) + slotSetCHWindow() + slotNewPCS() + slotGetterSetterValuesChanged() + slotRemovePCS() + slotEnableSplit( bool ) + toggleQtVersion(bool) + isDesignerExecutable(const QString&) + isQMakeExecutable(const QString&) + isValidQtDir(const QString&) + openPluginPaths() + + + + + knuminput.h + knuminput.h + knuminput.h + knuminput.h + kurlrequester.h + kpushbutton.h + kurlrequester.h + kpushbutton.h + kurlrequester.h + kpushbutton.h + kpushbutton.h + + diff --git a/languages/cpp/classgeneratorconfig.cpp b/languages/cpp/classgeneratorconfig.cpp new file mode 100644 index 00000000..c6049801 --- /dev/null +++ b/languages/cpp/classgeneratorconfig.cpp @@ -0,0 +1,236 @@ +/*************************************************************************** +* Copyright (C) 2003 by Alexander Dymo * +* cloudtemple@mksat.net * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#include +#include +#include +#include +#include + +#include +#include + +#include "cppsupportfactory.h" +#include "classgeneratorconfig.h" + +ClassGeneratorConfig::ClassGeneratorConfig( QWidget* parent, const char* name, WFlags fl ) + : ClassGeneratorConfigBase( parent, name, fl ) +{ + readConfig(); + currTemplate = &cppHeaderText; + template_edit->setText( *currTemplate ); +} + +ClassGeneratorConfig::ClassGeneratorConfig( QString v_cppHeaderText, QString v_cppSourceText, + QString v_objcHeaderText, QString v_objcSourceText, + QString v_gtkHeaderText, QString v_gtkSourceText, + NameCase v_fileCase, NameCase v_defCase, NameCase v_superCase, + bool v_showAuthor, bool v_genDoc, bool v_reformat, + QWidget* parent, const char* name, WFlags fl ) + : ClassGeneratorConfigBase( parent, name, fl ), + cppHeaderText( v_cppHeaderText ), cppSourceText( v_cppSourceText ), + objcHeaderText( v_objcHeaderText ), objcSourceText( v_objcSourceText ), + gtkHeaderText( v_gtkHeaderText ), gtkSourceText( v_gtkSourceText ) +{ + filecase_box->setCurrentItem( ( int ) v_fileCase ); + defcase_box->setCurrentItem( ( int ) v_defCase ); + supercase_box->setCurrentItem( ( int ) v_superCase ); + author_box->setChecked( v_showAuthor ); + doc_box->setChecked( v_genDoc ); + reformat_box->setChecked( v_reformat ); + + currTemplate = &cppHeaderText; +} + +ClassGeneratorConfig::~ClassGeneratorConfig() +{} + +/*$SPECIALIZATION$*/ +void ClassGeneratorConfig::templateTypeChanged( int type ) +{ + *currTemplate = template_edit->text(); + + currTemplate = identifyTemplate( type ); + template_edit->setText( *currTemplate ); +} + +QString ClassGeneratorConfig::cppHeader() +{ + if ( currTemplate == &cppHeaderText ) + * currTemplate = template_edit->text(); + return cppHeaderText; +} + +QString ClassGeneratorConfig::cppSource() +{ + if ( currTemplate == &cppSourceText ) + * currTemplate = template_edit->text(); + return cppSourceText; +} + +QString ClassGeneratorConfig::objcHeader() +{ + if ( currTemplate == &objcHeaderText ) + * currTemplate = template_edit->text(); + return objcHeaderText; +} + +QString ClassGeneratorConfig::objcSource() +{ + if ( currTemplate == &objcSourceText ) + * currTemplate = template_edit->text(); + return objcSourceText; +} + +QString ClassGeneratorConfig::gtkHeader() +{ + if ( currTemplate == >kHeaderText ) + * currTemplate = template_edit->text(); + return gtkHeaderText; +} + +QString ClassGeneratorConfig::gtkSource() +{ + if ( currTemplate == >kSourceText ) + * currTemplate = template_edit->text(); + return gtkSourceText; +} + +ClassGeneratorConfig::NameCase ClassGeneratorConfig::fileCase() +{ + return ( NameCase ) filecase_box->currentItem(); +} + +ClassGeneratorConfig::NameCase ClassGeneratorConfig::defCase() +{ + return ( NameCase ) defcase_box->currentItem(); +} + +ClassGeneratorConfig::NameCase ClassGeneratorConfig::superCase() +{ + return ( NameCase ) supercase_box->currentItem(); +} + +bool ClassGeneratorConfig::showAuthor() +{ + return author_box->isChecked(); +} + +bool ClassGeneratorConfig::genDoc() +{ + return doc_box->isChecked(); +} + +QString *ClassGeneratorConfig::identifyTemplate( int value ) +{ + switch ( value ) + { + case 0: + return & cppHeaderText; + case 1: + return &cppSourceText; + case 2: + return &objcHeaderText; + case 3: + return &objcSourceText; + case 4: + return >kHeaderText; + case 5: + return >kSourceText; + } + return 0; +} + +void ClassGeneratorConfig::readConfig() +{ + KConfig * config = CppSupportFactory::instance() ->config(); + if ( config ) + { + config->setGroup( "Class Generator" ); + + filecase_box->setCurrentItem( config->readNumEntry( "File Name Case", 0 ) ); + defcase_box->setCurrentItem( config->readNumEntry( "Defines Case", 1 ) ); + supercase_box->setCurrentItem( config->readNumEntry( "Superclasss Name Case", 0 ) ); + + author_box->setChecked( config->readBoolEntry( "Show Author Name", 1 ) ); + doc_box->setChecked( config->readBoolEntry( "Generate Empty Documentation", 1 ) ); + + reformat_box->setChecked( config->readBoolEntry( "Reformat Source", 0 ) ); + + KStandardDirs *dirs = CppSupportFactory::instance() ->dirs(); + + cppHeaderText = templateText( dirs->findResource( "newclasstemplates", "cpp_header" ) ); + cppSourceText = templateText( dirs->findResource( "newclasstemplates", "cpp_source" ) ); + objcHeaderText = templateText( dirs->findResource( "newclasstemplates", "objc_header" ) ); + objcSourceText = templateText( dirs->findResource( "newclasstemplates", "objc_source" ) ); + gtkHeaderText = templateText( dirs->findResource( "newclasstemplates", "gtk_header" ) ); + gtkSourceText = templateText( dirs->findResource( "newclasstemplates", "gtk_source" ) ); + } +} + + +QString ClassGeneratorConfig::templateText( QString path ) +{ + QFileInfo f( path ); + if ( f.exists() ) + { + QFile file( path ); + if ( file.open( IO_ReadOnly ) ) + { + QTextStream stream( &file ); + return stream.read(); + } + else + return ""; + } + else + return ""; +} + +void ClassGeneratorConfig::storeConfig() +{ + KConfig * config = CppSupportFactory::instance() ->config(); + if ( config ) + { + config->setGroup( "Class Generator" ); + + config->writeEntry( "File Name Case", filecase_box->currentItem() ); + config->writeEntry( "Defines Case", defcase_box->currentItem() ); + config->writeEntry( "Superclasss Name Case", supercase_box->currentItem() ); + + config->writeEntry( "Show Author Name", author_box->isChecked() ); + config->writeEntry( "Generate Empty Documentation", doc_box->isChecked() ); + + config->writeEntry( "Reformat Source", reformat_box->isChecked() ); + + KStandardDirs *dirs = CppSupportFactory::instance() ->dirs(); + + saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "cpp_header", cppHeader() ); + saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "cpp_source", cppSource() ); + saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "objc_header", objcHeader() ); + saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "objc_source", objcSource() ); + saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "gtk_header", gtkHeader() ); + saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "gtk_source", gtkSource() ); + } +} + +void ClassGeneratorConfig::saveTemplateText( QString path, QString content ) +{ + QFile f( path ); + if ( f.open( IO_WriteOnly ) ) + { + QTextStream stream( &f ); + stream << content; + f.close(); + } +} + +#include "classgeneratorconfig.moc" diff --git a/languages/cpp/classgeneratorconfig.h b/languages/cpp/classgeneratorconfig.h new file mode 100644 index 00000000..b9cb08a3 --- /dev/null +++ b/languages/cpp/classgeneratorconfig.h @@ -0,0 +1,81 @@ +/*************************************************************************** +* Copyright (C) 2003 by Alexander Dymo * +* cloudtemple@mksat.net * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef CLASSGENERATORCONFIG_H +#define CLASSGENERATORCONFIG_H + +#include "classgeneratorconfigbase.h" + +class ClassGeneratorConfig : public ClassGeneratorConfigBase +{ + Q_OBJECT + +public: + enum NameCase { LowerCase, UpperCase, SameAsClassCase, SameAsFileCase }; + + ClassGeneratorConfig( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + + ClassGeneratorConfig( QString v_cppHeaderText, QString v_cppSourceText, + QString v_objcHeaderText, QString v_objcSourceText, + QString v_gtkHeaderText, QString v_gtkSourceText, + NameCase v_fileCase, NameCase v_defCase, NameCase v_superCase, + bool v_showAuthor, bool v_genDoc, bool v_reformat, + QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + + ~ClassGeneratorConfig(); + /*$PUBLIC_FUNCTIONS$*/ + + void readConfig(); + + QString cppHeader(); + QString cppSource(); + QString objcHeader(); + QString objcSource(); + QString gtkHeader(); + QString gtkSource(); + + NameCase fileCase(); + NameCase defCase(); + NameCase superCase(); + + bool showAuthor(); + bool genDoc(); + +public slots: + /*$PUBLIC_SLOTS$*/ + void storeConfig(); + +protected: + /*$PROTECTED_FUNCTIONS$*/ + +protected slots: + /*$PROTECTED_SLOTS$*/ + virtual void templateTypeChanged( int type ); + +private: + QString *identifyTemplate( int value ); + QString templateText( QString path ); + void saveTemplateText( QString path, QString content ); + + QString cppHeaderText; + QString cppSourceText; + QString objcHeaderText; + QString objcSourceText; + QString gtkHeaderText; + QString gtkSourceText; + + QString *currTemplate; +}; + +#endif +// kate: indent-mode csands; tab-width 4; + + diff --git a/languages/cpp/classgeneratorconfigbase.ui b/languages/cpp/classgeneratorconfigbase.ui new file mode 100644 index 00000000..566e9eb2 --- /dev/null +++ b/languages/cpp/classgeneratorconfigbase.ui @@ -0,0 +1,261 @@ + +ClassGeneratorConfigBase + + + ClassGeneratorConfigBase + + + + 0 + 0 + 576 + 528 + + + + + unnamed + + + 0 + + + + groupBox7_2 + + + Class &Templates + + + + unnamed + + + + + Cpp Header + + + + + Cpp Source + + + + + Objective-C Header + + + + + Objective-C Source + + + + + GTK C Header + + + + + GTK C Source + + + + templatename_box + + + + + template_edit + + + + + + + groupBox10 + + + + 5 + 5 + 0 + 0 + + + + Names + + + + unnamed + + + + textLabel3_2 + + + #ifndef - #&define names: + + + defcase_box + + + + + textLabel3 + + + &File names: + + + filecase_box + + + + + + Lowercase + + + + + Uppercase + + + + + Same as Class Names + + + + filecase_box + + + + + + Lowercase + + + + + Uppercase + + + + + Same as Class Names + + + + + Same as File Names + + + + defcase_box + + + 1 + + + + + + Lowercase + + + + + Uppercase + + + + + Same as Class Names + + + + supercase_box + + + + + textLabel3_3 + + + &Superclass file names: + + + supercase_box + + + + + + + groupBox9 + + + Class Documentation + + + + unnamed + + + + author_box + + + Include &author name in class documentation + + + + + doc_box + + + Generate &empty documentation strings + + + + + + + reformat_box + + + &Reformat source before creating files + + + + + + + templatename_box + activated(int) + ClassGeneratorConfigBase + templateTypeChanged(int) + + + + templatename_box + template_edit + filecase_box + defcase_box + supercase_box + author_box + doc_box + + + kdialog.h + + + templateTypeChanged(int type) + + + + diff --git a/languages/cpp/codecompletionentry.h b/languages/cpp/codecompletionentry.h new file mode 100644 index 00000000..60042004 --- /dev/null +++ b/languages/cpp/codecompletionentry.h @@ -0,0 +1,57 @@ +/*************************************************************************** + cppcodecompletion.cpp - description + ------------------- + begin : Sat Jul 21 2001 + copyright : (C) 2001 by Victor R�er + email : victor_roeder@gmx.de + copyright : (C) 2002,2003 by Roberto Raggi + email : roberto@kdevelop.org + copyright : (C) 2005 by Adam Treat + email : manyoso@yahoo.com + copyright : (C) 2006 by David Nolden + email : david.nolden.kdevelop@art-master.de +***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef __CODECOMPLETIONENTRY_H__ +#define __CODECOMPLETIONENTRY_H__ + +#include + +//this is just a little helper-class to allow custom sorting, it must stay binary compatible with KTextEditor::CompletionEntry!! +class CodeCompletionEntry : public KTextEditor::CompletionEntry +{ +public: + CodeCompletionEntry() : KTextEditor::CompletionEntry() { + } + CodeCompletionEntry( const CodeCompletionEntry& rhs ) : KTextEditor::CompletionEntry( rhs ) { + } + CodeCompletionEntry( const KTextEditor::CompletionEntry& rhs ) : KTextEditor::CompletionEntry( rhs ) { + } + + bool operator < ( const CodeCompletionEntry& rhs ) { + return userdata < rhs.userdata; + } + bool operator == ( const CodeCompletionEntry& rhs ) { + return userdata == rhs.userdata; + } + bool operator > ( const CodeCompletionEntry& rhs ) { + return userdata > rhs.userdata; + } + + CodeCompletionEntry& operator = ( const KTextEditor::CompletionEntry& rhs ) { + (*(KTextEditor::CompletionEntry*)this) = rhs; + return *this; + } +}; + +#endif +// kate: indent-mode csands; tab-width 4; diff --git a/languages/cpp/codeinformationrepository.cpp b/languages/cpp/codeinformationrepository.cpp new file mode 100644 index 00000000..5bb22a68 --- /dev/null +++ b/languages/cpp/codeinformationrepository.cpp @@ -0,0 +1,339 @@ +/*************************************************************************** +* Copyright (C) 2003 by Roberto Raggi * +* roberto@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#include "codeinformationrepository.h" +#include "cpp_tags.h" + +#include +#include + +/// @todo move in utils.cpp +static QValueList +my_unique( const QValueList& entryList ) +{ + + QValueList< KTextEditor::CompletionEntry > l; + QMap map; + QValueList< KTextEditor::CompletionEntry >::ConstIterator it = entryList.begin(); + while ( it != entryList.end() ) + { + KTextEditor::CompletionEntry e = *it++; + QString key = e.type + " " + + e.text + " " + + e.prefix + " " + + e.postfix + " "; + if ( map.find( key ) == map.end() ) + { + map[ key ] = TRUE; + l << e; + } + } + return l; +} + +CodeInformationRepository::CodeInformationRepository( KDevCodeRepository* rep ) + : m_rep( rep ) +{} + +CodeInformationRepository::~CodeInformationRepository() +{} + +QValueList CodeInformationRepository::query( const QValueList & args ) +{ +// kdDebug( 9007 ) << "CodeInformationRepository::query()" << endl; + + QValueList tags; + + QValueList catalogs = m_rep->registeredCatalogs(); + QValueList::Iterator it = catalogs.begin(); + while ( it != catalogs.end() ) + { + Catalog * catalog = *it; + ++it; + + if ( !catalog->enabled() ) + continue; + + tags += catalog->query( args ); + } + + return tags; +} + +QValueList CodeInformationRepository::getTagsInFile( const QString & fileName ) +{ + kdDebug( 9007 ) << "CodeInformationRepository::getTagsInFile()" << endl; + + QValueList args; + args << Catalog::QueryArgument( "fileName", fileName ); + + QValueList catalogs = m_rep->registeredCatalogs(); + QValueList::Iterator it = catalogs.begin(); + while ( it != catalogs.end() ) + { + Catalog * catalog = *it; + ++it; + + QValueList tags = catalog->query( args ); + + if ( tags.size() ) + return tags; + } + + return QValueList(); +} + +QValueList CodeInformationRepository::getTagsInScope( const QStringList & scope, bool // isInstance + ) +{ + kdDebug( 9007 ) << "CodeInformationRepository::getTagsInScope()" << endl; + + QValueList tags; + QValueList args; + +#if 0 + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Namespace ) + << Catalog::QueryArgument( "scope", scope ); + tags += query( args ); + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Class ) + << Catalog::QueryArgument( "scope", scope ); + tags += query( args ); +#endif + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_FunctionDeclaration ) + << Catalog::QueryArgument( "scope", scope ); + tags += query( args ); + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Variable ) + << Catalog::QueryArgument( "scope", scope ); + tags += query( args ); + + if ( true /*!isInstance*/ ) + { + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Enumerator ) + << Catalog::QueryArgument( "scope", scope ); + tags += query( args ); + } + + return tags; +} + +QValueList CodeInformationRepository::getEntriesInScope( const QStringList & scope, bool isInstance, bool recompute ) +{ + kdDebug( 9007 ) << "CodeInformationRepository::getEntriesInScope()" << endl; + + if ( !recompute && !scope.size() && m_globalEntries.size() ) + return m_globalEntries; + else if ( scope.size() == 0 ) + { + m_globalEntries = my_unique( toEntryList( getTagsInScope( scope, isInstance ) ) ); + return m_globalEntries; + } + + return toEntryList( getTagsInScope( scope, isInstance ) ); +} + + +QValueList CodeInformationRepository::getBaseClassList( const QString& className ) +{ +// kdDebug( 9007 ) << "CodeInformationRepository::getBaseClassList()" << endl; + + if ( className.isEmpty() ) + return QValueList(); + + QValueList args; + args << Catalog::QueryArgument( "kind", Tag::Kind_Base_class ); + /* if( className.length() >= 2 ) + args << Catalog::QueryArgument( "prefix", className.left(2) );*/ + args << Catalog::QueryArgument( "name", className ); + return query( args ); +} + +QValueList CodeInformationRepository::getClassOrNamespaceList( const QStringList & scope ) +{ + kdDebug( 9007 ) << "CodeInformationRepository::getClassOrNamespaceList()" << endl; + + QValueList tags; + QValueList args; + + args << Catalog::QueryArgument( "kind", Tag::Kind_Namespace ) + << Catalog::QueryArgument( "scope", scope ); + tags += query( args ); + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Class ) + << Catalog::QueryArgument( "scope", scope ); + tags += query( args ); + + return tags; +} + +QValueList CodeInformationRepository::getTagsInScope( const QString & name, const QStringList & scope ) +{ + QValueList tags; + QValueList args; + + args.clear(); + args << Catalog::QueryArgument( "scope", scope ); + /* if( name.length() >= 2 ) + args << Catalog::QueryArgument( "prefix", name.left(2) ); */ + args << Catalog::QueryArgument( "name", name ); + + tags += query( args ); + + return tags; +} + +KTextEditor::CompletionEntry CodeInformationRepository::toEntry( Tag & tag, CppCodeCompletion::CompletionMode completionMode, TypeProcessor* proc ) +{ + KTextEditor::CompletionEntry entry; + + if ( tag.name().isEmpty() ) + return entry; + + switch ( tag.kind() ) + { + case Tag::Kind_Typedef: + entry.prefix = "typedef"; + entry.text = tag.name(); + break; + + case Tag::Kind_Class: + entry.prefix = "class"; + entry.text = tag.name(); + break; + + case Tag::Kind_Struct: + entry.prefix = "struct"; + entry.text = tag.name(); + break; + + case Tag::Kind_Namespace: + entry.prefix = "namespace"; + entry.text = tag.name(); + break; + + case Tag::Kind_FunctionDeclaration: + //case Tag::Kind_Function: + { + + CppFunction tagInfo( tag ); + QStringList arguments = tagInfo.arguments(); + QStringList argumentNames = tagInfo.argumentNames(); + + if ( completionMode == CppCodeCompletion::VirtualDeclCompletion ) + { + //Ideally the type info would be a entry.prefix, but we need them to be + //inserted upon completion so they have to be part of entry.text + entry.text = tagInfo.type(); + entry.text += " "; + entry.text += tag.name(); + } + else + entry.text = tag.name(); + + if ( !arguments.size() ) + entry.text += "("; + else + entry.text += "( "; + + QString signature; + for ( uint i = 0; i < arguments.size(); ++i ) + { + if( !proc ) + signature += arguments[ i ]; + else + signature += proc->processType( arguments[ i ] ); + + if ( completionMode == CppCodeCompletion::NormalCompletion || + completionMode == CppCodeCompletion::VirtualDeclCompletion ) + { + QString argName = argumentNames[ i ]; + if ( !argName.isEmpty() ) + signature += QString::fromLatin1( " " ) + argName; + + } + + if ( i != ( arguments.size() - 1 ) ) + { + signature += ", "; + } + } + + if ( signature.isEmpty() ) + entry.text += ")"; + else + entry.postfix = signature + " )"; + + if ( tagInfo.isConst() ) + entry.postfix += " const"; + + if ( completionMode == CppCodeCompletion::VirtualDeclCompletion ) + { + entry.text += entry.postfix + ";"; + entry.postfix = QString::null; + } + else if ( completionMode != CppCodeCompletion::NormalCompletion ) + { + entry.text += entry.postfix; + entry.postfix = QString::null; + } + + QString comment = tag.attribute( "description" ).toString(); + if ( !comment.isNull() ) + entry.comment = comment; + //else + //entry.comment = "no documentation available!"; + } + + break; + + case Tag::Kind_Enumerator: + case Tag::Kind_Variable: + entry.text = tag.name(); + break; + + default: + ; + } + + entry.comment = tag.comment(); + + return entry; +} + +QValueList CodeInformationRepository::toEntryList( const QValueList & tags, CppCodeCompletion::CompletionMode completionMode ) +{ + QValueList entryList; + QMap ns; + + QValueList::ConstIterator it = tags.begin(); + while ( it != tags.end() ) + { + Tag tag = *it; + ++it; + + KTextEditor::CompletionEntry entry = toEntry( tag, completionMode ); + if ( !entry.text.isEmpty() ) + entryList << entry; + } + + return entryList; +} + + diff --git a/languages/cpp/codeinformationrepository.h b/languages/cpp/codeinformationrepository.h new file mode 100644 index 00000000..f7fa712a --- /dev/null +++ b/languages/cpp/codeinformationrepository.h @@ -0,0 +1,58 @@ +/*************************************************************************** +* Copyright (C) 2003 by Roberto Raggi * +* roberto@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef CODEINFORMATIONREPOSITORY_H +#define CODEINFORMATIONREPOSITORY_H + +#include "catalog.h" +#include "cppcodecompletion.h" +#include + +#include + +struct TypeProcessor { + virtual QString processType( const QString& type ) = 0; + virtual QString parentType() = 0; +}; + +class KDevCodeRepository; + +class CodeInformationRepository +{ +public: + CodeInformationRepository( KDevCodeRepository* rep ); + virtual ~CodeInformationRepository(); + + static QValueList toEntryList( const QValueList& tags, + CppCodeCompletion::CompletionMode mode = CppCodeCompletion::NormalCompletion ); + static KTextEditor::CompletionEntry toEntry( Tag& tag, CppCodeCompletion::CompletionMode mode = CppCodeCompletion::NormalCompletion, TypeProcessor* proc = 0 ); + QValueList getEntriesInScope( const QStringList& scope, bool isInstance, bool recompute = false ); + + QValueList query( const QValueList& args ); + QValueList getTagsInScope( const QStringList& scope, bool isInstance ); + QValueList getTagsInScope( const QString& name, const QStringList& scope ); + + QValueList getTagsInFile( const QString& fileName ); + QValueList getBaseClassList( const QString& className ); + QValueList getClassOrNamespaceList( const QStringList& scope ); + +private: + QValueList m_globalEntries; + KDevCodeRepository* m_rep; + +private: + CodeInformationRepository( const CodeInformationRepository& source ); + void operator = ( const CodeInformationRepository& source ); +}; + +#endif +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/compiler/Makefile.am b/languages/cpp/compiler/Makefile.am new file mode 100644 index 00000000..128e715f --- /dev/null +++ b/languages/cpp/compiler/Makefile.am @@ -0,0 +1,6 @@ +# This is the collection of plugins. In contrast to the parts +# directory, these are 'transient' in a sense and don't +# share the complete KDevComponent interface. + +SUBDIRS = gccoptions + diff --git a/languages/cpp/compiler/gccoptions/Makefile.am b/languages/cpp/compiler/gccoptions/Makefile.am new file mode 100644 index 00000000..3e801ae4 --- /dev/null +++ b/languages/cpp/compiler/gccoptions/Makefile.am @@ -0,0 +1,20 @@ +# Here resides the gcc option dialog plugin. + +INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extras \ + -I$(top_srcdir)/lib/widgets $(all_includes) + +kde_module_LTLIBRARIES = libkdevgccoptions.la +libkdevgccoptions_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN) +libkdevgccoptions_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \ + $(top_builddir)/lib/widgets/libkdevwidgets.la $(top_builddir)/lib/interfaces/extras/libkdevextras.la $(LIB_KHTML) + +libkdevgccoptions_la_SOURCES = gccoptionsplugin.cpp + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdevgccoptions.desktop kdevgppoptions.desktop kdevg77options.desktop + + + + diff --git a/languages/cpp/compiler/gccoptions/gccoptionsplugin.cpp b/languages/cpp/compiler/gccoptions/gccoptionsplugin.cpp new file mode 100644 index 00000000..ac547fc7 --- /dev/null +++ b/languages/cpp/compiler/gccoptions/gccoptionsplugin.cpp @@ -0,0 +1,705 @@ +/*************************************************************************** +* Copyright (C) 2000-2001 by Bernd Gehrmann * +* bernd@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "flagboxes.h" +#include "gccoptionsplugin.h" + +K_EXPORT_COMPONENT_FACTORY( libkdevgccoptions, KGenericFactory( "kdevgccoptions" ) ) + +class GeneralTab : public QWidget +{ +public: + GeneralTab( GccOptionsPlugin::Type type, QWidget *parent = 0, const char *name = 0 ); + ~GeneralTab(); + + void readFlags( QStringList *str ); + void writeFlags( QStringList *str ); + +private: + FlagCheckBoxController *controller; +}; + + +class OptimizationTab : public QWidget +{ +public: + OptimizationTab( GccOptionsPlugin::Type type, QWidget *parent = 0, const char *name = 0 ); + ~OptimizationTab(); + + void readFlags( QStringList *str ); + void writeFlags( QStringList *str ); + +private: + QRadioButton *Odefault, *O0, *O1, *O2; + FlagListBox *optBox; +}; + + +class G77Tab : public QWidget +{ +public: + G77Tab( QWidget *parent = 0, const char *name = 0 ); + ~G77Tab(); + + void readFlags( QStringList *str ); + void writeFlags( QStringList *str ); + +private: + FlagCheckBoxController *controller; +}; + + +class Warnings1Tab : public QWidget +{ +public: + Warnings1Tab( GccOptionsPlugin::Type type, QWidget *parent = 0, const char *name = 0 ); + ~Warnings1Tab(); + + void readFlags( QStringList *str ); + void writeFlags( QStringList *str ); + +private: + FlagCheckBoxController *controller; + FlagListBox *wallBox; +}; + + +class Warnings2Tab : public QWidget +{ +public: + Warnings2Tab( GccOptionsPlugin::Type type, QWidget *parent = 0, const char *name = 0 ); + ~Warnings2Tab(); + + void readFlags( QStringList *str ); + void writeFlags( QStringList *str ); + +private: + FlagListBox *wrestBox; +}; + + +GeneralTab::GeneralTab( GccOptionsPlugin::Type type, QWidget *parent, const char *name ) + : QWidget( parent, name ), controller( new FlagCheckBoxController ) +{ + QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + layout->setAutoAdd( true ); + layout->addSpacing( 10 ); + + QVButtonGroup *output_group = new QVButtonGroup( i18n( "Output" ), this ); + new FlagCheckBox( output_group, controller, + "-fsyntax-only", i18n( "Only check the code for syntax errors, do not produce object code" ) ); + new FlagCheckBox( output_group, controller, + "-pg", i18n( "Generate extra code to write profile information for gprof" ) ); + new FlagCheckBox( output_group, controller, + "-save-temps", i18n( "Do not delete intermediate output like assembler files" ) ); + + QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + layout->addSpacing( 10 ); + + QVButtonGroup *codegen_group = new QVButtonGroup( i18n( "Code Generation" ), this ); + if ( type != GccOptionsPlugin::GPP ) + { + new FlagCheckBox( codegen_group, controller, + "-fexceptions", i18n( "Enable exception handling" ), + "-fno-exception" ); + } + else + { + new FlagCheckBox( codegen_group, controller, + "-fno-exceptions", i18n( "Disable exception handling" ), + "-fexception" ); + } + // The following two are somehow mutually exclusive, but the default is + // platform-dependent, so if we would leave out one of them, we wouldn't + // know how to set the remaining one. + new FlagCheckBox( codegen_group, controller, + "-fpcc-struct-return", i18n( "Return certain struct and union values in memory rather than in registers" ) ); + new FlagCheckBox( codegen_group, controller, + "-freg-struct-return", i18n( "Return certain struct and union values in registers when possible" ) ); + new FlagCheckBox( codegen_group, controller, + "-short-enums", i18n( "For an enum, choose the smallest possible integer type" ) ); + new FlagCheckBox( codegen_group, controller, + "-short-double", i18n( "Make 'double' the same as 'float'" ) ); + + QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + layout->addStretch(); +} + + +GeneralTab::~GeneralTab() +{ + delete controller; +} + + +void GeneralTab::readFlags( QStringList *list ) +{ + controller->readFlags( list ); +} + + +void GeneralTab::writeFlags( QStringList *list ) +{ + controller->writeFlags( list ); +} + + +OptimizationTab::OptimizationTab( GccOptionsPlugin::Type type, QWidget *parent, const char *name ) + : QWidget( parent, name ) +{ + QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + layout->setAutoAdd( true ); + + QVButtonGroup *group = new QVButtonGroup( i18n( "Optimization Level" ), this ); + Odefault = new QRadioButton( i18n( "Default" ), group ); + Odefault->setChecked( true ); + O0 = new QRadioButton( i18n( "No optimization" ), group ); + O1 = new QRadioButton( i18n( "Level 1" ), group ); + O2 = new QRadioButton( i18n( "Level 2" ), group ); + + optBox = new FlagListBox( this ); + + new FlagListItem( optBox, + "-ffloat-store", i18n( "Do not store floating point variables in registers" ), + "-fno-float-store" ); + new FlagListItem( optBox, + "-fno-defer-pop", i18n( "Pop the arguments to each function call directly " + "after the function returns" ), + "-fdefer-pop" ); + new FlagListItem( optBox, + "-fforce-mem", i18n( "Force memory operands to be copied into registers before " + "doing arithmetic on them" ), + "-fno-force-mem" ); + new FlagListItem( optBox, + "-fforce-addr", i18n( "Force memory address constants to be copied into registers before " + "doing arithmetic on them" ), + "-fno-force-addr" ); + new FlagListItem( optBox, + "-fomit-frame-pointer", i18n( "Do not keep the frame pointer in a register for functions that " + "do not need one" ), + "-fno-omit-frame-pointer" ); + new FlagListItem( optBox, + "-fno-inline", i18n( "Ignore the inline keyword" ), + "-finline" ); + + if ( type == GccOptionsPlugin::GPP ) + { + new FlagListItem( optBox, + "-fno-default-inline", i18n( "Do not make member functions inline merely because they " + "are defined inside the class scope" ), + "-fdefault-inline" ); + } + + QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + layout->addStretch(); +} + + +OptimizationTab::~OptimizationTab() +{} + + +void OptimizationTab::readFlags( QStringList *list ) +{ + optBox->readFlags( list ); + + QStringList::Iterator sli; + sli = list->find( "-O0" ); + if ( sli != list->end() ) + { + O0->setChecked( true ); + list->remove + ( sli ); + } + sli = list->find( "-O1" ); + if ( sli != list->end() ) + { + O1->setChecked( true ); + list->remove + ( sli ); + } + sli = list->find( "-O2" ); + if ( sli != list->end() ) + { + O2->setChecked( true ); + list->remove + ( sli ); + } +} + + +void OptimizationTab::writeFlags( QStringList *list ) +{ + optBox->writeFlags( list ); + + if ( O0->isChecked() ) + ( *list ) << "-O0"; + else if ( O1->isChecked() ) + ( *list ) << "-O1"; + else if ( O2->isChecked() ) + ( *list ) << "-O2"; +} + + +G77Tab::G77Tab( QWidget *parent, const char *name ) + : QWidget( parent, name ), controller( new FlagCheckBoxController ) +{ + QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + layout->setAutoAdd( true ); + layout->addSpacing( 10 ); + + QVButtonGroup *dialect_group = new QVButtonGroup( i18n( "Dialect" ), this ); + new FlagCheckBox( dialect_group, controller, + "-ffree-form", i18n( "Interpret source code as Fortran 90 free form" ), + "-fno-exception" ); + new FlagCheckBox( dialect_group, controller, + "-ff90", i18n( "Allow certain Fortran 90 constructs" ) ); + new FlagCheckBox( dialect_group, controller, + "-fdollar-ok", i18n( "Allow '$' in symbol names" ) ); + new FlagCheckBox( dialect_group, controller, + "-fbackslash", i18n( "Allow '\' in character constants to escape special characters" ), + "-fno-backslah" ); + new FlagCheckBox( dialect_group, controller, + "-fonetrip", i18n( "DO loops are executed at least once" ) ); + + QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + layout->addSpacing( 10 ); + + QVButtonGroup *codegen_group = new QVButtonGroup( i18n( "Code Generation" ), this ); + new FlagCheckBox( codegen_group, controller, + "-fno-automatic", i18n( "Treat local variables as if SAVE statement had been specified" ) ); + new FlagCheckBox( codegen_group, controller, + "-finit-local-zero", i18n( "Init local variables to zero" ) ); + new FlagCheckBox( codegen_group, controller, + "-fbounds-check", i18n( "Generate run-time checks for array subscripts" ) ); + + QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + layout->addStretch(); +} + + +G77Tab::~G77Tab() +{ + delete controller; +} + + +void G77Tab::readFlags( QStringList *list ) +{ + controller->readFlags( list ); +} + + +void G77Tab::writeFlags( QStringList *list ) +{ + controller->writeFlags( list ); +} + + +Warnings1Tab::Warnings1Tab( GccOptionsPlugin::Type type, QWidget *parent, const char *name ) + : QWidget( parent, name ), controller( new FlagCheckBoxController ) +{ + QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + layout->setAutoAdd( true ); + + new FlagCheckBox( this, controller, + "-w", i18n( "Inhibit all warnings" ) ); + new FlagCheckBox( this, controller, + "-Wno-import", i18n( "Inhibit warnings about the use of #import" ) ); + new FlagCheckBox( this, controller, + "-Werror", i18n( "Make all warnings into errors" ) ); + new FlagCheckBox( this, controller, + "-pedantic", i18n( "Issue all warnings demanded by strict ANSI C or ISO C++" ) ); + new FlagCheckBox( this, controller, + "-pedantic-errors", i18n( "Like -pedantic, but errors are produced instead of warnings" ) ); + new FlagCheckBox( this, controller, + "-Wall", i18n( "All warnings below, combined (-Wall):" ) ); + + wallBox = new FlagListBox( this ); + + new FlagListItem( wallBox, + "-Wchar-subscripts", i18n( "Warn if an array subscript has type char" ) ); + new FlagListItem( wallBox, + "-Wcomment", i18n( "Warn when a comment-start sequence /* appears inside a comment" ) ); + new FlagListItem( wallBox, + "-Wformat", i18n( "Check calls to printf(), scanf() etc\n" + "to make sure that the arguments supplied have types appropriate\n" + "to the format string specified, and that the conversions specified\n" + "in the format string make sense" ) ); + new FlagListItem( wallBox, + "-Wformat=2", i18n( "Enable -Wformat plus format checks not \n" + "included in -Wformat. Currently equivalent to \n" + "`-Wformat -Wformat-nonliteral -Wformat-security \n" + "-Wformat-y2k'." ) ); + new FlagListItem( wallBox, + "-Wimplicit-int", i18n( "Warn when a declaration does not specify a type" ) ); + new FlagListItem( wallBox, + "-Wimplicit-funtion-declaration", + i18n( "Issue a warning when a non-declared function is used" ) ); + new FlagListItem( wallBox, + "-Werror-implicit-function-declaration", + i18n( "Issue an error when a non-declared function is used" ) ); + new FlagListItem( wallBox, + "-Wmain", i18n( "Warn if the type of main() is suspicious" ) ); + new FlagListItem( wallBox, + "-Wmultichar", i18n( "Warn when multicharacter constants are encountered" ) ); + new FlagListItem( wallBox, + "-Wmissing-braces", i18n( "Warn if an aggregate or union initializer is not fully bracketed" ) ); + new FlagListItem( wallBox, + "-Wparentheses", i18n( "Warn when parentheses are omitted in certain contexts" ) ); + new FlagListItem( wallBox, + "-Wsequence-point", i18n( "Warn about code that may have undefined semantics because of\n" + "violations of sequence point rules in the C standard" ) ); + new FlagListItem( wallBox, + "-Wreturn-type", i18n( "Warn when a function without explicit return type is defined" ) ); + new FlagListItem( wallBox, + "-Wswitch", i18n( "Warn whenever a switch statement has an index of enumeral type\n" + "and lacks a case for one or more of the named codes of that enumeration" ) ); + new FlagListItem( wallBox, + "-Wtrigraphs", i18n( "Warn when trigraphs are encountered" ) ); + new FlagListItem( wallBox, + "-Wunused", i18n( "Warn when a variable is declared but not used" ) ); + new FlagListItem( wallBox, + "-Wuninitialized", i18n( "Warn when a variable is used without being initialized first" ) ); + new FlagListItem( wallBox, + "-Wunknown-pragmas", i18n( "Warn when an unknown #pragma statement is encountered" ) ); + new FlagListItem( wallBox, + "-Wdiv-by-zero", i18n( "Warn when a division by zero occurs." ) ); + if ( type == GccOptionsPlugin::GPP ) + { + new FlagListItem( wallBox, + "-Wreorder", i18n( "Warn when the order of member initializers is different from\n" + "the order in the class declaration" ) ); + } +} + + +Warnings1Tab::~Warnings1Tab() +{ + delete controller; +} + + +void Warnings1Tab::readFlags( QStringList *list ) +{ + controller->readFlags( list ); + wallBox->readFlags( list ); +} + + +void Warnings1Tab::writeFlags( QStringList *list ) +{ + controller->writeFlags( list ); + wallBox->writeFlags( list ); +} + + +Warnings2Tab::Warnings2Tab( GccOptionsPlugin::Type type, QWidget *parent, const char *name ) + : QWidget( parent, name ) +{ + QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() ); + layout->setAutoAdd( true ); + + wrestBox = new FlagListBox( this ); + + new FlagListItem( wrestBox, + "-W", i18n( "Set options not included in -Wall which are very specific" ) ); + new FlagListItem( wrestBox, + "-Wfloat-equal", i18n( "Warn if floating point values are used in equality comparisons" ) ); + new FlagListItem( wrestBox, + "-Wundef", i18n( "Warn if an undefined identifier is evaluated in an #if directive" ) ); + new FlagListItem( wrestBox, + "-Wshadow", i18n( "Warn whenever a local variable shadows another local variable" ) ); + new FlagListItem( wrestBox, + "-Wpointer-arith", i18n( "Warn about anything that depends on the sizeof a\n" + "function type or of void" ) ); + new FlagListItem( wrestBox, + "-Wcast-qual", i18n( "Warn whenever a pointer is cast so as to remove a type\n" + "qualifier from the target type" ) ); + new FlagListItem( wrestBox, + "-Wcast-align", i18n( "Warn whenever a pointer is cast such that the required\n" + "alignment of the target is increased" ) ); + new FlagListItem( wrestBox, + "-Wwrite-strings", i18n( "Warn when the address of a string constant is cast\n" + "into a non-const char * pointer" ) ); + new FlagListItem( wrestBox, + "-Wconversion", i18n( "Warn if a prototype causes a type conversion that is different\n" + "from what would happen to the same argument in the absence\n" + "of a prototype" ) ); + new FlagListItem( wrestBox, + "-Wsign-compare", i18n( "Warn when a comparison between signed and unsigned values\n" + "could produce an incorrect result when the signed value\n" + "is converted to unsigned" ) ); + new FlagListItem( wrestBox, + "-Wmissing-noreturn", i18n( "Warn about functions which might be candidates for attribute 'noreturn'" ) ); + new FlagListItem( wrestBox, + "-Waggregate-return", i18n( "Warn if any functions that return structures or unions are\n" + "defined or called" ) ); + new FlagListItem( wrestBox, + "-Wmissing-declarations", i18n( "Warn if a global function is defined without a previous declaration" ) ); + new FlagListItem( wrestBox, + "-Wno-deprecated-declarations", + i18n( "Do not warn about uses of functions, variables, and types marked as\n" + "deprecated by using the 'deprecated' attribute" ) ); + new FlagListItem( wrestBox, + "-Wpacked", i18n( "Warn if a structure is given the packed attribute, but the packed\n" + "attribute has no effect on the layout or size of the structure" ) ); + new FlagListItem( wrestBox, + "-Wpadded", i18n( "Warn if padding is included in a structure, either to align an\n" + "element of the structure or to align the whole structure" ) ); + new FlagListItem( wrestBox, + "-Wredundant-decls", i18n( "Warn if anything is declared more than once in the same scope" ) ); + new FlagListItem( wrestBox, + "-Wunreachable-code", i18n( "Warn if the compiler detects that code will never be executed" ) ); + new FlagListItem( wrestBox, + "-Winline", i18n( "Warn if an inline function cannot be inlined" ) ); + new FlagListItem( wrestBox, + "-Wlong-long", i18n( "Warn if the long long type is used" ) ); + new FlagListItem( wrestBox, + "-Wdisabled-optimization", i18n( "Warn if a requested optimization pass is disabled" ) ); + new FlagListItem( wrestBox, + "-Wno-div-by-zero", i18n( "Do not warn if there is a division by zero" ) ); + + if ( type == GccOptionsPlugin::GCC ) + { + new FlagListItem( wrestBox, + "-Wtraditional", i18n( "Warn about certain constructs that behave differently\n" + "in traditional and ANSI C" ) ); + new FlagListItem( wrestBox, + "-Wbad-function-cast", i18n( "Warn whenever a function call is cast to a non-matching type" ) ); + new FlagListItem( wrestBox, + "-Wstrict-prototypes", i18n( "Warn if a function is declared or defined without specifying\n" + "the argument types" ) ); + new FlagListItem( wrestBox, + "-Wmissing-prototypes", i18n( "Warn if a global function is defined without a previous prototype declaration" ) ); + new FlagListItem( wrestBox, + "-Wnested-externs", i18n( "Warn if an extern declaration is encountered within a function" ) ); + } + + + if ( type == GccOptionsPlugin::GPP ) + { + new FlagListItem( wrestBox, + "-Woverloaded-virtual", i18n( "Warn when a function declaration hides virtual\n" + "functions from a base class" ) ); + new FlagListItem( wrestBox, + "-Wsynth", i18n( "Warn when g++'s synthesis behavior does\n" + "not match that of cfront" ) ); + new FlagListItem( wrestBox, + "-Wctor-dtor-privacy", i18n( "Warn when a class seems unusable, because all the constructors or\n" + "destructors in a class are private and the class has no friends or\n" + "public static member functions" ) ); + new FlagListItem( wrestBox, + "-Wnon-virtual-dtor", i18n( "Warn when a class declares a non-virtual destructor that should\n" + "probably be virtual, because it looks like the class will be used\n" + "polymorphically" ) ); + new FlagListItem( wrestBox, + "-Wsign-promo", i18n( "Warn when overload resolution chooses a promotion from unsigned or\n" + "enumeral type to a signed type over a conversion to an unsigned\n" + "type of the same size. Previous versions of G++ would try to\n" + "preserve unsignedness, but the standard mandates the current behavior" ) ); + new FlagListItem( wrestBox, + "-Wabi", i18n( "Warn when G++ generates code that is probably not compatible with\n" + "the vendor-neutral C++ ABI" ) ); + /* new FlagListItem(wrestBox, + "-Wreorder", i18n("Warn when the order of member initializers given in the code does\n" + "not match the order in which they must be executed."));*/ + new FlagListItem( wrestBox, + "-Weffc++", i18n( "Warn about violations of the following style guidelines from Scott\n" + "Meyers' 'Effective C++' book:\n" + "* Item 11: Define a copy constructor and an assignment\n" + " operator for classes with dynamically allocated memory;\n" + "* Item 12: Prefer initialization to assignment in constructors;\n" + "* Item 14: Make destructors virtual in base classes;\n" + "* Item 15: Have `operator=' return a reference to `*this';\n" + "* Item 23: Do not try to return a reference when you must\n" + " return an object\n" + "\n" + "and about violations of the following style guidelines from Scott\n" + "Meyers' 'More Effective C++' book:\n" + "* Item 6: Distinguish between prefix and postfix forms of\n" + " increment and decrement operators;\n" + "* Item 7: Never overload '&&', '||', or ','" ) ); + new FlagListItem( wrestBox, + "-Wno-deprecated", i18n( "Do not warn about usage of deprecated features" ) ); + new FlagListItem( wrestBox, + "-Wno-non-template-friend", i18n( "Disable warnings when non-templatized friend functions are declared\n" + "within a template" ) ); + new FlagListItem( wrestBox, + "-Wold-style-cast", i18n( "Warn if an old-style (C-style) cast to a non-void type is used\n" + "within a C++ program" ) ); + new FlagListItem( wrestBox, + "-Wno-pmf-conversions", i18n( "Disable the diagnostic for converting a bound pointer to member\n" + "function to a plain pointer" ) ); + } +} + + +Warnings2Tab::~Warnings2Tab() +{} + + +void Warnings2Tab::readFlags( QStringList *list ) +{ + wrestBox->readFlags( list ); +} + + +void Warnings2Tab::writeFlags( QStringList *list ) +{ + wrestBox->writeFlags( list ); +} + + +// Last but not least... :-) +GccOptionsDialog::GccOptionsDialog( GccOptionsPlugin::Type type, QWidget *parent, const char *name ) + : KDialogBase( Tabbed, GccOptionsPlugin::captionForType( type ), Ok | Cancel, Ok, parent, name, true ) +{ + QVBox * vbox; + + vbox = addVBoxPage( i18n( "General" ) ); + general = new GeneralTab( type, vbox, "general tab" ); + + vbox = addVBoxPage( i18n( "Optimization" ) ); + optimization = new OptimizationTab( type, vbox, "optimization tab" ); + + if ( type == GccOptionsPlugin::G77 ) + { + vbox = addVBoxPage( i18n( "Fortran Specifics" ) ); + g77 = new G77Tab( vbox, "g77 tab" ); + } + else + g77 = 0; + + vbox = addVBoxPage( i18n( "Warnings (safe)" ) ); + warnings1 = new Warnings1Tab( type, vbox, "warnings1 tab" ); + + vbox = addVBoxPage( i18n( "Warnings (unsafe)" ) ); + warnings2 = new Warnings2Tab( type, vbox, "warnings2 tab" ); +} + + +GccOptionsDialog::~GccOptionsDialog() +{} + + +void GccOptionsDialog::setFlags( const QString &flags ) +{ + QStringList flaglist = QStringList::split( " ", flags ); + + // Hand them to 'general' at last, so it can make a line edit + // with the unprocessed items + if ( g77 ) + g77->readFlags( &flaglist ); + optimization->readFlags( &flaglist ); + warnings1->readFlags( &flaglist ); + warnings2->readFlags( &flaglist ); + general->readFlags( &flaglist ); + unrecognizedFlags = flaglist; +} + + +QString GccOptionsDialog::flags() const +{ + QStringList flaglist; + + if ( g77 ) + g77->writeFlags( &flaglist ); + optimization->writeFlags( &flaglist ); + warnings1->writeFlags( &flaglist ); + warnings2->writeFlags( &flaglist ); + general->writeFlags( &flaglist ); + + QString flags; + QStringList::ConstIterator li; + for ( li = flaglist.begin(); li != flaglist.end(); ++li ) + { + flags += ( *li ); + flags += " "; + } + + for ( li = unrecognizedFlags.begin(); li != unrecognizedFlags.end(); ++li ) + { + flags += ( *li ); + flags += " "; + } + + flags.truncate( flags.length() - 1 ); + return flags; +} + + +GccOptionsPlugin::GccOptionsPlugin( QObject *parent, const char *name, const QStringList &args ) + : KDevCompilerOptions( parent, name ) +{ + gcctype = Unknown; + + if ( args.count() == 0 ) + return ; + + QString typeStr = args[ 0 ]; + + if ( typeStr == "gcc" ) + gcctype = GccOptionsPlugin::GCC; + else if ( typeStr == "g++" ) + gcctype = GccOptionsPlugin::GPP; + else if ( typeStr == "g77" ) + gcctype = GccOptionsPlugin::G77; +} + + +GccOptionsPlugin::~GccOptionsPlugin() +{} + + +QString GccOptionsPlugin::captionForType( Type type ) +{ + switch ( type ) + { + case GCC: + return i18n( "GNU C Compiler Options" ); + case GPP: + return i18n( "GNU C++ Compiler Options" ); + case G77: + return i18n( "GNU Fortran 77 Compiler Options" ); + default: + return QString::null; + } +} + + +QString GccOptionsPlugin::exec( QWidget *parent, const QString &flags ) +{ + if ( gcctype == Unknown ) + return QString::null; + GccOptionsDialog *dlg = new GccOptionsDialog( gcctype, parent, "gcc options dialog" ); + QString newFlags = flags; + dlg->setFlags( flags ); + if ( dlg->exec() == QDialog::Accepted ) + newFlags = dlg->flags(); + delete dlg; + return newFlags; +} + +#include "gccoptionsplugin.moc" +//kate: indent-mode csands; tab-width 4; space-indent off; diff --git a/languages/cpp/compiler/gccoptions/gccoptionsplugin.h b/languages/cpp/compiler/gccoptions/gccoptionsplugin.h new file mode 100644 index 00000000..a3b8cd70 --- /dev/null +++ b/languages/cpp/compiler/gccoptions/gccoptionsplugin.h @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2000-2001 by Bernd Gehrmann * + * bernd@kdevelop.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _GCCOPTIONSPLUGIN_H_ +#define _GCCOPTIONSPLUGIN_H_ + +#include + +#include "kdevcompileroptions.h" + + +class GeneralTab; +class OptimizationTab; +class G77Tab; +class Warnings1Tab; +class Warnings2Tab; + + +class GccOptionsPlugin : public KDevCompilerOptions +{ + Q_OBJECT + +public: + enum Type { GCC, GPP, G77, Unknown }; + GccOptionsPlugin( QObject *parent, const char *name, const QStringList &args ); + ~GccOptionsPlugin(); + + static QString captionForType(Type type); + + virtual QString exec(QWidget *parent, const QString &flags); + +private: + Type gcctype; +}; + + +class GccOptionsDialog : public KDialogBase +{ +public: + GccOptionsDialog( GccOptionsPlugin::Type type, QWidget *parent=0, const char *name=0 ); + ~GccOptionsDialog(); + + void setFlags(const QString &flags); + QString flags() const; + +private: + GeneralTab *general; + OptimizationTab *optimization; + G77Tab *g77; + Warnings1Tab *warnings1; + Warnings2Tab *warnings2; + QStringList unrecognizedFlags; +}; + +#endif diff --git a/languages/cpp/compiler/gccoptions/kdevg77options.desktop b/languages/cpp/compiler/gccoptions/kdevg77options.desktop new file mode 100644 index 00000000..4f7941b7 --- /dev/null +++ b/languages/cpp/compiler/gccoptions/kdevg77options.desktop @@ -0,0 +1,56 @@ +[Desktop Entry] +Type=Service +Exec=g77 +Comment=GNU Fortran 77 Compiler +Comment[br]=Dastumer Fortran 77 GNU +Comment[ca]=Compilador Fortran 77 de GNU +Comment[da]=GNU Fortran 77 compiler +Comment[el]=Μεταγλωττιστής GNU Fortran 77 +Comment[es]=Compilador GNU de Fortran 77 +Comment[et]=GNU Fortran 77 kompilaator +Comment[eu]=GNU Fortran 77 konpiladorea +Comment[fa]=مترجم فرترن ۷۷ گنو +Comment[fr]=Compilateur pour Fortran 77 du GNU +Comment[ga]=Tiomsaitheoir Fortran 77 GNU +Comment[gl]=Compilador GNU Fortran 77 +Comment[hi]=जीएनयू फ़ोरट्रॉन 77 कम्पायलर +Comment[hu]=GNU Fortran 77 fordítóprogram +Comment[is]=GNU Fortran 77 þýðandi +Comment[it]=Compilatore per GNU Fortran 77 +Comment[ja]=GNU Fortran 77 コンパイラ +Comment[nds]=GNU Fortran 77-Kompilerer +Comment[ne]=GNU Fortran 77 कम्पाइलर +Comment[nl]=GNU Fortran 77-compiler +Comment[pl]=Kompilator GNU Fortran 77 +Comment[pt]=Compilador GNU Fortran 77 +Comment[pt_BR]=Compilador GNU Fortran 77 +Comment[ru]=Компилятор GNU Fortran 77 +Comment[sk]=GNU Fortran 77 kompilátor +Comment[sl]=Prevajalnik za GNU Fortran 77 +Comment[sr]=GNU-ов преводилац Fortran-а 77 +Comment[sr@Latn]=GNU-ov prevodilac Fortran-a 77 +Comment[sv]=GNU Fortran 77-compilator +Comment[ta]=GNU Fortran 77 தொகுப்பி +Comment[tg]=Талфифгари GNU Fortran 77 +Comment[tr]=GNU Fortran 77 Derleyicisi +Comment[zh_CN]=GNU Fortran 77 编译器 +Comment[zh_TW]=GNU Fortran 77 編譯器 +Name=G77Options +Name[de]=G77-Einstellungen (KDevelop) +Name[el]=G77Επιλογές +Name[hi]=जी77विकल्प +Name[nds]=G77-Optschonen (KDevelop) +Name[pl]=Opcje G77 +Name[sk]=G77 možnosti +Name[sl]=Možnosti G77 +Name[sv]=Alternativ för g77 +Name[ta]=G77விருப்பங்கள் +Name[tg]=G77Интихобҳо +Name[tr]=G77Seçenekleri +Name[zh_TW]=G77 選項 +ServiceTypes=KDevelop/CompilerOptions +X-KDE-Library=libkdevgccoptions +X-KDevelop-Version=5 +X-KDevelop-Language=Fortran +X-KDevelop-Args=g77 +X-KDevelop-Default=true diff --git a/languages/cpp/compiler/gccoptions/kdevgccoptions.desktop b/languages/cpp/compiler/gccoptions/kdevgccoptions.desktop new file mode 100644 index 00000000..5d135cb1 --- /dev/null +++ b/languages/cpp/compiler/gccoptions/kdevgccoptions.desktop @@ -0,0 +1,54 @@ +[Desktop Entry] +Type=Service +Exec=gcc +Comment=GNU C Compiler +Comment[br]=Dastumer C GNU +Comment[ca]=Compilador C de GNU +Comment[da]=GNU C compiler +Comment[el]=Μεταγλωττιστής GNU C +Comment[es]=Compilador GNU de C +Comment[et]=GNU C kompilaator +Comment[eu]=GNU C konpiladorea +Comment[fa]=مترجم سی گنو +Comment[fr]=Compilateur C du GNU +Comment[ga]=Tiomsaitheoir C GNU +Comment[gl]=Compilador GNU C +Comment[hi]=जीएनयू सी कम्पायलर +Comment[hu]=GNU C fordítóprogram +Comment[is]=GNU C þýðandi +Comment[it]=Compilatore GNU C +Comment[ja]=GNU C コンパイラ +Comment[nds]=GNU C-Kompilerer +Comment[ne]=GNU C कम्पाइलर +Comment[pl]=Kompilator GNU C +Comment[pt]=Compilador GNU C +Comment[pt_BR]=Compilador GNU C +Comment[ru]=Компилятор GNU C +Comment[sk]=GNU C kompilátor +Comment[sl]=Prevajalnik za GNU C +Comment[sr]=GNU-ов C преводилац +Comment[sr@Latn]=GNU-ov C prevodilac +Comment[sv]=GNU C-kompilator +Comment[ta]=GNU Cதொகுப்பி +Comment[tg]=Талфифгари GNU C +Comment[zh_CN]=GNU C 编译器 +Comment[zh_TW]=GNU C 編譯器 +Name=GccOptions +Name[de]=GCC-Einstellungen (KDevelop) +Name[el]=GccΕπιλογές +Name[hi]=जीसीसी-विकल्प +Name[nds]=GCC-Instellen +Name[pl]=Opcje Gcc +Name[sk]=Gcc možnosti +Name[sl]=Možnosti Gcc +Name[sv]=Alternativ för gcc +Name[ta]=Gccவிருப்பங்கள் +Name[tr]=GccSeçenekleri +Name[zh_TW]=Gcc 選項 +ServiceTypes=KDevelop/CompilerOptions +X-KDE-Library=libkdevgccoptions +X-KDevelop-Version=5 +X-KDevelop-Language=C +X-KDevelop-Args=gcc +X-KDevelop-Default=true + diff --git a/languages/cpp/compiler/gccoptions/kdevgppoptions.desktop b/languages/cpp/compiler/gccoptions/kdevgppoptions.desktop new file mode 100644 index 00000000..ad12fa4c --- /dev/null +++ b/languages/cpp/compiler/gccoptions/kdevgppoptions.desktop @@ -0,0 +1,56 @@ +[Desktop Entry] +Type=Service +Exec=g++ +Comment=GNU C++ Compiler +Comment[br]=Dastumer C++ GNU +Comment[ca]=Compilador C++ de GNU +Comment[da]=GNU C++ compiler +Comment[el]=Μεταγλωττιστής GNU C++ +Comment[es]=Compilador GNU de C++ +Comment[et]=GNU C++ kompilaator +Comment[eu]=GNU C++ konpiladorea +Comment[fa]=مترجم C++ گنو +Comment[fr]=Compilateur C++ de GNU +Comment[ga]=Tiomsaitheoir C++ GNU +Comment[gl]=Compilador GNU C++ +Comment[hi]=जीएनयू सी++ कम्पायलर +Comment[hu]=GNU C++ fordítóprogram +Comment[is]=GNU C++ þýðandi +Comment[it]=Compilatore GNU C++ +Comment[ja]=GNU C++ コンパイラ +Comment[nds]=GNU C++-Kompilerer +Comment[ne]=GNU C++ कम्पाइलर +Comment[nl]=GNU C++ compiler +Comment[pl]=Kompilator GNU C++ +Comment[pt]=Compilador GNU C++ +Comment[pt_BR]=Compilador GNU C++ +Comment[ru]=Компилятор GNU C++ +Comment[sk]=GNU C++ kompilátor +Comment[sl]=Prevajalnik za GNU C++ +Comment[sr]=GNU-ов C++ преводилац +Comment[sr@Latn]=GNU-ov C++ prevodilac +Comment[sv]=GNU C++ kompilator +Comment[ta]=GNU C++தொகுப்பி +Comment[tg]=Талфифгари GNU C++ +Comment[tr]=GNU C++ Derleyicisi +Comment[zh_CN]=GNU C++ 编译器 +Comment[zh_TW]=GNU C++ 編譯器 +Name=GppOptions +Name[de]=GPP-Einstellungen (KDevelop) +Name[el]=GppΕπιλογές +Name[hi]=जीपीपी-विकल्प +Name[nds]=GPP-Instellen +Name[pl]=Opcje Gpp +Name[sk]=Gpp možnosti +Name[sl]=Možnosti Gpp +Name[sv]=Alternativ för g++ +Name[ta]=Gppவிருப்பங்கள் +Name[tr]=GppSeçenekleri +Name[zh_TW]=Gpp 選項 +ServiceTypes=KDevelop/CompilerOptions +X-KDE-Library=libkdevgccoptions +X-KDevelop-Version=5 +X-KDevelop-Language=C++ +X-KDevelop-Args=g++ +X-KDevelop-Default=true + diff --git a/languages/cpp/completiondebug.cpp b/languages/cpp/completiondebug.cpp new file mode 100644 index 00000000..dc73329e --- /dev/null +++ b/languages/cpp/completiondebug.cpp @@ -0,0 +1,56 @@ + +/*************************************************************************** + copyright : (C) 2006 by David Nolden + email : david.nolden.kdevelop@art-master.de +***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "completiondebug.h" + +namespace CompletionDebug { + +DBGStreamType dbgState; + +const int completionMaxDepth = 50; + +DBGStreamType::KStreamType& dbg() { + return dbgState.dbg(); +} + +bool dbgActive() { + return true; +} + +#ifndef NDEBUG +kdbgstream dbgMajor() { + kdbgstream ret = kdDebug( 9007 ); + dbgState.outputPrefix( ret ); + return ret; +} +#else +kndbgstream dbgMajor() { + return kndDebug(); +}; + +#endif + +#ifndef NDEBUG +template<> + KDDebugState::KDDebugState() : m_stream ( kdDebug( 9007 ) ) { + } +#endif + +template<> + KDDebugState::KDDebugState() { + } +} + +// kate: indent-mode csands; tab-width 4; diff --git a/languages/cpp/completiondebug.h b/languages/cpp/completiondebug.h new file mode 100644 index 00000000..088b3b99 --- /dev/null +++ b/languages/cpp/completiondebug.h @@ -0,0 +1,221 @@ +/*************************************************************************** +copyright : (C) 2006 by David Nolden +email : david.nolden.kdevelop@art-master.de +***************************************************************************/ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#ifndef __COMPLETIONDEBUG_H__ +#define __COMPLETIONDEBUG_H__ + +///With verbose shut on, the whole type-resolution-process is nicely traced for easy debugging(at cost of speed). +//#define VERBOSE +//#define VERBOSEMAJOR + +///When defined, a backtrace is printed the first time the maximum depth is reached for the first time. +//#define DEPTHBACKTRACE + +#include +#include + +namespace CompletionDebug { +template +class KDDebugState { + private: + StreamType m_stream; + kndbgstream m_nstream; + QStringList m_prefixStack; + int m_counter; + int m_depth; + bool m_enabled; + bool m_hadWarning; + + public: + typedef StreamType KStreamType; + KDDebugState(); + + KDDebugState( StreamType stream ) : m_stream( stream ), m_counter( 0 ), m_depth( 0 ), m_enabled( true ), m_hadWarning( false ) {} + + void push( const QString & txt ) { + m_prefixStack.push_back( txt ); + pushDepth(); + } + + void pop() { + m_prefixStack.pop_back(); + popDepth(); + }; + + inline void pushDepth() { + m_depth++; + } + + inline void popDepth() { + m_depth--; + } + + bool hadWarning() { + return m_hadWarning; + } + + void setHadWarning( bool had ) { + m_hadWarning = had; + } + + StreamType& dbg() { +#ifndef VERBOSE + if ( !m_enabled ) + return m_nstream; +#endif + + m_stream << "(" << m_counter << ")"; + for ( QStringList::iterator it = m_prefixStack.begin(); it != m_prefixStack.end() ; ++it ) + m_stream << *it; + + m_counter++; + return m_stream; + } + + void setState( bool enabled ) { + m_enabled = enabled; + } + + bool state() { + return m_enabled; + } + +#ifndef NDEBUG + void outputPrefix( kdbgstream& target ) { + target << "(" << m_counter << ")"; + for ( QStringList::iterator it = m_prefixStack.begin(); it != m_prefixStack.end() ; ++it ) + target << *it; + + m_counter++; + } +#endif + + void clearCounter() { + m_counter = 0; + } + + int depth() { + return m_depth; + } +}; +#ifndef NDEBUG +template <> +KDDebugState::KDDebugState(); +#endif +template <> +KDDebugState::KDDebugState(); +#if defined(VERBOSE) && !defined(NDEBUG) +typedef KDDebugState DBGStreamType; +#else +typedef KDDebugState DBGStreamType; +#endif +///Class to help indent the debug-output correctly +extern DBGStreamType dbgState; +extern const int completionMaxDepth; +class LogDebug { + private: + DBGStreamType& m_state; + int m_max; + public: + LogDebug( const char* prefix = "#", int max = completionMaxDepth, DBGStreamType& st = dbgState ) : m_state( st ), m_max( max ) { + m_state.push( prefix ); + }; + ~LogDebug() { + m_state.pop(); + } + + DBGStreamType::KStreamType& dbg() { + return m_state.dbg(); + } + + int depth() { + return m_state.depth(); + } + + operator bool() { + bool r = depth() < m_max; + + if ( !r && !m_state.hadWarning() ) { + m_state.setHadWarning( true ); + dbg() << "recursion is too deep" << endl; +#ifdef DEPTHBACKTRACE + kdDebug( 9007 ) << kdBacktrace() << endl; +#endif + } + return r; + } +}; + + +///does not care about the logging, but still counts the depth +class DepthDebug { + DBGStreamType& m_state; + int m_max; + public: + DepthDebug( const char* prefix = "#", int max = completionMaxDepth, DBGStreamType& st = dbgState ) : m_state( st ), m_max( max ) { + Q_UNUSED( prefix ); + m_state.pushDepth(); + }; + + ~DepthDebug() { + m_state.popDepth(); + } + + kndbgstream dbg() { + return kndDebug(); + } + + int depth() { + return m_state.depth(); + } + + operator bool() { + bool r = depth() < m_max; + + if ( !r && !m_state.hadWarning() ) { + m_state.setHadWarning( true ); + dbg() << "recursion is too deep" << endl; +#ifdef DEPTHBACKTRACE + kdDebug( 9007 ) << kdBacktrace() << endl; +#endif + } + return r; + } +}; + +#ifndef VERBOSEMAJOR +#define ifVerboseMajor(x) /**/ +#else +#define ifVerboseMajor(x) x +#endif + +bool dbgActive(); + +#ifdef VERBOSE + +typedef LogDebug Debug; +DBGStreamType::KStreamType& dbg(); +#define ifVerbose( x) {if( dbgActive() ) {x;}} +#else + +DBGStreamType::KStreamType& dbg(); +typedef DepthDebug Debug; +#define ifVerbose(x) /**/ +#endif +#ifndef NDEBUG +kdbgstream dbgMajor(); +#else +kndbgstream dbgMajor(); +#endif +} +#endif +// kate: indent-mode csands; tab-width 2; diff --git a/languages/cpp/computerecoverypoints.h b/languages/cpp/computerecoverypoints.h new file mode 100644 index 00000000..eccd44f6 --- /dev/null +++ b/languages/cpp/computerecoverypoints.h @@ -0,0 +1,190 @@ +/*************************************************************************** + begin : Sat Jul 21 2001 + copyright : (C) 2001 by Victor R�er + email : victor_roeder@gmx.de + copyright : (C) 2002,2003 by Roberto Raggi + email : roberto@kdevelop.org + copyright : (C) 2005 by Adam Treat + email : manyoso@yahoo.com + copyright : (C) 2006 by David Nolden + email : david.nolden.kdevelop@art-master.de +***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef __COMPUTERECOVERYPOINTS_H__ +#define __COMPUTERECOVERYPOINTS_H__ + +#include + +#include "simpletype.h" +#include "simpletypenamespace.h" +#include "tree_parser.h" + +static QString toSimpleName( NameAST* name ) +{ + if ( !name ) + return QString::null; + + QString s; + QPtrList l = name->classOrNamespaceNameList(); + QPtrListIterator nameIt( l ); + while ( nameIt.current() ) + { + if ( nameIt.current() ->name() ) + { + s += nameIt.current() ->name() ->text() + "::"; + } + ++nameIt; + } + + if ( name->unqualifiedName() && name->unqualifiedName() ->name() ) + s += name->unqualifiedName() ->name() ->text(); + + return s; +} + + +struct RecoveryPoint +{ + int kind; + QStringList scope; + QValueList imports; + + int startLine, startColumn; + int endLine, endColumn; + + RecoveryPoint() + : kind( 0 ), startLine( 0 ), startColumn( 0 ), + endLine( 0 ), endColumn( 0 ) + {} + + ///Registers the recovery-points imports into the given namespace + void registerImports( SimpleType ns, QString hardCodedAliases ) { + SimpleTypeNamespace* n = dynamic_cast( &(*ns) ); + if( !n ) { + kdDebug( 9007 ) << "the global namespace was not resolved correctly " << endl; + } else { + ///put the imports into the global namespace + for( QValueList::iterator it = imports.begin(); it != imports.end(); ++it ) { + kdDebug( 9007 ) << "inserting import " << *it << " into the global scope" << endl; + n->addAliasMap( QString(""), (*it).join("::"), IncludeFiles() ); ///@TODO: remove this + } + n->addAliases( hardCodedAliases ); + } + } + +private: + RecoveryPoint( const RecoveryPoint& source ); + void operator = ( const RecoveryPoint& source ); +}; + + +// namespace? +class ComputeRecoveryPoints: public TreeParser +{ +public: + ComputeRecoveryPoints( QPtrList& points ) + : recoveryPoints( points ) + {} + + virtual void parseTranslationUnit( const ParsedFile& ast ) + { + QValueList dummy; + + m_imports.push( dummy ); + TreeParser::parseTranslationUnit( ast ); + m_imports.pop(); + + kdDebug( 9007 ) << "found " << recoveryPoints.count() << " recovery points" << endl; + } + + virtual void parseUsingDirective( UsingDirectiveAST* ast ) + { + if ( !ast->name() ) + return ; + + //QStringList type = CppCodeCompletion::typeName( ast->name() ->text() ).scope(); + m_imports.top().push_back( ast->name() ->text() ); + } + + virtual void parseNamespace( NamespaceAST* ast ) + { + m_currentScope.push_back( ast->namespaceName() ->text() ); + insertRecoveryPoint( ast ); + + m_imports.push( m_imports.top() ); // dup + // m_imports.top().push_back( m_currentScope ); + + TreeParser::parseNamespace( ast ); + + m_imports.pop(); + m_currentScope.pop_back(); + } + + void parseTemplateDeclaration( TemplateDeclarationAST* ast ) + { + if ( ast->declaration() ) + parseDeclaration( ast->declaration() ); + + TreeParser::parseTemplateDeclaration( ast ); + } + + + virtual void parseSimpleDeclaration( SimpleDeclarationAST* ast ) + { + TypeSpecifierAST * typeSpec = ast->typeSpec(); + //InitDeclaratorListAST* declarators = ast->initDeclaratorList(); + + if ( typeSpec ) + parseTypeSpecifier( typeSpec ); + + //insertRecoveryPoint( ast ); + TreeParser::parseSimpleDeclaration( ast ); + } + + virtual void parseFunctionDefinition( FunctionDefinitionAST* ast ) + { + m_imports.push( m_imports.top() ); // dup + insertRecoveryPoint( ast ); + m_imports.pop(); + } + + virtual void parseClassSpecifier( ClassSpecifierAST* ast ) + { + insertRecoveryPoint( ast ); + m_currentScope.push_back( toSimpleName( ast->name() ) ); + TreeParser::parseClassSpecifier( ast ); + m_currentScope.pop_back(); + } + + void insertRecoveryPoint( AST* ast ) + { + if ( !ast ) + return ; + + RecoveryPoint* pt = new RecoveryPoint(); + pt->kind = ast->nodeType(); + pt->scope = m_currentScope; + ast->getStartPosition( &pt->startLine, &pt->startColumn ); + ast->getEndPosition( &pt->endLine, &pt->endColumn ); + pt->imports = m_imports.top(); + + recoveryPoints.append( pt ); + } + +private: + QPtrList& recoveryPoints; + QValueStack< QValueList > m_imports; + QStringList m_currentScope; +}; + +#endif +// kate: indent-mode csands; tab-width 4; diff --git a/languages/cpp/configproblemreporter.ui b/languages/cpp/configproblemreporter.ui new file mode 100644 index 00000000..164d6693 --- /dev/null +++ b/languages/cpp/configproblemreporter.ui @@ -0,0 +1,189 @@ + +ConfigureProblemReporter + + + ConfigureProblemReporter + + + + 0 + 0 + 588 + 492 + + + + + unnamed + + + + groupBox3_2 + + + Problem Reporter + + + If enabled, the C++ parser will report any syntax errors it detects. +They will be displayed in the 'Problems' output view and as markers in the editor. + + + + unnamed + + + + problemReporterCheckbox + + + &Use Problem Reporter + + + + + + + groupBox1 + + + Sunken + + + Parsing + + + If enabled, the C++ parser will run on the active file after the stated timeout, after there has been any changes to the text. + +If disabled, the parser will typically only run when the file is saved. + + + + unnamed + + + + layout2 + + + + unnamed + + + + bgParserCheckbox + + + Enable &background parsing + + + + + delayLabel + + + + 7 + 5 + 0 + 0 + + + + msec + + + AlignVCenter|AlignLeft + + + + + + + delaySlider + + + 250 + + + 2000 + + + 250 + + + 500 + + + Horizontal + + + NoMarks + + + 250 + + + + + + + groupBox3 + + + Special &Headers + + + Often a macro that the C++ parser must understand in order to correctly parse a piece of code is defined somewhere in a non-standard header file that the parser does not look at. This textbox can be used to define those macros locally so that the C++ parser can understand them. + + + + unnamed + + + + specialHeader + + + + + + + + + delaySlider + valueChanged(int) + ConfigureProblemReporter + setDelayLabel(int) + + + bgParserCheckbox + toggled(bool) + ConfigureProblemReporter + bgParserCheckbox_toggled(bool) + + + + bgParserCheckbox + delaySlider + + + kdialog.h + configproblemreporter.ui.h + + + class CppSupportPart; + + + CppSupportPart* m_part; + + + init() + destroy() + setPart( CppSupportPart * part ) + accept() + bgParserCheckbox_toggled( bool b ) + setDelayLabel( int delay ) + + + + diff --git a/languages/cpp/configproblemreporter.ui.h b/languages/cpp/configproblemreporter.ui.h new file mode 100644 index 00000000..d5952b95 --- /dev/null +++ b/languages/cpp/configproblemreporter.ui.h @@ -0,0 +1,98 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ + +#include "cppsupportpart.h" + +#include + +#include +#include +#include +#include + +#include +#include + +void ConfigureProblemReporter::init() +{ + m_part = 0; + KConfig* config = kapp->config(); + config->setGroup( "General Options" ); + problemReporterCheckbox->setChecked( config->readBoolEntry( "EnableProblemReporter", true ) ); + bgParserCheckbox->setChecked( config->readBoolEntry( "EnableCppBgParser", true ) ); + delaySlider->setEnabled( bgParserCheckbox->isChecked() ); + delaySlider->setValue( config->readNumEntry( "BgParserDelay", 500 ) ); + setDelayLabel( delaySlider->value() ); +} + +void ConfigureProblemReporter::destroy() +{} + +void ConfigureProblemReporter::setPart( CppSupportPart* part ) +{ + m_part = part; + if ( !m_part ) + return ; + + QString conf_file_name = m_part->specialHeaderName(); + if ( QFile::exists( conf_file_name ) ) + { + QFile f( conf_file_name ); + if ( f.open( IO_ReadOnly ) ) + { + QTextStream stream( &f ); + specialHeader->setText( stream.read() ); + f.close(); + } + } +} + +void ConfigureProblemReporter::accept() +{ + KConfig * config = kapp->config(); + config->setGroup( "General Options" ); + config->writeEntry( "EnableProblemReporter", problemReporterCheckbox->isChecked() ); + config->writeEntry( "EnableCppBgParser", bgParserCheckbox->isChecked() ); + if ( bgParserCheckbox->isChecked() ) + config->writeEntry( "BgParserDelay", delaySlider->value() ); + config->sync(); + + m_part->updateBackgroundParserConfig(); + + + if ( m_part && specialHeader->isModified() ) + { + QString conf_file_name = m_part->specialHeaderName( true ); + QFile f( conf_file_name ); + if ( f.open( IO_WriteOnly ) ) + { + QTextStream stream( &f ); + stream << specialHeader->text(); + f.close(); + + m_part->updateParserConfiguration(); + } + } +} + +void ConfigureProblemReporter::bgParserCheckbox_toggled( bool b ) +{ + delaySlider->setEnabled( b ); + if ( b == TRUE ) + delayLabel->show(); + else + delayLabel->hide(); +} + + +void ConfigureProblemReporter::setDelayLabel( int delay ) +{ + delayLabel->setText( i18n( "delay: %1 msec" ).arg( delay ) ); +} +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/configuration b/languages/cpp/configuration new file mode 100644 index 00000000..bbdc5f4f --- /dev/null +++ b/languages/cpp/configuration @@ -0,0 +1,2 @@ +// add your favorite macros here + diff --git a/languages/cpp/cpp_tags.h b/languages/cpp/cpp_tags.h new file mode 100644 index 00000000..077fbd82 --- /dev/null +++ b/languages/cpp/cpp_tags.h @@ -0,0 +1,432 @@ +// +// +// C++ Interface: cpp_tags +// +// Description: +// +// +// Author: KDevelop Authors , (C) 2003 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef CPP_TAGS_H +#define CPP_TAGS_H + +#include +#include + +template +class CppBaseClass +{ +public: + CppBaseClass( Tag& tag ) + : m_tag( tag ) + { + m_info.flags = tag.flags(); + } + + operator Tag& () + { + return asTag(); + } + Tag& asTag() + { + return m_tag; + } + + operator const Tag& () const + { + return asTag(); + } + const Tag& asTag() const + { + return m_tag; + } + + static QString format( const Tag& tag ) + { + return QString::null; + } + + int access() const + { + return m_info.data.access; + } + + void setAccess( int access ) + { + m_info.data.access = access; + m_tag.setFlags( m_info.flags ); + } + + bool isVirtual() const + { + return m_info.data.isVirtual; + } + + void setVirtual( bool b ) + { + m_info.data.isVirtual = b; + m_tag.setFlags( m_info.flags ); + } + + QString name() const + { + return m_tag.name(); + } + + void setName( const QString& name ) + { + m_tag.setName( name ); + } + + QString baseClass() const + { + return m_tag.attribute( "b" ).toString(); + } + + void setBaseClass( const QString& baseClass ) + { + m_tag.setAttribute( "b", baseClass ); + } + +private: + Tag& m_tag; + union + { + unsigned long flags; + struct + { + unsigned long access: + 3; + unsigned long isVirtual: + 1; + } + data; + } m_info; +}; + +template +class CppVariable +{ +public: + CppVariable( Tag& tag ) + : m_tag( tag ) + { + m_info.flags = tag.flags(); + } + + operator Tag& () + { + return asTag(); + } + Tag& asTag() + { + return m_tag; + } + + operator const Tag& () const + { + return asTag(); + } + const Tag& asTag() const + { + return m_tag; + } + + static QString format( const Tag& tag ) + { + return QString::null; + } + + int access() const + { + return m_info.data.access; + } + + void setAccess( int access ) + { + m_info.data.access = access; + m_tag.setFlags( m_info.flags ); + } + + bool isFriend() const + { + return m_info.data.isFriend; + } + + void setFriend( bool b ) + { + m_info.data.isFriend = b; + m_tag.setFlags( m_info.flags ); + } + + bool isStatic() const + { + return m_info.data.isStatic; + } + + void setStatic( bool b ) + { + m_info.data.isStatic = b; + m_tag.setFlags( m_info.flags ); + } + + QString type() const + { + return m_tag.attribute( "t" ).toString(); + } + + void setType( const QString& type ) + { + m_tag.setAttribute( "t", type ); + } + + QString name() const + { + return m_tag.name(); + } + + void setName( const QString& name ) + { + m_tag.setName( name ); + } + +private: + Tag& m_tag; + union + { + unsigned long flags; + struct + { + unsigned long access: + 3; + unsigned long isStatic: + 1; + unsigned long isFriend: + 1; + } + data; + } m_info; +}; + +template +class CppFunction +{ +public: + CppFunction( Tag& tag ) + : m_tag( tag ) + { + m_info.flags = tag.flags(); + } + + operator Tag& () + { + return asTag(); + } + Tag& asTag() + { + return m_tag; + } + + operator const Tag& () const + { + return asTag(); + } + const Tag& asTag() const + { + return m_tag; + } + + static QString format( const Tag& tag ) + { + return QString::null; + } + + int access() const + { + return m_info.data.access; + } + + void setAccess( int access ) + { + m_info.data.access = access; + m_tag.setFlags( m_info.flags ); + } + + bool isSignal() const + { + return bool( m_info.data.isSignal ); + } + + void setSignal( bool isSignal ) + { + m_info.data.isSignal = isSignal; + m_tag.setFlags( m_info.flags ); + } + + bool isSlot() const + { + return bool( m_info.data.isSlot ); + } + + void setSlot( bool isSlot ) + { + m_info.data.isSlot = isSlot; + m_tag.setFlags( m_info.flags ); + } + + bool isInline() const + { + return m_info.data.isInline; + } + + void setInline( bool b ) + { + m_info.data.isInline = b; + m_tag.setFlags( m_info.flags ); + } + + bool isPure() const + { + return m_info.data.isPure; + } + + void setPure( bool b ) + { + m_info.data.isPure = b; + m_tag.setFlags( m_info.flags ); + } + + bool isFriend() const + { + return m_info.data.isFriend; + } + + void setFriend( bool b ) + { + m_info.data.isFriend = b; + m_tag.setFlags( m_info.flags ); + } + + bool isConst() const + { + return m_info.data.isConst; + } + + void setConst( bool b ) + { + m_info.data.isConst = b; + m_tag.setFlags( m_info.flags ); + } + + bool isVolatile() const + { + return m_info.data.isVolatile; + } + + void setVolatile( bool b ) + { + m_info.data.isVolatile = b; + m_tag.setFlags( m_info.flags ); + } + + bool isVirtual() const + { + return m_info.data.isVirtual; + } + + void setVirtual( bool b ) + { + m_info.data.isVirtual = b; + m_tag.setFlags( m_info.flags ); + } + + bool isStatic() const + { + return m_info.data.isStatic; + } + + void setStatic( bool b ) + { + m_info.data.isStatic = b; + m_tag.setFlags( m_info.flags ); + } + + + QString type() const + { + return m_tag.attribute( "t" ).toString(); + } + + void setType( const QString& type ) + { + m_tag.setAttribute( "t", type ); + } + + QString name() const + { + return m_tag.name(); + } + + void setName( const QString& name ) + { + m_tag.setName( name ); + } + + QStringList arguments() const + { + return m_tag.attribute( "a" ).toStringList(); + } + + void setArguments( const QStringList args ) + { + m_tag.setAttribute( "a", args ); + } + + QStringList argumentNames() const + { + return m_tag.attribute( "an" ).toStringList(); + } + + void setArgumentNames( const QStringList args ) + { + m_tag.setAttribute( "an", args ); + } + +private: + Tag& m_tag; + union + { + unsigned long flags; + struct + { + unsigned long access: + 3; + unsigned long isInline: + 1; + unsigned long isVirtual: + 1; + unsigned long isStatic: + 1; + unsigned long isPure: + 1; + unsigned long isFriend: + 1; + unsigned long isConst: + 1; + unsigned long isValile: + 1; + unsigned long isSlot: + 1; + unsigned long isSignal: + 1; + } + data; + } m_info; +}; + +#endif +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/cppcodecompletion.cpp b/languages/cpp/cppcodecompletion.cpp new file mode 100644 index 00000000..27cc9009 --- /dev/null +++ b/languages/cpp/cppcodecompletion.cpp @@ -0,0 +1,4492 @@ +/*************************************************************************** + cppcodecompletion.cpp - description + ------------------- +begin : Sat Jul 21 2001 +copyright : (C) 2001 by Victor R�er +email : victor_roeder@gmx.de +copyright : (C) 2002,2003 by Roberto Raggi +email : roberto@kdevelop.org +copyright : (C) 2005 by Adam Treat +email : manyoso@yahoo.com +copyright : (C) 2006,2007 by David Nolden +email : david.nolden.kdevelop@art-master.de +***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "cppcodecompletion.h" + + +#include "cppcodecompletionconfig.h" +#include "backgroundparser.h" +#include "ast.h" +#include "ast_utils.h" +#include "codeinformationrepository.h" +#include "parser.h" +#include "lexer.h" +#include "tree_parser.h" +#include "cpp_tags.h" +#include "cppsupport_utils.h" +#include "tag_creator.h" + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "codecompletionentry.h" +#include "typedesc.h" +#include "computerecoverypoints.h" +#include "completiondebug.h" +#include "bithelpers.h" +#include "stringhelpers.h" +#include "simpletype.h" +#include "simpletypecachebinder.h" +#include "safetycounter.h" +#include "cppevaluation.h" +#include "simplecontext.h" +#include "simpletypefunction.h" + +//#define DISABLE_TRACING + +CppCodeCompletion* CppCodeCompletion::m_instance = 0; + +const bool disableVerboseForCompletionList = false; +const bool disableVerboseForContextMenu = false; +const bool contextMenuEntriesAtTop = false; +bool showNamespaceAppearances = true; + +const char* constructorPrefix = ""; +const char* destructorPrefix = ""; +///This enables-disables the automatic processing of the expression under the mouse-cursor +//#define DISABLETOOLTIPS + +/** +-- TODO: Does not yet correctly search for overloaded functions and select the right one +-- TODO: The documentation shown in the calltips looks very bad, a better solution must be found(maybe an additional tooltip) +*/ + + void statusBarText( const QString& str, int time ) { + CppCodeCompletion* c = CppCodeCompletion::instance(); + if( c ) + c->addStatusText( str, time ); + } + +TypePointer CppCodeCompletion::createGlobalNamespace() { + KSharedPtr n = new SimpleTypeCachedNamespace( QStringList(), QStringList() ); + n->addAliases(m_pSupport->codeCompletionConfig()->namespaceAliases() ); + return n.data(); +} + +template +class ItemLocker { + public: + ItemLocker( Item& it ) : item( it ) { + it.lock(); + } + ~ItemLocker() { + item.unlock(); + } + private: + Item& item; +}; + +ParsedFilePointer getParsedFile( CodeModelItem* i ) { + if( !i || !i->file() || !i->file()->parseResult() ) return 0; + return dynamic_cast( i->file()->parseResult().data()); +} + +SafetyCounter safetyCounter; +CppCodeCompletion* cppCompletionInstance = 0; + +//file global functions, must be before any "using namespace" +QString cleanForMenu( QString txt ) { + return txt.replace( "&", "&&" ).replace( " ", " " ); +} + +QString buildSignature( TypePointer currType ) { + SimpleTypeFunctionInterface * f = currType->asFunction(); + if ( !f ) + return ""; + + QString ret; + LocateResult rtt = currType->locateDecType( f->getReturnType() ); + if ( rtt->resolved() || rtt.resolutionCount() > 1 ) + ret = rtt->fullNameChain(); + else + ret = f->getReturnType().fullNameChain(); + + + TypeDesc desc = currType->desc(); + desc.decreaseFunctionDepth(); + + QString sig = ret + " " + desc.fullNameChain() + f->signature(); + if ( f->isConst() ) + sig += " const"; + return sig; +} + +uint PopupTracker::pendingPopups = 0; +PopupTracker* PopupTracker::pt = 0; + +/** Multiple empty lines are reduced to one, too long lines wrapped over, and the beginnings of the lines are normalized +*/ +QStringList maximumLength( const QStringList& in, int length ) { + QStringList ret; + uint firstNonSpace = 50000; + for ( QStringList::const_iterator it = in.begin(); it != in.end(); ++it ) + for ( uint a = 0; a < ( *it ).length(); a++ ) + if ( !( *it ) [ a ].isSpace() ) { + if ( firstNonSpace > a ) + firstNonSpace = a; + break; + } + if ( firstNonSpace == 50000 ) + return QStringList(); + + bool hadEmptyLine = false; + for ( QStringList::const_iterator it = in.begin(); it != in.end(); ++it ) { + if ( ( *it ).length() <= firstNonSpace ) { + if ( !hadEmptyLine ) + ret << " "; + hadEmptyLine = true; + } else { + hadEmptyLine = false; + QString str = ( *it ).mid( firstNonSpace ); + while ( !str.isEmpty() ) { + if ( (int)str.length() < length ) { + ret << str; + break; + } else { + ret << str.left( length ) + "\\"; + str = str.mid( length ); + } + } + } + } + return ret; +} + +QStringList prepareTextForMenu( const QString& comment, int maxLines, int maxLength ) { + QStringList in = QStringList::split( "\n", comment ); + QStringList out; + for ( QStringList::iterator it = in.begin(); it != in.end(); ++it ) { + out << cleanForMenu( *it ); + if ( (int)out.count() >= maxLines ) { + out << "[...]"; + break; + } + } + + return maximumLength( out, maxLength ); +} + +QStringList formatComment( const QString& comment, int maxCols = 120 ) { + QStringList ret; + SafetyCounter s( 14 ); ///maximum of 14 lines + + QStringList lines = QStringList::split( "\n", comment ); + for ( QStringList::iterator it = lines.begin(); it != lines.end(); ++it ) { + QStringList words = QStringList::split( " ", *it ); + while ( !words.isEmpty() && s ) { + QString line = "? "; + int len = 0; + while ( !words.isEmpty() && len < maxCols ) { + len += words.front().length(); + line += words.front() + " "; + words.pop_front(); + } + ret << line; + } + } + if ( !s ) + ret << "? comment has too many lines"; + + return ret; +} + +bool operator < ( const CodeCompletionEntry& e1, const CodeCompletionEntry& e2 ) { + return e1.text < e2.text; +} + +template +static QValueList unique( const QValueList& entryList ) { + + QValueList< ItemType > l; + QMap map; + typename QValueList< ItemType >::ConstIterator it = entryList.begin(); + while ( it != entryList.end() ) { + CodeCompletionEntry e = *it++; + QString key = ( e.type + " " + + e.prefix + " " + + e.text + " " + + e.postfix + " " ).simplifyWhiteSpace().stripWhiteSpace(); + if ( map.find( key ) == map.end() ) { + map[ key ] = TRUE; + l << e; + } + } + return l; +} + +static QStringList unique( const QStringList& entryList ) { + + QStringList l; + QMap map; + QStringList::ConstIterator it = entryList.begin(); + while ( it != entryList.end() ) { + QString e = *it++; + if ( map.find( e ) == map.end() ) { + map[ e ] = TRUE; + l << e; + } + } + return l; +} + +static QStringList unique( const QValueList& entryList ) { + + QStringList l; + QMap map; + QValueList::ConstIterator it = entryList.begin(); + while ( it != entryList.end() ) { + QStringList li = ( *it++ ); + QString e = li.join( "\n" ); + if ( map.find( e ) == map.end() ) { + map[ e ] = TRUE; + l += li; + } + } + + return l; +} + + +bool tokenAt( const QString& text, const QString& token, int textPos ) { + if ( text.isEmpty() ) + return false; + + int tokenPos = token.length() - 1; + if ( tokenPos <= 0 || textPos <= 0 ) + return false; + + while ( text[ textPos ] == token[ tokenPos ] ) { + + --tokenPos; + --textPos; + + if ( tokenPos == 0 || textPos == 0 ) { + if ( tokenPos == 0 ) { + if ( textPos >= 1 && text[ textPos ] == token[ tokenPos ] ) { + QChar c = text[ textPos - 1 ]; + return c.isSpace() || c == '{' || c == '}' || c == ';'; + } else { + return false; + } + } else { + return false; + } + } + } + return false; +} + +CppSupportPart* CppCodeCompletion::cppSupport() const { + return m_pSupport; +} + +using namespace CompletionDebug; +using namespace StringHelpers; +using namespace BitHelpers; +using namespace CppEvaluation; + +struct PopupFillerHelpStruct { + CppCodeCompletion* receiver; + FileList files; + CppCodeCompletion::PopupActions& m_popupActions; + PopupFillerHelpStruct( CppCodeCompletion* rec ) : m_popupActions( rec->m_popupActions ) { + receiver = rec; + files = receiver->cppSupport()->codeModel()->fileList(); + } + + bool shouldShowIncludeMenu() const { + return true; + } + + QMap m_namespacePopupCache; + + void insertItem( QPopupMenu* parent, SimpleTypeImpl::MemberInfo d , QString prefix ) { + Q_UNUSED(prefix); + + QString memType = d.memberTypeToString(); + + if ( d.memberType == SimpleTypeImpl::MemberInfo::Typedef && d.type->fullName() == "const int" ) + memType = "enum"; + + QString txt = i18n( "Jump to %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) ); + int id = parent->insertItem( txt, receiver, SLOT( popupAction( int ) ) ); + + receiver->m_popupActions.insert( id, d.decl ); + } + + void insertItem ( QPopupMenu* parent, TypeDesc d , QString prefix ) { + Debug dbg( "#insert# ", 10 ); + + QString txt1, txt2; + + if ( d.resolved() && d.resolved() ->isNamespace() ) { + SimpleTypeCachedNamespace * ns = dynamic_cast( d.resolved().data() ); + if ( ns ) { + SimpleTypeNamespace::SlaveList slaves = ns->getSlaves( receiver->getIncludeFiles() ); + for ( SimpleTypeNamespace::SlaveList::iterator it = slaves.begin(); it != slaves.end(); ++it ) { + SimpleTypeCodeModel* cm = dynamic_cast( ( *it ).first.first.resolved().data() ); + if ( cm && cm->item() ) { + QPopupMenu * m = PopupTracker::createPopup( parent ); + QString scope = cm->scope().join("::"); + QMap< QString, QPopupMenu* >::iterator it = m_namespacePopupCache.find( scope ); + if( it != m_namespacePopupCache.end() ) { + parent->insertItem( "Imported Namespace " + scope, *it ); + delete m; + } else { + parent->insertItem( "Imported Namespace " + scope, m ); + + insertItem( m, ( new SimpleTypeCachedCodeModel( cm->item() ) ) ->desc(), prefix ); + m_namespacePopupCache.insert( scope, m ); + } + } else { + SimpleTypeNamespace* cn = dynamic_cast( ( *it ).first.first.resolved().data() ); + if( cn ) { + TypePointer t = new SimpleTypeNamespace( cn ); //To avoid endless recursion, this needs to be done(the dynamic-cast above fails) + insertItem( parent, t->desc(), prefix ); + } + } + } + return ; + } + } + + if ( d.resolved() && receiver->cppSupport() ->codeCompletionConfig() ->showNamespaceAppearances() ) { + if ( SimpleTypeCachedCodeModel * item = dynamic_cast( d.resolved().data() ) ) { ///(1) + if ( item->item() && item->item() ->isNamespace() ) { + NamespaceModel* ns = dynamic_cast( item->item().data() ); + QStringList wholeScope = ns->scope(); + wholeScope << ns->name(); + for( FileList::iterator it = files.begin(); it != files.end(); ++it ) { + // if( !safetyCounter ) break; + NamespaceModel* ns = (*it).data(); + + for( QStringList::iterator it2 = wholeScope.begin(); it2 != wholeScope.end(); ++it2 ) { + if( ns->hasNamespace( (*it2) ) ) { + ns = ns->namespaceByName( *it2 ); + if( !ns ) break; + } else { + ns = 0; + break; + } + } + + if( ns ) { + ItemDom i(ns); + int sLine, sCol, eLine, eCol; + i->getStartPosition( &sLine, &sCol ); + i->getEndPosition( &eLine, &eCol ); + insertItem( parent, (new SimpleTypeCodeModel( i ))->desc(), prefix + " " + (*it)->name() + QString(" (%1 Lines): ").arg( eLine - sLine ) ); ///SimpleTypeCodeModel is used instead of SimpleTypeCachedNodeModel, so the detection at (1) does not trigger, this avoids endless recursion. + } + + } + return; + } + } + } + + if ( d.resolved() ) { + if ( d.resolved() ->asFunction() ) { + txt1 = prefix + i18n( "Jump to declaration of %1(...)" ).arg( d.resolved() ->scope().join( "::" ) ); + txt2 = prefix + i18n( "Jump to definition of %1(...)" ).arg( d.resolved() ->scope().join( "::" ) ); + } else { + txt1 = prefix + i18n( "Jump to %1" ).arg( cleanForMenu( d.resolved() ->scope().join( "::" ) ) ); + } + } else { + if( !BuiltinTypes::isBuiltin( d ) ) { + txt1 = prefix + d.name() + i18n( " is unresolved" ); + } else { + txt1 = prefix + d.name() + i18n( " (builtin " ) + BuiltinTypes::comment( d ) + ")"; + } + } + + int id = parent->insertItem( txt1, receiver, SLOT( popupAction( int ) ) ); + if ( d.resolved() ) + receiver->m_popupActions.insert( id, d.resolved() ->getDeclarationInfo() ); + + if ( !txt2.isEmpty() ) { + int id2 = parent->insertItem( txt2, receiver, SLOT( popupDefinitionAction( int ) ) ); + if ( d.resolved() ) + receiver->m_popupDefinitionActions.insert( id2, d.resolved() ->getDeclarationInfo() ); + } + } +}; + +ItemDom itemFromScope( const QStringList& scope, NamespaceDom startNamespace ) { + if ( scope.isEmpty() ) + return ItemDom(); + + NamespaceDom glob = startNamespace; + if ( !glob ) + return ItemDom(); + + ClassModel* curr = glob ; + + QStringList::const_iterator mit = scope.begin(); + + while ( curr->isNamespace() && mit != scope.end() && ( ( NamespaceModel* ) curr ) ->hasNamespace( *mit ) ) { + curr = &( *( ( ( NamespaceModel* ) curr ) ->namespaceByName( *mit ) ) ); + ++mit; + } + + while ( ( curr->isNamespace() || curr->isClass() ) && mit != scope.end() && curr->hasClass( *mit ) ) { + ClassList cl = curr->classByName( *mit ); + curr = &( **cl.begin() ); + ++mit; + } + + if ( mit != --scope.end() ) + return ItemDom(); + + TypeAliasList l = curr->typeAliasByName( *mit ); + if ( !l.isEmpty() ) + return model_cast( l.front() ); + + VariableDom v = curr->variableByName( *mit ); + if ( v ) + return model_cast( v ); + + ClassList c = curr->classByName( *mit ); + if ( !c.isEmpty() ) + return model_cast( c.front() ); + + EnumDom en = curr->enumByName( *mit ); + if ( en ) + return model_cast( en ); + + FunctionList f = curr->functionByName( *mit ); + if ( !f.isEmpty() ) + return model_cast( f.front() ); + + FunctionDefinitionList fd = curr->functionDefinitionByName( *mit ); + if ( !fd.isEmpty() ) + return model_cast( fd.front() ); + + return ItemDom(); +} + +struct PopupClassViewFillerHelpStruct { + CppCodeCompletion* receiver; + CppCodeCompletion::PopupActions& m_popupActions; + PopupClassViewFillerHelpStruct( CppCodeCompletion* rec ) : m_popupActions( rec->m_popupActions ) { + receiver = rec; + } + + bool shouldShowIncludeMenu() const { + return false; + } + + void insertItem( QPopupMenu* parent, SimpleTypeImpl::MemberInfo d , QString prefix ) { + Q_UNUSED(prefix); + FileDom f = receiver->m_pSupport->codeModel() ->fileByName( d.decl.file ); + if ( !f ) + return ; + + ItemDom dom = itemFromScope( QStringList::split( "::", d.name ), model_cast( f ) ); + + QString memType = d.memberTypeToString(); + + if ( d.memberType == SimpleTypeImpl::MemberInfo::Typedef && d.type->fullName() == "const int" ) + memType = "enum"; + + QString txt = i18n( "Show %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) ); + int id = parent->insertItem( txt, receiver, SLOT( popupClassViewAction( int ) ) ); + + receiver->m_popupClassViewActions.insert( id, dom ); + } + + void insertItem ( QPopupMenu* parent, TypeDesc d , QString prefix ) { + Debug dbg( "#insert# ", 10 ); + + QString txt; + if ( !d.resolved() ) + return ; + + ItemDom dom; + + if ( d.resolved() ) { + SimpleTypeCodeModel * cm = dynamic_cast( d.resolved().data() ); + if ( cm ) + dom = cm->item(); + } + + if ( d.resolved() ) { + if ( !dom && d.resolved() ->isNamespace() ) { + SimpleTypeCachedNamespace * ns = dynamic_cast( d.resolved().data() ); + if ( ns ) { + SimpleTypeNamespace::SlaveList slaves = ns->getSlaves( receiver->getIncludeFiles() ); + for ( SimpleTypeNamespace::SlaveList::iterator it = slaves.begin(); it != slaves.end(); ++it ) { + SimpleTypeCodeModel* cm = dynamic_cast( ( *it ).first.first.resolved().data() ); + if ( cm && cm->item() ) { + insertItem( parent, ( new SimpleTypeCachedCodeModel( cm->item() ) ) ->desc(), prefix ); + } else { + SimpleTypeNamespace* cn = dynamic_cast( ( *it ).first.first.resolved().data() ); + if( cn ) { + TypePointer t = new SimpleTypeNamespace( cn ); //to avoid endless recursion (caching would be better) + insertItem( parent, t->desc(), prefix ); + } + } + } + return ; + } + } else { + if ( dom ) { + QString n = d.resolved() ->scope().join( "::" ); + //QString n = d.fullNameChain(); + if ( d.resolved() ->asFunction() ) { + n = buildSignature( d.resolved() ); + } + txt = prefix + i18n( "Show %1" ).arg( cleanForMenu( n ) ); + } else { + txt = prefix + d.name() + " not in code-model"; + } + } + } else { + if( !BuiltinTypes::isBuiltin( d ) ) { + txt = prefix + d.name() + i18n( " is unresolved" ); + } else { + txt = prefix + d.name() + i18n( " (builtin " ) + BuiltinTypes::comment( d ) + ")"; + } + } + + int id = parent->insertItem( txt, receiver, SLOT( popupClassViewAction( int ) ) ); + + if ( dom ) + receiver->m_popupClassViewActions.insert( id, dom ); + } +}; + +template +class PopupFiller { + HelpStruct struk; + QString depthAdd; + SafetyCounter s; + public: + PopupFiller( HelpStruct str , QString dAdd, int maxCount = 100 ) : struk( str ), depthAdd( dAdd ), s( maxCount ) {} + + + void fillIncludes( const DeclarationInfo& decl, QPopupMenu* parent, bool& needSeparator ) { + if( !struk.receiver->getIncludeFiles()[ HashedString( decl.file ) ] ) { + QString file = decl.file; + //The include-file seems to be missing + if( needSeparator ) { + needSeparator = false; + parent->insertSeparator(); + } + + QString includeFile = file; + QFileInfo info( file ); + + Driver* driver = struk.receiver->cppSupport()->driver(); + if( driver ) { + QStringList elements = QStringList::split( "/", file ); + includeFile = elements.back(); + elements.pop_back(); + + Dependence d; + d.first = includeFile; + d.second = Dep_Local; + while( driver->findIncludeFile( d, struk.receiver->activeFileName() ) != file && !elements.empty() ) { + //kdDebug( 9007 ) << "could not find include-file \"" << d.first << "\"" << endl; + includeFile = elements.back() + "/" + includeFile; + d.first = includeFile; + elements.pop_back(); + } + if( elements.empty() ) + includeFile = "/" + includeFile; + + //kdDebug( 9007 ) << "found include-file \"" << includeFile << "\"" << endl; + } + int id = parent->insertItem( i18n( "#include \"%1\" ( defines %2 )" ).arg ( includeFile ).arg( decl.name ), struk.receiver, SLOT( popupAction( int ) ) ); + DeclarationInfo fakeDec; + fakeDec.name = decl.name; + fakeDec.file = includeFile; + fakeDec.startLine = -1; //Use startline -1 to indicate that instead of jumping to the file, the file should be included. + struk.m_popupActions.insert( id, fakeDec ); + } + } + + void fill( QPopupMenu * parent, LocateResult d, QString prefix = "", const DeclarationInfo & sourceVariable = DeclarationInfo() ) { + Debug dbg( "#fl# ", 10 ) + ; + + + if ( !s || !dbg ) { + //dbgMajor() << "safety-counter triggered while filling \"" << d.fullNameChain() << "\"" << endl; + return ; + } + + if ( !sourceVariable.name.isEmpty() && sourceVariable.name != "this" ) { + SimpleTypeImpl::MemberInfo f; + f.decl = sourceVariable; + f.name = sourceVariable.name; + f.type = d.desc(); + f.memberType = SimpleTypeImpl::MemberInfo::Variable; + + /*int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").arg( type.sourceVariable.name ) , this, SLOT( popupAction( int ) ) ); + + m_popupActions.insert( id, type.sourceVariable );*/ + struk.insertItem( parent, f, prefix ); + + parent->insertSeparator(); + + if ( !sourceVariable.comment.isEmpty() ) { + QPopupMenu * m = PopupTracker::createPopup( parent ); + parent->insertItem( i18n( "Comment on %1" ).arg( sourceVariable.name ), m ); + QStringList ls = prepareTextForMenu( sourceVariable.comment, 15, 100 ); + for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) { + m->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) ); + } + parent->insertSeparator(); + } + } + + struk.insertItem( parent, d, prefix ); + + if( d->resolved() && !d->resolved()->specialization().isEmpty() ) { + SimpleType p = d->resolved()->parent(); + LocateResult r = p->locateDecType( d->name() ); + if( r ) { + QPopupMenu * m = PopupTracker::createPopup( parent ); + parent->insertItem( i18n( "Specialized from \"%1\"" ).arg( cleanForMenu( r->fullNameChain() ) ), m ); + fill( m, r ); + } + } + + TypeDesc::TemplateParams p = d->templateParams(); + for ( TypeDesc::TemplateParams::iterator it = p.begin(); it != p.end(); ++it ) { + //if( (*it)->resolved() ) { + QPopupMenu * m = PopupTracker::createPopup( parent ); + parent->insertItem( i18n( "Template-param \"%1\"" ).arg( cleanForMenu( ( *it ) ->fullNameChain() ) ), m ); + fill( m, **it ); + /*} else { + fill( parent, **it, prefix + depthAdd ); + }*/ + } + + if ( d->resolved() ) { + if ( d->resolved() ->asFunction() ) { + LocateResult rt = d->resolved() ->locateDecType( d->resolved() ->asFunction() ->getReturnType() ); + if ( rt ) { + QPopupMenu * m = PopupTracker::createPopup( parent ); + parent->insertItem( i18n( "Return-type \"%1\"" ).arg( cleanForMenu( rt->fullNameChain() ) ), m ); + fill( m, rt ); + } + + QValueList args = d->resolved() ->asFunction() ->getArgumentTypes(); + QStringList argNames = d->resolved() ->asFunction() ->getArgumentNames(); + if ( !args.isEmpty() ) { + QPopupMenu * m = PopupTracker::createPopup( parent ); + parent->insertItem( i18n( "Argument-types" ), m ); + QStringList::iterator it2 = argNames.begin(); + for ( QValueList::iterator it = args.begin(); it != args.end(); ++it ) { + LocateResult at = d->resolved() ->locateDecType( *it ); + QString name = ""; + if ( it2 != argNames.end() ) { + name = *it2; + ++it2; + } + QPopupMenu * mo = PopupTracker::createPopup( m ); + m->insertItem( i18n( "Argument \"%1\"" ).arg( cleanForMenu( at->fullNameChain() + " " + name ) ), mo ); + fill( mo, at ); + + } + } + } + } +#ifndef DISABLE_TRACING + if ( d.trace() ) { + QValueList > trace = d.trace() ->trace(); + if ( !trace.isEmpty() ) { + QPopupMenu * m = PopupTracker::createPopup( parent ); + parent->insertItem( i18n( "Trace" ), m ); + + for ( QValueList >::iterator it = trace.begin(); it != trace.end(); ++it ) { + QPopupMenu * mo = PopupTracker::createPopup( m ); + QString tail = ( *it ).second.fullNameChain(); + if ( !tail.isEmpty() ) + tail = "::" + tail; + m->insertItem( i18n( "%1 -> %2" ).arg( cleanForMenu( ( *it ).first.name + tail ) ).arg( cleanForMenu( ( *it ).first.type->fullNameChain() + tail ) ), mo ); + + struk.insertItem( mo, ( *it ).first, prefix ); + + if ( !( *it ).first.decl.comment.isEmpty() ) { + mo->insertSeparator(); + QPopupMenu * m = PopupTracker::createPopup( mo ); + mo->insertItem( i18n( "Comment" ), m ); + QStringList ls = prepareTextForMenu( ( *it ).first.decl.comment, 15, 100 ); + for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) { + m->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) ); + } + } + + /*bool needSeparator = true; + if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() && !(*it).first.decl.file.operator QString().isEmpty() ) + fillIncludes( (*it).first.decl, mo, needSeparator );*/ + } + } + } +#endif + + if ( d->resolved() ) { + QValueList bases = d->resolved() ->getBases(); + for ( QValueList::iterator it = bases.begin(); it != bases.end(); ++it ) { + QPopupMenu * m = PopupTracker::createPopup( parent ); + parent->insertItem( i18n( "Base-class \"%1\"" ).arg( cleanForMenu( ( *it ) ->fullNameChain() ) ), m ); + fill( m, *it ); + } + + if ( d->resolved() ->parent() && d->resolved() ->parent() ->desc() ) { + QPopupMenu * m = PopupTracker::createPopup( parent ); + parent->insertItem( i18n( "Nested in \"%1\"" ).arg( cleanForMenu( d->resolved() ->parent() ->fullTypeResolved() ) ), m ); + fill( m, d->resolved() ->parent() ->desc() ); + } + + if ( !d->resolved() ->comment().isEmpty() ) { + parent->insertSeparator(); + QPopupMenu * m = PopupTracker::createPopup( parent ); + parent->insertItem( i18n( "Comment on %1" ).arg( cleanForMenu( d->name() ) ), m ); + QStringList ls = prepareTextForMenu( d->resolved() ->comment(), 15, 100 ); + for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) { + m->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) ); + } + } + } + + //Add entries for including missing include-files + if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() ) { + bool needSeparator = true; + //Show the include-files for the whole trace, because usually the first in the trace should be the one to include + if ( d.trace() ) { + QValueList > trace = d.trace() ->trace(); + if ( !trace.isEmpty() ) { + for ( QValueList >::iterator it = trace.begin(); it != trace.end(); ++it ) { + if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() && !(*it).first.decl.file.operator QString().isEmpty() ) + fillIncludes( (*it).first.decl, parent, needSeparator ); + } + } + } + + //Show the include-file for the item itself + if( d->resolved() && !d->resolved()->isNamespace() && struk.receiver->cppSupport() ) { + fillIncludes( d->resolved()->getDeclarationInfo(), parent, needSeparator ); + } + } + } +}; + +struct CompTypeProcessor : public TypeProcessor { + SimpleType m_scope; + bool m_processArguments; + + CompTypeProcessor( SimpleType scope, bool processArguments ) : m_scope( scope ), m_processArguments( processArguments ) {} + + virtual QString parentType() { + return m_scope->fullType(); + } + + virtual QString processType( const QString& type ) { + if ( !m_processArguments ) + return type; + LocateResult t = m_scope->locateDecType( type ); + if ( t ) + return t->fullNameChain(); + else + return type; + } +}; + +struct CppCodeCompletionData { + QPtrList recoveryPoints; + //QStringList classNameList; + + CppCodeCompletionData() { + recoveryPoints.setAutoDelete( true ); + } + + RecoveryPoint* findRecoveryPoint( int line, int column ) { + if ( recoveryPoints.count() == 0 ) + return 0; + + QPair pt = qMakePair( line, column ); + + QPtrListIterator it( recoveryPoints ); + RecoveryPoint* recPt = 0; + + while ( it.current() ) { + QPair startPt = qMakePair( it.current() ->startLine, it.current() ->startColumn ); + QPair endPt = qMakePair( it.current() ->endLine, it.current() ->endColumn ); + + if ( pt < startPt ) { + break; + } + + if ( startPt < pt && pt < endPt ) + recPt = it.current(); + + ++it; + } + + return recPt; + } + +}; + +CppCodeCompletion::CppCodeCompletion( CppSupportPart* part ) + : d( new CppCodeCompletionData ), + //Matches on includes + m_includeRx( "^\\s*#\\s*include\\s+[\"<]" ), + //Matches on C++ and C style comments as well as literal strings + m_cppCodeCommentsRx( "(//([^\n]*)(\n|$)|/\\*.*\\*/|\"([^\\\\]|\\\\.)*\")" ), + //Matches on alpha chars and '.' + m_codeCompleteChRx( "([A-Z])|([a-z])|(\\.)" ), + //Matches on "->" and "::" +m_codeCompleteCh2Rx( "(->)|(\\:\\:)" ) { + m_instance = this; + cppCompletionInstance = this; + m_cppCodeCommentsRx.setMinimal( true ); + + m_pSupport = part; + + connect( m_pSupport->codeCompletionConfig(), SIGNAL( stored() ), this, SLOT( emptyCache() ) ); + + m_activeCursor = 0; + m_activeEditor = 0; + m_activeCompletion = 0; + m_activeHintInterface = 0; + m_activeView = 0; + m_ccTimer = new QTimer( this ); + m_showStatusTextTimer = new QTimer( this ); + + m_ccLine = 0; + m_ccColumn = 0; + connect( m_ccTimer, SIGNAL( timeout() ), this, SLOT( slotTimeout() ) ); + connect( m_showStatusTextTimer, SIGNAL( timeout() ), this, SLOT( slotStatusTextTimeout() ) ); + + computeFileEntryList(); + + CppSupportPart* cppSupport = m_pSupport; + connect( cppSupport->project(), SIGNAL( addedFilesToProject( const QStringList& ) ), + this, SLOT( computeFileEntryList() ) ); + connect( cppSupport->project(), SIGNAL( removedFilesFromProject( const QStringList& ) ), + this, SLOT( computeFileEntryList() ) ); + connect( cppSupport, SIGNAL( synchronousParseReady( const QString&, ParsedFilePointer ) ), this, SLOT( synchronousParseReady( const QString&, ParsedFilePointer ) ) ); + + m_bArgHintShow = false; + m_bCompletionBoxShow = false; + m_blockForKeyword = false; + m_demandCompletion = false; + m_completionMode = NormalCompletion; + + m_repository = new CodeInformationRepository( cppSupport->codeRepository() ); + + connect( cppSupport->codeRepository(), SIGNAL(catalogRegistered( Catalog* )), this, SLOT( emptyCache() ) ); + connect( cppSupport->codeRepository(), SIGNAL(catalogUnregistered( Catalog* )), this, SLOT( emptyCache() ) ); + connect( cppSupport->codeRepository(), SIGNAL(catalogChanged( Catalog* )), this, SLOT( emptyCache() ) ); + + setupCodeInformationRepository(); + + if ( part->partController() ->parts() ) { + QPtrListIterator it( *part->partController() ->parts() ); + while ( KParts::Part * part = it.current() ) { + integratePart( part ); + ++it; + } + } + + if ( part->partController() ->activePart() ) + slotActivePartChanged( part->partController() ->activePart() ); + + connect( part->partController( ), SIGNAL( partAdded( KParts::Part* ) ), + this, SLOT( slotPartAdded( KParts::Part* ) ) ); + connect( part->partController( ), SIGNAL( activePartChanged( KParts::Part* ) ), + this, SLOT( slotActivePartChanged( KParts::Part* ) ) ); + + connect( part, SIGNAL( fileParsed( const QString& ) ), + this, SLOT( slotFileParsed( const QString& ) ) ); + connect( part, SIGNAL( codeModelUpdated( const QString& ) ), + this, SLOT( slotCodeModelUpdated( const QString& ) ) ); + + KAction * action = new KAction( i18n("Jump to declaration under cursor"), 0, CTRL + Key_Comma, + this, SLOT(slotJumpToDeclCursorContext()), part->actionCollection(), "jump_to_declaration_cursor_context" ); + action->plug( &m_DummyActionWidget ); + + action = new KAction( i18n("Jump to definition under cursor"), 0, CTRL + Key_Period, + this, SLOT(slotJumpToDefCursorContext()), part->actionCollection(), "jump_to_defintion_cursor_context" ); + action->plug( &m_DummyActionWidget ); +} + +CppCodeCompletion::~CppCodeCompletion( ) { + delete m_repository; + delete d; +} + +void CppCodeCompletion::addStatusText( QString text, int timeout ) { + m_statusTextList.append( QPair( timeout, text ) ); + if ( !m_showStatusTextTimer->isActive() ) { + slotStatusTextTimeout(); + } +} + +void CppCodeCompletion::clearStatusText() { + m_statusTextList.clear(); + m_showStatusTextTimer->stop(); +} + +void CppCodeCompletion::slotStatusTextTimeout() { + if ( m_statusTextList.isEmpty() || !m_pSupport ) + return ; +// m_pSupport->mainWindow() ->statusBar() ->message( m_statusTextList.front().second, m_statusTextList.front().first ); + m_showStatusTextTimer->start( m_statusTextList.front().first , true ); + m_statusTextList.pop_front(); +} + +void CppCodeCompletion::slotTimeout() { + if ( !m_activeCursor || !m_activeEditor || !m_activeCompletion ) + return ; + + uint nLine, nCol; + m_activeCursor->cursorPositionReal( &nLine, &nCol ); + + if ( nLine != m_ccLine || nCol != m_ccColumn ) + return ; + + QString textLine = m_activeEditor->textLine( nLine ); + QChar ch = textLine[ nCol ]; + if ( ch.isLetterOrNumber() || ch == '_' ) + return ; + + completeText(); +} + +void CppCodeCompletion::slotArgHintHidden() { + //kdDebug(9007) << "CppCodeCompletion::slotArgHintHidden()" << endl; + m_bArgHintShow = false; +} + +void CppCodeCompletion::slotCompletionBoxHidden() { + //kdDebug( 9007 ) << "CppCodeCompletion::slotCompletionBoxHidden()" << endl; + m_bCompletionBoxShow = false; +} + + +void CppCodeCompletion::integratePart( KParts::Part * part ) { + if ( !part || !part->widget() ) + return ; + + KTextEditor::Document* doc = dynamic_cast( part ); + if ( doc ) { + kdDebug( 9007 ) << k_funcinfo << "integrate document: " << doc << endl; + + if ( m_pSupport ) { //The slot should connected even when automatic completion is disabled, so it can be enabled any time + kdDebug( 9007 ) << k_funcinfo << "enabling code completion" << endl; + connect( part, SIGNAL( textChanged() ), this, SLOT( slotTextChanged() ) ); + connect( part->widget(), SIGNAL( completionDone() ), this, + SLOT( slotCompletionBoxHidden() ) ); + connect( part->widget(), SIGNAL( completionAborted() ), this, + SLOT( slotCompletionBoxHidden() ) ); + connect( part->widget(), SIGNAL( argHintHidden() ), this, + SLOT( slotArgHintHidden() ) ); + } + } +} + +void CppCodeCompletion::slotPartAdded( KParts::Part * part ) { + integratePart( part ); +} + +void CppCodeCompletion::slotActivePartChanged( KParts::Part * part ) { + emptyCache(); + this->d->recoveryPoints.clear(); + if ( m_activeHintInterface && m_activeView ) { + disconnect( m_activeView , SIGNAL( needTextHint( int, int, QString & ) ), this, SLOT( slotTextHint( int, int, QString& ) ) ); + + m_activeHintInterface = 0; + } + if ( !part ) + return ; + + kdDebug( 9007 ) << k_funcinfo << endl; + + m_activeFileName = QString::null; + + KTextEditor::Document* doc = dynamic_cast( part ); + if ( !doc ) + return ; + + m_activeFileName = doc->url().path(); + + // if the interface stuff fails we should disable codecompletion automatically + m_activeEditor = dynamic_cast( part ); + if ( !m_activeEditor ) { + kdDebug( 9007 ) << "Editor doesn't support the EditDocumentIface" << endl; + return ; + } + + m_activeCursor = dynamic_cast( part->widget() ); + if ( !m_activeCursor ) { + kdDebug( 9007 ) << "The editor doesn't support the CursorDocumentIface!" << endl; + return ; + } + + m_activeCompletion = dynamic_cast( part->widget() ); + if ( !m_activeCompletion ) { + kdDebug( 9007 ) << "Editor doesn't support the CompletionIface" << endl; + return ; + } + + m_activeView = part ? dynamic_cast( part->widget() ) : 0; + + if ( m_activeView ) + m_activeHintInterface = dynamic_cast( m_activeView ); + + char* q = 0; + kdDebug() << q << endl; + + if ( m_activeHintInterface ) { +#ifndef DISABLETOOLTIPS + m_activeHintInterface->enableTextHints( 500 ); + connect( m_activeView, SIGNAL( needTextHint( int, int, QString & ) ), this, SLOT( slotTextHint( int, int, QString& ) ) ); +#endif + + } else { + kdDebug( 9007 ) << "editor has no text-hint-interface" << endl; + } + + kdDebug( 9007 ) << k_funcinfo << "-- end" << endl; +} + +void CppCodeCompletion::slotTextChanged() { + m_ccTimer->stop(); + + if ( !m_activeCursor ) + return ; + + unsigned int nLine, nCol; + m_activeCursor->cursorPositionReal( &nLine, &nCol ); + + QString strCurLine = m_activeEditor->textLine( nLine ); + QString ch = strCurLine.mid( nCol - 1, 1 ); + QString ch2 = strCurLine.mid( nCol - 2, 2 ); + + // Tell the completion box to _go_away_ when the completion char + // becomes empty or whitespace and the box is already showing. + // !!WARNING!! This is very hackish, but KTE doesn't offer a way + // to tell the completion box to _go_away_ + if ( ch.simplifyWhiteSpace().isEmpty() && + !strCurLine.simplifyWhiteSpace().contains( "virtual" ) && + m_bCompletionBoxShow ) { + QValueList entryList; + m_bCompletionBoxShow = true; + m_activeCompletion->showCompletionBox( entryList, 0 ); + } + + m_ccLine = 0; + m_ccColumn = 0; + + bool argsHint = m_pSupport->codeCompletionConfig() ->automaticArgumentsHint(); + bool codeComplete = m_pSupport->codeCompletionConfig() ->automaticCodeCompletion(); + bool headComplete = codeComplete; //m_pSupport->codeCompletionConfig() ->automaticHeaderCompletion(); + + // m_codeCompleteChRx completes on alpha chars and '.' + // m_codeCompleteCh2Rx completes on "->" and "::" + + if ( ( argsHint && ch == "(" ) || + ( codeComplete && strCurLine.simplifyWhiteSpace().contains( "virtual" ) ) || + ( codeComplete && ( m_codeCompleteChRx.search( ch ) != -1 || + m_codeCompleteCh2Rx.search( ch2 ) != -1 ) ) || + ( headComplete && ( ch == "\"" || ch == "<" ) && m_includeRx.search( strCurLine ) != -1 ) ) { + int time; + m_ccLine = nLine; + m_ccColumn = nCol; + if ( ch == "(" ) + time = m_pSupport->codeCompletionConfig() ->argumentsHintDelay(); + else + time = m_pSupport->codeCompletionConfig() ->codeCompletionDelay(); + m_ccTimer->start( time, true ); + } + + fitContextItem( nLine, nCol ); +} + +void CppCodeCompletion::fitContextItem( int nLine, int nCol ) { + if( !SimpleType::globalNamespace() ) { + kdDebug( 9007 ) << "no global namespace was set, clearing cache" << endl; + emptyCache(); + } + ///Find out whether the cache may be used on, or has to be cleared. + if ( m_cachedFromContext ) { + int sLine, sCol, eLine, eCol; + m_cachedFromContext->getStartPosition( &sLine, &sCol ); + m_cachedFromContext->getEndPosition( &eLine, &eCol ); + + if ( ( nLine < sLine || ( nLine == sLine && nCol < sCol ) ) || ( nLine > eLine || ( nLine == eLine && nCol >= eCol ) ) ) { + ///The stored item was left. First check whether the item was expanded. + FileDom file = m_pSupport->codeModel() ->fileByName( m_activeFileName ); + + if ( file ) { + CodeModelUtils::CodeModelHelper fileModel( m_pSupport->codeModel(), file ); + if ( m_cachedFromContext->isClass() ) { + ClassDom klass = fileModel.classAt( nLine, nCol ); + if ( klass ) { + ClassDom oldClass = dynamic_cast( m_cachedFromContext.data() ); + if ( oldClass && oldClass->name() == klass->name() && oldClass->scope() == klass->scope() ) { + m_cachedFromContext = klass.data(); + } else { + emptyCache(); + } + } else { + emptyCache(); + } + } else if ( m_cachedFromContext->isFunction() ) { + FunctionDom function = fileModel.functionAt( nLine, nCol ); + if ( function ) { + FunctionDom oldFunction = dynamic_cast( m_cachedFromContext.data() ); + if ( oldFunction && oldFunction->name() == function->name() && function->scope() == oldFunction->scope() && oldFunction->argumentList().count() == function->argumentList().count() ) { + ArgumentList l1 = oldFunction->argumentList(); + ArgumentList l2 = function->argumentList(); + ArgumentList::iterator it = l1.begin(); + ArgumentList::iterator it2 = l2.begin(); + bool match = true; + while ( it != l1.end() ) { + if ( ( *it ) ->type() != ( *it2 ) ->type() ) { + match = false; + break; + } + ++it; + ++it2; + } + if ( match ) { + m_cachedFromContext = function.data(); + } else { + emptyCache(); + } + + } else { + emptyCache(); + } + } else { + emptyCache(); + } + } else { + emptyCache(); + } + } else { + emptyCache(); + } + } + } +} + +enum { T_ACCESS, T_PAREN, T_BRACKET, T_IDE, T_UNKNOWN, T_TEMP }; + +QString CppCodeCompletion::replaceCppComments( const QString& contents ) { + QString text = contents; + + int pos = 0; + while ( ( pos = m_cppCodeCommentsRx.search( text, pos ) ) != -1 ) { + if ( m_cppCodeCommentsRx.cap( 1 ).startsWith( "//" ) ) { + QString before = m_cppCodeCommentsRx.cap( 1 ); + QString after; + after.fill( ' ', before.length() - 5 ); + after.prepend( "/*" ); + after.append( "*/" ); + text.replace( pos, before.length() - 1, after ); + pos += after.length(); + } else { + pos += m_cppCodeCommentsRx.matchedLength(); + } + } + return text; +} + +int CppCodeCompletion::expressionAt( const QString& contents, int index ) { + kdDebug( 9007 ) << k_funcinfo << endl; + + /* C++ style comments present issues with finding the expr so I'm + matching for them and replacing them with empty C style comments + of the same length for purposes of finding the expr. */ + + QString text = clearComments( contents ); + + int last = T_UNKNOWN; + int start = index; + --index; + + while ( index > 0 ) { + while ( index > 0 && text[ index ].isSpace() ) { + --index; + } + + QChar ch = text[ index ]; + QString ch2 = text.mid( index - 1, 2 ); + if ( ( last != T_IDE ) && ( ch.isLetterOrNumber() || ch == '_' ) ) { + while ( index > 0 && ( text[ index ].isLetterOrNumber() || text[ index ] == '_' ) ) { + --index; + } + last = T_IDE; + } else if ( last != T_IDE && ch == ')' ) { + int count = 0; + while ( index > 0 ) { + QChar ch = text[ index ]; + if ( ch == '(' ) { + ++count; + } else if ( ch == ')' ) { + --count; + } else if ( count == 0 ) { + //index; + last = T_PAREN; + break; + } + --index; + } + } else if ( last != T_IDE && ch == '>' && ch2 != "->" ) { + int count = 0; + while ( index > 0 ) { + QChar ch = text[ index ]; + if ( ch == '<' ) { + ++count; + } else if ( ch == '>' ) { + --count; + } else if ( count == 0 ) { + //--index; + last = T_TEMP; + break; + } + --index; + } + } else if ( ch == ']' ) { + int count = 0; + while ( index > 0 ) { + QChar ch = text[ index ]; + if ( ch == '[' ) { + ++count; + } else if ( ch == ']' ) { + --count; + } else if ( count == 0 ) { + //--index; + last = T_BRACKET; + break; + } + --index; + } + } else if ( ch == '.' ) { + --index; + last = T_ACCESS; + } else if ( ch2 == "::" ) { + index -= 2; + last = T_ACCESS; + } else if ( ch2 == "->" ) { + index -= 2; + last = T_ACCESS; + } else { + if ( start > index ) { + ++index; + } + last = T_UNKNOWN; + break; + } + } + + ///If we're at the first item, the above algorithm cannot be used safely, + ///so just determine whether the sign is valid for the beginning of an expression, if it isn't reject it. + if ( index == 0 && start > index && !( text[ index ].isLetterOrNumber() || text[ index ] == '_' || text[ index ] == ':' ) ) { + ++index; + } + + return index; +} + +QStringList CppCodeCompletion::splitExpression( const QString& text ) { +#define ADD_CURRENT()\ + if( current.length() ) { l << current; /*kdDebug(9007) << "add word " << current << endl;*/ current = ""; } + + QStringList l; + uint index = 0; + QString current; + while ( index < text.length() ) { + QChar ch = text[ index ]; + QString ch2 = text.mid( index, 2 ); + + if ( ch == '.' ) { + current += ch; + ADD_CURRENT(); + ++index; + } else if ( ch == '(' ) { + int count = 0; + while ( index < text.length() ) { + QChar ch = text[ index ]; + if ( ch == '(' ) { + ++count; + } else if ( ch == ')' ) { + --count; + } else if ( count == 0 ) { + break; + } + current += ch; + ++index; + } + } else if ( ch == '[' ) { + int count = 0; + while ( index < text.length() ) { + QChar ch = text[ index ]; + if ( ch == '[' ) { + ++count; + } else if ( ch == ']' ) { + --count; + } else if ( count == 0 ) { + break; + } + current += ch; + ++index; + } + } else if ( ch2 == "->" ) { + current += ch2; + ADD_CURRENT(); + index += 2; + } /*else if ( ch2 == "::" ) + { + current += ch2; + ADD_CURRENT(); + index += 2; + }*/ + else { + current += text[ index ]; + ++index; + } + } + ADD_CURRENT(); + return l; +} + +///Before calling this, a SimpleTypeConfiguration-object should be created, so that the ressources will be freed when that object is destroyed +EvaluationResult CppCodeCompletion::evaluateExpressionAt( int line, int column , SimpleTypeConfiguration& conf, bool ifUnknownSetType ) { + kdDebug( 9007 ) << "CppCodeCompletion::evaluateExpressionAt( " << line << ", " << column << " )" << endl; + + if ( !m_pSupport || !m_activeEditor ) + return EvaluationResult(); + if ( line < 0 || line >= ( int ) m_activeEditor->numLines() ) + return EvaluationResult(); + if ( column < 0 || column >= m_activeEditor->lineLength( line ) ) + return EvaluationResult(); + + { + QString curLine = m_activeEditor->textLine( line ); + + ///move column to the last letter of the pointed word + while ( column + 1 < ( int ) curLine.length() && isValidIdentifierSign( curLine[ column ] ) && isValidIdentifierSign( curLine[ column + 1 ] ) ) + column++; + + //if( column > 0 ) column--; + + if ( column >= ( int ) curLine.length() || curLine[ column ].isSpace() ) + return EvaluationResult(); + + QString expr = curLine.left( column + 1 ); + kdDebug( 9007 ) << "evaluating line \"" << expr.stripWhiteSpace() << "\"" << endl; + + if ( curLine[ column ] == '-' || curLine[ column ] == ';' ) + --column; + + EvaluationResult type = evaluateExpressionType( line, column + 1, conf, ifUnknownSetType ? addFlag( DefaultEvaluationOptions, DefaultAsTypeExpression ) : DefaultEvaluationOptions ); + + kdDebug( 9007 ) << "type: " << type->fullNameChain() << endl; + + return type; + } +} + +void CppCodeCompletion::popupAction( int number ) { + PopupActions::iterator it = m_popupActions.find( number ); + if ( it != m_popupActions.end() ) { + QString fileName = ( *it ).file == "current_file" ? m_activeFileName : ( *it ).file.operator QString(); + if( (*it).startLine == -1 ) { + //startLine -1 indicates that the file should be added to the include-files + m_activeEditor->insertLine( 0, QString("#include \"%1\" /* defines %2 */").arg( fileName ).arg( (*it).name ) ); + } else { + m_pSupport->partController() ->editDocument( fileName, ( *it ).startLine ); + } + } else { + kdDebug( 9007 ) << "error" << endl; + } +} + +void CppCodeCompletion::popupDefinitionAction( int number ) { + PopupActions::iterator it = m_popupDefinitionActions.find( number ); + if ( it != m_popupDefinitionActions.end() ) { + QString fileName = ( *it ).file == "current_file" ? m_activeFileName : ( *it ).file.operator QString(); + if ( !m_pSupport->switchHeaderImpl( fileName, ( *it ).startLine, ( *it ).startCol ) ) + m_pSupport->partController() ->editDocument( fileName, ( *it ).startLine ); + } else { + kdDebug( 9007 ) << "error" << endl; + } +} + +void CppCodeCompletion::selectItem( ItemDom item ) { + Extensions::KDevCodeBrowserFrontend * f = m_pSupport->extension< Extensions::KDevCodeBrowserFrontend > ( "KDevelop/CodeBrowserFrontend" ); + + if ( f != 0 ) { + ItemDom itemDom( &( *item ) ); + f->jumpedToItem( itemDom ); + } else { + kdDebug() << "could not find the proper extension" << endl; + } +} + +void CppCodeCompletion::popupClassViewAction( int number ) { + PopupClassViewActions::iterator it = m_popupClassViewActions.find( number ); + if ( it != m_popupClassViewActions.end() ) { + if ( ( *it ) ) + selectItem( *it ); + } else { + kdDebug( 9007 ) << "error" << endl; + } +} + +void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Context *context, int line, int column ) { + clearStatusText(); + Q_UNUSED(context); + if ( !m_pSupport->codeCompletionConfig() ->showEvaluationContextMenu() ) + return ; + + kdDebug( 9007 ) << "CppCodeCompletion::contextEvaluationMenu()" << endl; + + PopupTracker::print(); + + m_popupActions.clear(); + m_popupDefinitionActions.clear(); + m_popupClassViewActions.clear(); + + if ( !m_pSupport || !m_activeEditor ) + return ; + + struct SetDbgState { + DBGStreamType& st; + bool oldState; + SetDbgState( DBGStreamType& targ, bool state ) : st( targ ) { + oldState = targ.state(); + targ.setState( state ); + } + ~SetDbgState() { + st.setState( oldState ); + } + }; + + int cpos = 0; + + SetDbgState stt( dbgState, disableVerboseForContextMenu ); + + SimpleTypeConfiguration conf( m_activeFileName ); + + EvaluationResult type = evaluateExpressionAt( line, column, conf ); + + ///Test if it is a macro + if( type.isMacro ) { + QPopupMenu * m = PopupTracker::createPopup( popup ); + int gid; + if ( contextMenuEntriesAtTop ) + gid = popup->insertItem( i18n( "Navigate by Macro \"%1\"" ).arg( cleanForMenu( type.macro.name() ) ), m, 5, cpos++ ); + else + gid = popup->insertItem( i18n( "Navigate by Macro \"%1\"" ).arg( cleanForMenu( type.macro.name() ) ), m ); + + int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( type.macro.name() ) ), this, SLOT( popupAction( int ) ) ); + QPopupMenu * b = PopupTracker::createPopup( m ); + m->insertItem( i18n( "Body" ), b ); + + DeclarationInfo i; + i.file = type.macro.fileName(); + i.startCol = type.macro.column(); + i.startLine = type.macro.line(); + i.endCol = type.macro.column(); + i.endLine = type.macro.line(); + m_popupActions.insert( id, i ); + + QStringList ls = prepareTextForMenu( type.macro.body(), 20, 100 ); + for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) { + b->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) ); + } + } + + ///Test if it is an include-directive + QString includeFileName, includeFilePath; + bool simpleAlgorithm = false; + bool isIncludeDirective = getIncludeInfo( line, includeFileName, includeFilePath, simpleAlgorithm ); + if( isIncludeDirective ) { + ///Add menu entry + if( !includeFilePath.isEmpty() ) { + int gid; + QPopupMenu * m = PopupTracker::createPopup( popup ); + if ( contextMenuEntriesAtTop ) + gid = popup->insertItem( i18n( "Goto Include File: %1" ).arg( cleanForMenu( includeFileName ) ), m, 5, cpos++ ); + else + gid = popup->insertItem( i18n( "Goto Include File: %1" ).arg( cleanForMenu( includeFileName ) ), m ); + + int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( includeFilePath ) ), this, SLOT( popupAction( int ) ) ); + + DeclarationInfo i; + i.file = includeFilePath; + i.startCol = 0; + i.startLine = 0; + i.endCol = 0; + i.endLine = 0; + m_popupActions.insert( id, i ); + + if( simpleAlgorithm && cppSupport()->codeCompletionConfig()->resolveIncludePaths() ) { + //Add a notification that the correct algorithm failed in finding the include-file correctly + m->insertItem( i18n( "This include-file could not be located regularly, and was selected from the project file list." ) ); + } + } else { + ///Could not find include-file + if ( contextMenuEntriesAtTop ) + popup->insertItem( i18n( "Not Found: \"%1\"" ).arg( includeFileName ), 5, cpos++ ); + else + popup->insertItem( i18n( "Not Found: \"%1\"" ).arg( includeFileName ) ); + } + } + + ///Break if we cannot show additional information + if ( isIncludeDirective || (!type->resolved() && !type.sourceVariable && ( !type.resultType.trace() || type.resultType.trace() ->trace().isEmpty() ) && !BuiltinTypes::isBuiltin( type.resultType ) ) ) + return ; + + QString name = type->fullNameChain(); + if ( type.sourceVariable ) + name += " " + type.sourceVariable.name; + if ( type.resultType->resolved() && type.resultType->resolved() ->asFunction() ) + name = buildSignature( type.resultType->resolved() ); + + ///Fill the jump-menu + { + PopupFillerHelpStruct h( this ); + PopupFiller filler( h, "" ); + + QPopupMenu * m = PopupTracker::createPopup( popup ); + int gid; + if ( contextMenuEntriesAtTop ) + gid = popup->insertItem( i18n( "Navigate by \"%1\"" ).arg( cleanForMenu( name ) ), m, 5, cpos++ ); + else + gid = popup->insertItem( i18n( "Navigate by \"%1\"" ).arg( cleanForMenu( name ) ), m ); + + popup->setWhatsThis( gid, i18n( "Navigation

Provides a menu to navigate to positions of items that are involved in this expression" ) ); + + /*if( type.sourceVariable && type.sourceVariable.name != "this" ) { + int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").arg( type.sourceVariable.name ) , this, SLOT( popupAction( int ) ) ); + + m_popupActions.insert( id, type.sourceVariable ); + }*/ + + filler.fill( m, type, "", type.sourceVariable ); + } + if ( type->resolved() ) { + ///Now fill the class-view-browsing-stuff + { + QPopupMenu * m = PopupTracker::createPopup( popup ); + int gid; + if ( contextMenuEntriesAtTop ) + gid = popup->insertItem( i18n( "Navigate Class-View by \"%1\"" ).arg( cleanForMenu( name ) ), m, 6, cpos++ ); + else + gid = popup->insertItem( i18n( "Navigate Class-View by \"%1\"" ).arg( cleanForMenu( name ) ), m ); + + popup->setWhatsThis( gid, i18n( "Navigation

Provides a menu to show involved items in the class-view " ) ); + + PopupClassViewFillerHelpStruct h( this ); + PopupFiller filler( h, "" ); + + filler.fill( m, type ); + } + } + + if ( contextMenuEntriesAtTop ) + popup->insertSeparator( cpos ); +} + +void CppCodeCompletion::slotTextHint( int line, int column, QString &text ) { + if ( ! m_pSupport->codeCompletionConfig() ->statusBarTypeEvaluation() ) + return ; + + kdDebug( 9007 ) << "CppCodeCompletion::slotTextHint()" << endl; + + clearStatusText(); + + if ( m_lastHintTime.msecsTo( QTime::currentTime() ) < 300 ) { + kdDebug( 9007 ) << "slotNeedTextHint called too often" << endl; + return ; + } + + m_lastHintTime = QTime::currentTime(); + + clearStatusText(); + text = ""; + if ( !m_pSupport || !m_activeEditor ) + return ; + + SimpleTypeConfiguration conf( m_activeFileName ); + + EvaluationResult type = evaluateExpressionAt( line, column, conf ); + + if ( type.expr.expr().stripWhiteSpace().isEmpty() ) + return ; ///Expression could not be found + + if ( type.sourceVariable ) { + text += type.sourceVariable.toText() + "\n"; + } + + if ( type->resolved() ) { + /*SimpleTypeFunctionInterface* f = type->resolved()->asFunction(); + if( f ) { + text += "function: \"" + buildSignature( type->resolved() ) + "\""; + } else { + QValueList trace = type.resultType->trace(); + if( !trace.isEmpty() ) { + for( QValueList::iterator it = trace.begin(); it != trace.end(); ++it ) { + text += (*it).fullNameChain() + " --> "; + } + text += "\n"; + } + text += "type: \"" + type.resultType->fullTypeResolved() + "\""; + } + if( type.resultType->parent()) text += "\nnested in: \"" + type.resultType->parent()->fullTypeResolvedWithScope() + "\""; + DeclarationInfo i = type.resultType->getDeclarationInfo(); + if( i ) text += "\n" + i.locationToText(); + + if( !type.resultType->comment().isEmpty() ) text += "\n\n" + type.resultType->comment() + "";*/ + + } else {} + + kdDebug( 9007 ) << "showing: \n" << text << endl; + const int timeout = 2000; + + if ( type->resolved() ) { + addStatusText( i18n( "Type of \"%1\" is \"%2\"" ).arg( type.expr.expr() ).arg( type->fullNameChain() ), timeout ); + if ( type.sourceVariable && !type.sourceVariable.comment.isEmpty() ) { + addStatusText( i18n( "Comment on variable \"%1\": \"%2\"" ).arg( type.sourceVariable.name ).arg( type.sourceVariable.comment ) , 10000 ); + } + if ( !type->resolved() ->comment().isEmpty() ) { + addStatusText( i18n( "Comment on \"%1\": \"%2\"" ).arg( type->name() ).arg( type->resolved() ->comment() ) , 10000 ); + } + if ( type->resolved() ->comment().isEmpty() ) { + addStatusText( i18n( "\"%1\" has no comment" ).arg( type->name() ) , timeout ); + } + } else { + if ( type ) { + if( !BuiltinTypes::isBuiltin( type.resultType ) ) { + addStatusText( i18n( "Type of \"%1\" is unresolved, name: \"%2\"" ).arg( type.expr.expr() ).arg( type->fullNameChain() ), 2 * timeout ); + } else { + addStatusText( i18n( "\"%1\" is of builtin type \"%2\", a %3" ).arg( type.expr.expr() ).arg( type->fullNameChain() ).arg(BuiltinTypes::comment( type.resultType )), 2 * timeout ); + } + + + } else { + addStatusText( i18n( "Type of \"%1\" could not be evaluated: tried to evaluate expression as \"%2\"" ).arg( type.expr.expr() ).arg( type.expr.typeAsString() ), 2 * timeout ); + } + } + + text = ""; ///Don't really use tooltips since those are not implemented in katepart, and don't work right in the qt-designer based part +} + +///not good.. +bool CppCodeCompletion::isTypeExpression( const QString& expr ) { + TypeDesc d( expr ); + if ( !d.isValidType() ) + return false; + + QString ex = d.fullNameChain(); + QStringList lex = QStringList::split( " ", ex ); + QStringList lexpr = QStringList::split( " ", expr ); + return lex.join( " " ) == lexpr.join( " " ); +} + +bool CppCodeCompletion::mayBeTypeTail( int line, int column, QString& append, bool inFunction ) { + QString tail = clearComments( m_activeEditor->text( line, column + 1, line + 10 > ( int ) m_activeEditor->numLines() ? ( int ) m_activeEditor->numLines() : line + 10, 0 ) ); + tail.replace( "\n", " " ); + SafetyCounter s ( 100 ); + bool hadSpace = false; + while ( !tail.isEmpty() && s ) { + if ( tail[ 0 ] == ';' ) { + return false; + } else if ( ( !inFunction && tail[ 0 ] == ',' ) || tail[ 0 ] == '&' || tail[ 0 ] == '*' || tail[ 0 ] == '{' || tail[ 0 ] == ':' ) { + return true; + } else if ( isTypeOpenParen( tail[ 0 ] ) ) { + ///TODO: use findClose to make the whole expression include template-params + int to = findClose( tail, 0 ); + if ( to != -1 ) { + append = tail.left( to + 1 ); + tail = tail.mid( to + 1 ); + } else { + return false; + } + } else if ( isTypeCloseParen( tail[ 0 ] ) ) { + return true; + } else if ( tail[ 0 ].isSpace() ) { + tail = tail.mid( 1 ); + hadSpace = true; + } else if ( tail[ 0 ].isLetter() ) { + return hadSpace; + } else { + break; + } + } + + return false; +} + +bool CppCodeCompletion::canBeTypePrefix( const QString& prefix, bool inFunction ) { + + for ( int p = prefix.length() - 1 ; p >= 0; --p ) { + if ( prefix[ p ].isSpace() ) { + continue; + } + + if ( prefix[ p ] == ';' || prefix[ p ] == '<' || prefix[ p ] == ':' || ( !inFunction && ( prefix[ p ] == '(' || prefix[ p ] == ',' ) ) || prefix[ p ] == '}' || prefix[ p ] == '{' ) { + return true; + } + + ///@todo: make this a simple regex + if ( prefix[ p ].isLetterOrNumber() && ( tokenAt( prefix, "class", p ) || tokenAt( prefix, "struct", p ) || tokenAt( prefix, "const", p ) || tokenAt( prefix, "typedef", p ) || tokenAt( prefix, "public", p ) || tokenAt( prefix, "protected", p ) || tokenAt( prefix, "private", p ) || tokenAt( prefix, "virtual", p ) || tokenAt( prefix, "static", p ) || tokenAt( prefix, "virtual", p ) ) ) + return true; + else { + return false; + } + } + + return true; +} + +///This function is just a litte hack und should be remade, it doesn't work for all cases +ExpressionInfo CppCodeCompletion::findExpressionAt( int line, int column, int startLine, int startCol, bool inFunction ) { + ExpressionInfo ret; + + QString contents = clearComments( getText( startLine, startCol, line, column ) ); + + + int start_expr = expressionAt( contents, contents.length() ); + + if ( start_expr != int( contents.length() ) ) { + QString str = contents.mid( start_expr, contents.length() - start_expr ).stripWhiteSpace(); + if ( str.startsWith( "new " ) ) { + str = str.mid( 4 ).stripWhiteSpace(); + } + ret.setExpr( str ); + if ( !ret.expr().isEmpty() ) + ret.t = ExpressionInfo::NormalExpression; + } + + if ( ret ) { + ///Check whether it may be a type-expression + bool mayBeType = true; + QString append; + if ( !mayBeTypeTail( line, column - 1, append, inFunction ) ) + mayBeType = false; + if ( mayBeType ) { + if ( !canBeTypePrefix( contents.left( start_expr ), inFunction ) ) + mayBeType = false; + } + + //make this a regexp + QString e = ret.expr(); + if ( e.contains( "." ) || e.contains( "->" ) || e.contains( "(" ) || e.contains( ")" ) || e.contains( "=" ) || e.contains( "-" ) ) + mayBeType = false; + + if ( mayBeType ) { + ret.setExpr( ret.expr() + append ); + ret.t = ExpressionInfo::TypeExpression; + } + } + + return ret; +} + +void macrosToDriver( Driver& d, FileDom file ) { + return; //Deactivate this for now, because macros can cause inconsistency of line/column-numbers between processed text and the not-processed text of the buffer + ParseResultPointer p; + if( file ) + p = file->parseResult(); + ParsedFile* pf = dynamic_cast( p.data() ); + if( pf ) { + d.insertMacros( pf->usedMacros() ); ///Add macros + } +} + +SimpleContext* CppCodeCompletion::computeFunctionContext( FunctionDom f, int line, int col, SimpleTypeConfiguration& conf ) { + Q_UNUSED(conf); + if ( !f ) + return 0; + int modelStartLine, modelStartColumn; + int modelEndLine, modelEndColumn; + + f->getStartPosition( &modelStartLine, &modelStartColumn ); + f->getEndPosition( &modelEndLine, &modelEndColumn ); + + QString textLine = m_activeEditor->textLine( modelStartLine ); + kdDebug( 9007 ) << "startLine = " << textLine << endl; + + QString contents = getText( modelStartLine, modelStartColumn, line, col ); + + Driver d; + Lexer lexer( &d ); + macrosToDriver( d, f->file() ); + + lexer.setSource( contents ); + Parser parser( &d, &lexer ); + + DeclarationAST::Node recoveredDecl; + RecoveryPoint* recoveryPoint = this->d->findRecoveryPoint( line, col );///@todo recovery-points are not needed anymore + + parser.parseDeclaration( recoveredDecl ); + if ( recoveredDecl.get() ) { + bool isFunDef = recoveredDecl->nodeType() == NodeType_FunctionDefinition; + kdDebug( 9007 ) << "is function definition= " << isFunDef << endl; + + int startLine, startColumn; + int endLine, endColumn; + recoveredDecl->getStartPosition( &startLine, &startColumn ); + recoveredDecl->getEndPosition( &endLine, &endColumn ); + /*if( startLine != modelStartLine || endLine != modelEndLine || startColumn != modelStartColumn || endColumn != modelEndColumn ) { + kdDebug( 9007 ) << "code-model and real file are out of sync \nfunction-bounds in code-model: " << endl; + kdDebug( 9007 ) << "(l " << modelStartLine << ", c " << modelStartColumn << ") - (l " << modelEndLine << ", c " << modelEndColumn << ") " << "parsed function-bounds: " << endl; + kdDebug( 9007 ) << "(l " << startLine << ", c " << startColumn << ") - (l " << endLine << ", c " << endColumn << ") " << endl; + }*/ + + if ( isFunDef ) { + FunctionDefinitionAST * def = static_cast( recoveredDecl.get() ); + + SimpleContext* ctx = computeContext( def, endLine, endColumn, modelStartLine, modelStartColumn ); + if ( !ctx ) + return 0; + + QStringList scope = f->scope(); + + + if ( !scope.isEmpty() ) { + SimpleType parentType; + /* if( !m_cachedFromContext ) { + TypePointer t = SimpleType(QStringList())->locateDecType( scope.join("") ).desc().resolved();; + if( t ) + parentType = SimpleType( t.data() ); + else + parentType = SimpleType( scope ); + } else {*/ + parentType = SimpleType( scope, getIncludeFiles() ); + //} + parentType->descForEdit().setTotalPointerDepth( 1 ); + ctx->setContainer( parentType ); + } + + SimpleType global = ctx->global(); + + if( dynamic_cast( &(*global) ) ) { + SimpleTypeNamespace* globalNs = static_cast ( &(*global) ); + QValueList > localImports = ctx->imports(); + for( QValueList >::const_iterator it = localImports.begin(); it != localImports.end(); ++it ) + globalNs->addAliasMap( (*it).first, (*it).second ); + } + + /* //Should not be necessary any more + if( !getParsedFile( f->file().data() ) || getParsedFile( f->file().data() )->includeFiles().size() <= 1 ) { + if ( !m_cachedFromContext ) { + conf.setGlobalNamespace( &( *global ) ); + if ( recoveryPoint ) { + recoveryPoint->registerImports( global, m_pSupport->codeCompletionConfig() ->namespaceAliases() ); + } else { + kdDebug( 9007 ) << "no recovery-point, cannot use imports" << endl; + } + } + }*/ + + ///Insert the "this"-type(container) and correctly resolve it using imported namespaces + if ( ctx->container() ) { + if ( !m_cachedFromContext ) { + TypeDesc td = ctx->container() ->desc(); + td.setIncludeFiles( getIncludeFiles() ); + td.makePrivate(); + + td.resetResolved( ); + TypePointer tt = ctx->container() ->locateDecType( td, SimpleTypeImpl::LocateBase ) ->resolved(); + if ( tt ) { + ctx->setContainer( SimpleType( tt ) ); + } else { + kdDebug( 9007 ) << "could not resolve local this-type \"" << td.fullNameChain() << "\"" << endl; + } + } + + SimpleType this_type = ctx->container(); + + this_type->descForEdit().setTotalPointerDepth( 1 ); + + SimpleVariable var; + var.type = this_type->desc(); + var.name = "this"; + var.comment = this_type->comment(); + ctx->add + ( var ); + ctx->setContainer( this_type ); + } + + return ctx; + } else { + kdDebug( 9007 ) << "computeFunctionContext: context is no function-definition" << endl; + } + } else { + kdDebug( 9007 ) << "computeFunctionContext: could not find a valid declaration to recover" << endl; + } + return 0; +} + +bool CppCodeCompletion::functionContains( FunctionDom f , int line, int col ) { + if ( !f ) + return false; + int sl, sc, el, ec; + f->getStartPosition( &sl, &sc ); + f->getEndPosition( &el, &ec ); + QString t = clearComments( getText( sl, sc, el, ec ) ); + if ( t.isEmpty() ) + return false; + + //int i = t.find( '{' ); + int i = t.find( '(' ); //This now includes the argument-list + if ( i == -1 ) + return false; + int lineCols = 0; + for ( int a = 0; a < i; a++ ) { + if ( t[ a ] == '\n' ) { + sl++; + lineCols = 0; + } else { + lineCols++; + } + } + + sc += lineCols; + + return ( line > sl || ( line == sl && col >= sc ) ) && ( line < el || ( line == el && col < ec ) ); +} + +void CppCodeCompletion::getFunctionBody( FunctionDom f , int& line, int& col ) { + if ( !f ) + return; + int sl, sc, el, ec; + f->getStartPosition( &sl, &sc ); + f->getEndPosition( &el, &ec ); + QString t = clearComments( getText( sl, sc, el, ec ) ); + if ( t.isEmpty() ) + return; + + int i = t.find( '{' ); + if ( i == -1 ) + return; + i++; + if( (uint)i >= t.length() ) + return; + int lineCols = 0; + for ( int a = 0; a < i; a++ ) { + if ( t[ a ] == '\n' ) { + sl++; + lineCols = 0; + } else { + lineCols++; + } + } + + sc += lineCols; + + line = sl; + col = sc; +} + +void CppCodeCompletion::emptyCache() { + m_cachedFromContext = 0; + SimpleTypeConfiguration c; ///Will automatically destroy the type-store when the function is closed + kdDebug( 9007 ) << "completion-cache emptied" << endl; +} + +void CppCodeCompletion::needRecoveryPoints() { + + if ( this->d->recoveryPoints.isEmpty() ) { + kdDebug( 9007 ) << "missing recovery-points for file " << m_activeFileName << " they have to be computed now" << endl; + m_pSupport->backgroundParser() ->lock () + ; + + std::vector vec; + + TranslationUnitAST * ast = *m_pSupport->backgroundParser() ->translationUnit( m_activeFileName ); + m_pSupport->backgroundParser() ->unlock(); + if ( !ast ) { + kdDebug( 9007 ) << "background-parser is missing the translation-unit. The file needs to be reparsed." << endl; + m_pSupport->parseFileAndDependencies( m_activeFileName, true ); +// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Background-parser is missing the necessary translation-unit. It will be computed, but this completion will fail." ).arg( m_activeFileName ), 2000 ); + return; + } else { + computeRecoveryPointsLocked(); + } + if ( this->d->recoveryPoints.isEmpty() ) { + kdDebug( 9007 ) << "Failed to compute recovery-points for " << m_activeFileName << endl; +// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Failed to compute recovery-points for %1" ).arg( m_activeFileName ), 1000 ); + } else { + kdDebug( 9007 ) << "successfully computed recovery-points for " << m_activeFileName << endl; + } + } +} + +EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column, SimpleTypeConfiguration& conf, EvaluateExpressionOptions opt ) { + EvaluationResult ret; + safetyCounter.init(); + + FileDom file = m_pSupport->codeModel() ->fileByName( m_activeFileName ); + + if ( !file ) { +// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "File %1 does not exist in the code-model" ).arg( m_activeFileName ), 1000 ); + kdDebug( 9007 ) << "Error: file " << m_activeFileName << " could not be located in the code-model, code-completion stopped\n"; + return SimpleType(); + } + + needRecoveryPoints(); + + CodeModelUtils::CodeModelHelper fileModel( m_pSupport->codeModel(), file ); + ItemDom contextItem; + + int nLine = line, nCol = column; + + // emptyCache(); + fitContextItem( line, column ); + + QString strCurLine = m_activeEditor->textLine( nLine ); + + QString ch = strCurLine.mid( nCol - 1, 1 ); + QString ch2 = strCurLine.mid( nCol - 2, 2 ); + + while ( ch[ 0 ].isSpace() && nCol >= 3 ) { + nCol -= 1; + ch = strCurLine.mid( nCol - 1, 1 ); + ch2 = strCurLine.mid( nCol - 2, 2 ); + } + + if ( ch2 == "->" || ch == "." || ch == "(" ) { + int pos = ch2 == "->" ? nCol - 3 : nCol - 2; + QChar c = strCurLine[ pos ]; + while ( pos > 0 && c.isSpace() ) + c = strCurLine[ --pos ]; + + if ( !( c.isLetterOrNumber() || c == '_' || c == ')' || c == ']' || c == '>' ) ) { + conf.invalidate(); + return SimpleType(); + } + } + bool showArguments = false; + + if ( ch == "(" ) { + --nCol; + while ( nCol > 0 && strCurLine[ nCol ].isSpace() ) + --nCol; + showArguments = true; + } + + QString word; + + { + ExpressionInfo exp_ = findExpressionAt( line, column , line, 0 ); + + if( file->parseResult() ) { + ParsedFilePointer p = dynamic_cast( file->parseResult().data()); + if( p ) { + if( p->usedMacros().hasMacro( exp_.expr() ) ) { + //It is a macro, return it + ret.expr = exp_.expr(); + ret.isMacro = true; + ret.macro = p->usedMacros().macro( exp_.expr() ); + return ret; + } + } + } + } + + if ( !m_cachedFromContext ) + conf.setGlobalNamespace( createGlobalNamespace() ); + + ItemLocker block( *m_pSupport->backgroundParser() ); + + FunctionDom currentFunction = fileModel.functionAt( line, column ); + + bool functionFailed = true; + + if ( opt & SearchInFunctions ) { + //currentFunction = fileModel.functionAt( line, column ); + + if ( currentFunction && functionContains( currentFunction, line, column ) ) { + ///Evaluate the context of the function-body if we're in the argument-list + int realLine = line, realColumn = column; + getFunctionBody( currentFunction, realLine, realColumn ); + if( realLine < line || ( realLine == line && realColumn < column ) ) { + realLine = line; + realColumn = column; + } + + SimpleContext * ctx = computeFunctionContext( currentFunction, realLine, realColumn, conf ); + contextItem = currentFunction.data(); + + if ( ctx ) { + opt = remFlag( opt, SearchInClasses ); + int startLine, endLine; + currentFunction->getStartPosition( &startLine, &endLine ); + ExpressionInfo exp = findExpressionAt( line, column , startLine, endLine, true ); + if ( ( opt & DefaultAsTypeExpression ) && ( !exp.canBeNormalExpression() && !exp.canBeTypeExpression() ) && !exp.expr().isEmpty() ) + exp.t = ExpressionInfo::TypeExpression; + + if ( exp.canBeTypeExpression() ) { + { + if ( ! ( opt & IncludeTypeExpression ) ) { + kdDebug( 9007 ) << "recognized a type-expression, but another expression-type is desired" << endl; + } else { + TypeDesc d( exp.expr() ); + d.setIncludeFiles( getIncludeFiles() ); + ret.resultType = ctx->container() ->locateDecType( d ); + ret.expr = exp; + } + } + } + if ( /*exp.canBeNormalExpression() &&*/ !ret.resultType->resolved() ) { ///It is not cleary possible to recognize the kind of an expression from the syntax as long as it's not written completely + { + if ( ! ( opt & IncludeStandardExpressions ) ) { + kdDebug( 9007 ) << "recognized a standard-expression, but another expression-type is desired" << endl; + } else { + ///Remove the not completely typed last word while normal completion + if ( !showArguments && ( opt & CompletionOption ) ) { + QString e = exp.expr(); + int idx = e.length() - 1; + while ( e[ idx ].isLetterOrNumber() || e[ idx ] == '_' ) + --idx; + + if ( idx != int( e.length() ) - 1 ) { + ++idx; + word = e.mid( idx ).stripWhiteSpace(); + exp.setExpr( e.left( idx ).stripWhiteSpace() ); + } + } + + functionFailed = false; + ret = evaluateExpression( exp, ctx ); + } + } + } + } else { + kdDebug( 9007 ) << "could not compute context" << endl; + } + if ( ctx ) + delete ctx; + } else { + kdDebug( 9007 ) << "could not find context-function in code-model" << endl; + } + } + + if ( ( opt & SearchInClasses ) && !ret->resolved() && functionFailed ) { + ClassDom currentClass = fileModel.classAt( line, column ); + int startLine = 0, startCol = 0; + + RecoveryPoint* recoveryPoint = this->d->findRecoveryPoint( line, column ); + + QStringList scope; + + if ( !currentClass ) { + kdDebug( 9007 ) << "no container-class found" << endl; + if ( !recoveryPoint ) { + kdDebug( 9007 ) << "no recovery-point found" << endl; + } else { + startLine = recoveryPoint->startLine; + startCol = recoveryPoint->startColumn; + scope = recoveryPoint->scope; + } + } else { + contextItem = currentClass.data(); + scope = currentClass->scope(); + scope << currentClass->name(); + currentClass->getStartPosition( &startLine, &startCol ); + } + + SimpleType container; + if ( m_cachedFromContext ) { + TypeDesc d( scope.join( "::" ) ); + d.setIncludeFiles( getIncludeFiles() ); + SimpleTypeImpl * i = SimpleType( QStringList(), getIncludeFiles() ) ->locateDecType( d ).desc().resolved().data(); + if ( i ) + container = i; + else + container = SimpleType( scope, getIncludeFiles() ); + } else { + container = SimpleType( scope, getIncludeFiles() ); + } + + ExpressionInfo exp = findExpressionAt( line, column , startLine, startCol ); + exp.t = ExpressionInfo::TypeExpression; ///Outside of functions, we can only handle type-expressions + ret.expr = exp; + + if ( exp && ( exp.t & ExpressionInfo::TypeExpression ) ) { + kdDebug( 9007 ) << "locating \"" << exp.expr() << "\" in " << container->fullTypeResolvedWithScope() << endl; + TypeDesc d( exp.expr() ); + d.setIncludeFiles( getIncludeFiles() ); + ret.resultType = container->locateDecType( d ); + } else { + if ( exp ) { + kdDebug( 9007 ) << "wrong expression-type recognized" << endl; + } else { + kdDebug( 9007 ) << "expression could not be recognized" << endl; + } + } + } + + CppCodeCompletionConfig * cfg = m_pSupport->codeCompletionConfig(); + if( cfg->usePermanentCaching() && contextItem ) { + conf.invalidate(); + m_cachedFromContext = contextItem; + } + + return ret; +} + +bool isAfterKeyword( const QString& str, int column ) { + QStringList keywords; + keywords << "new"; + keywords << "throw"; + keywords << "return"; + keywords << "emit"; ///This could be done even better by only showing signals for completion.. + for ( QStringList::iterator it = keywords.begin(); it != keywords.end(); ++it ) { + int len = ( *it ).length(); + if ( column >= len && str.mid( column - len, len ) == *it ) + return true; + } + return false; +} + +void CppCodeCompletion::setMaxComments( int count ) { + m_maxComments = count; +} + +///TODO: make this use findExpressionAt etc. (like the other expression-evaluation-stuff) +void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) { + kdDebug( 9007 ) << "CppCodeCompletion::completeText()" << endl; + clearStatusText(); + + if ( !m_pSupport || !m_activeCursor || !m_activeEditor || !m_activeCompletion ) + return ; + + setMaxComments( 1000 ); + + needRecoveryPoints(); + + CppCodeCompletionConfig * cfg = m_pSupport->codeCompletionConfig(); + m_demandCompletion = invokedOnDemand; + + FileDom file = m_pSupport->codeModel() ->fileByName( m_activeFileName ); + + if ( !file ) { +// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "File %1 does not exist in the code-model" ).arg( m_activeFileName ), 1000 ); + kdDebug( 9007 ) << "Error: file " << m_activeFileName << " could not be located in the code-model, code-completion stopped\n"; + return ; + } + + CodeModelUtils::CodeModelHelper fileModel( m_pSupport->codeModel(), file ); + + ItemDom contextItem; + + unsigned int line, column; + m_activeCursor->cursorPositionReal( &line, &column ); + + fitContextItem( line, column ); + + ///Check whether the cursor is within a comment + int surroundingStartLine = line - 10, surroundingEndLine = line + 10; + if ( surroundingStartLine < 0 ) + surroundingStartLine = 0; + if ( surroundingEndLine > m_activeEditor->numLines() - 1 ) + surroundingEndLine = m_activeEditor->numLines() - 1; + int surroundingEndCol = m_activeEditor->lineLength( surroundingEndLine ); + + QString pre = getText( surroundingStartLine, 0, line, column ); + int pos = pre.length(); + pre += getText( line, column, surroundingEndLine, surroundingEndCol ); + QString cleared = clearComments( pre ); + if ( cleared[ pos ] != pre[ pos ] ) { + kdDebug( 9007 ) << "stopping completion because we're in a coment" << endl; + return ; + } + + int nLine = line, nCol = column; + + QString strCurLine = clearComments( m_activeEditor->textLine( nLine ) ); + + QString ch = strCurLine.mid( nCol - 1, 1 ); + QString ch2 = strCurLine.mid( nCol - 2, 2 ); + + while ( ch[ 0 ].isSpace() && nCol >= 3 ) { + nCol -= 1; + ch = strCurLine.mid( nCol - 1, 1 ); + ch2 = strCurLine.mid( nCol - 2, 2 ); + } + + if ( m_includeRx.search( strCurLine ) != -1 ) { + if ( !m_fileEntryList.isEmpty() ) { + m_bCompletionBoxShow = true; + m_activeCompletion->showCompletionBox( m_fileEntryList, column - m_includeRx.matchedLength() ); + } + return ; + } + + bool showArguments = false; + bool isInstance = true; + m_completionMode = NormalCompletion; + + if ( ch2 == "->" || ch == "." || ch == "(" ) { + int pos = ch2 == "->" ? nCol - 3 : nCol - 2; + QChar c = strCurLine[ pos ]; + while ( pos > 0 && c.isSpace() ) + c = strCurLine[ --pos ]; + + if ( !( c.isLetterOrNumber() || c == '_' || c == ')' || c == ']' || c == '>' ) ) + return ; + } + + if ( ch == "(" ) { + --nCol; + while ( nCol > 0 && strCurLine[ nCol - 1 ].isSpace() ) + --nCol; + + ///check whether it is a value-definition using constructor + int column = nCol; + bool s1 = false, s2 = false; + while ( column > 0 && isValidIdentifierSign( strCurLine[ column - 1 ] ) ) { + column--; + s1 = true; + } + + ///skip white space + while ( column > 0 && strCurLine[ column - 1 ].isSpace() ) { + --column; + s2 = true; + } + + if ( s1 && s2 && isValidIdentifierSign( strCurLine[ column - 1 ] ) ) { + if ( isAfterKeyword( strCurLine, column ) ) { + ///Maybe a constructor using "new", or "throw", "return", ... + } else { + ///it is a local constructor like "QString name("David");" + nCol = column; + } + } + + + + showArguments = TRUE; + } + + EvaluationResult type; + SimpleType this_type; + QString expr, word; + + DeclarationAST::Node recoveredDecl; + TypeSpecifierAST::Node recoveredTypeSpec; + + SimpleContext* ctx = 0; + SimpleTypeConfiguration conf( m_activeFileName ); + + if ( !m_cachedFromContext ) + conf.setGlobalNamespace( createGlobalNamespace() ); + + ItemLocker block( *m_pSupport->backgroundParser() ); + + FunctionDom currentFunction = fileModel.functionAt( line, column ); + + RecoveryPoint * recoveryPoint = d->findRecoveryPoint( line, column ); + if ( recoveryPoint || currentFunction ) { + contextItem = currentFunction.data(); + QStringList scope; + + int startLine, startColumn; + if ( currentFunction ) { ///maybe change the priority of these + kdDebug( 9007 ) << "using code-model for completion" << endl; + currentFunction->getStartPosition( &startLine, &startColumn ); + scope = currentFunction->scope(); + } else { + kdDebug( 9007 ) << "recovery-point, node-kind = " << nodeTypeToString( recoveryPoint->kind ) << endl; + startLine = recoveryPoint->startLine; + startColumn = recoveryPoint->startColumn; + scope = recoveryPoint->scope; + } + + QString textLine = m_activeEditor->textLine( startLine ); + kdDebug( 9007 ) << "startLine = " << textLine << endl; + + if ( currentFunction || recoveryPoint->kind == NodeType_FunctionDefinition ) { + + QString textToReparse = clearComments( getText( startLine, startColumn, line, showArguments ? nCol : column ) ); + + kdDebug( 9007 ) << "-------------> reparse text" << endl << textToReparse << endl + << "--------------------------------------------" << endl; + + Driver d; + Lexer lexer( &d ); + + macrosToDriver( d, file ); + + lexer.setSource( textToReparse ); + Parser parser( &d, &lexer ); + + parser.parseDeclaration( recoveredDecl ); + /* kdDebug(9007) << "recoveredDecl = " << recoveredDecl.get() << endl;*/ + if ( recoveredDecl.get() ) { + + bool isFunDef = recoveredDecl->nodeType() == NodeType_FunctionDefinition; + kdDebug( 9007 ) << "is function definition= " << isFunDef << endl; + + int endLine, endColumn; + recoveredDecl->getEndPosition( &endLine, &endColumn ); + kdDebug( 9007 ) << "endLine = " << endLine << ", endColumn " << endColumn << endl; + + /// @todo check end position + + if ( isFunDef ) { + FunctionDefinitionAST * def = static_cast( recoveredDecl.get() ); + + /// @todo remove code duplication + + QString contents = textToReparse; + int start_expr = expressionAt( contents, contents.length() ); + + // kdDebug(9007) << "start_expr = " << start_expr << endl; + if ( start_expr != int( contents.length() ) ) + expr = contents.mid( start_expr, contents.length() - start_expr ).stripWhiteSpace(); + + if ( expr.startsWith( "SIGNAL" ) || expr.startsWith( "SLOT" ) ) { + m_completionMode = expr.startsWith( "SIGNAL" ) ? SignalCompletion : SlotCompletion; + + showArguments = false; + int end_expr = start_expr - 1; + while ( end_expr > 0 && contents[ end_expr ].isSpace() ) + --end_expr; + + if ( contents[ end_expr ] != ',' ) { + expr = QString::null; + } else { + start_expr = expressionAt( contents, end_expr ); + expr = contents.mid( start_expr, end_expr - start_expr ).stripWhiteSpace(); + } + } else { + if ( !showArguments ) { + int idx = expr.length() - 1; + while ( expr[ idx ].isLetterOrNumber() || expr[ idx ] == '_' ) + --idx; + + if ( idx != int( expr.length() ) - 1 ) { + ++idx; + word = expr.mid( idx ).stripWhiteSpace(); + expr = expr.left( idx ).stripWhiteSpace(); + } + } + } + + ctx = computeContext( def, endLine, endColumn, startLine, startColumn ); + DeclaratorAST* d = def->initDeclarator() ->declarator(); + NameAST* name = d->declaratorId(); + + QStringList nested; + + QPtrList l; + if ( name ) { + l = name->classOrNamespaceNameList(); + } + // QPtrList l = name->classOrNamespaceNameList(); + QPtrListIterator nameIt( l ); + while ( nameIt.current() ) { + if ( nameIt.current() ->name() ) { + nested << nameIt.current() ->name() ->text(); + } + ++nameIt; + } + + if ( currentFunction ) { + scope = currentFunction->scope(); + if ( !scope.isEmpty() ) { + //scope.pop_back(); + } else { + kdDebug( 9007 ) << "scope is empty" << endl; + } + if( dynamic_cast( SimpleType::globalNamespace().data() ) ) { + SimpleTypeNamespace* globalNs = static_cast ( SimpleType::globalNamespace().data() ); + QValueList > localImports = ctx->imports(); + for( QValueList >::const_iterator it = localImports.begin(); it != localImports.end(); ++it ) + globalNs->addAliasMap( (*it).first, (*it).second ); + } + } else { + scope += nested; + } + + if ( !scope.isEmpty() ) { + SimpleType parentType; + + /*if( !m_cachedFromContext ) { + TypePointer t = createGlobalNamespace(); + conf.setGlobalNamespace( t ); + SimpleTypeNamespace * n = dynamic_cast( t.data() ); + if ( !n ) { + QString str = QString( "the global namespace was not resolved correctly , real type: " ) + typeid( n ).name() + QString( " name: " ) + n->scope().join( "::" ) + " scope-size: " + n->scope().count(); + kdDebug( 9007 ) << str << endl; + m_pSupport->mainWindow() ->statusBar() ->message( str , 1000 ); + } else { + } + this_type = SimpleType(t); + }*/ + + if ( m_cachedFromContext ) { + TypeDesc d( scope.join( "::" ) ); + d.setIncludeFiles( getIncludeFiles() ); + SimpleTypeImpl * i = SimpleType( QStringList(), getIncludeFiles() ) ->locateDecType( d ).desc().resolved().data(); + if ( i ) { + parentType = i; + } else { + parentType = SimpleType( scope, getIncludeFiles() ); + } + } else { + parentType = SimpleType( scope, getIncludeFiles() ); + } + this_type = parentType; + this_type->descForEdit().setTotalPointerDepth( 1 ); + ctx->setContainer( this_type ); + } + + ///Now locate the local type using the imported namespaces + if ( !scope.isEmpty() ) { + if ( !m_cachedFromContext ) { + TypeDesc td = ctx->container() ->desc(); + td.makePrivate(); + td.resetResolved( ); + td.setIncludeFiles( getIncludeFiles() ); + TypePointer tt = ctx->container() ->locateDecType( td, SimpleTypeImpl::LocateBase ) ->resolved(); + if ( tt ) { + ctx->setContainer( SimpleType( tt ) ); + } else { + kdDebug( 9007 ) << "could not resolve local this-type \"" << td.fullNameChain() << "\"" << endl; + } + } + + SimpleType this_type = ctx->container(); + + this_type->descForEdit().setTotalPointerDepth( 1 ); + + SimpleVariable var; + var.type = this_type->desc(); + var.name = "this"; + var.comment = this_type->comment(); + ctx->add + ( var ); + ctx->setContainer( this_type ); + } + + ExpressionInfo exp( expr ); + exp.t = ( ExpressionInfo::Type ) ( ExpressionInfo::NormalExpression | ExpressionInfo::TypeExpression ); + type = evaluateExpression( exp, ctx ); + } + + } else { + kdDebug( 9007 ) << "no valid declaration to recover!!!" << endl; + } + } else if ( recoveryPoint->kind == NodeType_ClassSpecifier ) { + QString textToReparse = getText( recoveryPoint->startLine, recoveryPoint->startColumn, + recoveryPoint->endLine, recoveryPoint->endColumn, line ); + // kdDebug(9007) << "-------------> please reparse only text" << endl << textToReparse << endl + // << "--------------------------------------------" << endl; + + Driver d; + Lexer lexer( &d ); + macrosToDriver( d, file ); + + lexer.setSource( textToReparse ); + Parser parser( &d, &lexer ); + + parser.parseClassSpecifier( recoveredTypeSpec ); + /* kdDebug(9007) << "recoveredDecl = " << recoveredTypeSpec.get() << endl;*/ + if ( recoveredTypeSpec.get() ) { + + //ClassSpecifierAST * clazz = static_cast( recoveredTypeSpec.get() ); + + QString keyword = getText( line, 0, line, column ).simplifyWhiteSpace(); + + kdDebug( 9007 ) << "===========================> keyword is: " << keyword << endl; + + if ( keyword == "virtual" ) { /* + BaseClauseAST *baseClause = clazz->baseClause(); + if ( baseClause ) + { + QPtrList baseList = baseClause->baseSpecifierList(); + QPtrList::iterator it = baseList.begin(); + + for ( ; it != baseList.end(); ++it ) + type.append( ( *it )->name()->text() ); + + ctx = new SimpleContext(); + + showArguments = false; + m_completionMode = VirtualDeclCompletion; + + kdDebug(9007) << "------> found virtual keyword for class specifier '" + << clazz->text() << "'" << endl; + }*/ + } else if ( QString( "virtual" ).find( keyword ) != -1 ) + m_blockForKeyword = true; + else + m_blockForKeyword = false; + } + } + } + + ///@todo is all this necessary? + if ( !recoveredDecl.get() && !recoveredTypeSpec.get() ) { + TranslationUnitAST * ast = *m_pSupport->backgroundParser() ->translationUnit( m_activeFileName ); + if ( AST * node = findNodeAt( ast, line, column ) ) { + kdDebug( 9007 ) << "------------------- AST FOUND --------------------" << endl; + kdDebug( 9007 ) << "node-kind = " << nodeTypeToString( node->nodeType() ) << endl; + + if ( FunctionDefinitionAST * def = functionDefinition( node ) ) { + kdDebug( 9007 ) << "------> found a function definition" << endl; + + int startLine, startColumn; + def->getStartPosition( &startLine, &startColumn ); + + QString contents = getText( startLine, startColumn, line, showArguments ? nCol : column ); + + + /// @todo remove code duplication + int start_expr = expressionAt( contents, contents.length() ); + + // kdDebug(9007) << "start_expr = " << start_expr << endl; + if ( start_expr != int( contents.length() ) ) + expr = contents.mid( start_expr, contents.length() - start_expr ).stripWhiteSpace(); + + if ( expr.startsWith( "SIGNAL" ) || expr.startsWith( "SLOT" ) ) { + m_completionMode = expr.startsWith( "SIGNAL" ) ? SignalCompletion : SlotCompletion; + + showArguments = false; + int end_expr = start_expr - 1; + while ( end_expr > 0 && contents[ end_expr ].isSpace() ) + --end_expr; + + if ( contents[ end_expr ] != ',' ) { + expr = QString::null; + } else { + start_expr = expressionAt( contents, end_expr ); + expr = contents.mid( start_expr, end_expr - start_expr ).stripWhiteSpace(); + } + } else { + int idx = expr.length() - 1; + while ( expr[ idx ].isLetterOrNumber() || expr[ idx ] == '_' ) + --idx; + + if ( idx != int( expr.length() ) - 1 ) { + ++idx; + word = expr.mid( idx ).stripWhiteSpace(); + expr = expr.left( idx ).stripWhiteSpace(); + } + } + + ctx = computeContext( def, line, column, startLine, startColumn ); + + QStringList scope; + scopeOfNode( def, scope ); + this_type = SimpleType( scope, getIncludeFiles() ); + + if ( scope.size() ) { /* + SimpleVariable var; + var.type = scope; + var.name = "this"; + ctx->add( var );*/ + //kdDebug(9007) << "add variable " << var.name << " with type " << var.type << endl; + } + + ExpressionInfo exp( expr ); + exp.t = ( ExpressionInfo::Type ) ( ExpressionInfo::NormalExpression | ExpressionInfo::TypeExpression ); + type = evaluateExpression( exp, ctx ); + } + } + } + + if ( !ctx ) + return ; + + if ( ch2 == "::" ) { + QString str = clearComments( expr ); + if ( !str.contains( '.' ) && !str.contains( "->" ) ) ///Necessary, because the expression may also be like user->BaseUser:: + isInstance = false; + } + + QString resolutionType = "(resolved)"; + if( !type->resolved() ) { + if( BuiltinTypes::isBuiltin( type.resultType ) ) { + resolutionType = "(builtin " + BuiltinTypes::comment( type.resultType ) + ")"; + } else { + resolutionType = "(unresolved)"; + } + } + + kdDebug( 9007 ) << "===========================> type is: " << type->fullNameChain() << resolutionType << endl; + kdDebug( 9007 ) << "===========================> word is: " << word << endl; + + if ( !showArguments ) { + QValueList entryList; + + if ( !type && this_type && ( expr.isEmpty() || expr.endsWith( ";" ) ) ) { + + bool alwaysIncludeNamespaces = cfg->alwaysIncludeNamespaces(); + { + SimpleType t = this_type; + ///First, all static data. + bool ready = false; + SafetyCounter cnt( 20 ); + int depth = 0; + while ( !ready & cnt ) { + if ( t->scope().isEmpty() ) { + ready = true; + } + if( !t->isNamespace() || invokedOnDemand || alwaysIncludeNamespaces ) + computeCompletionEntryList( t, entryList, t->scope(), false, depth ); + t = t->parent(); + depth++; + } + } + { + SimpleType t = this_type; + ///Now find non-static(if we have an instance) and global data + bool ready = false; + SafetyCounter cnt( 20 ); + int depth = 0; + bool first = true; + while ( !ready & cnt ) { + if ( t->scope().isEmpty() ) { + ready = true; + } + if ( ( (t->isNamespace() && invokedOnDemand) || alwaysIncludeNamespaces ) || ( first && isInstance ) ) + computeCompletionEntryList( t, entryList, t->scope(), t->isNamespace() ? true : isInstance, depth ); + t = t->parent(); + depth++; + first = false; + } + } + if( ctx ) computeCompletionEntryList( entryList, ctx, isInstance ); + } else if ( type->resolved() && expr.isEmpty() ) { + if( ctx ) computeCompletionEntryList( entryList, ctx, isInstance ); + + // if ( m_pSupport->codeCompletionConfig() ->includeGlobalFunctions() ) + // computeCompletionEntryList( type, entryList, QStringList(), false ); + + computeCompletionEntryList( type, entryList, QStringList(), false ); + + if ( this_type.scope().size() ) + computeCompletionEntryList( this_type, entryList, this_type.scope(), isInstance ); + computeCompletionEntryList( type, entryList, type->resolved() ->scope() , isInstance ); + } else if ( type->resolved() ) { + if ( type->resolved() ) + computeCompletionEntryList( type, entryList, type->resolved() ->scope() , isInstance ); + } + + QStringList trueMatches; + + if ( invokedOnDemand ) { + // find matching words + QValueList::Iterator it; + for ( it = entryList.begin(); it != entryList.end(); ++it ) { + if ( ( *it ).text.startsWith( word ) ) { + trueMatches << ( *it ).text; + + // if more than one entry matches, abort immediately + if ( trueMatches.size() > 1 ) + break; + } + } + } + + if ( invokedOnDemand && trueMatches.size() == 1 ) { + // erbsland: get the cursor position now, because m_ccLine and m_ccColumn + // are not set until the first typed char. + unsigned int nLine, nCol; + m_activeCursor->cursorPositionReal( &nLine, &nCol ); + // there is only one entry -> complete immediately + m_activeEditor->insertText( nLine, nCol, + trueMatches[ 0 ].right( trueMatches[ 0 ].length() - word.length() ) ); + } else if ( entryList.size() ) { + entryList = unique( entryList ); + qHeapSort( entryList ); + + m_bCompletionBoxShow = true; + ///Warning: the conversion is only possible because CodeCompletionEntry is binary compatible with KTextEditor::CompletionEntry, + ///never change that! + m_activeCompletion->showCompletionBox( *( ( QValueList* ) ( &entryList ) ), word.length() ); + } + } else { + QValueList signatureList; + + signatureList = computeSignatureList( type ); + + QString methodName = type->name(); + + ///Search for variables with ()-operator in the context + if ( ctx ) { + SimpleVariable var = ctx->findVariable( methodName ); + if ( !var.name.isEmpty() ) { + signatureList += computeSignatureList( ctx->container() ->locateDecType( var.type ) ); + } + } + + ///search for fitting methods/classes in the current context + SimpleType t = this_type; + bool ready = false; + SafetyCounter s( 20 ); + do { + if ( !t ) + ready = true; + TypeDesc d( methodName ); + d.setIncludeFiles( getIncludeFiles() ); + SimpleType method = t->typeOf( d ); + if ( method ) + signatureList += computeSignatureList( method ); + if ( t ) + t = t->parent(); + } while ( !ready && s ); + + if ( !signatureList.isEmpty() ) { + //signatureList = unique( signatureList ); + //qHeapSort( signatureList ); + m_bArgHintShow = true; + m_activeCompletion->showArgHint( unique( signatureList ), "()", "," ); + } + } + + delete( ctx ); + ctx = 0; + + if ( cfg->usePermanentCaching() ) { + conf.invalidate(); + m_cachedFromContext = contextItem; + } +} + + +QValueList CppCodeCompletion::computeSignatureList( EvaluationResult result ) { + SimpleType type = result; + + if ( result.expr.t == ExpressionInfo::TypeExpression ) { + TypeDesc d( result->name() ); + d.setIncludeFiles( getIncludeFiles() ); + type = type->typeOf( d, SimpleTypeImpl::MemberInfo::Function ); ///Compute the signature of the constructor + } + + QValueList retList; + SimpleTypeFunctionInterface* f = type->asFunction(); + SimpleType currType = type; + + if ( !f && !type->isNamespace() ) { + SimpleType t = type->typeOf( TypeDesc("operator ( )"), SimpleTypeImpl::MemberInfo::Function ); + + if ( t ) { + f = t->asFunction(); + currType = t; + } + } + + while ( f ) { + QStringList lst; + QString sig = buildSignature( currType.get() ); + QString comment = currType->comment(); + QStringList commentList; + if ( m_pSupport->codeCompletionConfig() ->showCommentWithArgumentHint() ) { + + if ( !comment.isEmpty() ) { + if ( sig.length() + comment.length() < 130 ) { + sig += ": \"" + currType->comment() + "\""; + } else { + commentList = formatComment( comment ); + } + } + } + + lst << sig; + lst += commentList; + + currType = f->nextFunction(); + + ///Maybe try to apply implicit template-params in this place + + retList << lst; + f = currType->asFunction(); + } + return retList; +} + +void CppCodeCompletion::synchronousParseReady( const QString& file, ParsedFilePointer unit ) { + if ( file == m_activeFileName ) { + computeRecoveryPoints( unit ); + } +} + +void CppCodeCompletion::slotCodeModelUpdated( const QString& fileName ) { + if ( fileName != m_activeFileName || !m_pSupport || !m_activeEditor ) + return ; + +// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Current file updated %1" ).arg( m_activeFileName ), 1000 ); + + computeRecoveryPointsLocked(); +} + +void CppCodeCompletion::slotFileParsed( const QString& fileName ) { + if ( fileName != m_activeFileName || !m_pSupport || !m_activeEditor ) + return ; + +// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Current file parsed %1 (cache emptied)" ).arg( m_activeFileName ), 1000 ); + + emptyCache(); ///The cache has to be emptied, because the code-model changed. @todo Better: Only refresh the code-model(tell all code-model-types to refresh themselves on demand) + + computeRecoveryPointsLocked(); +} + +void CppCodeCompletion::setupCodeInformationRepository( ) {} + +SimpleContext* CppCodeCompletion::computeContext( FunctionDefinitionAST * ast, int line, int col, int lineOffset, int colOffset ) { + kdDebug( 9007 ) << "CppCodeCompletion::computeContext() -- main" << endl; + + SimpleContext* ctx = new SimpleContext(); + + if ( ast && ast->initDeclarator() && ast->initDeclarator() ->declarator() ) { + DeclaratorAST * d = ast->initDeclarator() ->declarator(); + if ( ParameterDeclarationClauseAST * clause = d->parameterDeclarationClause() ) { + if ( ParameterDeclarationListAST * params = clause->parameterDeclarationList() ) { + QPtrList l( params->parameterList() ); + QPtrListIterator it( l ); + while ( it.current() ) { + ParameterDeclarationAST * param = it.current(); + ++it; + + SimpleVariable var; + + QStringList ptrList; + QPtrList ptrOpList = param->declarator() ->ptrOpList(); + QPtrList::iterator it = ptrOpList.begin(); + for ( ; it != ptrOpList.end(); ++it ) { + ptrList.append( ( *it ) ->text() ); + } + + var.ptrList = ptrList; + var.type = param->typeSpec() ->text() + ptrList.join( "" ); + var.name = declaratorToString( param->declarator(), QString::null, true ); + var.comment = param->comment(); + param->getStartPosition( &var.startLine, &var.startCol ); + param->getEndPosition( &var.endLine, &var.endCol ); + + if ( var.type ) { + ctx->add + ( var ); + //kdDebug(9007) << "add argument " << var.name << " with type " << var.type << endl; + } + } + } + } + } + + + if ( ast ) + computeContext( ctx, ast->functionBody(), line, col ); + + if ( ctx ) { + ctx->offset( lineOffset, colOffset ); + } + + return ctx; +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, StatementAST* stmt, int line, int col ) { + if ( !stmt ) + return ; + + switch ( stmt->nodeType() ) { + case NodeType_IfStatement: + computeContext( ctx, static_cast( stmt ), line, col ); + break; + case NodeType_WhileStatement: + computeContext( ctx, static_cast( stmt ), line, col ); + break; + case NodeType_DoStatement: + computeContext( ctx, static_cast( stmt ), line, col ); + break; + case NodeType_ForStatement: + computeContext( ctx, static_cast( stmt ), line, col ); + break; + case NodeType_SwitchStatement: + computeContext( ctx, static_cast( stmt ), line, col ); + break; + case NodeType_TryBlockStatement: + computeContext( ctx, static_cast( stmt ), line, col ); + break; + case NodeType_DeclarationStatement: + computeContext( ctx, static_cast( stmt ), line, col ); + break; + case NodeType_StatementList: + computeContext( ctx, static_cast( stmt ), line, col ); + break; + case NodeType_ExpressionStatement: + break; + } +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, StatementListAST* ast, int line, int col ) { + if ( !inContextScope( ast, line, col, false, true ) ) + return ; + + QPtrList l( ast->statementList() ); + QPtrListIterator it( l ); + while ( it.current() ) { + StatementAST * stmt = it.current(); + ++it; + + computeContext( ctx, stmt, line, col ); + } +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, IfStatementAST* ast, int line, int col ) { + if ( !inContextScope( ast, line, col ) ) + return ; + + computeContext( ctx, ast->condition(), line, col ); + computeContext( ctx, ast->statement(), line, col ); + computeContext( ctx, ast->elseStatement(), line, col ); +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, ForStatementAST* ast, int line, int col ) { + if ( !inContextScope( ast, line, col ) ) + return ; + + computeContext( ctx, ast->initStatement(), line, col ); + computeContext( ctx, ast->condition(), line, col ); + computeContext( ctx, ast->statement(), line, col ); +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, DoStatementAST* ast, int line, int col ) { + if ( !inContextScope( ast, line, col ) ) + return ; + + //computeContext( ctx, ast->condition(), line, col ); + computeContext( ctx, ast->statement(), line, col ); +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, WhileStatementAST* ast, int line, int col ) { + if ( !inContextScope( ast, line, col ) ) + return ; + + computeContext( ctx, ast->condition(), line, col ); + computeContext( ctx, ast->statement(), line, col ); +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, SwitchStatementAST* ast, int line, int col ) { + if ( !inContextScope( ast, line, col ) ) + return ; + + computeContext( ctx, ast->condition(), line, col ); + computeContext( ctx, ast->statement(), line, col ); +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, TryBlockStatementAST* ast, int line, int col ) { + if ( !inContextScope( ast, line, col ) ) + return ; + + computeContext( ctx, ast->statement(), line, col ); + computeContext( ctx, ast->catchStatementList(), line, col ); +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, CatchStatementListAST* ast, int line, int col ) { + /*if ( !inContextScope( ast, line, col, false, true ) ) + return;*/ + + QPtrList l( ast->statementList() ); + QPtrListIterator it( l ); + while ( it.current() ) { + CatchStatementAST * stmt = it.current(); + ++it; + + computeContext( ctx, stmt, line, col ); + } +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, CatchStatementAST* ast, int line, int col ) { + if ( !ast->statement() ) + return ; + if ( !inContextScope( ast->statement(), line, col ) ) + return ; + + computeContext( ctx, ast->condition(), line, col ); + computeContext( ctx, ast->statement(), line, col ); +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, DeclarationStatementAST* ast, int line, int col ) { + ///@todo respect NodeType_Typedef + if( ast->declaration() && ast->declaration() ->nodeType() == NodeType_UsingDirective ) { + UsingDirectiveAST* usingDecl = static_cast( ast->declaration() ); + QString name; + if( usingDecl->name() ) { + name = usingDecl->name()->text(); + + if( !name.isNull() ) + ctx->addImport( QPair( "", name ) ); + } + } + + if( ast->declaration() && ast->declaration() ->nodeType() == NodeType_NamespaceAlias ) { + NamespaceAliasAST* namespaceAlias = static_cast( ast->declaration() ); + QString name; + + if( namespaceAlias ->namespaceName() && namespaceAlias->aliasName() ) { + ctx->addImport( QPair( namespaceAlias->namespaceName()->text(), namespaceAlias->aliasName()->text() ) ); + } + } + + if ( !ast->declaration() || ast->declaration() ->nodeType() != NodeType_SimpleDeclaration ) + return ; + + if ( !inContextScope( ast, line, col, true, false ) ) + return ; + + SimpleDeclarationAST* simpleDecl = static_cast( ast->declaration() ); + TypeSpecifierAST* typeSpec = simpleDecl->typeSpec(); + + InitDeclaratorListAST* initDeclListAST = simpleDecl->initDeclaratorList(); + if ( !initDeclListAST ) + return ; + + QPtrList l = initDeclListAST->initDeclaratorList(); + QPtrListIterator it( l ); + while ( it.current() ) { + DeclaratorAST * d = it.current() ->declarator(); + ++it; + + if ( d->declaratorId() ) { + SimpleVariable var; + + QStringList ptrList; + QPtrList ptrOpList = d->ptrOpList(); + QPtrList::iterator it = ptrOpList.begin(); + for ( ; it != ptrOpList.end(); ++it ) { + ptrList.append( ( *it ) ->text() ); + } + + for( int a = 0; a < d->arrayDimensionList().count(); a++ ) + ptrList.append("*"); + + var.ptrList = ptrList; + var.type = typeSpec->text() + ptrList.join( "" ); + var.name = toSimpleName( d->declaratorId() ); + var.comment = d->comment(); + d->getStartPosition( &var.startLine, &var.startCol ); + d->getEndPosition( &var.endLine, &var.endCol ); + + ctx->add + ( var ); + //kdDebug(9007) << "add variable " << var.name << " with type " << var.type << endl; + } + } +} + +void CppCodeCompletion::computeContext( SimpleContext*& ctx, ConditionAST* ast, int line, int col ) { + if ( !ast->typeSpec() || !ast->declarator() || !ast->declarator() ->declaratorId() ) + return ; + + if ( !inContextScope( ast, line, col, true, false ) ) + return ; + + SimpleVariable var; + + QStringList ptrList; + QPtrList ptrOpList = ast->declarator() ->ptrOpList(); + QPtrList::iterator it = ptrOpList.begin(); + for ( ; it != ptrOpList.end(); ++it ) { + ptrList.append( ( *it ) ->text() ); + } + + var.ptrList = ptrList; + var.type = ast->typeSpec() ->text() + ptrList.join( "" ); + var.name = toSimpleName( ast->declarator() ->declaratorId() ); + var.comment = ast->comment(); + ast->getStartPosition( &var.startLine, &var.startCol ); + ast->getEndPosition( &var.endLine, &var.endCol ); + ctx->add + ( var ); + //kdDebug(9007) << "add variable " << var.name << " with type " << var.type << endl; +} + +bool CppCodeCompletion::inContextScope( AST* ast, int line, int col, bool checkStart, bool checkEnd ) { + int startLine, startColumn; + int endLine, endColumn; + ast->getStartPosition( &startLine, &startColumn ); + ast->getEndPosition( &endLine, &endColumn ); + + // kdDebug(9007) << k_funcinfo << endl; + // kdDebug(9007) << "current char line: " << line << " col: " << col << endl; + // + // kdDebug(9007) << nodeTypeToString( ast->nodeType() ) + // << " start line: " << startLine + // << " col: " << startColumn << endl; + // kdDebug(9007) << nodeTypeToString( ast->nodeType() ) + // << " end line: " << endLine + // << " col: " << endColumn << endl; + + bool start = line > startLine || ( line == startLine && col >= startColumn ); + bool end = line < endLine || ( line == endLine && col <= endColumn ); + + if ( checkStart && checkEnd ) + return start && end; + else if ( checkStart ) + return start; + else if ( checkEnd ) + return end; + + return false; +} + +FunctionDefinitionAST * CppCodeCompletion::functionDefinition( AST* node ) { + + while ( node ) { + if ( node->nodeType() == NodeType_FunctionDefinition ) + return static_cast( node ); + node = node->parent(); + } + return 0; +} + +QString CppCodeCompletion::getText( int startLine, int startColumn, int endLine, int endColumn, int omitLine ) { + if ( startLine == endLine ) { + QString textLine = m_activeEditor->textLine( startLine ); + return textLine.mid( startColumn, endColumn - startColumn ); + } + + QStringList contents; + + for ( int line = startLine; line <= endLine; ++line ) { + if ( line == omitLine ) + continue; + + QString textLine = m_activeEditor->textLine( line ); + + if ( line == startLine ) + textLine = textLine.mid( startColumn ); + if ( line == endLine ) + textLine = textLine.left( endColumn ); + + contents << textLine; + } + return contents.join( "\n" ); +} + +void CppCodeCompletion::computeRecoveryPointsLocked() { + m_pSupport->backgroundParser() ->lock () + ; + ParsedFilePointer unit = m_pSupport->backgroundParser() ->translationUnit( m_activeFileName ); + computeRecoveryPoints( unit ); + m_pSupport->backgroundParser() ->unlock(); +} + +void CppCodeCompletion::computeRecoveryPoints( ParsedFilePointer unit ) { + if ( m_blockForKeyword ) + return ; + + kdDebug( 9007 ) << "CppCodeCompletion::computeRecoveryPoints" << endl; + + d->recoveryPoints.clear(); + if ( !unit ) + return ; + + ComputeRecoveryPoints walker( d->recoveryPoints ); + walker.parseTranslationUnit( *unit ); +} + +QString codeModelAccessToString( CodeModelItem::Access access ) { + switch ( access ) { + case CodeModelItem::Public: + return "public"; + case CodeModelItem::Protected: + return "protected"; + case CodeModelItem::Private: + return "private"; + default: + return "unknown"; + } +} + +#define MAXCOMMENTCOLUMNS 45 + + +QString CppCodeCompletion::commentFromItem( const SimpleType& parent, const ItemDom& item ) { + --m_maxComments; + static QString maxReached = " "; + if( m_maxComments < 0 ) { + return maxReached; + } + QString ret; + int line, col; + item->getStartPosition( &line, &col ); + + + if ( !parent->scope().isEmpty() ) { + ret += "Container: " + parent->fullTypeResolvedWithScope(); + } + + if ( item->isEnum() ) { + ret += "\nKind: Enum"; + ret += "\nValues:"; + const EnumModel* en = dynamic_cast( item.data() ); + if ( en ) { + EnumeratorList values = en->enumeratorList(); + for ( EnumeratorList::iterator it = values.begin(); it != values.end(); ++it ) { + ret += "\n " + ( *it ) ->name(); + if ( !( *it ) ->value().isEmpty() ) { + ret + " = " + ( *it ) ->value(); + } + } + + ret += "\n\nAccess: " + codeModelAccessToString( ( CodeModelItem::Access ) en->access() ); + } else {} + + } + + if ( item->isFunction() || item->isFunctionDefinition() ) { + const FunctionModel * f = dynamic_cast( item.data() ); + ret += "\nKind: Function"; + if ( f ) { + QString state; + if ( f->isStatic() ) + state += "static "; + if ( f->isVirtual() ) + state += "virtual "; + if ( f->isAbstract() ) + state += "abstract "; + //if( f->isTemplateable() ) state += "template "; + if ( f->isConstant() ) + state += "const "; + if ( f->isSlot() ) + state += "slot "; + if ( f->isSignal() ) + state += "signal "; + + if ( !state.isEmpty() ) + ret += "\nModifiers: " + state; + + ret += "\nAccess: " + codeModelAccessToString( ( CodeModelItem::Access ) f->access() ); + } + } + + if ( item->isEnumerator() ) { + const EnumeratorModel * f = dynamic_cast( item.data() ); + ret += "\nKind: Enumerator"; + if ( f ) { + if ( !f->value().isEmpty() ) + ret += "\nValue: " + f->value(); + + //ret += "\nAccess: " + codeModelAccessToString( f->() ); + } + } else { + if ( item->isVariable() ) { + const VariableModel * f = dynamic_cast( item.data() ); + if ( f ) { + if ( !f->isEnumeratorVariable() ) { + ret += "\nKind: Variable"; + if ( f->isStatic() ) + ret += "\nModifiers: static"; + } else { + ret += "\nKind: Enumerator"; + ret += "\nEnum: " + f->type(); + } + + ret += "\nAccess: " + codeModelAccessToString( ( CodeModelItem::Access ) f->access() ); + } + } + } + + if ( item->isTypeAlias() ) { + const TypeAliasModel * t = dynamic_cast( item.data() ); + ret += "\nKind: Typedef"; + if ( t ) { + ret += "\nType: " + t->type(); + LocateResult r = parent->locateDecType( t->type() ); + if ( r.desc().resolved() ) + ret += "\nResolved type: " + r.desc().resolved() ->fullTypeResolvedWithScope(); + else + ret += "\nPartially resolved type: " + r.desc().fullNameChain(); + } + } + + if ( item->isClass() ) { + ret += "\nKind: Class"; + } + + ret += QString( "\nFile: %1\nLine: %2 Column: %3" ).arg( prepareTextForMenu( item->fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).arg( line ).arg( col ); + if ( !item->comment().isEmpty() ) + ret += "\n\n" + prepareTextForMenu( item->comment(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ); + return ret; +} + +QString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag ) { + --m_maxComments; + static QString maxReached = " "; + if( m_maxComments < 0 ) { + return maxReached; + } + + int line, col; + tag.getStartPosition( &line, &col ); + QString ret; // = tag.comment(); + + if ( !parent->scope().isEmpty() ) { + ret += "Container: " + parent->fullTypeResolvedWithScope(); + } + /* + if( tag.kind() == Tag::Kind_Enum ) { + ret += "\nKind: Enum"; + ret += "\nValues:"; + EnumModel* en = dynamic_cast( item.data() ); + if( en ) { + EnumeratorList values =en->enumeratorList(); + for( EnumeratorList::iterator it = values.begin(); it != values.end(); ++it ) + { + ret += "\n " + (*it)->name(); + if( !(*it)->value().isEmpty() ) { + ret + " = " + (*it)->value(); + } + } + + ret += "\n\nAccess: " + codeModelAccessToString( (CodeModelItem::Access)en->access() ); + } else { + } + }*/ + + if ( tag.kind() == Tag::Kind_Function || tag.kind() == Tag::Kind_FunctionDeclaration ) { + CppFunction function( tag ); + + ret += "\nKind: Function"; + + QString state; + if ( function.isStatic() ) + state += "static "; + if ( function.isVirtual() ) + state += "virtual "; + //if( function.isVolatile() ) state += "volatile "; + if ( function.isConst() ) + state += "const "; + if ( function.isSlot() ) + state += "slot "; + if ( function.isSignal() ) + state += "signal "; + if ( !state.isEmpty() ) + ret += "\nModifiers: " + state; + + ret += "\nAccess: " + TagUtils::accessToString( function.access() ); + } + + /*if( item->isEnumerator() ) { + EnumeratorModel* f = dynamic_cast( item.data() ); + ret += "\nKind: Enumerator"; + if( f ) { + if( !f->value().isEmpty() ) + ret += "\nValue: " + f->value(); + + //ret += "\nAccess: " + codeModelAccessToString( f->() ); + } + } else { + if( item->isVariable() ) { + VariableModel* f = dynamic_cast( item.data() ); + ret += "\nKind: Variable"; + if( f ) { + ret += "\nAccess: " + codeModelAccessToString( (CodeModelItem::Access)f->access() ); + } + } + }*/ + + if ( tag.kind() == Tag::Kind_Enum ) { + CppVariable var( tag ); + + ret += "\nKind: Enum"; + } + + if ( tag.kind() == Tag::Kind_Enumerator ) { + CppVariable var( tag ); + + ret += "\nKind: Enumerator"; + if ( tag.hasAttribute( "enum" ) && tag.attribute( "enum" ).asString() != "int" ) + ret += "\nEnum: " + tag.attribute( "enum" ).asString(); + } + + if ( tag.kind() == Tag::Kind_Variable ) { + CppVariable var( tag ); + + ret += "\nKind: Variable"; + if ( var.isStatic() ) + ret += "\nModifiers: static"; + ret += "\nAccess: " + TagUtils::accessToString( var.access() ); + } + + if ( tag.kind() == Tag::Kind_Typedef ) { + ret += "\nKind: Typedef"; + ret += "\nType: " + tagType( tag ); + LocateResult r = parent->locateDecType( tagType( tag ) ); + if ( r.desc().resolved() ) + ret += "\nResolved type: " + r.desc().resolved() ->fullTypeResolvedWithScope(); + else + ret += "\nPartially resolved type: " + r.desc().fullNameChain(); + } + + if ( tag.kind() == Tag::Kind_Class ) { + ret += "\nKind: Class"; + } + if ( tag.kind() == Tag::Kind_Struct ) { + ret += "\nKind: Struct"; + } + + ret += QString( "\nFile: %1\nLine: %2 Column: %3" ).arg( prepareTextForMenu( tag.fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).arg( line ).arg( col ); + if ( !tag.comment().isEmpty() ) { + ret += "\n\n" + prepareTextForMenu( tag.comment(), 20, MAXCOMMENTCOLUMNS ).join( "\n" ); + } + return ret; +} + +void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList& entryList, const QStringList& type, SimpleTypeNamespace* ns, std::set& ignore, bool isInstance, int depth ) { + HashedString myName = HashedString( ns->scope().join("::") +"%"+typeid(*ns).name() ); + if ( ignore.find( myName ) != ignore.end() ) + return ; + ignore.insert( myName ); + SimpleTypeNamespace::SlaveList slaves = ns->getSlaves( getIncludeFiles() ); + for ( SimpleTypeNamespace::SlaveList::iterator it = slaves.begin(); it != slaves.end(); ++it ) { + SimpleTypeNamespace* nns = dynamic_cast( (*it).first.first.resolved().data() ); + if ( !nns ) { + if( ( *it ).first.first.resolved() ) computeCompletionEntryList( SimpleType((*it).first.first.resolved()), entryList, ( *it ).first.first.resolved()->scope(), isInstance, depth ); + } else { + if( ( *it ).first.first.resolved() ) computeCompletionEntryList( SimpleType(( *it ).first.first.resolved()), entryList, ( *it ).first.first.resolved()->scope(), nns, ignore, isInstance, depth ); + } + } +} + +void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList< CodeCompletionEntry > & entryList, const QStringList & type, bool isInstance, int depth ) { + dbgState.setState( disableVerboseForCompletionList ); + + Debug d( "#cel#" ); + if ( !safetyCounter || !d ) + return ; + SimpleTypeImpl* m = &( *typeR ) ; + + if ( SimpleTypeNamespace * ns = dynamic_cast( m ) ) { + std::set ignore; + computeCompletionEntryList( typeR, entryList, type, ns, ignore, isInstance, depth ); + } else if ( dynamic_cast( m ) ) { + ItemDom item = ( dynamic_cast( m ) ) ->item(); + if ( item ) + if ( ClassModel * mod = dynamic_cast ( &( *item ) ) ) + computeCompletionEntryList( typeR, entryList, ClassDom( mod ) , isInstance, depth ); + } else { + QValueList args; + QValueList tags; + + QStringList ts = type; + if( !ts.isEmpty() ) { + QString s = ts.back() + typeR->specialization(); + ts.pop_back(); + ts.push_back( s ); + } + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_FunctionDeclaration ) + << Catalog::QueryArgument( "scope", ts ); + tags = m_repository->query( args ); + computeCompletionEntryList( typeR, entryList, tags, isInstance, depth ); + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Variable ) + << Catalog::QueryArgument( "scope", ts ); + tags = m_repository->query( args ); + computeCompletionEntryList( typeR, entryList, tags, isInstance, depth ); + + if ( !isInstance ) { + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Enumerator ) + << Catalog::QueryArgument( "scope", ts ); + tags = m_repository->query( args ); + computeCompletionEntryList( typeR, entryList, tags, isInstance, depth ); + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Enum ) + << Catalog::QueryArgument( "scope", ts ); + tags = m_repository->query( args ); + computeCompletionEntryList( typeR, entryList, tags, isInstance, depth ); + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Typedef ) + << Catalog::QueryArgument( "scope", ts ); + tags = m_repository->query( args ); + computeCompletionEntryList( typeR, entryList, tags, isInstance, depth ); + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Class ) + << Catalog::QueryArgument( "scope", ts ); + tags = m_repository->query( args ); + computeCompletionEntryList( typeR, entryList, tags, isInstance, depth ); + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Struct ) + << Catalog::QueryArgument( "scope", ts ); + tags = m_repository->query( args ); + computeCompletionEntryList( typeR, entryList, tags, isInstance, depth ); + } + + args.clear(); + args << Catalog::QueryArgument( "kind", Tag::Kind_Base_class ); + QString fullname = type.join( "::" )+typeR->specialization(); + /* if( fullname.length() >=2 ) + args << Catalog::QueryArgument( "prefix", fullname.left(2) );*/ + args << Catalog::QueryArgument( "name", fullname ); + + + QValueList parents = typeR->getBases( ); + for ( QValueList::Iterator it = parents.begin(); it != parents.end(); ++it ) { + if ( !( *it ) ->resolved() ) + continue; + SimpleType tp = SimpleType( ( *it ) ->resolved() ); + if ( tp ) + computeCompletionEntryList( tp, entryList, tp.scope(), isInstance, depth + 1 ); + } + } + dbgState.setState( true ); +} + + +void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, QValueList< Tag > & tags, bool isInstance, int depth ) { + Debug d( "#cel#" ); + if ( !safetyCounter || !d ) + return ; + QString className = type->desc().name(); + + bool isNs = type->isNamespace(); + + CompTypeProcessor proc( type, m_pSupport->codeCompletionConfig() ->processFunctionArguments() && type->usingTemplates() ); + bool resolve = m_pSupport->codeCompletionConfig() ->processPrimaryTypes() && type->usingTemplates(); + + QValueList::Iterator it = tags.begin(); + while ( it != tags.end() ) { + Tag & tag = *it; + ++it; + + int subSorting = 0; + + if ( tag.name().isEmpty() ) { + continue; + } else if ( m_completionMode != NormalCompletion ) { + if ( tag.kind() != Tag::Kind_FunctionDeclaration ) + continue; + } + + if ( tag.kind() == Tag::Kind_Function || tag.kind() == Tag::Kind_FunctionDeclaration ) { + CppFunction info( tag ); + + if ( m_completionMode == SlotCompletion && !info.isSlot() ) + continue; + else if ( m_completionMode == SignalCompletion && !info.isSignal() ) + continue; + else if ( m_completionMode == VirtualDeclCompletion && !info.isVirtual() ) + continue; + + if ( info.isConst() ) + subSorting = 1; + if ( info.isSlot() ) + subSorting = 2; + if ( info.isSignal() ) + subSorting = 3; + if ( info.isVirtual() ) + subSorting = 4; + if ( info.isStatic() ) + subSorting = 5; + } + + CodeCompletionEntry e = CodeInformationRepository::toEntry( tag, m_completionMode, &proc ); + + TagFlags fl; + fl.flags = tag.flags(); + int num = fl.data.access; + + QString str = "public"; + if ( num != 0 ) { + str = TagUtils::accessToString( num ); + } else { + num = 0; + } + // 0 = protected, 1 = public, 2 = private + + if ( str == "public" ) + num = 0; + else if ( str == "protected" ) + num = 1; + else if ( str == "private" ) + num = 2; + + int sortPosition = 0; + + switch ( tag.kind() ) { + case Tag::Kind_Enum: + sortPosition = 3; + if ( isInstance ) + continue; + break; + case Tag::Kind_Enumerator: + sortPosition = 4; + if ( isInstance ) + continue; + break; + case Tag::Kind_Struct: + case Tag::Kind_Union: + case Tag::Kind_Class: + sortPosition = 5; + if ( isInstance ) + continue; + break; + case Tag::Kind_VariableDeclaration: + case Tag::Kind_Variable: + sortPosition = 2; + if ( !isInstance && !CppVariable( tag ).isStatic() && !isNs ) + continue; + break; + case Tag::Kind_FunctionDeclaration: + case Tag::Kind_Function: + sortPosition = 1; + if ( !isInstance && !CppFunction( tag ).isStatic() && !isNs ) + continue; + break; + case Tag::Kind_Typedef: + sortPosition = 6; + if ( isInstance ) + continue; + break; + } + + e.userdata = QString( "%1%2%3%4%5" ).arg( num ).arg( depth ).arg( className ).arg( sortPosition ).arg( subSorting ); + + if ( m_completionMode != SignalCompletion ) { + if ( !type->isNamespace() ) { + if ( num == 1 ) + e.postfix += "; (protected)"; // in " + proc.parentType() + ")"; + if ( num == 2 ) + e.postfix += "; (private)"; // in " + proc.parentType() + ")"; + } + } + + + QString prefix = tagType( tag ).stripWhiteSpace(); + + if ( tag.kind() == Tag::Kind_Enumerator && tag.hasAttribute( "enum" ) ) { + prefix = tag.attribute( "enum" ).asString(); + e.userdata += prefix; ///Sort enumerators together + } else if ( tag.kind() == Tag::Kind_Enum ) { + prefix = "enum"; + } else { + + if ( tag.kind() == Tag::Kind_FunctionDeclaration || tag.kind() == Tag::Kind_Function || tag.kind() == Tag::Kind_Variable || tag.kind() == Tag::Kind_Typedef ) { + if ( !prefix.isEmpty() && resolve ) { + LocateResult et = type->locateDecType( prefix ); + + if ( et ) + prefix = et->fullNameChain(); + } + } + + if ( tag.kind() == Tag::Kind_FunctionDeclaration || tag.kind() == Tag::Kind_Function ) { + if ( prefix.isEmpty() ) { + if ( tag.name() == className ) + prefix = constructorPrefix; + else if ( tag.name().startsWith( "~" ) ) + prefix = destructorPrefix; + } + } + + if ( tag.kind() == Tag::Kind_Class || tag.kind() == Tag::Kind_Function ) + prefix = ""; + } + + e.comment = commentFromTag( type, tag ); + + if ( e.prefix.isEmpty() ) + e.prefix = prefix; + else + e.prefix += " " + prefix; + + e.prefix = e.prefix.stripWhiteSpace(); + e.prefix = stringMult( depth, " " ) + e.prefix.stripWhiteSpace(); + + e.text = e.text.stripWhiteSpace(); + + if ( str != "private" ) + entryList << e; + } +} + +void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, ClassDom klass, bool isInstance, int depth ) { + Debug d( "#cel#" ); + if ( !safetyCounter || !d ) + return ; + + computeCompletionEntryList( type, entryList, klass->functionList(), isInstance, depth ); + + ///Find all function-definitions that have no functions. Those may be inlined functions and need to be treated too. + FunctionDefinitionList definitions = klass->functionDefinitionList(); + FunctionList l; + + QStringList classScope = klass->scope(); + classScope << klass->name(); + + for ( FunctionDefinitionList::iterator it = definitions.begin(); it != definitions.end(); ++it ) { + FunctionList fl = klass->functionByName( ( *it ) ->name() ); + + ArgumentList args = ( *it ) ->argumentList(); + + if ( !l.isEmpty() ) { + bool matched = false; + for ( FunctionList::iterator it = fl.begin(); it != fl.end(); ++it ) { + ArgumentList fArgs = ( *it ) ->argumentList(); + if ( fArgs.count() != args.count() ) + continue; + ArgumentList::iterator it = args.begin(); + ArgumentList::iterator it2 = fArgs.begin(); + bool hit = true; + while ( it != args.end() ) { + if ( ( *it ) ->type() != ( *it2 ) ->type() ) { + hit = false; + break; + } + ++it; + ++it2; + } + if ( hit ) { + matched = true; + break; + } + + } + + if ( matched ) + continue; + } + + ///The function-definition belongs to some sub-class + if( (*it)->scope() != classScope && !(*it)->scope().isEmpty() ) continue; + l << ( FunctionModel* ) ( *it ).data(); + } + + if ( !l.isEmpty() ) + computeCompletionEntryList( type, entryList, l, isInstance, depth ); + + if ( m_completionMode == NormalCompletion ) + computeCompletionEntryList( type, entryList, klass->variableList(), isInstance, depth ); + + if ( !isInstance ) { + computeCompletionEntryList( klass->name(), type, entryList, klass->classList(), isInstance, depth ); + computeCompletionEntryList( klass->name(), type, entryList, klass->typeAliasList(), isInstance, depth ); + } + + QValueList parents = type->getBases( ); + + for ( QValueList::Iterator it = parents.begin(); it != parents.end(); ++it ) { + if ( !( *it ) ->resolved() ) + continue; + + SimpleTypeImpl* i = ( *it ) ->resolved(); + computeCompletionEntryList( i, entryList, i->scope(), isInstance, depth + 1 ); + /* + SimpleTypeCodeModel* m = dynamic_cast ( i ); + if ( m ) { + ItemDom item = m->item(); + ClassModel* kl = dynamic_cast ( &( *item ) ); + if ( kl ) { + computeCompletionEntryList( SimpleType( ( *it ) ->resolved() ), entryList, ClassDom ( kl ), isInstance, depth + 1 ); + } + }*/ + } +} + +void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, NamespaceDom scope, bool isInstance, int depth ) { + Debug d( "#cel#" ); + if ( !safetyCounter || !d ) + return ; + + CppCodeCompletionConfig * cfg = m_pSupport->codeCompletionConfig(); + + computeCompletionEntryList( type, entryList, ClassDom( scope.data() ), isInstance, depth ); + if ( !isInstance ) + computeCompletionEntryList( type, entryList, scope->namespaceList(), isInstance, depth ); +} + +void CppCodeCompletion::computeCompletionEntryList( QString parent, SimpleType type, QValueList< CodeCompletionEntry > & entryList, const ClassList & lst, bool isInstance, int depth ) { + Debug d( "#cel#" ); + if ( !safetyCounter || !d ) + return ; + + + ClassList::ConstIterator it = lst.begin(); + while ( it != lst.end() ) { + ClassDom klass = *it; + ++it; + + CodeCompletionEntry entry; + entry.prefix = "class"; + entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace(); + entry.text = klass->name(); + entry.comment = commentFromItem( type, klass.data() ); + if ( isInstance ) + continue; + + entry.userdata = QString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 6 ); + + entryList << entry; + + + // if ( cfg->includeTypes() ) + /*{ + computeCompletionEntryList( type, entryList, klass->classList(), isInstance, depth ); + }*/ + } +} + +void CppCodeCompletion::computeCompletionEntryList( QString parent, SimpleType type, QValueList< CodeCompletionEntry > & entryList, const TypeAliasList & lst, bool isInstance, int depth ) { + Debug d( "#cel#" ); + if ( !safetyCounter || !d ) + return ; + + + TypeAliasList::ConstIterator it = lst.begin(); + while ( it != lst.end() ) { + TypeAliasDom klass = *it; + ++it; + + CodeCompletionEntry entry; + + LocateResult et = type->locateDecType( klass->type() ); + if ( et ) + entry.prefix = "typedef " + et->fullNameChain(); + else + entry.prefix = "typedef " + klass->type(); + + entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace(); + entry.text = klass->name(); + entry.comment = commentFromItem( type, klass.data() ); + entry.userdata = QString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 5 ); + entryList << entry; + } +} +void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, const NamespaceList & lst, bool /*isInstance*/, int depth ) { + Debug d( "#cel#" ); + if ( !safetyCounter || !d ) + return ; + + NamespaceList::ConstIterator it = lst.begin(); + while ( it != lst.end() ) { + NamespaceDom scope = *it; + ++it; + + CodeCompletionEntry entry; + entry.prefix = "namespace"; + entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace(); + entry.text = scope->name(); + entry.comment = commentFromItem( type, scope.data() ); + entryList << entry; + } +} + +void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, const FunctionList & methods, bool isInstance, int depth ) { + Debug d( "#cel#" ); + if ( !safetyCounter || !d ) + return ; + QString className = type->desc().name(); + bool isNs = type->isNamespace(); + + bool resolve = type->usingTemplates() && m_pSupport->codeCompletionConfig() ->processPrimaryTypes(); + + CompTypeProcessor proc( type, m_pSupport->codeCompletionConfig() ->processFunctionArguments() && type->usingTemplates() ); + + FunctionList::ConstIterator it = methods.begin(); + while ( it != methods.end() ) { + FunctionDom meth = *it; + ++it; + + if ( isInstance && meth->isStatic() ) + continue; + else if ( m_completionMode == SignalCompletion && !meth->isSignal() ) + continue; + else if ( m_completionMode == SlotCompletion && !meth->isSlot() ) + continue; + else if ( m_completionMode == VirtualDeclCompletion && !meth->isVirtual() ) + continue; + + if ( !isInstance && !meth->isStatic() && !isNs ) + continue; + + CodeCompletionEntry entry; + + entry.comment = commentFromItem( type, model_cast( meth ) ); + + if ( ! resolve ) { + entry.prefix = meth->resultType(); + } else { + QString tt = meth->resultType(); + LocateResult t = type->locateDecType( tt ); + if ( t ) { + entry.prefix = t->fullNameChain(); + } else + entry.prefix = meth->resultType(); + } + + if ( entry.prefix.isEmpty() && meth->name() == className ) + entry.prefix = constructorPrefix; + if ( entry.prefix.isEmpty() && meth->name().startsWith( "~" ) ) + entry.prefix = destructorPrefix; + + entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace(); + QString text; + + ArgumentList args = meth->argumentList(); + ArgumentList::Iterator argIt = args.begin(); + /* + if ( m_completionMode == VirtualDeclCompletion ) + { + //Ideally the type info would be a entry.prefix, but we need them to be + //inserted upon completion so they have to be part of entry.text + entry.text = meth->resultType(); + entry.text += " "; + entry.text += meth->name(); + } + else*/ + entry.text = meth->name(); + + entry.text += formattedOpeningParenthesis( args.size() == 0 ); + + while ( argIt != args.end() ) { + ArgumentDom arg = *argIt; + ++argIt; + + text += proc.processType( arg->type() ); + if ( m_completionMode == NormalCompletion || + m_completionMode == VirtualDeclCompletion ) + text += QString( " " ) + arg->name(); + + if ( argIt != args.end() ) + text += ", "; + } + + if ( args.size() == 0 ) { + entry.text += formattedClosingParenthesis( true ); + } else { + text += formattedClosingParenthesis( false ); + } + + int subSorting = 0; + if ( meth->isConstant() ) + subSorting = 1; + if ( meth->isSlot() ) + subSorting = 2; + if ( meth->isSignal() ) + subSorting = 3; + if ( meth->isVirtual() ) + subSorting = 4; + if ( meth->isStatic() ) + subSorting = 5; + + entry.userdata += QString( "%1%2%3%4%5" ).arg( meth->access() ).arg( depth ).arg( className ).arg( 1 ).arg( subSorting ); + + if ( m_completionMode == VirtualDeclCompletion ) + entry.text += text + ";"; + if ( m_completionMode != NormalCompletion ) + entry.text += text; + else + entry.postfix = text; + + if ( meth->isConstant() ) + entry.postfix += " const"; + if ( m_completionMode != SignalCompletion ) { + if ( !type->isNamespace() ) { + if ( meth->access() == CodeModelItem::Protected ) + entry.postfix += "; (protected)"; // in " + type->fullType() + ")"; + if ( meth->access() == CodeModelItem::Private ) + entry.postfix += "; (private)"; // in " + type->fullType() + ")"; + } + } + + entry.text = entry.text.stripWhiteSpace(); + + entryList << entry; + } +} + +void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, const VariableList & attributes, bool isInstance, int depth ) { + Debug d( "#cel#" ); + QString className = type->desc().name(); + bool isNs = type->isNamespace(); + + if ( !safetyCounter || !d ) + return ; + + if ( m_completionMode != NormalCompletion ) + return ; + bool resolve = type->usingTemplates() && m_pSupport->codeCompletionConfig() ->processPrimaryTypes(); + + VariableList::ConstIterator it = attributes.begin(); + while ( it != attributes.end() ) { + VariableDom attr = *it; + ++it; + + if ( isInstance && attr->isStatic() ) + continue; + if ( !isInstance && !attr->isStatic() && !isNs ) + continue; + + CodeCompletionEntry entry; + entry.text = attr->name(); + entry.comment = commentFromItem( type, model_cast( attr ) ); + entry.userdata += QString( "%1%2%3%4" ).arg( attr->access() ).arg( depth ).arg( className ).arg( 2 ); + + + if ( !attr->isEnumeratorVariable() ) { + if ( ! resolve ) { + entry.prefix = attr->type(); + } else { + QString tt = attr->type(); + LocateResult t = type->locateDecType( tt ); + //SimpleType t = type->typeOf( attr->name() ); + if ( t ) + entry.prefix = t->fullNameChain(); + else + entry.prefix = attr->type(); + } + } else { + entry.prefix = attr->type(); + entry.userdata += attr->type(); ///Sort enumerators by their enum + } + if ( attr->access() == CodeModelItem::Protected ) + entry.postfix += "; (protected)"; // in " + type->fullType() + ")"; + if ( attr->access() == CodeModelItem::Private ) + entry.postfix += "; (private)"; // in " + type->fullType() + ")"; + + entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace(); + + entryList << entry; + } +} + +void CppCodeCompletion::computeCompletionEntryList( QValueList< CodeCompletionEntry > & entryList, SimpleContext * ctx, bool /*isInstance*/, int depth ) { + Debug d( "#cel#" ); + if ( !safetyCounter || !d ) + return ; + + while ( ctx ) { + QValueList vars = ctx->vars(); + QValueList::ConstIterator it = vars.begin(); + while ( it != vars.end() ) { + const SimpleVariable & var = *it; + ++it; + + CodeCompletionEntry entry; + entry.prefix = var.type.fullNameChain(); + entry.text = var.name; + entry.userdata = "000"; + entry.comment = "Local variable"; + entryList << entry; + + } + ctx = ctx->prev(); + } + +} + +EvaluationResult CppCodeCompletion::evaluateExpression( ExpressionInfo expr, SimpleContext* ctx ) { + safetyCounter.init(); + + //d->classNameList = typeNameList( m_pSupport->codeModel() ); + + CppEvaluation::ExpressionEvaluation obj( this, expr, AllOperators, getIncludeFiles(), ctx ); + + EvaluationResult res; + res = obj.evaluate(); + + QString resolutionType = "(resolved)"; + if( !res->resolved() ) { + if( BuiltinTypes::isBuiltin( res.resultType ) ) { + resolutionType = "(builtin " + BuiltinTypes::comment( res.resultType ) + ")"; + } else { + resolutionType = "(unresolved)"; + } + } + + addStatusText( i18n( "Type of \"%1\" is \"%2\", %3" ).arg( expr.expr() ).arg( res->fullNameChain() ).arg( resolutionType ), 5000 ); + + return res; +} + +void CppCodeCompletion::computeFileEntryList( ) { + m_fileEntryList.clear(); + + QStringList fileList = m_pSupport->project() ->allFiles(); + for ( QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it ) { + if ( !m_pSupport->isHeader( *it ) ) + continue; + + CodeCompletionEntry entry; + entry.text = QFileInfo( *it ).fileName(); + + m_fileEntryList.push_back( entry ); + } + + m_fileEntryList = unique( m_fileEntryList ); +} + +HashedStringSet CppCodeCompletion::getIncludeFiles( const QString& fi ) { + QString file = fi; + if( file.isEmpty() ) + file = m_activeFileName; + + FileDom f = m_pSupport->codeModel() ->fileByName( file ); + if( f ) { + ParseResultPointer p = f->parseResult(); + if( p ) { + ParsedFilePointer pp = dynamic_cast( p.data() ); + if( pp ) { + return pp->includeFiles(); + } + } + } + return HashedStringSet(); +} + +void CppCodeCompletion::slotJumpToDeclCursorContext() +{ + kdDebug(9007) << k_funcinfo << endl; + jumpCursorContext( Declaration ); +} + +void CppCodeCompletion::slotJumpToDefCursorContext() +{ + kdDebug(9007) << k_funcinfo << endl; + jumpCursorContext( Definition ); +} + +void CppCodeCompletion::jumpCursorContext( FunctionType f ) +{ + if ( !m_activeCursor ) return; + + SimpleTypeConfiguration conf( m_activeFileName ); + + unsigned int line; + unsigned int column; + m_activeCursor->cursorPositionReal( &line, &column ); + + EvaluationResult result = evaluateExpressionAt( line, column, conf ); + + // Determine the declaration info based on the type of item we are dealing with. + DeclarationInfo d; + + QString includeFileName, includeFilePath; + bool unused; + + if ( result.isMacro ) { + d.name = result.macro.name(); + d.file = result.macro.fileName(); + d.startLine = d.endLine = result.macro.line(); + d.startCol = d.endCol = result.macro.column(); + } else if ( getIncludeInfo( line, includeFileName, includeFilePath, unused ) ) { + d.name = includeFileName; + d.file = includeFilePath; + } else { + d = result.sourceVariable; + } + if ( !d ) { + LocateResult type = result.resultType; + if ( type && type->resolved() ) { + // Is it a namespace? + if ( type->resolved()->isNamespace() ) { + SimpleTypeCachedNamespace * ns = dynamic_cast( type->resolved().data() ); + if ( ns ) { + SimpleTypeNamespace::SlaveList slaves = ns->getSlaves( getIncludeFiles() ); + if ( slaves.begin() != slaves.end() ) { + SimpleTypeCachedCodeModel * item = dynamic_cast( ( *slaves.begin() ).first.first.resolved().data() ); + if ( item && item->item() && item->item()->isNamespace() ) { + NamespaceModel* ns = dynamic_cast( item->item().data() ); + QStringList wholeScope = ns->scope(); + wholeScope << ns->name(); + FileList files = cppSupport()->codeModel()->fileList(); + for ( FileList::iterator it = files.begin(); it != files.end(); ++it ) { + NamespaceModel* ns = (*it).data(); + for ( QStringList::iterator it2 = wholeScope.begin(); it2 != wholeScope.end(); ++it2 ) { + if ( ns->hasNamespace( (*it2) ) ) { + ns = ns->namespaceByName( *it2 ); + if ( !ns ) break; + } else { + ns = 0; + break; + } + } + if ( ns ) { + d.name = ns->name(); + ns->getStartPosition( &d.startLine, &d.startCol ); + ns->getEndPosition( &d.endLine, &d.endCol ); + d.file = ns->fileName(); + break; + } + } + } + } + } + } else { + // Not a namespace, we can get the declaration info straight from the type description. + d = type->resolved()->getDeclarationInfo(); + } + } + // Unresolved, maybe its a named enumeration? + else if ( type && type.trace() ) { + QValueList< QPair > trace = type.trace()->trace(); + if ( !trace.isEmpty() ) { + if ( trace.begin() != trace.end() ) { + d = ( *trace.begin() ).first.decl; + } + } + } + } + if ( d ) { + QString fileName = d.file == "current_file" ? m_activeFileName : d.file.operator QString(); + if ( f == Definition && cppSupport()->switchHeaderImpl( fileName, d.startLine, d.startCol ) ) + return; + cppSupport()->partController()->editDocument( fileName, d.startLine ); + } +} + +QString CppCodeCompletion::createTypeInfoString( int line, int column ) +{ + QString typeInfoString; + + SimpleTypeConfiguration conf( m_activeFileName ); + EvaluationResult type = evaluateExpressionAt( line, column, conf ); + + if ( type.expr.expr().stripWhiteSpace().isEmpty() ) + return typeInfoString; + + typeInfoString += type.expr.expr() + QString(" : " ); + + if ( type->resolved() ) + { + QString scope = type->resolved()->scope().join("::"); + int pos = scope.findRev("::"); + if ( scope.isEmpty() || pos == -1 ) + { + scope = "::"; + } + else + { + scope.truncate( pos + 2 ); + } + + typeInfoString += scope + type->fullNameChain() + QString( i18n(" (resolved) ") ); + } + else + { + if ( type ) + { + if( !BuiltinTypes::isBuiltin( type.resultType ) ) + { + typeInfoString += type->fullNameChain() + QString( i18n(" (unresolved) ") ); + } + else + { + typeInfoString += type->fullNameChain() + ", " + BuiltinTypes::comment( type.resultType ) + QString( i18n(" (builtin type) ") ); + } + } + else + { + typeInfoString += QString( i18n(" (unresolved) ") ); + } + } + + if( cppSupport() && type->resolved() && cppSupport()->codeCompletionConfig()->preProcessAllHeaders() ) { + DeclarationInfo decl = type->resolved()->getDeclarationInfo(); + if( !getIncludeFiles()[ HashedString( decl.file ) ] ) { + typeInfoString += " [header not included] "; + } + } + + return typeInfoString; +} + +bool CppCodeCompletion::getIncludeInfo( int line, QString& includeFileName, QString& includeFilePath, bool& usedProjectFiles ) +{ + bool isIncludeDirective = false; + QString lineText = getText( line, 0, line+1, 0 ); + QRegExp includeRx( "(?:#include[\\s]*(?:\\\"|\\<))([^\\n]*)(\\\"|\\>)" ); + if( includeRx.search( lineText ) != -1 ) { + //It is an include-directive. The regular expression captures the string, and the closing sign('"' or '>'). + isIncludeDirective = true; + usedProjectFiles = false; + QStringList captured = includeRx.capturedTexts(); + if( captured.size() == 3 ) { + Dependence d; + d.first = captured[1]; + d.second = captured[2] == "\"" ? Dep_Local : Dep_Global; + includeFilePath = cppSupport()->driver()->findIncludeFile( d, activeFileName() ); + if( includeFilePath.isEmpty() ) { + //A simple backup-algorithm that can only find files within the same project + includeFilePath = cppSupport()->findHeaderSimple( d.first ); + usedProjectFiles = true; + } + includeFileName = d.first; + } else { + kdDebug( 9007 ) << "wrong count of captured items" << endl; + } + } + return isIncludeDirective; +} + + +#include "cppcodecompletion.moc" +//kate: indent-mode csands; tab-width 2; space-indent off; + diff --git a/languages/cpp/cppcodecompletion.h b/languages/cpp/cppcodecompletion.h new file mode 100644 index 00000000..0eb49908 --- /dev/null +++ b/languages/cpp/cppcodecompletion.h @@ -0,0 +1,324 @@ +/*************************************************************************** + cppcodecompletion.h - description + ------------------- + begin : Sat Jul 21 2001 + copyright : (C) 2001 by Victor R�er + email : victor_roeder@gmx.de + copyright : (C) 2002,2003 by Roberto Raggi + email : roberto@kdevelop.org +***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef __CPPCODECOMPLETION_H__ +#define __CPPCODECOMPLETION_H__ + +#include "cppsupportpart.h" +#include "declarationinfo.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "driver.h" +///A little debugging class +#include +class PopupTracker : public QObject { + Q_OBJECT +public: + static PopupTracker* pt; + + static uint pendingPopups; + + static QPopupMenu* createPopup( QWidget* parent ) { + if( !pt ) pt = new PopupTracker(); + QPopupMenu* m = new QPopupMenu( parent ); + ++pendingPopups; + connect( m, SIGNAL(destroyed()), pt, SLOT(destroyedPopup()) ); + return m; + } + + static void print() { + if( pendingPopups ) + kdDebug( 9007 ) << "PopupTracker: " << pendingPopups << " popups are still alive" << endl; + } + +public slots: + void destroyedPopup() { + --pendingPopups; + } +}; + + +class CodeCompletionEntry; +class CodeInformationRepository; +class SimpleContext; +class SimpleType; +class SimpleTypeNamespace; +class CppCodeCompletionData; +class SimpleTypeConfiguration; +class TypeDesc; +struct PopupFillerHelpStruct; +struct PopupClassViewFillerHelpStruct; +class SimpleTypeImpl; +class TranslationUnitAST; +namespace CppEvaluation +{ + class EvaluationResult; +} +struct ExpressionInfo; + +typedef KSharedPtr TypePointer; + +class CppCodeCompletion : public QObject +{ + Q_OBJECT +public: + friend class SimpleType; + enum CompletionMode + { + NormalCompletion, + SignalCompletion, + SlotCompletion, + VirtualDeclCompletion + }; + enum MemberAccessOp + { + NoOp, + DotOp, + ArrowOp + }; + +public: + CppCodeCompletion( CppSupportPart* part ); + virtual ~CppCodeCompletion(); + + CodeInformationRepository* repository() + { + return m_repository; + } + CompletionMode completionMode() const + { + return m_completionMode; + } + + QString createTypeInfoString( int line, int column ); + + QString replaceCppComments( const QString& contents ); + int expressionAt( const QString& text, int index ); + QStringList splitExpression( const QString& text ); + + CppEvaluation::EvaluationResult evaluateExpression( ExpressionInfo expr, SimpleContext* ctx ); + + CppEvaluation::EvaluationResult evaluateExpressionAt( int line, int column, SimpleTypeConfiguration& conf, bool ifUnknownSetType = false ); + + void contextEvaluationMenus ( QPopupMenu *popup, const Context *context, int line, int col ); + + CppSupportPart* cppSupport() const; + + HashedStringSet getIncludeFiles( const QString& file = QString() ); + + static CppCodeCompletion* instance() { + return m_instance; + } + + ///Adds a string that will be ticked through the status-bar + void addStatusText( QString text, int timeout ); + void clearStatusText(); + + QString activeFileName() const { + return m_activeFileName; + } + +public slots: + /** + * @param invokedOnDemand if true and there is exactly one matching entry + * complete the match immediately without showing the completion box. + * This is only true, when the users invokes the completion himself + * (eg presses the completion shortcut CTRL+space) + */ + void completeText( bool invokedOnDemand = false ); +private slots: + void emptyCache(); + void slotPartAdded( KParts::Part *part ); + void slotActivePartChanged( KParts::Part *part ); + void slotArgHintHidden(); + void slotCompletionBoxHidden(); + void slotTextChanged(); + void slotFileParsed( const QString& fileName ); + void slotCodeModelUpdated( const QString& fileName ); + void slotTimeout(); + void slotStatusTextTimeout(); + void computeFileEntryList(); + bool isTypeExpression( const QString& expr ); + void slotTextHint( int line, int col, QString &text ); + void popupAction( int number ); + void popupDefinitionAction( int number ); + void popupClassViewAction( int number ); + void synchronousParseReady( const QString& file, ParsedFilePointer unit ); + void slotJumpToDefCursorContext(); + void slotJumpToDeclCursorContext(); + +private: + enum FunctionType { Declaration, Definition }; + + TypePointer createGlobalNamespace(); + bool functionContains( FunctionDom f , int line, int col ); + void getFunctionBody( FunctionDom f , int& line, int& col ); + void selectItem( ItemDom item ); + void addTypePopups( QPopupMenu* parent, TypeDesc d, QString depthAdd, QString prefix = "" ); + void addTypeClassPopups( QPopupMenu* parent, TypeDesc d, QString depthAdd, QString prefix = "" ); + QValueList computeSignatureList( CppEvaluation::EvaluationResult function ); + void integratePart( KParts::Part* part ); + void setupCodeInformationRepository(); + FunctionDefinitionAST* functionDefinition( AST* node ); + void computeRecoveryPoints( ParsedFilePointer unit ); + void computeRecoveryPointsLocked(); + void jumpCursorContext( FunctionType ); + bool getIncludeInfo( int line, QString& includeFileName, QString& includeFilePath, bool& usedProjectFiles ); + + enum EvaluateExpressionOptions { + IncludeStandardExpressions = 1, + IncludeTypeExpression = 2, + CompletionOption = 4, ///Cut off the last word because it is incomplete + SearchInFunctions = 8, + SearchInClasses = 16, + DefaultAsTypeExpression = 32, ///This makes the evaluation interpret any unidentified expression as a type-expression + DefaultEvaluationOptions = 1 | 2 | 8 | 16, + DefaultCompletionOptions = 1 | 4 | 8 | 16 + }; + + bool mayBeTypeTail( int line, int column, QString& append, bool inFunction = false ); + bool canBeTypePrefix( const QString& prefix, bool inFunction = false ); + + + ExpressionInfo findExpressionAt( int line, int col, int startLine, int startCol, bool inFunction = false ); + SimpleContext* computeFunctionContext( FunctionDom f, int line, int col, SimpleTypeConfiguration& conf ); + + CppEvaluation::EvaluationResult evaluateExpressionType( int line, int column, SimpleTypeConfiguration& conf, EvaluateExpressionOptions opt = DefaultCompletionOptions ); + SimpleType unTypeDef( SimpleType scope , QMap& typedefs ); + + // QString buildSignature( TypePointer currType ); + SimpleType typeOf( QValueList& tags, MemberAccessOp accessOp ); + + /// @todo remove isInstance + void computeCompletionEntryList( QValueList& entryList, SimpleContext* ctx, bool isInstance, int depth = 0 ); + void computeCompletionEntryList( SimpleType type, QValueList& + entryList, const QStringList& typeList, SimpleTypeNamespace* ns, std::set& ignore, bool isInstance, int depth = 0 ); + void computeCompletionEntryList( SimpleType type, QValueList& + entryList, const QStringList& typeList, bool isInstance, int depth = 0 ); + void computeCompletionEntryList( SimpleType type, QValueList& entryList, QValueList& tags, bool isInstance, int depth ); + void computeCompletionEntryList( SimpleType type, QValueList& entryList, ClassDom klass, bool isInstance, int depth ); + void computeCompletionEntryList( SimpleType type, QValueList& entryList, NamespaceDom scope, bool isInstance, int depth ); + void computeCompletionEntryList( SimpleType type, QValueList& entryList, const FunctionList& methods, bool isInstance, int depth ); + void computeCompletionEntryList( SimpleType type, QValueList& entryList, const VariableList& attributes, bool isInstance, int depth ); + void computeCompletionEntryList( QString parent, SimpleType type, QValueList& entryList, const ClassList& lst, bool isInstance, int depth ); + void computeCompletionEntryList( QString parent, SimpleType type, QValueList& entryList, const TypeAliasList& lst, bool isInstance, int depth ); + void computeCompletionEntryList( SimpleType type, QValueList& entryList, const NamespaceList& lst, bool isInstance, int depth ); + + SimpleContext* computeContext( FunctionDefinitionAST* ast, int line, int col, int lineOffset, int colOffset ); + void computeContext( SimpleContext*& ctx, StatementAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, StatementListAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, IfStatementAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, ForStatementAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, DoStatementAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, WhileStatementAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, SwitchStatementAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, TryBlockStatementAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, CatchStatementListAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, CatchStatementAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, DeclarationStatementAST* ast, int line, int col ); + void computeContext( SimpleContext*& ctx, ConditionAST* ast, int line, int col ); + bool inContextScope( AST* ast, int line, int col, bool checkStart = true, bool checkEnd = true ); + + QString getText( int startLine, int startColumn, int endLine, int endColumn, int omitLine = -1 ); + + +private: + + friend class SimpleTypeCatalog; + friend class SimpleTypeCodeModel; + friend class SimpleTypeImpl; + friend class ExpressionEvaluation; + friend class PopupFillerHelpStruct; + friend class PopupClassViewFillerHelpStruct; + QGuardedPtr m_pSupport; + QTimer* m_ccTimer; + QTimer* m_showStatusTextTimer; + QValueList > m_statusTextList; + + void fitContextItem( int nLine, int nColumn ); + void needRecoveryPoints(); + + QString m_activeFileName; + KTextEditor::ViewCursorInterface* m_activeCursor; + KTextEditor::EditInterface* m_activeEditor; + KTextEditor::TextHintInterface* m_activeHintInterface; + KTextEditor::CodeCompletionInterface* m_activeCompletion; + KTextEditor::View* m_activeView; + + bool m_bArgHintShow; + bool m_bCompletionBoxShow; + bool m_blockForKeyword; + bool m_demandCompletion; + + unsigned int m_ccLine; + unsigned int m_ccColumn; + static CppCodeCompletion* m_instance; + + CodeInformationRepository* m_repository; + CppCodeCompletionData* d; + CompletionMode m_completionMode; + + QTime m_lastHintTime; + + //If more then the given count of comments were requested, all following ones will be blank.(Performance-reasons) + void setMaxComments( int count ); + + QString commentFromItem( const SimpleType& parent, const ItemDom& item ); + QString commentFromTag( const SimpleType& parent, Tag& tag ); + + ItemDom m_cachedFromContext; ///Can be a function or a class, representing the position from where the last completion was started. Necessary as long as all imports are put into the global namespace. + + QRegExp m_includeRx; + QRegExp m_cppCodeCommentsRx; + QRegExp m_codeCompleteChRx; + QRegExp m_codeCompleteCh2Rx; + QValueList m_fileEntryList; + + int m_maxComments; + + typedef QMap PopupActions; + typedef QMap PopupClassViewActions; + PopupActions m_popupActions; + PopupActions m_popupDefinitionActions; + PopupClassViewActions m_popupClassViewActions; + + // we need something to plug actions that are not in any menu + // into in order for their shortcuts to work + QWidget m_DummyActionWidget; +}; + +#endif +// kate: indent-mode csands; tab-width 4; diff --git a/languages/cpp/cppcodecompletionconfig.cpp b/languages/cpp/cppcodecompletionconfig.cpp new file mode 100644 index 00000000..2c394858 --- /dev/null +++ b/languages/cpp/cppcodecompletionconfig.cpp @@ -0,0 +1,151 @@ +// +// +// C++ Implementation: $MODULE$ +// +// Description: +// +// +// Author: Roberto Raggi , (C) 2003 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "cppcodecompletionconfig.h" +#include "cppsupportpart.h" + +#include + +#include +#include + +QString CppCodeCompletionConfig::defaultPath = QString::fromLatin1( "/kdevcppsupport/codecompletion" ); + +CppCodeCompletionConfig::CppCodeCompletionConfig( CppSupportPart * part, QDomDocument* dom ) + : QObject( part ), m_part( part ), m_dom( dom ) +{ + init(); +} + +CppCodeCompletionConfig::~CppCodeCompletionConfig() +{} + +void CppCodeCompletionConfig::init( ) +{ +/* m_includeGlobalFunctions = DomUtil::readBoolEntry( *m_dom, defaultPath + "/includeGlobalFunctions", true ); + m_includeTypes = DomUtil::readBoolEntry( *m_dom, defaultPath + "/includeTypes", true ); + m_includeEnums = DomUtil::readBoolEntry( *m_dom, defaultPath + "/includeEnums", true ); + m_includeTypedefs = DomUtil::readBoolEntry( *m_dom, defaultPath + "/includeTypedefs", false );*/ + m_automaticCodeCompletion = DomUtil::readBoolEntry( *m_dom, defaultPath + "/automaticCodeCompletion", false ); + m_automaticArgumentsHint = DomUtil::readBoolEntry( *m_dom, defaultPath + "/automaticArgumentsHint", true ); + m_automaticHeaderCompletion = DomUtil::readBoolEntry( *m_dom, defaultPath + "/automaticHeaderCompletion", true ); + m_codeCompletionDelay = DomUtil::readIntEntry( *m_dom, defaultPath + "/codeCompletionDelay", 250 ); + m_argumentsHintDelay = DomUtil::readIntEntry( *m_dom, defaultPath + "/argumentsHintDelay", 400 ); + m_headerCompletionDelay = DomUtil::readIntEntry( *m_dom, defaultPath + "/headerCompletionDelay", 250 ); + + m_showOnlyAccessibleItems = DomUtil::readBoolEntry( *m_dom, defaultPath + "/showOnlyAccessibleItems", false ); + m_completionBoxItemOrder = (CompletionBoxItemOrder)DomUtil::readIntEntry( *m_dom, defaultPath + "/completionBoxItemOrder", ByAccessLevel ); + m_showEvaluationContextMenu = DomUtil::readBoolEntry( *m_dom, defaultPath + "/howEvaluationContextMenu", true ); + m_showCommentWithArgumentHint = DomUtil::readBoolEntry( *m_dom, defaultPath + "/showCommentWithArgumentHint", true ); + m_statusBarTypeEvaluation = DomUtil::readBoolEntry( *m_dom, defaultPath + "/statusBarTypeEvaluation", false ); + m_namespaceAliases = DomUtil::readEntry( *m_dom, defaultPath + "/namespaceAliases", "std=_GLIBCXX_STD;__gnu_cxx=std" ); + m_processPrimaryTypes = DomUtil::readBoolEntry( *m_dom, defaultPath + "/processPrimaryTypes", true ); + m_processFunctionArguments = DomUtil::readBoolEntry( *m_dom, defaultPath + "/processFunctionArguments", false ); + + m_preProcessAllHeaders = DomUtil::readBoolEntry( *m_dom, defaultPath + "/preProcessAllHeaders", false ); + m_parseMissingHeaders = DomUtil::readBoolEntry( *m_dom, defaultPath + "/parseMissingHeadersExperimental", false ); + m_resolveIncludePaths = DomUtil::readBoolEntry( *m_dom, defaultPath + "/resolveIncludePathsUsingMakeExperimental", false ); + m_alwaysParseInBackground = DomUtil::readBoolEntry( *m_dom, defaultPath + "/alwaysParseInBackground", true ); + m_usePermanentCaching = DomUtil::readBoolEntry( *m_dom, defaultPath + "/usePermanentCaching", true ); + m_alwaysIncludeNamespaces = DomUtil::readBoolEntry( *m_dom, defaultPath + "/alwaysIncludeNamespaces", false ); + m_includePaths = DomUtil::readEntry( *m_dom, defaultPath + "/includePaths", ".;" ); + + +} + +void CppCodeCompletionConfig::store( ) +{ +/* DomUtil::writeBoolEntry( *m_dom, defaultPath + "/includeGlobalFunctions", m_includeGlobalFunctions ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/includeTypes", m_includeTypes ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/includeEnums", m_includeEnums ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/includeTypedefs", m_includeTypedefs );*/ + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/automaticCodeCompletion", m_automaticCodeCompletion ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/automaticArgumentsHint", m_automaticArgumentsHint ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/automaticHeaderCompletion", m_automaticHeaderCompletion ); + DomUtil::writeIntEntry( *m_dom, defaultPath + "/codeCompletionDelay", m_codeCompletionDelay ); + DomUtil::writeIntEntry( *m_dom, defaultPath + "/argumentsHintDelay", m_argumentsHintDelay ); + DomUtil::writeIntEntry( *m_dom, defaultPath + "/headerCompletionDelay", m_headerCompletionDelay ); + + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/showOnlyAccessibleItems", m_showOnlyAccessibleItems ); + DomUtil::writeIntEntry( *m_dom, defaultPath + "/completionBoxItemOrder", m_completionBoxItemOrder ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/howEvaluationContextMenu", m_showEvaluationContextMenu ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/showCommentWithArgumentHint", m_showCommentWithArgumentHint ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/statusBarTypeEvaluation", m_statusBarTypeEvaluation ); + DomUtil::writeEntry( *m_dom, defaultPath + "/namespaceAliases", m_namespaceAliases ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/processPrimaryTypes", m_processPrimaryTypes ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/processFunctionArguments", m_processFunctionArguments ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/preProcessAllHeaders", m_preProcessAllHeaders ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/parseMissingHeadersExperimental", m_parseMissingHeaders ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/resolveIncludePathsUsingMakeExperimental", m_resolveIncludePaths ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/alwaysParseInBackground", m_alwaysParseInBackground ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/usePermanentCaching", m_usePermanentCaching ); + DomUtil::writeBoolEntry( *m_dom, defaultPath + "/alwaysIncludeNamespaces", m_alwaysIncludeNamespaces ); + DomUtil::writeEntry( *m_dom, defaultPath + "/includePaths", m_includePaths ); + + emit stored(); +} + +// void CppCodeCompletionConfig::setIncludeTypes( bool b ) +// { +// m_includeTypes = b; +// } +// +// void CppCodeCompletionConfig::setIncludeEnums( bool b ) +// { +// m_includeEnums = b; +// } +// +// void CppCodeCompletionConfig::setIncludeTypedefs( bool b ) +// { +// m_includeTypedefs = b; +// } + +void CppCodeCompletionConfig::setAutomaticCodeCompletion( bool b ) +{ + m_automaticCodeCompletion = b; +} + +void CppCodeCompletionConfig::setAutomaticArgumentsHint( bool b ) +{ + m_automaticArgumentsHint = b; +} + +void CppCodeCompletionConfig::setCodeCompletionDelay( int delay ) +{ + m_codeCompletionDelay = delay; +} + +void CppCodeCompletionConfig::setArgumentsHintDelay( int delay ) +{ + m_argumentsHintDelay = delay; +} + +// void CppCodeCompletionConfig::setIncludeGlobalFunctions( bool b ) +// { +// m_includeGlobalFunctions = b; +// } + +void CppCodeCompletionConfig::setHeaderCompletionDelay( int delay ) +{ + m_headerCompletionDelay = delay; +} + +void CppCodeCompletionConfig::setAutomaticHeaderCompletion( bool b ) +{ + m_automaticHeaderCompletion = b; +} + +bool CppCodeCompletionConfig::showNamespaceAppearances() const { + return true; +} + +#include "cppcodecompletionconfig.moc" diff --git a/languages/cpp/cppcodecompletionconfig.h b/languages/cpp/cppcodecompletionconfig.h new file mode 100644 index 00000000..13b23ccf --- /dev/null +++ b/languages/cpp/cppcodecompletionconfig.h @@ -0,0 +1,310 @@ +// +// +// C++ Interface: $MODULE$ +// +// Description: +// +// +// Author: Roberto Raggi , (C) 2003 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef CPPCODECOMPLETIONCONFIG_H +#define CPPCODECOMPLETIONCONFIG_H + +#include + +class CppSupportPart; +class QDomDocument; + + +/** +@author Roberto Raggi +*/ +class CppCodeCompletionConfig : public QObject +{ + Q_OBJECT +public: + CppCodeCompletionConfig( CppSupportPart* part, QDomDocument* dom ); + virtual ~CppCodeCompletionConfig(); + +// bool includeGlobalFunctions() const +// { +// return m_includeGlobalFunctions; +// } +// +// void setIncludeGlobalFunctions( bool b ); +// +// bool includeTypes() const +// { +// return m_includeTypes; +// } +// +// void setIncludeTypes( bool b ); +// +// bool includeEnums() const +// { +// return m_includeEnums; +// } +// +// void setIncludeEnums( bool b ); +// +// bool includeTypedefs() const +// { +// return m_includeTypedefs; +// } +// +// void setIncludeTypedefs( bool b ); + + enum CompletionBoxItemOrder { + ByAccessLevel, + ByClass, + ByAlphabet + }; + + ///Whether the completion-cache should be kept alive as long as the context does not change + bool usePermanentCaching() const { + return m_usePermanentCaching; + } + + void setUsePermanentCaching(bool b) { + m_usePermanentCaching = b; + } + + ///Whether higher namespaces(like the global one) should be included while computing the + ///completion-list when using automatic code-completion. Should get an option in the interface(slows down the completion). + bool alwaysIncludeNamespaces() const { + return m_alwaysIncludeNamespaces; + } + + void setAlwaysIncludeNamespaces(bool b) { + m_alwaysIncludeNamespaces = b; + } + + ///Whether all included headers should be processed by the preprocessor(makes macros work across header-files) + void setPreProcessAllHeaders(bool b) { + m_preProcessAllHeaders = b; + } + + ///Whether headers that were found and were not yet parsed in their active state should be parsed into the code-model + void setParseMissingHeaders(bool b) { + m_parseMissingHeaders = b; + } + + ///Additional include-paths defined by the user + void setCustomIncludePaths(QString str) { + m_includePaths = str; + } + + ///Whether we should try to automatically find out the used include-path from Makefiles etc. + void setResolveIncludePaths(bool b) { + m_resolveIncludePaths = b; + } + + ///Whether higher namespaces(like the global one) should be included while computing the + ///completion-list when using automatic code-completion. Should get an option in the interface(slows down the completion). + + ///Whether all included headers should be processed by the preprocessor(makes macros work across header-files) + bool preProcessAllHeaders() const { + return m_preProcessAllHeaders; + } + + ///Whether headers that were found and were not yet parsed in their active state should be parsed into the code-model + bool parseMissingHeaders() const { + return m_parseMissingHeaders; + } + + ///Additional include-paths defined by the user + QString customIncludePaths() const { + return m_includePaths; + } + + ///Whether we should try to automatically find out the used include-path from Makefiles etc. + bool resolveIncludePaths() const { + return m_resolveIncludePaths; + } + + bool alwaysParseInBackground() const { + return m_alwaysParseInBackground; + } + + void setAlwaysParseInBackground(bool b) { + m_alwaysParseInBackground = b; + } + + bool showNamespaceAppearances() const; + + bool showOnlyAccessibleItems() const { + ///not yet used + return m_showOnlyAccessibleItems; + } + + CompletionBoxItemOrder completionBoxItemOrder() const { + ///not yet used + return m_completionBoxItemOrder; + } + + bool showEvaluationContextMenu() const { + ///used + return m_showEvaluationContextMenu; + } + + bool showCommentWithArgumentHint() const { + ///used + return m_showCommentWithArgumentHint; + } + + bool statusBarTypeEvaluation() const { + ///used + return m_statusBarTypeEvaluation; + } + + QString namespaceAliases() const { + ///used + return m_namespaceAliases; + } + + bool processPrimaryTypes() const { ///The "do complete return-type-evaluation" entry. However it should be renamed, because it also covers Variable-types and typedefs! + ///used + return m_processPrimaryTypes; + } + + bool processFunctionArguments() const { ///The "do complete argument-type-evaluation" entry + ///used + return m_processFunctionArguments; + } + + + void setShowOnlyAccessibleItems( bool b ) { + ///not yet used + m_showOnlyAccessibleItems = b; + } + + void setCompletionBoxItemOrder( CompletionBoxItemOrder b ) { + ///not yet used + m_completionBoxItemOrder = b; + } + + void setShowEvaluationContextMenu( bool b ) { + ///used + m_showEvaluationContextMenu = b; + } + + void setShowCommentWithArgumentHint( bool b ) { + ///used + m_showCommentWithArgumentHint = b; + } + + void setStatusBarTypeEvaluation( bool b ) { + ///used + m_statusBarTypeEvaluation = b; + } + + void setNamespaceAliases( QString n ) { + ///used + m_namespaceAliases = n; + } + + void setProcessPrimaryTypes( bool b ) { ///The "do complete return-type-evaluation" entry. However it should be renamed, because it also covers Variable-types and typedefs! + ///used + m_processPrimaryTypes = b; + } + + void setProcessFunctionArguments( bool b ) { ///The "do complete argument-type-evaluation" entry + ///used + m_processFunctionArguments = b; + } + + bool automaticCodeCompletion() const { + return m_automaticCodeCompletion; + } + + + void setAutomaticCodeCompletion( bool b ); + + bool automaticArgumentsHint() const + { + ///used + return m_automaticArgumentsHint; + } + + void setAutomaticArgumentsHint( bool b ); + + bool automaticHeaderCompletion() const + { + ///used + return m_automaticHeaderCompletion; + } + + void setAutomaticHeaderCompletion( bool b ); + + int codeCompletionDelay() const + { + ///used + return m_codeCompletionDelay; + } + + void setCodeCompletionDelay( int delay ); + + int argumentsHintDelay() const + { + ///used + return m_argumentsHintDelay; + } + + void setArgumentsHintDelay( int delay ); + + int headerCompletionDelay() const + { + ///used + return m_headerCompletionDelay; + } + + void setHeaderCompletionDelay( int delay ); + +public slots: + void store(); + +signals: + void stored(); + +private: + void init(); + +private: + CppSupportPart* m_part; + QDomDocument* m_dom; +/* bool m_includeGlobalFunctions; + bool m_includeTypes; + bool m_includeEnums; + bool m_includeTypedefs;*/ + bool m_automaticCodeCompletion; + bool m_automaticArgumentsHint; + bool m_automaticHeaderCompletion; + int m_codeCompletionDelay; + int m_argumentsHintDelay; + int m_headerCompletionDelay; + + bool m_preProcessAllHeaders; + bool m_parseMissingHeaders; + bool m_resolveIncludePaths; + bool m_alwaysIncludeNamespaces; + bool m_alwaysParseInBackground; + bool m_usePermanentCaching; + QString m_includePaths; + + bool m_showOnlyAccessibleItems; + CompletionBoxItemOrder m_completionBoxItemOrder; + bool m_showEvaluationContextMenu; + bool m_showCommentWithArgumentHint; + bool m_statusBarTypeEvaluation; + QString m_namespaceAliases; + bool m_processPrimaryTypes; + bool m_processFunctionArguments; + + static QString defaultPath; +}; + +#endif +// kate: indent-mode csands; tab-width 4; diff --git a/languages/cpp/cppevaluation.cpp b/languages/cpp/cppevaluation.cpp new file mode 100644 index 00000000..ff1f4ab9 --- /dev/null +++ b/languages/cpp/cppevaluation.cpp @@ -0,0 +1,483 @@ +/*************************************************************************** + begin : Sat Jul 21 2001 + copyright : (C) 2001 by Victor R�er + email : victor_roeder@gmx.de + copyright : (C) 2002,2003 by Roberto Raggi + email : roberto@kdevelop.org + copyright : (C) 2005 by Adam Treat + email : manyoso@yahoo.com + copyright : (C) 2006 by David Nolden + email : david.nolden.kdevelop@art-master.de +***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "cppevaluation.h" +#include "simplecontext.h" +#include "safetycounter.h" + +extern SafetyCounter safetyCounter; + +namespace CppEvaluation { + +void statusLog( const QString& str ) { + ifVerboseMajor( dbgMajor() << str << endl ); + statusBarText( str, 2000 ); +} +OperatorSet AllOperators; + +///These lines register the operators to the list of all operators +RegisterOperator< DotOperator > DotReg( AllOperators ); +RegisterOperator< NestedTypeOperator > NestedReg( AllOperators ); +RegisterOperator< ArrowOperator > ArrowReg( AllOperators ); +RegisterOperator< StarOperator > StarReg( AllOperators ); +RegisterOperator< AddressOperator > AddressReg( AllOperators ); +RegisterOperator< IndexOperator > IndexReg( AllOperators ); +RegisterOperator< ParenOperator > ParenReg( AllOperators ); + +template +QValueList convertList( const QValueList& from ) { + QValueList ret; + for( typename QValueList::const_iterator it = from.begin(); it != from.end(); ++it ) { + ret << (To)*it; + } + return ret; +} + +QString nameFromType( SimpleType t ) { + return t->fullTypeResolved(); +} + +QString Operator::printTypeList( QValueList& lst ) +{ + QString ret; + for( QValueList::iterator it = lst.begin(); it != lst.end(); ++it ) { + ret += "\"" + (*it)->fullNameChain() + "\", "; + } + ret.truncate( ret.length() - 3 ); + return ret; +} + +void Operator::log( const QString& msg ) { + statusLog( "\"" + name() + "\": " + msg ); + //ifVerboseMajor( dbgMajor() << "\"" << name() << "\": " << msg << endl ); +} + +OperatorSet::~OperatorSet() { + for( QValueList< Operator* >::iterator it = m_operators.begin(); it != m_operators.end(); ++it ) { + delete *it; + } +} + +OperatorIdentification OperatorSet::identifyOperator( const QString& str_ , Operator::BindingSide allowedBindings) { + QString str = str_.stripWhiteSpace(); + for( OperatorList::iterator it = m_operators.begin(); it != m_operators.end(); ++it ) { + if( ((*it)->binding() & allowedBindings) == (*it)->binding() ) { + if( OperatorIdentification ident = (*it)->identify( str ) ) { + return ident; + } + } + } + + return OperatorIdentification(); +} + +OperatorIdentification UnaryOperator::identify( QString& str ) { + OperatorIdentification ret; + if( str.startsWith( m_identString ) ) { + ret.start = 0; + ret.end = m_identString.length(); + ret.found = true; + ret.op = this; + } + return ret; +} + +EvaluationResult UnaryOperator::apply( QValueList params, QValueList innerParams ) { + if( !checkParams( params ) ) { + log( QString("parameter-check failed: %1 params: ").arg( params.size() ) + printTypeList( params ) ); + return EvaluationResult(); + } else { + EvaluationResult t = unaryApply( params.front(), innerParams ); + if( !t ) { + if( params.front() ) + log( "could not apply \"" + name() + "\" to \"" + nameFromType( params.front() ) + "\""); + else + log( "operator \"" + name() + "\" applied on \"" + nameFromType( params.front() ) + "\": returning unresolved type \"" + nameFromType( t ) + "\""); + } + return t; + } +} + +EvaluationResult NestedTypeOperator::unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ) { + return param; +} + +EvaluationResult DotOperator::unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ) { + if( param->totalPointerDepth() == 0 ) { + return param; + } else { + log( "failed to apply dot-operator to " + param->fullNameChain() + " because the pointer-depth is wrong" ); + return EvaluationResult(); + } +} + + +EvaluationResult ArrowOperator::unaryApply( EvaluationResult param, const QValueList& innerParams ) { + if( param->totalPointerDepth() == 1 ) { + param->setTotalPointerDepth( param->totalPointerDepth() - 1 ); + return param; + } else { + if( param->resolved() ) { + if( param->totalPointerDepth() == 0 ) { + return param->resolved()->applyOperator( SimpleTypeImpl::ArrowOp , convertList(innerParams) ); + } else { + log("failed to apply arrow-operator to " + param->fullNameChain() + " because the pointer-depth is wrong" ); + return EvaluationResult(); + } + } else { + log( "failed to apply arrow-operator to unresolved type" ); + return EvaluationResult(); + } + }; +} + +EvaluationResult StarOperator::unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ) { + if( param->totalPointerDepth() > 0 ) { + param->setTotalPointerDepth( param->totalPointerDepth() - 1 ); + return param; + } else { + if( param->resolved() ) { + return param->resolved()->applyOperator( SimpleTypeImpl::StarOp ); + } else { + log( "failed to apply star-operator to unresolved type" ); + return EvaluationResult(); + } + }; +} + +EvaluationResult AddressOperator::unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ) { + param->setTotalPointerDepth( param->totalPointerDepth() + 1 ); + return param; +} + +OperatorIdentification UnaryParenOperator::identify( QString& str ) { + OperatorIdentification ret; + if( str.startsWith( QString( identString()[0] ) ) ) { + ret.start = 0; + ret.end = findClose( str, 0 ); + if( ret.end == -1 ) { + ret.found = false; + ret.end = 0; + } else { + if( str[ret.end] == identString()[1] ) { + ret.found = true; + ret.end += 1; + ret.op = this; + + ///Try to extract the parameter-strings. + ParamIterator it( identString(), str.mid( ret.start, ret.end - ret.start ) ); + + while( it ) { + ret.innerParams << (*it).stripWhiteSpace(); + + ++it; + } + + } else { + ret.end = 0; + } + } + } + return ret; +} + + +EvaluationResult IndexOperator::unaryApply( EvaluationResult param, const QValueList& innerParams ) { + if( param->totalPointerDepth() > 0 ) { + param->setTotalPointerDepth( param->totalPointerDepth() - 1 ); + return param; + } else { + if( param->resolved() ) { + return param->resolved()->applyOperator( SimpleTypeImpl::IndexOp, convertList( innerParams ) ); + } else { + log( "failed to apply index-operator to unresolved type" ); + return EvaluationResult(); + } + }; +} + +EvaluationResult ParenOperator::unaryApply( EvaluationResult param, const QValueList& innerParams ) { + if( param ) { + if( param->resolved() ) { + return param->resolved()->applyOperator( SimpleTypeImpl::ParenOp, convertList(innerParams) ); + } else { + log( "failed to apply paren-operator to unresolved type" ); + return EvaluationResult(); + } + + } else { + return innerParams[0]; + } +} + +ExpressionEvaluation::ExpressionEvaluation( CppCodeCompletion* data, ExpressionInfo expr, OperatorSet& operators, const HashedStringSet& includeFiles, SimpleContext* ctx ) : m_data( data ), m_ctx( ctx ), m_expr( expr ), m_global(false), m_operators( operators ), m_includeFiles( includeFiles ) { + safetyCounter.init(); + + ifVerboseMajor( dbgMajor( ) << "Initializing evaluation of expression " << expr << endl ); + + if ( expr.expr().startsWith( "::" ) ) + { + expr.setExpr( expr.expr().mid( 2 ) ); + m_global = true; + } + + //m_expr = m_data->splitExpression( expr.expr() ).join(""); +} + +EvaluationResult ExpressionEvaluation::evaluate() { + EvaluationResult res; + res = evaluateExpressionInternal( m_expr.expr(), m_ctx->global(), m_ctx, m_ctx, /*m_expr.canBeTypeExpression() cannot be safely determined*/true ); + + ExpressionInfo ex = res.expr; ///backup and set the type which was chosen while the evaluation-process + res.expr = m_expr; + res.expr.t = ex.t; + + return res; +} + +EvaluationResult ExpressionEvaluation::evaluateExpressionInternal( QString expr, EvaluationResult scope, SimpleContext * ctx, SimpleContext* innerCtx , bool canBeTypeExpression) { + LogDebug d( "#evl#" ); + if( expr.isEmpty() || !safetyCounter ) { + scope.expr.t = ExpressionInfo::NormalExpression; + return scope; + } + + /*if( !scope->resolved() ) { + ifVerboseMajor( dbgMajor() << "evaluateExpressionInternal(\"" << expr << "\") scope: \"" << scope->fullTypeStructure() << "\" is unresolved " << endl ); + return EvaluationResult(); + }*/ + + ifVerboseMajor( dbgMajor() << "evaluateExpressionInternal(\"" << expr << "\") scope: \"" << scope->fullNameChain() << "\" context: " << ctx << endl ); + + expr = expr.stripWhiteSpace(); + + ///Find the rightmost operator with the lowest priority, for the first split. + QValueList idents; + for( uint a = 0; a < expr.length(); ++a ) { + QString part = expr.mid( a ); + OperatorIdentification ident = m_operators.identifyOperator( part ); + if( ident ) { + ifVerboseMajor( dbgMajor() << "identified \"" << ident.op->name() << "\" in string " << part << endl ); + ident.start += a; + ident.end += a; + idents << ident; + a += ident.end; + } else { + if( isLeftParen( part[0] ) ) { + int jump = findClose( part, 0 ); + if( jump != -1 ) + a += jump; + } + } + } + + if( !idents.isEmpty() ) { + OperatorIdentification lowest; + + for( QValueList::iterator it = idents.begin(); it != idents.end(); ++it ) { + if( lowest ) { + if( lowest.op->priority() >= (*it).op->priority() ) + lowest = *it; + } else { + lowest = *it; + } + } + + if( lowest ) { + QString leftSide = expr.left( lowest.start ).stripWhiteSpace(); + QString rightSide = expr.right( expr.length() - lowest.end ).stripWhiteSpace(); + + EvaluationResult left, right; + if( !leftSide.isEmpty() ) { + left = evaluateExpressionInternal( leftSide, scope, ctx, innerCtx, lowest.op->canBeType( Operator::Left ) ); + } else { + left = scope; + } + + if( !left && (lowest.op->binding() & Operator::Left) ) { + ifVerboseMajor( dbgMajor() << "problem while evaluating expression \"" << expr << "\", the operator \"" << lowest.op->name() << "\" has a binding to the left side, but no left side could be evaluated: \"" << leftSide << "\"" << endl ); + } + + if( !rightSide.isEmpty() && (lowest.op->binding() & Operator::Right) ) + right = evaluateExpressionInternal( rightSide, SimpleType(), ctx, innerCtx, lowest.op->canBeType( Operator::Right ) ); + + if( !right && (lowest.op->binding() & Operator::Right) ) { + ifVerboseMajor( dbgMajor() << "problem while evaluating expression \"" << expr << "\", the operator \"" << lowest.op->name() << "\" has a binding to the right side, but no right side could be evaluated: \"" << rightSide << "\"" << endl ); + } + + QValueList innerParams; + QValueList params; + if( lowest.op->binding() & Operator::Left ) params << left; + if( lowest.op->binding() & Operator::Right ) params << right; + + for( QValueList::iterator it = lowest.innerParams.begin(); it != lowest.innerParams.end(); ++it ) { + ifVerboseMajor(dbgMajor() << "evaluating inner parameter \"" + *it + "\"" ); + innerParams << evaluateExpressionInternal( (*it), SimpleType(), innerCtx, innerCtx, lowest.op->canBeType( Operator::Neutral ) ); + } + + EvaluationResult applied = lowest.op->apply( params, innerParams ); + if( !applied ) { + statusLog( "\"" + expr + "\": failed to apply the operator \"" + lowest.op->name() + "\"" ); + } + + if( ! (lowest.op->binding() & Operator::Left) && !leftSide.isEmpty() ) { + ///When the operator has no binding to the left, the left side should be empty. + statusLog( "\"" + expr + "\": problem with the operator \"" + lowest.op->name() + ", it has no binding to the left side, but the left side is \""+ leftSide + "\"" ); + } + + if( ! (lowest.op->binding() & Operator::Right) && !rightSide.isEmpty() ) { + ///When the operator has no binding to the right, we should continue evaluating the right side, using the left type as scope. + ///Think about this. + return evaluateExpressionInternal( rightSide, applied, 0, innerCtx, lowest.op->canBeType( Operator::Right ) ); + } + + return applied; + } else { + ifVerboseMajor( dbgMajor() << " could not find an operator in " << expr << endl ); + return evaluateAtomicExpression( expr, scope, ctx ); + } + } + + //dbgMajor() << " could not evaluate " << expr << endl; + ifVerboseMajor( dbgMajor() << "evaluating \"" << expr << "\" as atomic expression" << endl ); + + TypeDesc exp = m_ctx->container()->resolveTemplateParams( TypeDesc(expr) ); + + ifVerboseMajor( dbgMajor() << "after template-parameter resolution: \"" << exp.fullNameChain() << "\"" << endl ); + + EvaluationResult res = evaluateAtomicExpression( exp, scope, ctx, canBeTypeExpression ); + return res; +} + +/**This function needs a clean workover. + * An atomic expression is one that only consists of a type-, function- or variable-name(may include '::') + */ +EvaluationResult ExpressionEvaluation::evaluateAtomicExpression( TypeDesc expr, EvaluationResult scope, SimpleContext * ctx, bool canBeTypeExpression ) { + LogDebug d( "#evt#"); + if( !safetyCounter || !d ) return SimpleType(); + bool canBeItemExpression = true; ///To be implemented + + if( scope ) { + expr.setIncludeFiles( scope.resultType->includeFiles() ); + } else { + expr.setIncludeFiles( m_includeFiles ); + } + + + ifVerboseMajor( dbgMajor() << "evaluateAtomicExpression(\"" << expr.name() << "\") scope: \"" << scope->fullNameChain() << "\" context: " << ctx << endl ); + + EvaluationResult bestRet; + int bestDepth = 0; + + if( expr.name().isEmpty() ) + return scope; + + TypePointer searchIn = scope->resolved(); + if( !searchIn ) { + statusLog( "scope-type is not resolved" ); + return EvaluationResult(); + } + + if( ctx ) + searchIn = ctx->container().get(); + + if( ctx && canBeItemExpression ) { + ///Search for variables and functions, first in the current context, and then through the container-classes upwards. + // find the variable in the current context + SimpleVariable var = ctx->findVariable( expr.name() ); + + if ( var.type ) { + TypeDesc d( var.type ); + d.setIncludeFiles( m_includeFiles ); + EvaluationResult ret = EvaluationResult( ctx->container()->locateDecType( d ), var.toDeclarationInfo( "current_file" )); + ret.expr.t = ExpressionInfo::NormalExpression; + return ret; + } + + SimpleType current = ctx->container(); + + SimpleTypeImpl::TypeOfResult type; + + SafetyCounter s( 20 ); + bool ready = false; + int depth = 0; + + while( !ready && s ) + { + if( !current ) ready = true; + + type = current->typeOf( expr ); + if ( type) { + bestRet = EvaluationResult( type.type, type.decl ); + bestDepth = depth; + bestRet.expr = expr.fullNameChain(); + bestRet.expr.t = ExpressionInfo::NormalExpression; + } + + depth++; + if( !ready ) current = current->parent(); + } + } + /* + if( scope.expr.t & ExpressionInfo::TypeExpression ) + canBeTypeExpression = true;*/ + + if( canBeItemExpression && (!bestRet || bestDepth > 0 ) ) { + //SimpleTypeImpl:: + SimpleTypeImpl::TypeOfResult res = searchIn->typeOf( expr ); + + if( res ) { + bestRet = EvaluationResult( res.type, res.decl ); + bestDepth = 0; + } + } + if( canBeTypeExpression ) { + ///Search for Types + LocateResult type = searchIn->locateDecType( expr ); + + if( !bestRet || + /** Did we find a constructor within a class? */ + (type->resolved() && ( bestRet->resolved() && type->resolved()->desc() == bestRet->resolved()->parent()->desc() && bestRet->resolved()->asFunction() ) ) ) { + /*if ( type && type->resolved() ) + {*/ + EvaluationResult ret = type; + ret.expr = expr.fullNameChain(); + ret.expr.t = ExpressionInfo::TypeExpression; + bestRet = ret; + } + /*} else { + bestRet = EvaluationResult( type ); + QStringList s = split+exprList; + s.pop_front(); + if( !s.isEmpty() ) + bestRet->append( new TypeDescShared( s.join("::") ) ); + }*/ + } + + if( bestRet ) + return bestRet; + + ifVerboseMajor( dbgMajor() << "evaluateAtomicExpression: \"" << scope.resultType->fullNameChain() << "\"could not locate " << expr.fullNameChain() << endl ); + return bestRet; +} +} + +// kate: indent-mode csands; tab-width 2; diff --git a/languages/cpp/cppevaluation.h b/languages/cpp/cppevaluation.h new file mode 100644 index 00000000..e4adeb28 --- /dev/null +++ b/languages/cpp/cppevaluation.h @@ -0,0 +1,367 @@ +/*************************************************************************** + begin : Sat Jul 21 2001 + copyright : (C) 2001 by Victor R�er + email : victor_roeder@gmx.de + copyright : (C) 2002,2003 by Roberto Raggi + email : roberto@kdevelop.org + copyright : (C) 2005 by Adam Treat + email : manyoso@yahoo.com + copyright : (C) 2006 by David Nolden + email : david.nolden.kdevelop@art-master.de +***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef CPPEVALUATION_H +#define CPPEVALUATION_H + +#include + +#include "expressioninfo.h" +#include "simpletype.h" +#include "declarationinfo.h" +#include + +class SimpleContext; + +void statusBarText( const QString& str, int time = 1000 ); + +namespace CppEvaluation { + +template +extern QValueList convertList( const QValueList& from ); + +extern QString nameFromType( SimpleType t ); + +class Operator; + +struct OperatorIdentification { + QValueList innerParams; /** Inner parameters of the operator( for the vec["hello"] the "hello" ) */ + int start, end; /** Range the operator occupies */ + bool found; + Operator* op; ///Can be 0 ! + + OperatorIdentification() : start( 0 ), end( 0 ), found( false ), op( 0 ) {} + + operator bool() { + return found; + } +}; + + +class EvaluationResult { + public: + EvaluationResult& operator = ( const EvaluationResult& rhs ) { + resultType = rhs.resultType; + sourceVariable = rhs.sourceVariable; + expr = rhs.expr; + isMacro = rhs.isMacro; + macro = rhs.macro; + return *this; + } + + EvaluationResult( const EvaluationResult& rhs ) : resultType( rhs.resultType ), expr( rhs.expr ), sourceVariable( rhs.sourceVariable ), isMacro( rhs.isMacro ), macro( rhs.macro ) {} + + LocateResult resultType; ///The resulting type + + ExpressionInfo expr; ///Information about the expression that was processed + + DeclarationInfo sourceVariable; ///If the type comes from a variable, this stores Information about it + + bool isMacro; + Macro macro; + + ///should be removed + EvaluationResult( SimpleType rhs ) : isMacro( false ) { + if ( rhs.get() != 0 ) + resultType = rhs->desc(); + } + + EvaluationResult( LocateResult tp = TypeDesc(), DeclarationInfo var = DeclarationInfo() ) : resultType( tp ), sourceVariable( var ), isMacro( false ) {} + + /*operator TypeDesc () const { + return (TypeDesc)resultType; + }*/ + + ///This must be removed + operator SimpleType() const { + if ( resultType->resolved() ) { + return SimpleType( resultType->resolved() ); + } else { + return SimpleType( new SimpleTypeImpl( ( TypeDesc ) resultType ) ); + } + } + + TypeDesc* operator -> () { + return & resultType.desc(); + } + + operator LocateResult () const { + return resultType; + } + + operator bool() const { + return ( bool ) resultType; + } +}; + + + +class Operator { + public: + enum BindingSide { + Neutral = 0, + Left = 1, + Right = 2 + }; + enum Type { + Unary = 1, + Binary = 2, + Ternary = 3 + }; + + virtual ~Operator() {} + + virtual int priority() = 0; + + virtual Type type() = 0; + virtual int paramCount() = 0; + + ///"binding" means that the operator needs the evaluated type of the expression on that side + ///The types of all bound sides will later be sent in the "params"-list of the apply-function + virtual BindingSide binding() = 0; ///The side to which the operator binds + + ///When this returns true, the ident-structure must be filled correctly + virtual OperatorIdentification identify( QString& str ) = 0; + + ///params + virtual EvaluationResult apply( QValueList params, QValueList innerParams ) = 0; + + virtual QString name() = 0; + + ///Should return whether the item it the given side can be a type(Neutral stands for the inner paremeters) + virtual bool canBeType( BindingSide side ) { + return true; + } + + protected: + void log( const QString& msg ); + QString printTypeList( QValueList& lst ); +}; + + +class OperatorSet { + private: + typedef QValueList< Operator* > OperatorList; + OperatorList m_operators; + public: + OperatorSet() {} + + ~OperatorSet(); + + void registerOperator( Operator* op ) { + m_operators << op; + } + + OperatorIdentification identifyOperator( const QString& str_ , Operator::BindingSide allowedBindings = ( Operator::BindingSide ) ( Operator::Left | Operator::Right | Operator::Neutral ) ); + +}; +extern OperatorSet AllOperators; + + +template +class RegisterOperator { + public: + RegisterOperator( OperatorSet& set + ) { + set.registerOperator( new OperatorType() ); + } + ~RegisterOperator() {} +} +; + + +class UnaryOperator : public Operator { + public: + UnaryOperator( int priority , QString identString, QString description, Operator::BindingSide binding ) : Operator(), m_priority( priority ), m_identString( identString ), m_name( description ), m_binding( binding ) {} + + virtual int priority() { + return m_priority; + } + + virtual Operator::Type type() { + return Operator::Unary; + } + + virtual Operator::BindingSide binding() { + return m_binding; + } + + virtual int paramCount() { + return 1; + } + + virtual OperatorIdentification identify( QString& str ); + + virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList& innerParams ) = 0; + + virtual bool checkParams( const QValueList& params ) { + return !params.isEmpty() && params[ 0 ]; + } + + virtual EvaluationResult apply( QValueList params, QValueList innerParams ); + + virtual QString name() { + return m_name; + } + + private: + int m_priority; + QString m_identString; + QString m_name; + Operator::BindingSide m_binding; + protected: + + QString identString() const { + return m_identString; + } + +}; + + +class NestedTypeOperator : public UnaryOperator { + public: + NestedTypeOperator() : UnaryOperator( 18, "::", "nested-type-operator", Operator::Left ) {} + + virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ); +}; + +//RegisterOperator< NestedTypeOperator > NestedTypeReg( AllOperators ); ///This registers the operator to the list of all operators + +class DotOperator : public UnaryOperator { + public: + DotOperator() : UnaryOperator( 17, ".", "dot-operator", Operator::Left ) {} + + virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ); + + virtual bool canBeType( BindingSide side ) { + return false; + } +}; + +class ArrowOperator : public UnaryOperator { + public: + ArrowOperator() : UnaryOperator( 17, "->", "arrow-operator", Operator::Left ) {} + + virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList& innerParams ); + + virtual bool canBeType( BindingSide side ) { + return false; + } +}; + + +class StarOperator : public UnaryOperator { + public: + StarOperator() : UnaryOperator( 15, "*", "star-operator", Operator::Right ) { ///Normally this should have a priority of 16, but that would need changes to the expression-parsin g-loop + } + + virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ); + + virtual bool canBeType( BindingSide side ) { + return false; + } +}; + + +class AddressOperator : public UnaryOperator { + public: + AddressOperator() : UnaryOperator( 16, "&", "address-operator", Operator::Right ) {} + + virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ); + + virtual bool canBeType( BindingSide side ) { + return false; + } +}; + + +class UnaryParenOperator : public UnaryOperator { + public: + ///Identstring should be both parens, for Example "[]" or "()" + UnaryParenOperator( int priority , QString identString, QString description, Operator::BindingSide binding ) : UnaryOperator( priority, identString, description, binding ) {} + + virtual OperatorIdentification identify( QString& str ); + + virtual bool canBeType( BindingSide side ) { + return false; + } +}; + +class IndexOperator : public UnaryParenOperator { + public: + IndexOperator() : UnaryParenOperator( 17, "[]", "index-operator", Operator::Left ) {} + + virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList& innerParams ); + + virtual bool canBeType( BindingSide side ) { + return false; + } +}; + + +class ParenOperator : public UnaryParenOperator { + public: + ParenOperator() : UnaryParenOperator( 16, "()", "paren-operator", Operator::Left ) {} + + virtual bool checkParams( const QValueList& params ) { + return !params.isEmpty(); + } + + virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList& innerParams ); + + virtual bool canBeType( BindingSide side ) { + return false; + } +}; + +//This is used in CppCodeCompletion::evaluateExpression(..) +class ExpressionEvaluation { + private: + CppCodeCompletion* m_data; + SimpleContext* m_ctx; + ExpressionInfo m_expr; + bool m_global; + OperatorSet& m_operators; + HashedStringSet m_includeFiles; + + public: + ExpressionEvaluation( CppCodeCompletion* data, ExpressionInfo expr, OperatorSet& operators, const HashedStringSet& includeFiles, SimpleContext* ctx = 0 ); + + EvaluationResult evaluate(); + + private: + /** + recursion-method: + 1. Find the rightmost operator with the lowest priority, split the expression + + vector[ (*it)->position ](). + */ + virtual EvaluationResult evaluateExpressionInternal( QString expr, EvaluationResult scope, SimpleContext * ctx, SimpleContext* innerCtx , bool canBeTypeExpression = true ); + + ///Locates types or members + EvaluationResult evaluateAtomicExpression( TypeDesc expr, EvaluationResult scope, SimpleContext * ctx = 0, bool canBeTypeExpression = true ); +}; + + +} + +#endif +// kate: indent-mode csands; tab-width 4; diff --git a/languages/cpp/cppimplementationwidget.cpp b/languages/cpp/cppimplementationwidget.cpp new file mode 100644 index 00000000..c00c9b05 --- /dev/null +++ b/languages/cpp/cppimplementationwidget.cpp @@ -0,0 +1,100 @@ +/*************************************************************************** +* Copyright (C) 2004 by Alexander Dymo * +* adymo@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License as * +* published by the Free Software Foundation; either version 2 of the * +* License, or (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ +#include "cppimplementationwidget.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +CppImplementationWidget::CppImplementationWidget( KDevLanguageSupport *part, + QWidget *parent, const char *name, bool modal ) + : ImplementationWidget( part, parent, name, modal ) +{} + +QStringList CppImplementationWidget::createClassFiles() +{ + QString template_h = "#ifndef $DEFTEXT$_H\n#define $DEFTEXT$_H\n\n#include \"$BASEINCLUDE$\"\n\nclass $CLASSNAME$: public $BASECLASSNAME$ {\nQ_OBJECT\npublic:\n $CLASSNAME$(QWidget *parent = 0, const char *name = 0);\n};\n\n#endif\n"; + QString template_cpp = "#include \"$CLASSINCLUDE$\"\n\n$CLASSNAME$::$CLASSNAME$(QWidget *parent, const char *name)\n :$BASECLASSNAME$(parent, name)\n{\n}\n"; + if ( m_part->project() ->options() == KDevProject::UsesAutotoolsBuildSystem ) + template_cpp += "\n#include \"$MOCINCLUDE$\"\n"; + + QFileInfo formInfo( m_formName ); + template_h.replace( QRegExp( "\\$BASEINCLUDE\\$" ), formInfo.baseName() + ".h" ); + template_h.replace( QRegExp( "\\$CLASSNAME\\$" ), classNameEdit->text() ); + template_h.replace( QRegExp( "\\$BASECLASSNAME\\$" ), m_baseClassName ); + template_h.replace( QRegExp( "\\$DEFTEXT\\$" ), fileNameEdit->text().upper() ); + + template_cpp.replace( QRegExp( "\\$CLASSINCLUDE\\$" ), fileNameEdit->text() + ".h" ); + template_cpp.replace( QRegExp( "\\$CLASSNAME\\$" ), classNameEdit->text() ); + template_cpp.replace( QRegExp( "\\$BASECLASSNAME\\$" ), m_baseClassName ); + template_cpp.replace( QRegExp( "\\$MOCINCLUDE\\$" ), fileNameEdit->text() + ".moc" ); + + template_h = FileTemplate::read( m_part, "h" ) + template_h; + template_cpp = FileTemplate::read( m_part, "cpp" ) + template_cpp; + + QString file_h = fileNameEdit->text() + ".h"; + QString file_cpp = fileNameEdit->text() + ".cpp"; + if ( !m_part->project() ->activeDirectory().isEmpty() ) + { + file_h = m_part->project() ->activeDirectory() + "/" + file_h; + file_cpp = m_part->project() ->activeDirectory() + "/" + file_cpp; + } + + QFile ifile( QDir::cleanDirPath( m_part->project() ->projectDirectory() + "/" + file_cpp ) ); + if ( !ifile.open( IO_WriteOnly ) ) + { + KMessageBox::error( this, i18n( "Cannot write to implementation file" ) ); + return QStringList(); + } + QTextStream istream( &ifile ); + istream << template_cpp; + ifile.close(); + + QFile hfile( QDir::cleanDirPath( m_part->project() ->projectDirectory() + "/" + file_h ) ); + if ( !hfile.open( IO_WriteOnly ) ) + { + KMessageBox::error( this, i18n( "Cannot write to header file" ) ); + return QStringList(); + } + QTextStream hstream( &hfile ); + hstream << template_h; + hfile.close(); + + QStringList fileList; + fileList.append( file_h ); + fileList.append( file_cpp ); + + return fileList; +} + +#include "cppimplementationwidget.moc" diff --git a/languages/cpp/cppimplementationwidget.h b/languages/cpp/cppimplementationwidget.h new file mode 100644 index 00000000..d10045db --- /dev/null +++ b/languages/cpp/cppimplementationwidget.h @@ -0,0 +1,43 @@ +/*************************************************************************** +* Copyright (C) 2004 by Alexander Dymo * +* adymo@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License as * +* published by the Free Software Foundation; either version 2 of the * +* License, or (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ +#ifndef CPPIMPLEMENTATIONWIDGET_H +#define CPPIMPLEMENTATIONWIDGET_H + +#include + +#include + +class KListViewItem; +class CppSupportPart; + +class CppImplementationWidget : public ImplementationWidget +{ + Q_OBJECT +public: + CppImplementationWidget( KDevLanguageSupport *part, QWidget* parent = 0, const char* name = 0, bool modal = false ); + +protected: + virtual QStringList createClassFiles(); +}; + +#endif +// kate: indent-mode csands; tab-width 4; + + diff --git a/languages/cpp/cppnewclassdlg.cpp b/languages/cpp/cppnewclassdlg.cpp new file mode 100644 index 00000000..b941b46e --- /dev/null +++ b/languages/cpp/cppnewclassdlg.cpp @@ -0,0 +1,2242 @@ +/*************************************************************************** +* Copyright (C) 1998 by Sandy Meier * +* smeier@rz.uni-potsdam.de * +* Copyright (C) 1999 by Benoit.Cerrina * +* Benoit.Cerrina@writeme.com * +* Copyright (C) 2002 by Bernd Gehrmann * +* bernd@kdevelop.org * +* Copyright (C) 2003 by Eray Ozkural * +* * +* Copyright (C) 2003-2004 by Alexander Dymo * +* adymo@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#include "cppnewclassdlg.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cppsupportpart.h" +#include "kdevproject.h" +#include "kdevsourceformatter.h" +#include "kdevcoderepository.h" +#include "kdevpartcontroller.h" +#include "backgroundparser.h" +#include "domutil.h" +#include "filetemplate.h" +#include "storeconverter.h" +#include "qtbuildconfig.h" + +#include "classgeneratorconfig.h" + +QString QRegExp_escape( const QString& str ) +{ +#if QT_VERSION >= 0x030100 + return QRegExp::escape( str ); +#else + // this block is copyrighted by Trolltech AS (GPL) + static const char meta[] = "$()*+.?[\\]^{|}"; + QString quoted = str; + int i = 0; + + while ( i < ( int ) quoted.length() ) + { + if ( strchr( meta, quoted[ i ].latin1() ) != 0 ) + quoted.insert( i++, "\\" ); + i++; + } + return quoted; +#endif +} + +CppNewClassDialog::CppNewClassDialog( CppSupportPart *part, QWidget *parent, const char *name ) + : CppNewClassDialogBase( parent, name ), myModel( 0 ) +{ + headerModified = false; + baseincludeModified = false; + implementationModified = false; + m_part = part; + // read file template configuration + // KDevProject *project = part->project(); + QDomDocument &dom = *part->projectDom(); + interface_url = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/interfaceURL" ); + implementation_url = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/implementationURL" ); + interface_suffix = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/interfacesuffix", ".h" ); + implementation_suffix = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/implementationsuffix", ".cpp" ); + lowercase_filenames = DomUtil::readBoolEntry( dom, "/cppsupportpart/filetemplates/lowercasefilenames", true ); + m_parse = DomUtil::readEntry( *m_part->projectDom(), "/cppsupportpart/newclass/filenamesetting", "none" ); + // name_handler_combo->setCurrentText(m_parse); + baseclasses_view->setSorting( -1 ); + constructors_view->setSorting( -1 ); + + accessMenu = new QPopupMenu( this ); + accessMenu->insertItem( i18n( "Use as Private" ), + this, SLOT( changeToPrivate() ), 0, 1 ); + accessMenu->insertItem( i18n( "Use as Protected" ), + this, SLOT( changeToProtected() ), 0, 2 ); + accessMenu->insertItem( i18n( "Use as Public" ), + this, SLOT( changeToPublic() ), 0, 3 ); + accessMenu->insertSeparator(); + accessMenu->insertItem( i18n( "Unset" ), + this, SLOT( changeToInherited() ), 0, 5 ); + + overMenu = new QPopupMenu( this ); + overMenu->insertItem( i18n( "Extend Base Class Functionality" ), + this, SLOT( extendFunctionality() ), 0, 11 ); + overMenu->insertItem( i18n( "Replace Base Class Method" ), + this, SLOT( replaceFunctionality() ), 0, 12 ); + + compBasename = basename_edit->completionObject(); + setCompletionBasename( m_part->codeModel() ); + compNamespace = namespace_edit->completionObject(); + setCompletionNamespaceRecursive( m_part->codeModel() ->globalNamespace() ); + classname_edit->setFocus(); + + // enable/disable qt options for non qt projects + childclass_box->setEnabled( m_part->qtBuildConfig()->isUsed() ); + qobject_box->setEnabled( m_part->qtBuildConfig()->isUsed() ); +} + + +CppNewClassDialog::~CppNewClassDialog() +{ + delete compBasename; + delete compNamespace; + delete myModel; +} + +void CppNewClassDialog::setCompletionBasename( CodeModel *model ) +{ + compBasename->clear(); + + // Import selected namespace without qualifier + NamespaceDom namespaceDom = model->globalNamespace(); + + QStringList::const_iterator it = currNamespace.begin(); + for ( ; it != currNamespace.end() ; ++it ) + { + if ( ! namespaceDom->hasNamespace( *it ) ) + break; + namespaceDom = namespaceDom->namespaceByName( *it ); + } + + if ( it == currNamespace.end() ) + // complete namespace has been found (not breaked) + compBasename->insertItems( sortedNameList( namespaceDom -> classList() ) ); + + addCompletionBasenameNamespacesRecursive( model->globalNamespace() ); + + QStringList compItems = compBasename->items(); + it = compItems.begin(); + for ( int i = 0; + it != compItems.end(); ++it, ++i ) + kdDebug( 9007 ) << "compBasename->items()[" << i << "] = \"" << *it << "\"" << endl; +} + +QStringList& gres( QStringList &list, const QRegExp & rx, const QString & after ) +{ + QStringList::Iterator it = list.begin(); + while ( it != list.end() ) + { + ( *it ).replace( rx, after ); + ++it; + } + return list; +} + +void CppNewClassDialog::addCompletionBasenameNamespacesRecursive( const NamespaceDom & namespaceDom, + const QString & namespaceParent ) +{ + // Add classes of this namespace + QStringList classList = sortedNameList( namespaceDom -> classList() ); + + if ( ! namespaceParent.isEmpty() ) + { +#if QT_VERSION >= 0x030200 + classList.gres( QRegExp( "^" ), namespaceParent + "::" ); +#else + + gres( classList, QRegExp( "^" ), namespaceParent + "::" ); +#endif + + } + + compBasename -> insertItems( classList ); + + + // Recursion + NamespaceList namespaceList = namespaceDom->namespaceList(); + NamespaceList::const_iterator it = namespaceList.begin(); + + for ( ; it != namespaceList.end() ; ++it ) + { + QString fullNamespace; + + if ( ! namespaceParent.isEmpty() ) + fullNamespace = namespaceParent + "::"; + + fullNamespace += ( *it ) -> name(); + addCompletionBasenameNamespacesRecursive( *it, fullNamespace ); + } +} + + +void CppNewClassDialog::setCompletionNamespaceRecursive( const NamespaceDom & namespaceDom, const QString & namespaceParent ) +{ + NamespaceList namespaceList = namespaceDom->namespaceList(); + NamespaceList::const_iterator it = namespaceList.begin(); + for ( ; it != namespaceList.end() ; ++it ) + { + QString fullNamespace; + + if ( ! namespaceParent.isEmpty() ) + fullNamespace = namespaceParent + "::"; + + fullNamespace += ( *it ) -> name(); + kdDebug( 9007 ) << "compNamespace -> addItem( \"" << fullNamespace << "\" )" << endl; + compNamespace -> addItem( fullNamespace ); + setCompletionNamespaceRecursive( *it, fullNamespace ); + } +} + +void CppNewClassDialog::nameHandlerChanged( const QString &text ) +{ + DomUtil::writeEntry( *m_part->projectDom(), "/cppsupportpart/newclass/filenamesetting", text ); + m_parse = text; + classNameChanged( classname_edit->text() ); +} + +void CppNewClassDialog::classNameChanged( const QString &text ) +{ + QString str = text; + + if ( !headerModified ) + { + QString header = str + interface_suffix; + switch ( gen_config->fileCase() ) + { + case ClassGeneratorConfig::LowerCase: + header = header.lower(); + break; + case ClassGeneratorConfig::UpperCase: + header = header.upper(); + break; + default: + ; + } + header = header.replace( QRegExp( "(template *<.*> *)?(class +)?" ), "" ); + header_edit->setText( header ); + } + if ( !implementationModified ) + { + QString implementation; + if ( str.contains( "template" ) ) + implementation = str + "_impl" + interface_suffix; + else + implementation = str + implementation_suffix; + switch ( gen_config->fileCase() ) + { + case ClassGeneratorConfig::LowerCase: + implementation = implementation.lower(); + break; + case ClassGeneratorConfig::UpperCase: + implementation = implementation.upper(); + break; + default: + ; + } + implementation = implementation.replace( QRegExp( "(template *<.*> *)?(class +)?" ), "" ); + implementation_edit->setText( implementation ); + } +} + +void CppNewClassDialog::classNamespaceChanged( const QString &text ) +{ + currNamespace = QStringList::split( QString( "::" ), text ); + setCompletionBasename( m_part -> codeModel() ); + reloadAdvancedInheritance( true ); +} + +void CppNewClassDialog::baseclassname_changed( const QString &text ) +{ + if ( ( basename_edit->hasFocus() ) && ( !baseincludeModified ) ) + { + QString header = text; + + // handle Qt classes in a special way. + if( m_part->qtBuildConfig()->isUsed() && header.startsWith( "Q" ) ) + { + if( m_part->qtBuildConfig()->version() == 3 ) + { + header = header.lower() + ".h"; + } + else if( m_part->qtBuildConfig()->version() == 4 ) + { + // 1:1, e.g QObject is #include + } + } + else + { + if ( header.contains( QRegExp( "::" ) ) ) + header = header.mid( header.findRev( QRegExp( "::" ) ) + 2 ); + header = header.replace( QRegExp( " *<.*>" ), "" ); + header += interface_suffix; + + switch ( gen_config->superCase() ) + { + case ClassGeneratorConfig::LowerCase: + header = header.lower(); + break; + case ClassGeneratorConfig::UpperCase: + header = header.upper(); + break; + default: + ; + } + } + + baseinclude_edit->setText( header ); + } +} + +void CppNewClassDialog::baseIncludeChanged( const QString &text ) +{ + if ( baseinclude_edit->hasFocus() ) + { + baseincludeModified = true; + if ( baseclasses_view->selectedItem() ) + baseclasses_view->selectedItem() ->setText( 4, "true" ); + } + if ( baseclasses_view->selectedItem() ) + { + baseclasses_view->selectedItem() ->setText( 3, text ); + } +} + +void CppNewClassDialog::headerChanged() +{ + // Only if a change caused by the user himself + if ( header_edit->hasFocus() ) + headerModified = true; +} + + +void CppNewClassDialog::implementationChanged() +{ + // Only if a change caused by the user himself + if ( implementation_edit->hasFocus() ) + implementationModified = true; +} + +void CppNewClassDialog::checkObjCInheritance( int val ) +{ + childclass_box->setEnabled( !val && m_part->qtBuildConfig()->isUsed() ); + gtk_box->setEnabled( !val ); + qobject_box->setEnabled( !val && m_part->qtBuildConfig()->isUsed() ); + namespace_edit->setEnabled( !val ); + class_tabs->setTabEnabled( tab2, !val ); + /* virtual_box->setEnabled(!val); + public_button->setEnabled(!val); + protected_button->setEnabled(!val); + private_button->setEnabled(!val);*/ + if ( val && ( baseclasses_view->childCount() > 1 ) ) + if ( KMessageBox::warningContinueCancel( this, + i18n( "Objective C does not support multiple inheritance.\nOnly the first base class in the list will be taken into account." ), + i18n( "Warning" ), KStdGuiItem::cont(), "Check Objective C inheritance rules" ) == KMessageBox::Cancel ) + objc_box->setChecked( false ); +} + +void CppNewClassDialog::checkQWidgetInheritance( int val ) +{ + if ( val ) + { + qobject_box->setEnabled( val && m_part->qtBuildConfig()->isUsed() ); + qobject_box->setChecked( val && m_part->qtBuildConfig()->isUsed() ); + objc_box->setEnabled( !val ); + gtk_box->setEnabled( !val ); + } + else if ( qobject_box->isChecked() ) + { + objc_box->setEnabled( false ); + gtk_box->setEnabled( false ); + } + else + { + objc_box->setEnabled( !val ); + gtk_box->setEnabled( !val ); + } + + + if ( val ) + { + if ( baseclasses_view->childCount() == 0 ) + { + addBaseClass(); + basename_edit->setText( "QWidget" ); + } + /* constructors_cpp_edit->append(classname_edit->text() + "::" + classname_edit->text() + + "(QWidget *parent, const char *name):\n QWidget(parent, name)\n{\n}\n"); + constructors_h_edit->append(classname_edit->text() + "(QWidget *parent, const char *name);\n");*/ + } + + if ( val && ( baseclasses_view->childCount() > 1 ) ) + if ( KMessageBox::warningContinueCancel( this, + i18n( "Multiple inheritance requires QObject derivative to be first and unique in base class list." ), + i18n( "Warning" ), KStdGuiItem::cont(), "Check QWidget inheritance rules" ) == KMessageBox::Cancel ) + childclass_box->setChecked( false ); +} + +void CppNewClassDialog::qobject_box_stateChanged( int val ) +{ + if ( childclass_box->isChecked() ) + return ; + + if ( baseclasses_view->childCount() == 0 ) + { + addBaseClass(); + basename_edit->setText( "QObject" ); + } + + + objc_box->setEnabled( !val ); + gtk_box->setEnabled( !val ); +} + +void CppNewClassDialog::gtk_box_stateChanged( int val ) +{ + class_tabs->setTabEnabled( tab2, !val ); + childclass_box->setEnabled( !val && m_part->qtBuildConfig()->isUsed() ); + objc_box->setEnabled( !val ); + qobject_box->setEnabled( !val && m_part->qtBuildConfig()->isUsed() ); + namespace_edit->setEnabled( !val ); + + basename_edit->setEnabled( !val ); + virtual_box->setEnabled( !val ); + public_button->setEnabled( !val ); + protected_button->setEnabled( !val ); + private_button->setEnabled( !val ); + addbaseclass_button->setEnabled( !val ); + rembaseclass_button->setEnabled( !val ); + upbaseclass_button->setEnabled( !val ); + downbaseclass_button->setEnabled( !val ); + baseclasses_view->setEnabled( !val ); + baseinclude_edit->setEnabled( !val ); +} + + +void CppNewClassDialog::accept() +{ + ClassGenerator generator( *this ); + if ( generator.generate() ) + QDialog::accept(); + +} + +void CppNewClassDialog::setStateOfInheritanceEditors( bool state, bool hideList ) +{ + basename_edit->setEnabled( state ); + virtual_box->setEnabled( state ); + public_button->setEnabled( state ); + protected_button->setEnabled( state ); + private_button->setEnabled( state ); + scope_box->setEnabled( state ); + baseinclude_edit->setEnabled( state ); + if ( state ) + baseclasses_view->setEnabled( state ); + else + baseclasses_view->setEnabled( hideList ? state : true ); + rembaseclass_button->setEnabled( state ); + if ( !state ) + { + upbaseclass_button->setEnabled( state ); + downbaseclass_button->setEnabled( state ); + } +} + +void CppNewClassDialog::addBaseClass() +{ + baseincludeModified = false; + if ( baseclasses_view->selectedItem() ) + baseclasses_view->selectedItem() ->setSelected( false ); + QListViewItem* it = new QListViewItem( baseclasses_view, baseclasses_view->lastItem(), + QString::null, "public", QString( "%1" ).arg( scope_box->currentItem() ), QString::null, "false" ); + setStateOfInheritanceEditors( true ); + public_button->setChecked( true ); + virtual_box->setChecked( false ); + basename_edit->setText( QString::null ); + basename_edit->setFocus(); + baseclasses_view->setSelected( it, true ); +} + +void CppNewClassDialog::remBaseClass() +{ + bool basename_focused = false; + if ( basename_edit->hasFocus() ) + { + basename_focused = true; + basename_edit->clearFocus(); + } + if ( baseclasses_view->selectedItem() ) + { + QListViewItem * it = baseclasses_view->selectedItem(); + remClassFromAdv( it->text( 0 ) ); + baseclasses_view->selectedItem() ->setSelected( false ); + if ( it->itemBelow() ) + baseclasses_view->setSelected( it->itemBelow(), true ); + else if ( it->itemAbove() ) + baseclasses_view->setSelected( it->itemAbove(), true ); + delete it; + if ( baseclasses_view->childCount() == 0 ) + setStateOfInheritanceEditors( false ); + baseincludeModified = false; + } + if ( basename_focused ) + basename_edit->setFocus(); +} + +void CppNewClassDialog::remBaseClassOnly() +{ + if ( baseclasses_view->selectedItem() ) + { + QListViewItem * it = baseclasses_view->selectedItem(); + baseclasses_view->selectedItem() ->setSelected( false ); + if ( it->itemBelow() ) + baseclasses_view->setSelected( it->itemBelow(), true ); + else if ( it->itemAbove() ) + baseclasses_view->setSelected( it->itemAbove(), true ); + delete it; + if ( baseclasses_view->childCount() == 0 ) + setStateOfInheritanceEditors( false ); + baseincludeModified = true; + } +} + +void CppNewClassDialog::remClassFromAdv( QString text ) +{ + // Strip off namespace qualification + if ( text.contains( "::" ) ) + text = text.mid( text.findRev( "::" ) + 2 ); + + removeTemplateParams( text ); + QListViewItem *it = 0; + if ( ( it = access_view->findItem( text, 0 ) ) ) + delete it; + if ( ( it = methods_view->findItem( text, 0 ) ) ) + delete it; + if ( ( it = constructors_view->findItem( text, 0 ) ) ) + { + /// @todo changing constructors text in constructors_cpp_edit + // and constructors_h_edit must be implemented + + /* int *para = new int(1); + int *index = new int(1); + if (constructors_cpp_edit->find(text + "(", true, false, true, para, index)) + { + qWarning("%s( found", text.latin1()); + if (para) constructors_cpp_edit->removeParagraph(*para); + }*/ + delete it; + } +} + +void CppNewClassDialog::currBaseNameChanged( const QString &text ) +{ + if ( baseclasses_view->selectedItem() && ( basename_edit->hasFocus() ) ) + { + if ( class_tabs->isTabEnabled( tab2 ) ) + { + //check for this class in the adv. inheritance lists + //and delete if it exists + remClassFromAdv( baseclasses_view->selectedItem() ->text( 0 ) ); + //parse new base class + parseClass( text, baseclasses_view->selectedItem() ->text( 1 ) ); + } + baseclasses_view->selectedItem() ->setText( 0, text ); + updateConstructorsOrder(); + } +} + +void CppNewClassDialog::currBasePrivateSet() +{ + if ( baseclasses_view->selectedItem() ) + { + setAccessForBase( baseclasses_view->selectedItem() ->text( 0 ), "private" ); + baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + QString( "private" ) ); + } +} + +void CppNewClassDialog::currBaseProtectedSet() +{ + if ( baseclasses_view->selectedItem() ) + { + setAccessForBase( baseclasses_view->selectedItem() ->text( 0 ), "protected" ); + baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + QString( "protected" ) ); + } +} + +void CppNewClassDialog::currBasePublicSet() +{ + if ( baseclasses_view->selectedItem() ) + { + setAccessForBase( baseclasses_view->selectedItem() ->text( 0 ), "public" ); + baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + QString( "public" ) ); + } +} + +void CppNewClassDialog::scopeboxActivated( int value ) +{ + if ( baseclasses_view->selectedItem() ) + { + baseclasses_view->selectedItem() ->setText( 2, QString( "%1" ).arg( value ) ); + } +} + +void CppNewClassDialog::currBaseVirtualChanged( int val ) +{ + if ( baseclasses_view->selectedItem() ) + { + baseclasses_view->selectedItem() ->setText( 1, QString( val ? "virtual " : "" ) + + QString( private_button->isChecked() ? "private" : "" ) + + QString( protected_button->isChecked() ? "protected" : "" ) + + QString( public_button->isChecked() ? "public" : "" ) ); + } +} + +void CppNewClassDialog::currBaseSelected( QListViewItem *it ) +{ + if ( it == 0 ) + { + setStateOfInheritanceEditors( false, false ); + return ; + } + setStateOfInheritanceEditors( true ); + basename_edit->setText( it->text( 0 ) ); + baseinclude_edit->setText( it->text( 3 ) ); + scope_box->setCurrentItem( it->text( 2 ).toInt() ); + if ( it->text( 1 ).contains( "private" ) ) + private_button->setChecked( true ); + else + private_button->setChecked( false ); + if ( it->text( 1 ).contains( "protected" ) ) + protected_button->setChecked( true ); + else + protected_button->setChecked( false ); + if ( it->text( 1 ).contains( "public" ) ) + public_button->setChecked( true ); + else + public_button->setChecked( false ); + if ( it->text( 1 ).contains( "virtual" ) ) + virtual_box->setChecked( true ); + else + virtual_box->setChecked( false ); + checkUpButtonState(); + checkDownButtonState(); + + if ( it->text( 4 ) == "true" ) + baseincludeModified = true; + else + baseincludeModified = false; +} + +void CppNewClassDialog::upbaseclass_button_clicked() +{ + bool basename_focused = false; + if ( basename_edit->hasFocus() ) + { + basename_focused = true; + basename_edit->clearFocus(); + } + if ( baseclasses_view->selectedItem() ) + { + QListViewItem * it = baseclasses_view->selectedItem(); + if ( it->itemAbove() ) + { + QListViewItem * newit; + if ( it->itemAbove() ->itemAbove() ) + newit = new QListViewItem( baseclasses_view, it->itemAbove() ->itemAbove(), + it->text( 0 ), it->text( 1 ), it->text( 2 ), it->text( 3 ), it->text( 4 ) ); + else + newit = new QListViewItem( baseclasses_view, it->text( 0 ), it->text( 1 ), + it->text( 2 ), it->text( 3 ), it->text( 4 ) ); + remBaseClassOnly(); + baseclasses_view->setSelected( newit, true ); + checkUpButtonState(); + updateConstructorsOrder(); + } + } + if ( basename_focused ) + basename_edit->setFocus(); +} + +void CppNewClassDialog::downbaseclass_button_clicked() +{ + bool basename_focused = false; + if ( basename_edit->hasFocus() ) + { + basename_focused = true; + basename_edit->clearFocus(); + } + if ( baseclasses_view->selectedItem() ) + { + QListViewItem * it = baseclasses_view->selectedItem(); + if ( it->itemBelow() ) + { + QListViewItem * newit = new QListViewItem( baseclasses_view, it->itemBelow(), + it->text( 0 ), it->text( 1 ), it->text( 2 ), it->text( 3 ), it->text( 3 ) ); + remBaseClassOnly(); + baseclasses_view->setSelected( newit, true ); + setStateOfInheritanceEditors( true ); + checkDownButtonState(); + updateConstructorsOrder(); + } + } + if ( basename_focused ) + basename_edit->setFocus(); +} + +void CppNewClassDialog::updateConstructorsOrder() +{ + QListViewItemIterator it( baseclasses_view ); + QListViewItem *c_it; + QListViewItem *fc_it = 0; + + while ( it.current() ) + { + if ( ( c_it = constructors_view->findItem( it.current() ->text( 0 ), 0 ) ) ) + { + c_it->moveItem( fc_it ); + fc_it = c_it; + } + ++it; + } +} + + +void CppNewClassDialog::checkUpButtonState() +{ + if ( baseclasses_view->selectedItem() ) + upbaseclass_button->setEnabled( baseclasses_view->selectedItem() ->itemAbove() ); +} + +void CppNewClassDialog::checkDownButtonState() +{ + if ( baseclasses_view->selectedItem() ) + downbaseclass_button->setEnabled( baseclasses_view->selectedItem() ->itemBelow() ); +} + +void CppNewClassDialog::baseclasses_view_selectionChanged() +{ + /* if (baseclasses_view->selectedItem()) + { + setStateOfInheritanceEditors(false, false); + }*/ +} + +void CppNewClassDialog::changeToPrivate() +{ + if ( access_view->selectedItem() ) + access_view->selectedItem() ->setText( 2, "private" ); +} + +void CppNewClassDialog::changeToProtected() +{ + if ( access_view->selectedItem() ) + access_view->selectedItem() ->setText( 2, "protected" ); +} + +void CppNewClassDialog::changeToPublic() +{ + if ( access_view->selectedItem() ) + access_view->selectedItem() ->setText( 2, "public" ); +} + +void CppNewClassDialog::changeToInherited() +{ + if ( access_view->selectedItem() ) + access_view->selectedItem() ->setText( 2, QString::null ); +} + +void CppNewClassDialog::newTabSelected( const QString& /*text*/ ) +{ + /* if (text == i18n("&Advanced Inheritance")) + reloadAdvancedInheritance(true);*/ +} + +void CppNewClassDialog::newTabSelected( QWidget* /*w*/ ) +{ + /* if ( QString(w->name()) == QString("tab2")) + { + reloadAdvancedInheritance(false); + }*/ +} + + +void CppNewClassDialog::reloadAdvancedInheritance( bool clean ) +{ + clearConstructorsList( clean ); + clearMethodsList( clean ); + clearUpgradeList( clean ); + + QListViewItemIterator it( baseclasses_view ); + while ( it.current() ) + { + if ( ! ( it.current() ->text( 0 ).isEmpty() ) ) + { + parseClass( it.current() ->text( 0 ), it.current() ->text( 1 ) ); + } + ++it; + } +} + +void CppNewClassDialog::parseClass( QString clName, QString inheritance ) +{ + // Determine namespace + QStringList clNamespace = currNamespace; + bool clFullQualified = false; + + if ( clName.contains( "::" ) ) + { + // Full qualified, override imported namespace + clFullQualified = true; + int splitpoint = clName.findRev( "::" ); + clNamespace = QStringList::split( "::", clName.left( splitpoint ) ); + clName = clName.mid( splitpoint + 2 ); + } + + kdDebug( 9007 ) << "clFullQualified = " << clFullQualified << endl; + kdDebug( 9007 ) << "clName = " << clName << endl; + QString debMsg = "clNamespace = "; + for ( QStringList::const_iterator it = clNamespace.begin(); + it != clNamespace.end(); ++it ) + debMsg += ( *it ) + "::"; + kdDebug( 9007 ) << debMsg << endl; + + QString templateAdd = templateActualParamsFormatted( clName ); + removeTemplateParams( clName ); + + ClassList myClasses; // = m_part->codeModel()->globalNamespace()->classByName(clName); + + NamespaceDom namespaceDom = m_part->codeModel() ->globalNamespace(); + + QStringList::const_iterator namespaceIt = clNamespace.begin(); + for ( ; namespaceIt != clNamespace.end(); ++namespaceIt ) + { + if ( ! namespaceDom -> hasNamespace( *namespaceIt ) ) + break; + namespaceDom = namespaceDom->namespaceByName( *namespaceIt ); + } + if ( namespaceIt == clNamespace.end() ) + { + // Found specified namespace + myClasses = namespaceDom->classByName( clName ); + // Fall back to global namespace if class was not fully qualified and is not found in selected namespace + if ( myClasses.empty() && ! clFullQualified ) + myClasses = m_part -> codeModel() -> globalNamespace() -> classByName( clName ); + } + + if ( myClasses.empty() ) + { + kdDebug() << "Trying persistent class store..." << endl; + parsePCSClass( clName, inheritance ); + } + + for ( ClassList::const_iterator classIt = myClasses.begin(); classIt != myClasses.end(); ++classIt ) + { + PCheckListItem *it = new PCheckListItem( *classIt, constructors_view, ( *classIt ) ->name() ); + it->templateAddition = templateAdd; + PListViewItem *over = new PListViewItem( *classIt, methods_view, ( *classIt ) ->name() ); + over->templateAddition = templateAdd; + QListViewItem *over_methods = new QListViewItem( over, i18n( "Methods" ) ); + QListViewItem *over_slots = new QListViewItem( over, i18n( "Slots (Qt-specific)" ) ); + PListViewItem *access = new PListViewItem( *classIt, access_view, ( *classIt ) ->name() ); + QListViewItem *access_methods = new QListViewItem( access, i18n( "Methods" ) ); + QListViewItem *access_slots = new QListViewItem( access, i18n( "Slots (Qt-specific)" ) ); + QListViewItem *access_attrs = new QListViewItem( access, i18n( "Attributes" ) ); + + FunctionList functionList = ( *classIt ) ->functionList(); + for ( FunctionList::const_iterator methodIt = functionList.begin(); + methodIt != functionList.end(); ++methodIt ) + { + if ( ( *methodIt ) ->isSignal() ) + { + // don't show signals as overridable methods + } + else if ( isConstructor( ( *classIt ) ->name(), *methodIt ) ) + { + addToConstructorsList( it, *methodIt ); + } + else if ( ( *methodIt ) ->isSlot() ) + { + if ( ( *methodIt ) ->access() != CodeModelItem::Private ) + { + addToMethodsList( over_slots, *methodIt ); + + QString inhModifier; + //protected inheritance gives protected attributes + if ( inheritance.contains( "protected" ) ) + inhModifier = "protected"; + //private inheritance gives private attributes + else if ( inheritance.contains( "private" ) ) + inhModifier = "private"; + //public inheritance gives protected and public attributes + else if ( inheritance.contains( "public" ) ) + inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; + addToUpgradeList( access_slots, *methodIt, inhModifier ); + } + } + else + { + // display only public and protected methods of the base class + if ( ( !isDestructor( ( *classIt ) ->name(), *methodIt ) ) && ( ( *methodIt ) ->access() != CodeModelItem::Private ) ) + { + addToMethodsList( over_methods, *methodIt ); + + // see what modifier is given for the base class + QString inhModifier; + //protected inheritance gives protected methods + if ( inheritance.contains( "protected" ) ) + inhModifier = "protected"; + //private inheritance gives private methods + else if ( inheritance.contains( "private" ) ) + inhModifier = "private"; + //public inheritance gives protected and public methods + else if ( inheritance.contains( "public" ) ) + inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; + addToUpgradeList( access_methods, *methodIt, inhModifier ); + } + } + } + + VariableList variableList = ( *classIt ) ->variableList(); + for ( VariableList::const_iterator varIt = variableList.begin(); + varIt != variableList.end(); ++varIt ) + { + if ( ( *varIt ) ->access() != CodeModelItem::Private ) + { + QString inhModifier; + //protected inheritance gives protected attributes + if ( inheritance.contains( "protected" ) ) + inhModifier = "protected"; + //private inheritance gives private attributes + else if ( inheritance.contains( "private" ) ) + inhModifier = "private"; + //public inheritance gives protected and public attributes + else if ( inheritance.contains( "public" ) ) + inhModifier = ( *varIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; + addToUpgradeList( access_attrs, *varIt, inhModifier ); + } + } + } +} + +bool CppNewClassDialog::isConstructor( QString className, const FunctionDom &method ) +{ + // regexp: myclass\\s*\\(\\s*(const)?\\s*myclass\\s*&[A-Za-z_0-9\\s]*\\) is for copy constructors + if ( ( className == method->name() ) ) + { + qWarning( "1x" ); + if ( ( method->argumentList().count() == 1 ) && ( m_part->formatModelItem( method->argumentList() [ 0 ].data() ).contains( QRegExp( " *(const)? *" + className + " *& *" ) ) ) ) + // if ( method->asString().contains(QRegExp(className + "\\s*\\(\\s*(const)?\\s*" + className + "\\s*&[A-Za-z_0-9\\s]*\\)", true, false)) ) + return false; + else + return true; + } + else + return false; +} + +void CppNewClassDialog::addToConstructorsList( QCheckListItem *myClass, FunctionDom method ) +{ + new PCheckListItem( method, myClass, m_part->formatModelItem( method.data() ), QCheckListItem::RadioButton ); +} + +void CppNewClassDialog::addToMethodsList( QListViewItem *parent, FunctionDom method ) +{ + PCheckListItem *it = new PCheckListItem( method, parent, m_part->formatModelItem( method.data() ), QCheckListItem::CheckBox ); + method->isAbstract() ? it->setText( 1, i18n( "replace" ) ) : it->setText( 1, i18n( "extend" ) ); +} + +void CppNewClassDialog::addToUpgradeList( QListViewItem *parent, FunctionDom method, QString modifier ) +{ + PListViewItem *it = new PListViewItem( method, parent, m_part->formatModelItem( method.data() ) ); + it->setText( 1, modifier ); +} + +void CppNewClassDialog::addToUpgradeList( QListViewItem *parent, VariableDom attr, QString modifier ) +{ + PListViewItem *it = new PListViewItem( attr, parent, m_part->formatModelItem( attr.data() ) ); + it->setText( 1, modifier ); +} + + +void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance ) +{ + // Determine namespace + QStringList clNamespace = currNamespace; + bool clFullQualified = false; + + if ( clName.contains( "::" ) ) + { + // Full qualified, override imported namespace + clFullQualified = true; + int splitpoint = clName.findRev( "::" ); + clNamespace = QStringList::split( "::", clName.left( splitpoint ) ); + clName = clName.mid( splitpoint + 2 ); + } + + kdDebug( 9007 ) << "clFullQualified = " << clFullQualified << endl; + kdDebug( 9007 ) << "clName = " << clName << endl; + kdDebug( 9007 ) << "clNamespace = " << clNamespace.join( "." ) << endl; + + QString templateAdd = templateActualParamsFormatted( clName ); + removeTemplateParams( clName ); + + myModel = new CodeModel(); + StoreConverter converter( m_part, myModel ); + converter.PCSClassToCodeModel( clName, clNamespace ); + + ClassList myClasses = myModel->globalNamespace() ->classByName( clName ); + // kdDebug() << " tag class count: " << myClasses.count() << endl; + + for ( ClassList::const_iterator classIt = myClasses.begin(); classIt != myClasses.end(); ++classIt ) + { + kdDebug() << " this is class " << ( *classIt ) ->name() << endl; + PCheckListItem *it = new PCheckListItem( *classIt, constructors_view, ( *classIt ) ->name() ); + it->templateAddition = templateAdd; + PListViewItem *over = new PListViewItem( *classIt, methods_view, ( *classIt ) ->name() ); + over->templateAddition = templateAdd; + QListViewItem *over_methods = new QListViewItem( over, i18n( "Methods" ) ); + QListViewItem *over_slots = new QListViewItem( over, i18n( "Slots (Qt-specific)" ) ); + PListViewItem *access = new PListViewItem( *classIt, access_view, ( *classIt ) ->name() ); + QListViewItem *access_methods = new QListViewItem( access, i18n( "Methods" ) ); + QListViewItem *access_slots = new QListViewItem( access, i18n( "Slots (Qt-specific)" ) ); + QListViewItem *access_attrs = new QListViewItem( access, i18n( "Attributes" ) ); + + FunctionList functionList = ( *classIt ) ->functionList(); + for ( FunctionList::const_iterator methodIt = functionList.begin(); + methodIt != functionList.end(); ++methodIt ) + { + if ( ( *methodIt ) ->isSignal() ) + { + //don't show signals as overridable methods + } + else if ( isConstructor( ( *classIt ) ->name(), *methodIt ) ) + { + addToConstructorsList( it, *methodIt ); + } + else if ( ( *methodIt ) ->isSlot() ) + { + if ( ( *methodIt ) ->access() != CodeModelItem::Private ) + { + addToMethodsList( over_slots, *methodIt ); + + QString inhModifier; + //protected inheritance gives protected attributes + if ( inheritance.contains( "protected" ) ) + inhModifier = "protected"; + //private inheritance gives private attributes + else if ( inheritance.contains( "private" ) ) + inhModifier = "private"; + //public inheritance gives protected and public attributes + else if ( inheritance.contains( "public" ) ) + inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; + addToUpgradeList( access_slots, *methodIt, inhModifier ); + } + } + else + { + //display only public and protected methods of the base class + if ( ( !isDestructor( ( *classIt ) ->name(), *methodIt ) ) && ( ( *methodIt ) ->access() != CodeModelItem::Private ) ) + { + addToMethodsList( over_methods, *methodIt ); + + //see what modifier is given for the base class + QString inhModifier; + //protected inheritance gives protected methods + if ( inheritance.contains( "protected" ) ) + inhModifier = "protected"; + //private inheritance gives private methods + else if ( inheritance.contains( "private" ) ) + inhModifier = "private"; + //public inheritance gives protected and public methods + else if ( inheritance.contains( "public" ) ) + inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; + addToUpgradeList( access_methods, *methodIt, inhModifier ); + } + } + } + + VariableList variableList = ( *classIt ) ->variableList(); + for ( VariableList::const_iterator varIt = variableList.begin(); + varIt != variableList.end(); ++varIt ) + { + if ( ( *varIt ) ->access() != CodeModelItem::Private ) + { + QString inhModifier; + //protected inheritance gives protected attributes + if ( inheritance.contains( "protected" ) ) + inhModifier = "protected"; + //private inheritance gives private attributes + else if ( inheritance.contains( "private" ) ) + inhModifier = "private"; + //public inheritance gives protected and public attributes + else if ( inheritance.contains( "public" ) ) + inhModifier = ( *varIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; + addToUpgradeList( access_attrs, *varIt, inhModifier ); + } + } + } +} + +void CppNewClassDialog::clear_selection_button_clicked() +{ + QListViewItemIterator it( constructors_view ); + while ( it.current() ) + { + PCheckListItem *curr; + if ( ( curr = dynamic_cast* >( it.current() ) ) ) + curr->setOn( false ); + ++it; + } +} + +void CppNewClassDialog::clearConstructorsList( bool clean ) +{ + if ( clean ) + constructors_view->clear(); + /* else + { + QListViewItemIterator it( constructors_view ); + while ( it.current() ) + { + if ( ! currBaseClasses.contains(it.current().text(0)) ) + delete it.current(); + ++it; + } + }*/ +} + +void CppNewClassDialog::clearMethodsList( bool clean ) +{ + if ( clean ) + methods_view->clear(); +} + +void CppNewClassDialog::clearUpgradeList( bool clean ) +{ + if ( clean ) + access_view->clear(); +} + +void CppNewClassDialog::setAccessForItem( QListViewItem *curr, QString newAccess, bool isPublic ) +{ + if ( newAccess == "public" ) + curr->setText( 1, isPublic ? "public" : "protected" ); + else + curr->setText( 1, newAccess ); + if ( !curr->text( 2 ).isEmpty() ) + { + if ( ( curr->text( 2 ) == "private" ) && ( ( newAccess == "public" ) || ( newAccess == "protected" ) ) ) + curr->setText( 2, QString::null ); + if ( ( curr->text( 2 ) == "protected" ) && ( ( newAccess == "public" ) && ( isPublic ) ) ) + curr->setText( 2, QString::null ); + } +} + +void CppNewClassDialog::setAccessForBase( QString baseclass, QString newAccess ) +{ + QListViewItem * base; + + if ( ( base = access_view->findItem( baseclass, 0 ) ) ) + { + QListViewItemIterator it( base ); + while ( it.current() ) + { + if ( !it.current() ->text( 1 ).isEmpty() ) + { + PListViewItem *curr; + PListViewItem *curr_m; + if ( ( curr = dynamic_cast* >( it.current() ) ) ) + setAccessForItem( curr, newAccess, curr->item() ->access() == CodeModelItem::Public ); + else if ( ( curr_m = dynamic_cast* >( it.current() ) ) ) + setAccessForItem( curr_m, newAccess, curr_m->item() ->access() == CodeModelItem::Public ); + } + ++it; + } + } +} + + +void CppNewClassDialog::access_view_mouseButtonPressed( int button, QListViewItem * item, const QPoint &p, int /*c*/ ) +{ + if ( item && ( ( button == LeftButton ) || ( button == RightButton ) ) && ( item->depth() > 1 ) ) + { + accessMenu->setItemEnabled( 1, true ); + accessMenu->setItemEnabled( 2, true ); + accessMenu->setItemEnabled( 3, true ); + if ( item->text( 1 ) == "protected" ) + { + accessMenu->setItemEnabled( 1, false ); + } + if ( item->text( 1 ) == "public" ) + { + accessMenu->setItemEnabled( 1, false ); + accessMenu->setItemEnabled( 2, false ); + } + accessMenu->exec( p ); + + /* accessMenu->setItemEnabled(1, item->text(1) == "private" ? false : true ); + accessMenu->setItemEnabled(2, item->text(1) == "protected" ? false : true ); + accessMenu->setItemEnabled(3, item->text(1) == "public" ? false : true );*/ + } +} + + +void CppNewClassDialog::methods_view_mouseButtonPressed( int button , QListViewItem * item, const QPoint&p , int /*c*/ ) +{ + if ( item && ( button == RightButton ) && ( item->depth() > 1 ) && ( ! item->text( 1 ).isEmpty() ) ) + { + overMenu->exec( p ); + } +} + +void CppNewClassDialog::extendFunctionality() +{ + if ( methods_view->selectedItem() ) + methods_view->selectedItem() ->setText( 1, i18n( "extend" ) ); +} + +void CppNewClassDialog::replaceFunctionality() +{ + if ( methods_view->selectedItem() ) + methods_view->selectedItem() ->setText( 1, i18n( "replace" ) ); +} + +void CppNewClassDialog::selectall_button_clicked() +{ + QListViewItemIterator it( constructors_view ); + while ( it.current() ) + { + PCheckListItem *curr; + if ( ( curr = dynamic_cast* >( it.current() ) ) ) + curr->setOn( true ); + ++it; + } +} + +void CppNewClassDialog::to_constructors_list_clicked() +{ + QString templateAdd = templateStrFormatted().isEmpty() ? QString::null : templateStrFormatted() + "\n"; + QString constructor_h = classNameFormatted(); + QString constructor_cpp = templateAdd + classNameFormatted() + templateParamsFormatted() + "::" + classNameFormatted(); + constructor_h += "("; + constructor_cpp += "("; + QString params_h; + QString params_cpp; + QString base; + int unnamed = 1; + + QListViewItemIterator it( constructors_view ); + while ( it.current() ) + { + PCheckListItem *curr; + if ( ( curr = dynamic_cast* >( it.current() ) ) ) + { + if ( curr->isOn() && curr->parent() ) + { + //fill the base classes list + base += base.isEmpty() ? ": " : ", "; + base += curr->parent() ->text( 0 ); + PCheckListItem *p; + if ( ( p = dynamic_cast* >( curr->parent() ) ) ) + { + base += p->templateAddition; + } + params_h += params_h.isEmpty() ? "" : ", "; + + //fill arguments for both constructor and base class initializer + QString cparams; + QString bparams; + ArgumentList argumentList = curr->item() ->argumentList(); + for ( ArgumentList::const_iterator argIt = argumentList.begin(); + argIt != argumentList.end(); ++argIt ) + { + bparams += bparams.isEmpty() ? "" : ", "; + cparams += cparams.isEmpty() ? "" : ", "; + cparams += ( *argIt ) ->type() + " "; + if ( ( *argIt ) ->name().isEmpty() ) + { + cparams += QString( "arg%1" ).arg( unnamed ); + bparams += QString( "arg%1" ).arg( unnamed++ ); + } + else + { + bparams += ( *argIt ) ->name(); + cparams += ( *argIt ) ->name(); + } + if ( !( *argIt ) ->defaultValue().isEmpty() ) + bparams += " = " + ( *argIt ) ->defaultValue(); + } + params_h += cparams; + params_cpp = params_h; + base += "(" + bparams + ")"; + } + } + ++it; + } + + constructor_cpp += params_cpp + ")" + base + QString( "\n{\n}\n\n\n" ); + constructor_h += params_h + ");\n\n"; + + constructors_h_edit->append( constructor_h ); + constructors_cpp_edit->append( constructor_cpp ); +} + + + +/* ---------------------------------------------------------- + ---------------------------------------------------------- + ---------------------------------------------------------- + ---------------------------------------------------------- + + class CppNewClassDialog::ClassGenerator + + ---------------------------------------------------------- + ---------------------------------------------------------- + ---------------------------------------------------------- + ---------------------------------------------------------- */ + + +bool CppNewClassDialog::ClassGenerator::validateInput() +{ + className = dlg.classname_edit->text().simplifyWhiteSpace(); + QString temp = className; + className.replace( QRegExp( "template *<.*> *(class *)?" ), "" ); + templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" ); + templateStr.replace( QRegExp( " *class *$" ), "" ); + + templateParams = templateStr; + templateParams.replace( QRegExp( "^ *template *" ), "" ); + templateParams.replace( QRegExp( " *class *" ), "" ); + templateParams.simplifyWhiteSpace(); + + if ( className.isEmpty() ) + { + KMessageBox::error( &dlg, i18n( "You must enter a classname." ) ); + return false; + } + + header = dlg.header_edit->text().simplifyWhiteSpace(); + if ( header.isEmpty() ) + { + KMessageBox::error( &dlg, i18n( "You must enter a name for the header file." ) ); + return false; + } + implementation = dlg.implementation_edit->text().simplifyWhiteSpace(); + if ( (!headeronly) && implementation.isEmpty() ) + { + KMessageBox::error( &dlg, i18n( "You must enter a name for the implementation file." ) ); + return false; + } + + /// \FIXME + if ( ( header.find( '/' ) != -1 || implementation.find( '/' ) != -1 ) && !( dlg.m_part->project() ->options() & KDevProject::UsesQMakeBuildSystem) ) + { + KMessageBox::error( &dlg, i18n( "Generated files will always be added to the " + "active directory, so you must not give an " + "explicit subdirectory." ) ); + return false; + } + + return true; +} + + +bool CppNewClassDialog::ClassGenerator::generate() +{ + if ( !validateInput() ) + return false; + + project = dlg.m_part->project(); + subDir = project->projectDirectory() + "/"; + if ( !project->activeDirectory().isEmpty() ){ + subDir += project->activeDirectory(); + subDir = QDir::cleanDirPath(subDir); + subDir += "/"; + } + headerPath = subDir + header; + implementationPath = subDir + implementation; + + if ( QFileInfo( headerPath ).exists() || QFileInfo( implementationPath ).exists() ) + { + KMessageBox::error( &dlg, i18n( "KDevelop is not able to add classes " + "to existing header or implementation files." ) ); + return false; + } + + if( ( dlg.m_part->project() ->options() & KDevProject::UsesQMakeBuildSystem) ) + { + QDir dir( QFileInfo( project->projectDirectory()+QString( QChar( QDir::separator() ) )+project->activeDirectory() + QString( QChar( QDir::separator() ) ) + header ).dirPath() ); + kdDebug(9024) << "Dir for new file:" << dir.absPath() << endl; + if( dir.isRelative() ) + dir.convertToAbs(); + + QValueStack dirsToCreate; + while( !dir.exists() ) + { + dirsToCreate.push( dir.dirName() ); + dir.cdUp(); + } + + while( !dirsToCreate.isEmpty() ) + { + dir.mkdir( dirsToCreate.top() ); + dir.cd( dirsToCreate.pop() ); + } + } + common_text(); + + if(!headeronly) gen_implementation(); + + gen_interface(); + + QStringList fileList; + QString file; + if( project->activeDirectory().isEmpty() ) + file = header; + else + file = project->activeDirectory() + "/" + header; + fileList.append ( file ); + if (!headeronly) + { + if( project->activeDirectory().isEmpty() ) + file = implementation; + else + file = project->activeDirectory() + "/" + implementation; + fileList.append ( file ); + } + project->addFiles ( fileList ); + + return true; +} + +void CppNewClassDialog::ClassGenerator::common_text() +{ + + // common + + namespaceStr = dlg.namespace_edit->text(); + namespaces = QStringList::split( QString( "::" ), namespaceStr ); + + childClass = dlg.childclass_box->isChecked(); + objc = dlg.objc_box->isChecked(); + qobject = dlg.qobject_box->isChecked(); + gtk = dlg.gtk_box->isChecked(); + headeronly = dlg.headeronly_box->isChecked(); + + if ( ( dlg.baseclasses_view->childCount() == 0 ) && childClass ) + new QListViewItem( dlg.baseclasses_view, "QWidget", "public" ); + if ( objc && ( dlg.baseclasses_view->childCount() == 0 ) ) + new QListViewItem( dlg.baseclasses_view, "NSObject", "public" ); + + if ( dlg.documentation_edit->text().isEmpty() && ( !dlg.gen_config->doc_box->isChecked() ) ) + doc = ""; + else + { + doc = QString( "/**\n" ); + if ( !dlg.documentation_edit->text().isEmpty() ) + { + doc.append( dlg.documentation_edit->text() ); + if ( dlg.gen_config->author_box->isChecked() ) + doc.append( "\n\n" ); + } + QString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" ); + QString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" ); + if( !email.isEmpty() ) + author += QString( " <%1>" ).arg( email ); + + if ( dlg.gen_config->author_box->isChecked() ) + doc.append( "\t@author " + author + "\n" ); + doc.append( "*/" ); + } + + if ( !namespaceStr.isEmpty() ) + { + for ( QStringList::Iterator it = namespaces.begin(); it != namespaces.end(); ++it ) + { + if ( !namespaceBeg.isEmpty() ) + namespaceBeg += "\n\n"; + if ( !namespaceEnd.isEmpty() ) + namespaceEnd += "\n\n"; + namespaceBeg += "namespace " + ( *it ) + " {"; + namespaceEnd += "}"; + } + } + + //advanced constructor creation + + advConstructorsHeader = QString::null; + advConstructorsSource = QString::null; + if ( !dlg.constructors_h_edit->text().isEmpty() ) + { + advConstructorsHeader = " " + dlg.constructors_h_edit->text(); + advConstructorsHeader.replace( QRegExp( "\n" ), "\n " ); + } + if ( !dlg.constructors_cpp_edit->text().isEmpty() ) + { + advConstructorsSource = dlg.constructors_cpp_edit->text(); + } + advConstructorsHeader.replace( QRegExp( "[\\n ]*$" ), QString::null ); + advConstructorsSource.replace( QRegExp( "[\\n ]*$" ), QString::null ); + + //advanced method overriding + + advH_public = QString::null; + advH_public_slots = QString::null; + advH_protected = QString::null; + advH_protected_slots = QString::null; + advH_private = QString::null; + advH_private_slots = QString::null; + advCpp = QString::null; + + QListViewItemIterator it( dlg.methods_view ); + while ( it.current() ) + { + PCheckListItem *curr; + if ( ( curr = dynamic_cast* >( it.current() ) ) ) + { + if ( curr->isOn() && ( curr->parent() ) && ( curr->parent() ->parent() ) ) + { + QString * adv_h = 0; + if ( curr->item() ->access() == CodeModelItem::Private ) + adv_h = curr->item() ->isSlot() ? &advH_private_slots : &advH_private; + if ( curr->item() ->access() == CodeModelItem::Protected ) + adv_h = curr->item() ->isSlot() ? &advH_protected_slots : &advH_protected; + if ( curr->item() ->access() == CodeModelItem::Public ) + adv_h = curr->item() ->isSlot() ? &advH_public_slots : &advH_public; + + // if (advCpp.isEmpty()) advCpp += "\n\n"; + + QString bcName = curr->parent() ->parent() ->text( 0 ); + PListViewItem *bc; + if ( ( bc = dynamic_cast* >( curr->parent() ->parent() ) ) ) + { + bcName += bc->templateAddition; + } + genMethodDeclaration( curr->item(), className, templateStr, adv_h, &advCpp, + ( curr->text( 1 ) == i18n( "extend" ) ) ? true : false, bcName ); + } + } + ++it; + } + + //advanced access control and upgrading + QListViewItemIterator ita( dlg.access_view ); + while ( ita.current() ) + { + PListViewItem *curr; + PListViewItem *curr_m; + if ( ( curr = dynamic_cast* >( ita.current() ) ) ) + { + if ( ( !curr->text( 2 ).isEmpty() ) && ( curr->parent() ) && ( curr->parent() ->parent() ) ) + { + QString * adv_h = 0; + if ( curr->text( 2 ) == "private" ) + adv_h = &advH_private; + if ( curr->text( 2 ) == "public" ) + adv_h = &advH_public; + if ( curr->text( 2 ) == "protected" ) + adv_h = &advH_protected; + + /* if ((*adv_h).isEmpty()) + *adv_h += "\n\n";*/ + if ( adv_h ) + *adv_h += QString( " using " ) + curr->parent() ->parent() ->text( 0 ) + "::" + curr->item() ->name() + ";\n"; + } + } + else if ( ( curr_m = dynamic_cast* >( ita.current() ) ) ) + { + if ( ( !curr_m->text( 2 ).isEmpty() ) && ( curr_m->parent() ) && ( curr_m->parent() ->parent() ) ) + { + QString * adv_h = 0; + if ( curr_m->text( 2 ) == "private" ) + adv_h = &advH_private; + if ( curr_m->text( 2 ) == "public" ) + adv_h = &advH_public; + if ( curr_m->text( 2 ) == "protected" ) + adv_h = &advH_protected; + + /* if ((*adv_h).isEmpty()) + *adv_h += "\n\n";*/ + + QString methodName = curr_m->item() ->name(); + if ( !methodName.contains( QRegExp( "^[a-zA-z_]" ) ) ) + methodName = "operator" + methodName; + *adv_h += " using " + curr_m->parent() ->parent() ->text( 0 ) + "::" + methodName + ";\n"; + } + } + ++ita; + } + + QRegExp e( "[\\n ]*$" ); + advH_public.replace( e, QString::null ); + advH_public_slots.replace( e, QString::null ); + advH_protected.replace( e, QString::null ); + advH_protected_slots.replace( e, QString::null ); + advH_private.replace( e, QString::null ); + advH_private_slots.replace( e, QString::null ); + advCpp.replace( e, QString::null ); +} + +void CppNewClassDialog::ClassGenerator::genMethodDeclaration( FunctionDom method, + QString className, QString templateStr, QString *adv_h, QString *adv_cpp, bool extend, QString baseClassName ) +{ + /* if ((*adv_h).isEmpty()) + *adv_h += "\n\n";*/ + QString methodName = method->name(); + if ( !methodName.contains( QRegExp( "^[a-zA-z_]" ) ) ) + methodName = "operator" + methodName; + *adv_h += " " + ( method->isVirtual() ? QString( "virtual " ) : QString( "" ) ) + + ( method->isStatic() ? QString( "static " ) : QString( "" ) ) + + method->resultType() + " " + methodName + "("; + if ( !templateStr.isEmpty() ) + * adv_cpp += templateStr + "\n"; + *adv_cpp += method->resultType() + " " + className + templateParams + "::" + methodName + "("; + + QString bparams; + QString cparams; + int unnamed = 1; + + ArgumentList argumentList = method->argumentList(); + for ( ArgumentList::const_iterator argIt = argumentList.begin(); + argIt != argumentList.end(); ++argIt ) + { + bparams += bparams.isEmpty() ? "" : ", "; + cparams += cparams.isEmpty() ? "" : ", "; + cparams += ( *argIt ) ->type() + " "; + if ( ( *argIt ) ->name().isEmpty() ) + { + cparams += QString( "arg%1" ).arg( unnamed ); + bparams += QString( "arg%1" ).arg( unnamed++ ); + } + else + { + bparams += ( *argIt ) ->name(); + cparams += ( *argIt ) ->name(); + } + if ( !( *argIt ) ->defaultValue().isEmpty() ) + bparams += " " + ( *argIt ) ->defaultValue(); + } + *adv_h += cparams + ")" + ( method->isConstant() ? " const" : "" ) + ";\n"; + *adv_cpp += cparams + ")" + ( method->isConstant() ? " const" : "" ) + "\n{\n"; + if ( extend ) + * adv_cpp += ( ( method->resultType() == "void" ) ? " " : " return " ) + + baseClassName + "::" + methodName + "(" + bparams + ");\n"; + *adv_cpp += "}\n\n"; +} + + +void CppNewClassDialog::ClassGenerator::gen_implementation() +{ + + // implementation + + QString classImpl; + QFileInfo fi( implementationPath ); + QString module = fi.baseName(); + QString basefilename = fi.baseName( true ); + + if ( dlg.filetemplate_box->isChecked() ) + { + /* QDomDocument dom = *dlg.m_part->projectDom(); + if(DomUtil::readBoolEntry(dom,"/cppsupportpart/filetemplates/choosefiles",false)) + classImpl = FileTemplate::read(dlg.m_part, DomUtil::readEntry(dom,"/cppsupportpart/filetemplates/implementationURL",""), FileTemplate::Custom); + else*/ + classImpl = FileTemplate::read( dlg.m_part, fi.extension( true ) ); + } + + classImpl.replace( QRegExp( "\\$MODULE\\$" ), module ); + classImpl.replace( QRegExp( "\\$FILENAME\\$" ), basefilename ); + + if ( objc ) + { + classImpl += dlg.gen_config->objcSource(); + } + else if ( gtk ) + { + classImpl += dlg.gen_config->gtkSource(); + } + else + { + classImpl += dlg.gen_config->cppSource(); + /* classImpl += QString( + "#include \"$HEADER$\"\n" + "\n" + "\n") + + namespaceBeg + + ( advConstructorsSource.isEmpty() ? QString("$CLASSNAME$::$CLASSNAME$($ARGS$)\n" + "$BASEINITIALIZER$" + "{\n" + "}\n") : advConstructorsSource ) + + QString("\n" + "$CLASSNAME$::~$CLASSNAME$()\n" + "{\n" + "}\n") + + advCpp + + namespaceEnd;*/ + } + + QString relPath; + for ( int i = implementation.findRev( '/' ); i != -1; i = implementation.findRev( '/', --i ) ) + relPath += "../"; + + QString constructors = ( advConstructorsSource.isEmpty() ? QString( "$TEMPLATESTR$\n$CLASSNAME$$TEMPLATEPARAMS$::$CLASSNAME$($ARGS$)\n" + "$BASEINITIALIZER$" + "{\n" + "}" ) : advConstructorsSource ) + + QString( "\n\n\n" + "$TEMPLATESTR$\n$CLASSNAME$$TEMPLATEPARAMS$::~$CLASSNAME$()\n" + "{\n" + "}\n" ); + + qWarning( "NEW CLASS: constructors = %s", constructors.latin1() ); + + if ( childClass ) + { + if( dlg.m_part->qtBuildConfig()->version() == 3 ) + { + argsH = "QWidget *parent = 0, const char *name = 0"; + argsCpp = "QWidget *parent, const char *name"; + } + else + { + argsH = "QWidget *parent = 0"; + argsCpp = "QWidget *parent"; + } + } + else if ( qobject ) + { + if( dlg.m_part->qtBuildConfig()->version() == 3 ) + { + argsH = "QObject *parent = 0, const char *name = 0"; + argsCpp = "QObject *parent, const char *name"; + } + else + { + argsH = "QObject *parent = 0"; + argsCpp = "QObject *parent"; + } + } + else + { + argsH = ""; + argsCpp = ""; + } + QString baseInitializer; + + if ( childClass && ( dlg.baseclasses_view->childCount() == 0 ) ) + { + if( dlg.m_part->qtBuildConfig()->version() == 3 ) + baseInitializer = " : QWidget(parent, name)"; + else + baseInitializer = " : QWidget(parent)"; + } + else if ( qobject && ( dlg.baseclasses_view->childCount() == 0 ) ) + { + if( dlg.m_part->qtBuildConfig()->version() == 3 ) + baseInitializer = " : QObject(parent, name)"; + else + baseInitializer = " : QObject(parent)"; + } + else if ( dlg.baseclasses_view->childCount() != 0 ) + { + QListViewItemIterator it( dlg.baseclasses_view ); + baseInitializer += " : "; + while ( it.current() ) + { + if ( !it.current() ->text( 0 ).isEmpty() ) + { + if ( baseInitializer != " : " ) + { + baseInitializer += ", "; + } + + if ( childClass && ( baseInitializer == " : " ) ) + { + if( dlg.m_part->qtBuildConfig()->version() == 3 ) + baseInitializer += it.current()->text( 0 ) + "(parent, name)"; + else + baseInitializer += it.current()->text( 0 ) + "(parent)"; + } + else if ( qobject && ( baseInitializer == " : " ) ) + { + if( dlg.m_part->qtBuildConfig()->version() == 3 ) + baseInitializer += it.current()->text( 0 ) + "(parent, name)"; + else + baseInitializer += it.current()->text( 0 ) + "(parent)"; + } + else + { + baseInitializer += it.current()->text( 0 ) + "()"; + } + } + ++it; + } + baseInitializer += "\n"; + } + + constructors.replace( QRegExp( "\\$BASEINITIALIZER\\$" ), baseInitializer ); + constructors.replace( QRegExp( "\\$CLASSNAME\\$" ), className ); + // qWarning("NEW CLASS: constructors = %s", constructors.latin1()); + if ( templateStr.isEmpty() ) + { + constructors.replace( QRegExp( "\\$TEMPLATESTR\\$\\n" ), "" ); + constructors.replace( QRegExp( "\\$TEMPLATEPARAMS\\$" ), "" ); + } + else + { + constructors.replace( QRegExp( "\\$TEMPLATESTR\\$" ), templateStr ); + constructors.replace( QRegExp( "\\$TEMPLATEPARAMS\\$" ), templateParams ); + classImpl.replace( QRegExp( "#include \"\\$HEADER\\$\"\\n" ), "" ); + } + // qWarning("NEW CLASS: constructors = %s", constructors.latin1()); + constructors.replace( QRegExp( "\\$ARGS\\$" ), argsCpp ); + // qWarning("NEW CLASS: constructors = %s", constructors.latin1()); + + + //remove unnesessary carriadge returns + QString hp = relPath + header; + beautifySource( classImpl, hp, className, namespaceBeg, constructors, advCpp, namespaceEnd, implementation ); + + classImpl.replace( QRegExp( "\\$HEADER\\$" ), relPath + header ); + classImpl.replace( QRegExp( "\\$CLASSNAME\\$" ), className ); + classImpl.replace( QRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg ); + classImpl.replace( QRegExp( "\\$CONSTRUCTORDEFINITIONS\\$" ), constructors ); + classImpl.replace( QRegExp( "\\$DEFINITIONS\\$" ), advCpp ); + classImpl.replace( QRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd ); + classImpl.replace( QRegExp( "\\$FILENAME\\$" ), implementation ); + + if ( ( dlg.m_part->project() ) && ( childClass || qobject ) && ( dlg.m_part->project() ->options() & KDevProject::UsesAutotoolsBuildSystem ) ) + { + QString moc = header; + moc.replace( QRegExp( "\\..*" ), ".moc" ); + classImpl += "#include \"" + moc + "\"\n"; + } + + if ( dlg.gen_config->reformat_box->isChecked() ) + { + KDevSourceFormatter * fmt = dlg.m_part->extension( "KDevelop/SourceFormatter" ); + if ( fmt ) + classImpl = fmt->formatSource( classImpl ); + } + + kdDebug( 9007 ) << "implementationPath = " << implementationPath << endl; + + QFile ifile( implementationPath ); + if ( !ifile.open( IO_WriteOnly ) ) + { + KMessageBox::error( &dlg, i18n( "Cannot write to implementation file" ) ); + return ; + } + QTextStream istream( &ifile ); + istream << classImpl; + ifile.close(); + + KURL u; + u.setPath( implementationPath ); + dlg.m_part->partController()->editDocument( u ); +} + + +void CppNewClassDialog::ClassGenerator::gen_interface() +{ + // interface + + QString classIntf; + QFileInfo fi( headerPath ); + QString module = fi.baseName(); + QString basefilename = fi.baseName( true ); + + if ( dlg.filetemplate_box->isChecked() ) + { + /* QDomDocument dom = *dlg.m_part->projectDom(); + if(DomUtil::readBoolEntry(dom,"/cppsupportpart/filetemplates/choosefiles",false)) + classIntf = FileTemplate::read(dlg.m_part, DomUtil::readEntry(dom,"/cppsupportpart/filetemplates/interfaceURL",""), FileTemplate::Custom); + else*/ + classIntf = FileTemplate::read( dlg.m_part, fi.extension( true ) ); + } + + classIntf.replace( QRegExp( "\\$MODULE\\$" ), module ); + classIntf.replace( QRegExp( "\\$FILENAME\\$" ), basefilename ); + + if ( objc ) + { + classIntf += dlg.gen_config->objcHeader(); + } + else if ( gtk ) + { + classIntf += dlg.gen_config->gtkHeader(); + } + else + { + classIntf += dlg.gen_config->cppHeader(); + /* classIntf = QString("\n" + "#ifndef $HEADERGUARD$\n" + "#define $HEADERGUARD$\n" + "\n" + "$INCLUDEBASEHEADER$\n" + "\n") + + namespaceBeg + + QString("class $CLASSNAME$$INHERITANCE$\n" + "{\n" + "$QOBJECT$" + "public:\n") + + ( advConstructorsHeader.isEmpty() ? QString(" $CLASSNAME$($ARGS$);\n") : advConstructorsHeader ) + + QString("\n ~$CLASSNAME$();\n") + + advH_public + + (advH_public_slots.isEmpty() ? QString::fromLatin1("") : ("\n\npublic slots:" + advH_public_slots)) + + (advH_protected.isEmpty() ? QString::fromLatin1("") : ("\n\nprotected:" + advH_protected)) + + (advH_protected_slots.isEmpty() ? QString::fromLatin1("") : ("\n\nprotected slots:" + advH_protected_slots)) + + (advH_private.isEmpty() ? QString::fromLatin1("") : ("\n\nprivate:" + advH_private)) + + (advH_private_slots.isEmpty() ? QString::fromLatin1("") : ("\n\nprivate slots:" + advH_private_slots)) + + QString("};\n" + "\n") + + namespaceEnd + + "#endif\n";*/ + } + + QString headerGuard; + switch ( dlg.gen_config->defCase() ) + { + case ClassGeneratorConfig::UpperCase: + headerGuard = namespaceStr.upper() + header.mid( header.findRev( "/" )+1 ).upper(); + break; + case ClassGeneratorConfig::LowerCase: + headerGuard = namespaceStr.lower() + header.mid( header.findRev( "/" )+1 ).lower(); + break; + case ClassGeneratorConfig::SameAsFileCase: + headerGuard = dlg.header_edit->text().mid( dlg.header_edit->text().findRev( "/" )+1 ); + break; + case ClassGeneratorConfig::SameAsClassCase: + headerGuard = namespaceStr + header.mid( header.findRev( "/" )+1 ); + break; + } + + headerGuard.replace( QRegExp( "\\." ), "_" ); + headerGuard.replace( QRegExp( "::" ), "_" ); + QString includeBaseHeader; + if( dlg.m_part->qtBuildConfig()->isUsed() ) + { + if( childClass && ( dlg.baseclasses_view->childCount() == 0 ) ) + { + if( dlg.m_part->qtBuildConfig()->version() == 3 ) + includeBaseHeader = "#include "; + else + includeBaseHeader = "#include "; + } + else if( qobject && ( dlg.baseclasses_view->childCount() == 0 ) ) + { + if( dlg.m_part->qtBuildConfig()->version() == 3 ) + includeBaseHeader = "#include "; + else + includeBaseHeader = "#include "; + } + } + + if ( objc ) + { + if ( dlg.baseclasses_view->firstChild() ) + if ( dlg.baseclasses_view->firstChild() ->text( 0 ) != "NSObject" ) + if ( !dlg.baseclasses_view->firstChild() ->text( 3 ).isEmpty() ) + includeBaseHeader = "#include " + + ( dlg.baseclasses_view->firstChild() ->text( 2 ).toInt() == 0 ? QString( "<" ) : QString( "\"" ) ) + + dlg.baseclasses_view->firstChild() ->text( 3 ) + + ( dlg.baseclasses_view->firstChild() ->text( 2 ).toInt() == 0 ? QString( ">" ) : QString( "\"" ) ); + } + else + { + QListViewItemIterator it( dlg.baseclasses_view ); + while ( it.current() ) + { + if ( !it.current() ->text( 0 ).isEmpty() ) + if ( !it.current() ->text( 3 ).isEmpty() ) + // if ((!childClass) || (it.current()->text(0) != "QWidget")) + includeBaseHeader += ( includeBaseHeader.isEmpty() ? QString( "" ) : QString( "\n" ) ) + QString::fromLatin1( "#include " ) + + ( it.current() ->text( 2 ).toInt() == 0 ? QString( "<" ) : QString( "\"" ) ) + + it.current() ->text( 3 ) + + ( it.current() ->text( 2 ).toInt() == 0 ? QString( ">" ) : QString( "\"" ) ); + ++it; + } + } + + QString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" ); + QString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" ); + if( !email.isEmpty() ) + author += QString( " <%1>" ).arg( email ); + + QString inheritance; + if ( dlg.baseclasses_view->childCount() > 0 ) + { + inheritance += " : "; + + QListViewItemIterator it( dlg.baseclasses_view ); + while ( it.current() ) + { + if ( !it.current() ->text( 0 ).isEmpty() ) + { + if ( inheritance != " : " ) + inheritance += ", "; + if ( it.current() ->text( 1 ).contains( "virtual" ) ) + inheritance += "virtual "; + if ( it.current() ->text( 1 ).contains( "public" ) ) + inheritance += "public "; + if ( it.current() ->text( 1 ).contains( "protected" ) ) + inheritance += "protected "; + if ( it.current() ->text( 1 ).contains( "private" ) ) + inheritance += "private "; + inheritance += it.current() ->text( 0 ); + } + ++it; + } + } + else if ( qobject ) + inheritance += ": public QObject"; + + QString constructors = QString( advConstructorsHeader.isEmpty() ? + QString( " $CLASSNAME$($ARGS$);" ) : advConstructorsHeader ) + + QString( "\n\n ~$CLASSNAME$();" ); + + constructors.replace( QRegExp( "\\$CLASSNAME\\$" ), className ); + constructors.replace( QRegExp( "\\$ARGS\\$" ), argsH ); + + QString qobjectStr; + if ( childClass || qobject ) + qobjectStr = "Q_OBJECT"; + + + QString baseclass; + if ( dlg.baseclasses_view->childCount() > 0 ) + baseclass = dlg.baseclasses_view->firstChild() ->text( 0 ); + //remove unnesessary carriadge returns + beautifyHeader( classIntf, headerGuard, includeBaseHeader, author, doc, className, templateStr, + baseclass, inheritance, qobjectStr, argsH, + header, namespaceBeg, constructors, advH_public, advH_public_slots, + advH_protected, advH_protected_slots, advH_private, advH_private_slots, namespaceEnd ); + + + classIntf.replace( QRegExp( "\\$HEADERGUARD\\$" ), headerGuard ); + classIntf.replace( QRegExp( "\\$INCLUDEBASEHEADER\\$" ), includeBaseHeader ); + classIntf.replace( QRegExp( "\\$AUTHOR\\$" ), author ); + classIntf.replace( QRegExp( "\\$DOC\\$" ), doc ); + classIntf.replace( QRegExp( "\\$TEMPLATE\\$" ), templateStr ); + classIntf.replace( QRegExp( "\\$CLASSNAME\\$" ), className ); + if ( dlg.baseclasses_view->childCount() > 0 ) + classIntf.replace( QRegExp( "\\$BASECLASS\\$" ), dlg.baseclasses_view->firstChild() ->text( 0 ) ); + classIntf.replace( QRegExp( "\\$INHERITANCE\\$" ), inheritance ); + classIntf.replace( QRegExp( "\\$QOBJECT\\$" ), qobjectStr ); + classIntf.replace( QRegExp( "\\$ARGS\\$" ), argsH ); + classIntf.replace( QRegExp( "\\$FILENAME\\$" ), header ); + classIntf.replace( QRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg ); + classIntf.replace( QRegExp( "\\$CONSTRUCTORDECLARATIONS\\$" ), constructors ); + classIntf.replace( QRegExp( "\\$PUBLICDECLARATIONS\\$" ), advH_public ); + classIntf.replace( QRegExp( "\\$PUBLICSLOTS\\$" ), advH_public_slots ); + classIntf.replace( QRegExp( "\\$PROTECTEDDECLARATIONS\\$" ), QString( "protected:\n" ) + advH_protected ); + classIntf.replace( QRegExp( "\\$PROTECTEDSLOTS\\$" ), QString( "protected slots:\n" ) + advH_protected_slots ); + classIntf.replace( QRegExp( "\\$PRIVATEDECLARATIONS\\$" ), QString( "private:\n" ) + advH_private ); + classIntf.replace( QRegExp( "\\$PRIVATESLOTS\\$" ), QString( "private slots:\n" ) + advH_private_slots ); + classIntf.replace( QRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd ); + + if ( !templateStr.isEmpty() && (!headeronly) ) + classIntf.replace( QRegExp( "#endif" ), "#include \"" + dlg.implementation_edit->text() + "\"\n\n#endif" ); + + if ( dlg.gen_config->reformat_box->isChecked() ) + { + KDevSourceFormatter * fmt = dlg.m_part->extension( "KDevelop/SourceFormatter" ); + if ( fmt ) + classIntf = fmt->formatSource( classIntf ); + } + + QFile hfile( headerPath ); + if ( !hfile.open( IO_WriteOnly ) ) + { + KMessageBox::error( &dlg, i18n( "Cannot write to header file" ) ); + return ; + } + QTextStream hstream( &hfile ); + hstream << classIntf; + hfile.close(); + + KURL u; + u.setPath( headerPath ); + dlg.m_part->partController()->editDocument( u ); +} + +void CppNewClassDialog::ClassGenerator::beautifyHeader( QString &templ, QString &headerGuard, + QString &includeBaseHeader, QString &author, QString &doc, QString &className, QString &templateStr, + QString &baseclass, QString &inheritance, QString &qobjectStr, QString &args, + QString &header, QString &namespaceBeg, QString &constructors, QString &advH_public, QString &advH_public_slots, + QString &advH_protected, QString &advH_protected_slots, QString &advH_private, QString &advH_private_slots, + QString &namespaceEnd ) +{ + if ( headerGuard.isEmpty() ) + templ.replace( QRegExp( "\\$HEADERGUARD\\$[\\n ]*" ), QString::null ); + if ( includeBaseHeader.isEmpty() ) + templ.replace( QRegExp( "\\$INCLUDEBASEHEADER\\$[\\n ]*" ), QString::null ); + if ( author.isEmpty() ) + templ.replace( QRegExp( "\\$AUTHOR\\$[\\n ]*" ), QString::null ); + if ( doc.isEmpty() ) + templ.replace( QRegExp( "\\$DOC\\$[\\n ]*" ), QString::null ); + if ( className.isEmpty() ) + templ.replace( QRegExp( "\\$CLASSNAME\\$[\\n ]*" ), QString::null ); + if ( templateStr.isEmpty() ) + templ.replace( QRegExp( "\\$TEMPLATE\\$[\\n ]*" ), QString::null ); + if ( baseclass.isEmpty() ) + templ.replace( QRegExp( "\\$BASECLASS\\$[\\n ]*" ), QString::null ); + if ( inheritance.isEmpty() ) + templ.replace( QRegExp( "\\$INHERITANCE\\$[\\n ]*" ), QString::null ); + if ( qobjectStr.isEmpty() ) + templ.replace( QRegExp( "\\$QOBJECT\\$[\\n ]*" ), QString::null ); + if ( args.isEmpty() ) + templ.replace( QRegExp( "\\$ARGS\\$[\\n ]*" ), QString::null ); + if ( header.isEmpty() ) + templ.replace( QRegExp( "\\$FILENAME\\$[\\n ]*" ), QString::null ); + if ( namespaceBeg.isEmpty() ) + templ.replace( QRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), QString::null ); + if ( constructors.isEmpty() ) + templ.replace( QRegExp( "\\$CONSTRUCTORDECLARATIONS\\$[\\n ]*" ), QString::null ); + if ( advH_public.isEmpty() ) + templ.replace( QRegExp( "\\$PUBLICDECLARATIONS\\$[\\n ]*" ), QString::null ); + if ( advH_public_slots.isEmpty() ) + templ.replace( QRegExp( "\\$PUBLICSLOTS\\$[\\n ]*" ), QString::null ); + if ( advH_protected.isEmpty() ) + templ.replace( QRegExp( "\\$PROTECTEDDECLARATIONS\\$[\\n ]*" ), QString::null ); + if ( advH_protected_slots.isEmpty() ) + templ.replace( QRegExp( "\\$PROTECTEDSLOTS\\$[\\n ]*" ), QString::null ); + if ( advH_private.isEmpty() ) + templ.replace( QRegExp( "\\$PRIVATEDECLARATIONS\\$[\\n ]*" ), QString::null ); + if ( advH_private_slots.isEmpty() ) + templ.replace( QRegExp( "\\$PRIVATESLOTS\\$[\\n ]*" ), QString::null ); + if ( namespaceEnd.isEmpty() ) + templ.replace( QRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), QString::null ); +} + + +void CppNewClassDialog::ClassGenerator::beautifySource( QString &templ, QString &header, QString &className, QString &namespaceBeg, + QString &constructors, QString &advCpp, QString &namespaceEnd, QString &implementation ) +{ + if ( header.isEmpty() ) + templ.replace( QRegExp( "\\$HEADER\\$[\\n ]*" ), QString::null ); + if ( className.isEmpty() ) + templ.replace( QRegExp( "\\$CLASSNAME\\$[\\n ]*" ), QString::null ); + if ( namespaceBeg.isEmpty() ) + templ.replace( QRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), QString::null ); + if ( constructors.isEmpty() ) + templ.replace( QRegExp( "\\$CONSTRUCTORDEFINITIONS\\$[\\n ]*" ), QString::null ); + if ( advCpp.isEmpty() ) + templ.replace( QRegExp( "\\$DEFINITIONS\\$[\\n ]*" ), QString::null ); + if ( namespaceEnd.isEmpty() ) + templ.replace( QRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), QString::null ); + if ( implementation.isEmpty() ) + templ.replace( QRegExp( "\\$FILENAME\\$[\\n ]*" ), QString::null ); +} + +QString CppNewClassDialog::classNameFormatted( ) +{ + return classNameFormatted( classname_edit->text() ); +} + +QString CppNewClassDialog::classNameFormatted( const QString &name ) +{ + QString temp = name.simplifyWhiteSpace(); + return temp.replace( QRegExp( "template *<.*> *(class *)?" ), "" ); +} + + +QString CppNewClassDialog::templateStrFormatted( ) +{ + return templateStrFormatted( classname_edit->text() ); +} + +QString CppNewClassDialog::templateStrFormatted( const QString &name ) +{ + QString className = name.simplifyWhiteSpace(); + QString temp = className; + className.replace( QRegExp( "template *<.*> *(class *)?" ), "" ); + QString templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" ); + templateStr.replace( QRegExp( " *class *$" ), "" ); + return templateStr; +} + +QString CppNewClassDialog::templateParamsFormatted( ) +{ + return templateParamsFormatted( classname_edit->text() ); +} + +QString CppNewClassDialog::templateParamsFormatted( const QString &name ) +{ + QString className = name.simplifyWhiteSpace(); + QString temp = className; + className.replace( QRegExp( "template *<.*> *(class *)?" ), "" ); + QString templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" ); + templateStr.replace( QRegExp( " *class *$" ), "" ); + + QString templateParams = templateStr; + templateParams.replace( QRegExp( "^ *template *" ), "" ); + templateParams.replace( QRegExp( " *class *" ), "" ); + templateParams.simplifyWhiteSpace(); + + return templateParams; +} + +QString CppNewClassDialog::templateActualParamsFormatted( const QString & name ) +{ + QString className = name.simplifyWhiteSpace(); + QString temp = className; + className.replace( QRegExp( "<.*> *" ), "" ); + QString templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" ); + return templateStr; +} + +void CppNewClassDialog::removeTemplateParams( QString & name ) +{ + name.replace( QRegExp( "<.*> *" ), "" ); +} + +bool CppNewClassDialog::isDestructor( QString className, const FunctionDom &method ) +{ + if ( m_part->formatModelItem( method.data() ).contains( QRegExp( " *~ *" + className ) ) ) + return true; + return false; +} + +void CppNewClassDialog::headeronly_box_stateChanged(int val) +{ + implementation_edit->setEnabled(!val); +} + +#include "cppnewclassdlg.moc" + +//kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on diff --git a/languages/cpp/cppnewclassdlg.h b/languages/cpp/cppnewclassdlg.h new file mode 100644 index 00000000..fb680921 --- /dev/null +++ b/languages/cpp/cppnewclassdlg.h @@ -0,0 +1,292 @@ +/*************************************************************************** +* Copyright (C) 1998 by Sandy Meier * +* smeier@rz.uni-potsdam.de * +* Copyright (C) 2002 by Bernd Gehrmann * +* bernd@kdevelop.org * +* Copyright (C) 2003 by Alexander Dymo * +* cloudtemple@mksat.net * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef _CPPNEWCLASSDLG_H_ +#define _CPPNEWCLASSDLG_H_ + +#include +#include +#include + +#include "codemodel.h" +#include "cppnewclassdlgbase.h" + +class CppSupportPart; +class KDevProject; +class QPopupMenu; +class KCompletion; +class CodeModel; + + +template +class PCheckListItem: public QCheckListItem +{ +public: + + PCheckListItem ( T item, QCheckListItem * parent, const QString & text, Type tt = Controller ) : + QCheckListItem ( parent, text, tt ), m_item( item ) + {} + + PCheckListItem ( T item, QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = Controller ) : + QCheckListItem ( parent, after, text, tt ), m_item( item ) + {} + + PCheckListItem ( T item, QListViewItem * parent, const QString & text, Type tt = Controller ) : + QCheckListItem ( parent, text, tt ), m_item( item ) + {} + + PCheckListItem ( T item, QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = Controller ) : + QCheckListItem ( parent, after, text, tt ), m_item( item ) + {} + + PCheckListItem ( T item, QListView * parent, const QString & text, Type tt = Controller ) : + QCheckListItem ( parent, text, tt ), m_item( item ) + {} + + PCheckListItem ( T item, QListView * parent, QListViewItem * after, const QString & text, Type tt = Controller ) : + QCheckListItem ( parent, after, text, tt ), m_item( item ) + {} + + PCheckListItem ( T item, QListViewItem * parent, const QString & text, const QPixmap & p ) : + QCheckListItem ( parent, text, p ), m_item( item ) + {} + + PCheckListItem ( T item, QListView * parent, const QString & text, const QPixmap & p ) : + QCheckListItem ( parent, text, p ), m_item( item ) + {} + + T item() + { + return m_item; + } + + QString templateAddition; + +private: + T m_item; +}; + +template +class PListViewItem: public QListViewItem +{ +public: + + PListViewItem ( T item, QListViewItem * parent, QListViewItem * after, const QString & text ) : + QListViewItem ( parent, after, text ), m_item( item ) + {} + + PListViewItem ( T item, QListViewItem * parent, const QString & text ) : + QListViewItem ( parent, text ), m_item( item ) + {} + + PListViewItem ( T item, QListView * parent, const QString & text ) : + QListViewItem ( parent, text ), m_item( item ) + {} + + PListViewItem ( T item, QListView * parent, QListViewItem * after, const QString & text ) : + QListViewItem ( parent, after, text ), m_item( item ) + {} + + T item() + { + return m_item; + } + + QString templateAddition; +private: + T m_item; +}; + + +class CppNewClassDialog : public CppNewClassDialogBase +{ + Q_OBJECT + +public: + CppNewClassDialog( CppSupportPart *part, QWidget *parent = 0, const char *name = 0 ); + ~CppNewClassDialog(); + +protected: + virtual void accept(); + virtual void classNameChanged( const QString &text ); + virtual void classNamespaceChanged( const QString &text ); + virtual void headerChanged(); + virtual void implementationChanged(); + virtual void nameHandlerChanged( const QString &text ); + virtual void baseclassname_changed( const QString &text ); + virtual void baseIncludeChanged( const QString &text ); + + virtual void addBaseClass(); + virtual void remBaseClass(); + virtual void remBaseClassOnly(); + virtual void currBaseNameChanged( const QString &text ); + virtual void currBasePrivateSet(); + virtual void currBaseProtectedSet(); + virtual void currBasePublicSet(); + virtual void currBaseVirtualChanged( int val ); + virtual void currBaseSelected( QListViewItem *it ); + virtual void scopeboxActivated( int value ); + + virtual void checkObjCInheritance( int val ); + virtual void checkQWidgetInheritance( int val ); + + virtual void upbaseclass_button_clicked(); + virtual void downbaseclass_button_clicked(); + virtual void baseclasses_view_selectionChanged(); + + virtual void newTabSelected( const QString &text ); + virtual void newTabSelected( QWidget *w ); + virtual void access_view_mouseButtonPressed( int button, QListViewItem * item, const QPoint &p, int c ); + virtual void changeToPrivate(); + virtual void changeToProtected(); + virtual void changeToPublic(); + virtual void changeToInherited(); + virtual void methods_view_mouseButtonPressed( int button , QListViewItem * item, const QPoint&p , int c ); + virtual void extendFunctionality(); + virtual void replaceFunctionality(); + virtual void to_constructors_list_clicked(); + virtual void clear_selection_button_clicked(); + virtual void selectall_button_clicked(); + virtual void gtk_box_stateChanged( int val ); + virtual void qobject_box_stateChanged( int val ); + virtual void headeronly_box_stateChanged(int val); + + void reloadAdvancedInheritance( bool clean = false ); + void parseClass( QString clName, QString inheritance ); + void parsePCSClass( QString clName, QString inheritance ); + void addToConstructorsList( QCheckListItem *myClass, FunctionDom method ); + void addToMethodsList( QListViewItem *parent, FunctionDom method ); + void addToUpgradeList( QListViewItem *parent, FunctionDom method, QString modifier ); + void addToUpgradeList( QListViewItem *parent, VariableDom attr, QString modifier ); + void clearConstructorsList( bool clean = false ); + void clearMethodsList( bool clean = false ); + void clearUpgradeList( bool clean = false ); + bool isConstructor( QString className, const FunctionDom &method ); + bool isDestructor( QString className, const FunctionDom &method ); + +private: + + bool headerModified; + bool baseincludeModified; + bool implementationModified; + QString m_parse; + QPopupMenu *accessMenu; + QPopupMenu *overMenu; + CppSupportPart *m_part; + CodeModel *myModel; + + // configuration variables + QString interface_url; + QString implementation_url; + QString interface_suffix; + QString implementation_suffix; + QStringList currNamespace; + bool lowercase_filenames; + QStringList currBaseClasses; + KCompletion * compBasename; + KCompletion * compNamespace; + + void setCompletionBasename( CodeModel *model ); + void addCompletionBasenameNamespacesRecursive( const NamespaceDom & namespaceDom, const QString & namespaceParent = "" ); + void setCompletionNamespaceRecursive( const NamespaceDom & namespaceDom, const QString & namespaceParent = "" ); + void setStateOfInheritanceEditors( bool state, bool hideList = true ); + void setAccessForBase( QString baseclass, QString newAccess ); + void setAccessForItem( QListViewItem *curr, QString newAccess, bool isPublic ); + void remClassFromAdv( QString text ); + void checkUpButtonState(); + void checkDownButtonState(); + void updateConstructorsOrder(); + + QString classNameFormatted(); + QString templateStrFormatted(); + QString templateParamsFormatted(); + QString classNameFormatted( const QString & ); + QString templateStrFormatted( const QString & ); + QString templateParamsFormatted( const QString & ); + QString templateActualParamsFormatted( const QString & ); + void removeTemplateParams( QString & ); + + friend class ClassGenerator; + + //! The class that translates UI input to a class + class ClassGenerator + { + + public: + ClassGenerator( CppNewClassDialog& _dlg ) : dlg( _dlg ) + {} + bool generate(); + + private: + bool validateInput(); + void common_text(); + void gen_implementation(); + void gen_interface(); + void genMethodDeclaration( FunctionDom method, QString className, QString templateStr, + QString *adv_h, QString *adv_cpp, bool extend, QString baseClassName ); + + void beautifyHeader( QString &templ, QString &headerGuard, + QString &includeBaseHeader, QString &author, QString &doc, QString &className, QString &templateStr, + QString &baseclass, QString &inheritance, QString &qobjectStr, QString &args, + QString &header, QString &namespaceBeg, QString &constructors, QString &advH_public, + QString &advH_public_slots, + QString &advH_protected, QString &advH_protected_slots, QString &advH_private, QString &advH_private_slots, + QString &namespaceEnd ); + void beautifySource( QString &templ, QString &header, QString &className, QString &namespaceBeg, + QString &constructors, QString &advCpp, QString &namespaceEnd, QString &implementation ); + + QString className; + QString templateStr; + QString templateParams; + QString header; + QString implementation; + + QString advConstructorsHeader; + QString advConstructorsSource; + + KDevProject *project; + QString subDir, headerPath, implementationPath; + QString doc; + QString namespaceStr; + bool childClass; + bool objc; + bool qobject; + bool gtk; + bool headeronly; + QStringList namespaces; + QString namespaceBeg, namespaceEnd; + QString argsH; + QString argsCpp; + + QString advH_public; + QString advH_public_slots; + QString advH_protected; + QString advH_protected_slots; + QString advH_private; + QString advH_private_slots; + QString advCpp; + + + CppNewClassDialog& dlg; + }; + + + //! workaround to make gcc 2.95.x happy + friend class CppNewClassDialog::ClassGenerator; +}; + +#endif +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/cppnewclassdlgbase.ui b/languages/cpp/cppnewclassdlgbase.ui new file mode 100644 index 00000000..4f443eaf --- /dev/null +++ b/languages/cpp/cppnewclassdlgbase.ui @@ -0,0 +1,1290 @@ + +CppNewClassDialogBase + + + CppNewClassDlgBase + + + + 0 + 0 + 510 + 611 + + + + New Class + + + + + + + unnamed + + + + class_tabs + + + + tab1 + + + Class &Information + + + + unnamed + + + + Spacer6 + + + Horizontal + + + Preferred + + + + 10 + 20 + + + + + + Layout10 + + + + unnamed + + + 0 + + + + documentation_label_ + + + Docu&mentation: + + + documentation_edit + + + + + documentation_edit + + + Insert a short description for your new class +here for documentation purposes. This can be used +to create API documentation in HTML format with +doxygen or similar tools. + + + + + + + filenames_group + + + File Names + + + + unnamed + + + + header_label + + + &Header: + + + header_edit + + + + + header_edit + + + Insert your header file name here. +It is automatically inserted while +you select the classname, but you can +still edit it afterwards. + + + + + implementation_label + + + Im&plementation: + + + implementation_edit + + + + + implementation_edit + + + Insert your implementation filename here. +It is automatically inserted while +you select the classname, but you can +still edit it afterwards. + + + + + headeronly_box + + + Create only header + + + + + + + groupBox7 + + + Class + + + + unnamed + + + + classname_label + + + + 5 + 5 + 0 + 0 + + + + &Name: + + + classname_edit + + + + + classname_edit + + + Insert your new classname here. +You can also define template classes by specifying +template <params> classname + + + + + namespace_label + + + + 5 + 5 + 0 + 0 + + + + Name&space: + + + namespace_edit + + + + + namespace_edit + + + Insert a name of the namespace here. +You can define nested namespaces by specifying +Namespace1::Namespace2::...::NamespaceN + + + + + + + inheritance_group + + + Inheritance + + + + unnamed + + + + addbaseclass_button + + + + 1 + 0 + 0 + 0 + + + + &Add + + + true + + + + + rembaseclass_button + + + false + + + + 1 + 0 + 0 + 0 + + + + + 0 + 0 + + + + &Remove + + + true + + + + + upbaseclass_button + + + false + + + + 1 + 0 + 0 + 0 + + + + Move &Up + + + true + + + + + downbaseclass_button + + + false + + + + 1 + 0 + 0 + 0 + + + + + 0 + 0 + + + + Move &Down + + + true + + + + + basename_label + + + + 0 + 5 + 0 + 0 + + + + &Base class: + + + basename_edit + + + + + + Baseclass Name + + + true + + + true + + + + + Inheritance Type + + + true + + + true + + + + baseclasses_view + + + false + + + AutoOneFit + + + AllColumns + + + + + basename_edit + + + false + + + + 7 + 0 + 0 + 0 + + + + + 0 + 20 + + + + StrongFocus + + + Insert the base class which your new class will be derived from. If you have checked 'Generate QWidget child class' the new class will be derived from QWidget. If no base class is named, the new class will not have a parent class. You can also use template classes here (like BaseClass<int, int>) + + + + + baseinclude_edit + + + false + + + + 7 + 0 + 0 + 0 + + + + + 0 + 20 + + + + StrongFocus + + + + + + + + layout5 + + + + unnamed + + + + + Global + + + + + Local + + + + scope_box + + + false + + + + 1 + 1 + 0 + 0 + + + + + + virtual_box + + + false + + + Virtual + + + + + public_button + + + false + + + Public + + + true + + + + + protected_button + + + false + + + Protected + + + + + private_button + + + false + + + Private + + + + + + + + + optionsBox + + + Options + + + + unnamed + + + + filetemplate_box + + + Use file t&emplates + + + true + + + + + qobject_box + + + Generate QOb&ject child class + + + + + childclass_box + + + Generate Q&Widget child class + + + + + gtk_box + + + Generate G&TK+ class + + + + + objc_box + + + Use Objective-C + + + + + + + + + tab2 + + + Ad&vanced Information + + + + unnamed + + + + tabWidget4 + + + + tab + + + Constr&uctors + + + + unnamed + + + + + Base Class Constructors + + + true + + + true + + + + constructors_view + + + AutoOneFit + + + true + + + AllColumns + + + + + layout4 + + + + unnamed + + + + to_constructors_list + + + + 0 + 0 + 0 + 0 + + + + + 125 + 0 + + + + C&reate Constructor >> + + + + + clear_selection_button + + + + 0 + 0 + 0 + 0 + + + + + 125 + 0 + + + + C&lear Selection + + + + + spacer9_2_2 + + + Horizontal + + + Expanding + + + + 150 + 20 + + + + + + + + tabWidget3 + + + + tab_header + + + &Header + + + + unnamed + + + 2 + + + + constructors_h_edit + + + + 7 + 7 + 0 + 0 + + + + PlainText + + + NoWrap + + + + + + + tab_source + + + &Source + + + + unnamed + + + 2 + + + + constructors_cpp_edit + + + + 7 + 7 + 0 + 0 + + + + PlainText + + + NoWrap + + + + + + + + + + tab + + + Methods Ov&erriding + + + + unnamed + + + + + Methods + + + true + + + true + + + + + Extend Functionality + + + true + + + true + + + + methods_view + + + true + + + AutoOneFit + + + true + + + true + + + AllColumns + + + + + + + tab + + + &Access Control + + + + unnamed + + + + + Methods & Attributes + + + true + + + true + + + + + Implied Modifier + + + true + + + true + + + + + New Modifier + + + true + + + true + + + + access_view + + + + 7 + 7 + 0 + 0 + + + + AutoOneFit + + + true + + + true + + + AllColumns + + + + + + + + + + tab + + + &Generation Options + + + + unnamed + + + + gen_config + + + StrongFocus + + + + + + + + Layout3 + + + + unnamed + + + 0 + + + + Spacer7_2 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + ok_button + + + &OK + + + true + + + + + cancel_button + + + &Cancel + + + + + + + + + ClassGeneratorConfig +

classgeneratorconfig.h
+ + 0 + 0 + + 0 + + 5 + 5 + 0 + 0 + + image0 + + + + + 789c9d95594f32591086effd15c4ba3393fae895ee4ce6824540141011b7c95cf406a202caa6f065fefb549faaea0b24996fc623cb937aeb3d55754e871f67a587eb6ee9ecc7c96a1dada74929798e96a5b374339bedfefceb8f9f27a7b65da27fcb724bf6e96f27a783752929f516f32c070402289b3fc39d8203c3136157e276c1260eac0f0ade0907927f2d9c58261f929cad72be0cef8535ff5959e277c201ef0fa02cf1ae7022f9efca12ff301ca81e87c21a5f32db5acf95b0eebfcdd92e2be3a5b0fa7986435bfd6e981d99278c0ae6795c288b3e2b98e3036157d8f839961308af985df51b1b0e9dc0098ddf5a3811fd7dceaee52a370d475e28f9b7ca1c07539f67173c144e65be2fcae2d763f62d89df2acb7cc282393e57b6b9ff58d893fca632c7d1ccc78bbcd48b4c7cc2ec4bfdf0aa2cfbf50be6fa2c65d9af2aacfd2c94e53cccf9fa7645eb7794a59ebdb027fe5565895f09cb7e981a267f9febaf3117fab6702af599e7a5e2049e6dce1377c25affa6608e4786e34a58894dfc8b59f5f890731087e28f2de648fbdb16ccfd6c9465bf7365c732f12f61ed3f5016fd4a59f4e6790fddd00a5d137f638eb4bfa532df5ffc148ea4be5ac17c5ea9b2ecd72b98efff403893fa1accb12d5c5696fd4d7f6152c41f95c53f2a98f56b6597fbf3857da9b75e30fb5584b59fa78239de5596fd3e0be6fdccf311b99115f1fcdaccb12fe77927ac7e2365f1c382793e63e14cfccdf3132571e69b1f07e83327d23fbac2bee4d785d57f2a9c89de9c6fecaa1fce98135bf845b9e2189e2a07e6fee287b0cfcf3bce9525ff5d38927a1bcca9cc1b66ca528ff93d89d338e3f9e182b9c86f31a752ff609d2f847f5f83b5ea31c218137a4f8fac0cc738e10cd6d3b7189f718a2ff88a6f38c339ad05adfcf31d3f7089ab037d42ea356e708b9ff8853bdc6395de6b58c706ad736c1ee823f2de608b146dbcc08e8976f012afb04b3975ec1de853aa2457f749d5c16b1ce00d0ecdf75b1ce1dd11fd1b55d236cef7f8808ff88465b4d02676d03da29f51dd9e513fa28f150c3004246d07002288bfe9e7d45f0712f22635a490d15ef730361e3b389c67aedf2390ea3157e73dc333e9a6f042d13ebc7ed32f6882405d3ee1c678030ee10d6630a76f162c8ee8f37adeb14c0aaa0b3e68b725ac80a2b039a29f630db6e46bc127d5fd45de4b5226b0833d8ea07a445f871ae96dacc218ead08073c835136842eba8be016db830e77a419f21aca143f76c025b9ae7e5813ea35bd5a0731fd1c4877a7f614fde57d085deb7f31ad31dccf54fd087883ab7a88f6baabb45fdf760003707fa09ddd826f66048af1826f00a0bb3aa7009b73082bb03fd2faeffa7fff58cfffcbcfffdfbc93f7f7d62d7 + + + + + ok_button + clicked() + CppNewClassDlgBase + accept() + + + cancel_button + clicked() + CppNewClassDlgBase + reject() + + + classname_edit + textChanged(const QString&) + CppNewClassDlgBase + classNameChanged(const QString&) + + + header_edit + textChanged(const QString&) + CppNewClassDlgBase + headerChanged() + + + implementation_edit + textChanged(const QString&) + CppNewClassDlgBase + implementationChanged() + + + childclass_box + stateChanged(int) + CppNewClassDlgBase + checkQWidgetInheritance(int) + + + objc_box + stateChanged(int) + CppNewClassDlgBase + checkObjCInheritance(int) + + + virtual_box + stateChanged(int) + CppNewClassDlgBase + currBaseVirtualChanged(int) + + + public_button + clicked() + CppNewClassDlgBase + currBasePublicSet() + + + protected_button + clicked() + CppNewClassDlgBase + currBaseProtectedSet() + + + private_button + clicked() + CppNewClassDlgBase + currBasePrivateSet() + + + addbaseclass_button + clicked() + CppNewClassDlgBase + addBaseClass() + + + rembaseclass_button + clicked() + CppNewClassDlgBase + remBaseClass() + + + baseclasses_view + currentChanged(QListViewItem*) + CppNewClassDlgBase + currBaseSelected(QListViewItem*) + + + upbaseclass_button + clicked() + CppNewClassDlgBase + upbaseclass_button_clicked() + + + downbaseclass_button + clicked() + CppNewClassDlgBase + downbaseclass_button_clicked() + + + baseclasses_view + selectionChanged() + CppNewClassDlgBase + baseclasses_view_selectionChanged() + + + gtk_box + stateChanged(int) + CppNewClassDlgBase + gtk_box_stateChanged(int) + + + basename_edit + textChanged(const QString&) + CppNewClassDlgBase + currBaseNameChanged(const QString&) + + + qobject_box + stateChanged(int) + CppNewClassDlgBase + qobject_box_stateChanged(int) + + + access_view + mouseButtonPressed(int,QListViewItem*,const QPoint&,int) + CppNewClassDlgBase + access_view_mouseButtonPressed(int,QListViewItem*,const QPoint&,int) + + + methods_view + mouseButtonPressed(int,QListViewItem*,const QPoint&,int) + CppNewClassDlgBase + methods_view_mouseButtonPressed(int,QListViewItem*,const QPoint&,int) + + + clear_selection_button + clicked() + CppNewClassDlgBase + clear_selection_button_clicked() + + + to_constructors_list + clicked() + CppNewClassDlgBase + to_constructors_list_clicked() + + + class_tabs + selected(const QString&) + CppNewClassDlgBase + newTabSelected(const QString&) + + + class_tabs + currentChanged(QWidget*) + CppNewClassDlgBase + newTabSelected(QWidget*) + + + basename_edit + textChanged(const QString&) + CppNewClassDlgBase + baseclassname_changed(const QString&) + + + baseinclude_edit + textChanged(const QString&) + CppNewClassDlgBase + baseIncludeChanged(const QString&) + + + scope_box + activated(int) + CppNewClassDlgBase + scopeboxActivated(int) + + + namespace_edit + textChanged(const QString&) + CppNewClassDlgBase + classNamespaceChanged(const QString&) + + + headeronly_box + stateChanged(int) + CppNewClassDlgBase + headeronly_box_stateChanged(int) + + + + classname_edit + namespace_edit + addbaseclass_button + basename_edit + baseinclude_edit + scope_box + virtual_box + public_button + protected_button + private_button + baseclasses_view + rembaseclass_button + upbaseclass_button + downbaseclass_button + header_edit + implementation_edit + filetemplate_box + qobject_box + childclass_box + gtk_box + objc_box + documentation_edit + class_tabs + ok_button + cancel_button + tabWidget4 + constructors_view + to_constructors_list + clear_selection_button + tabWidget3 + constructors_h_edit + methods_view + access_view + gen_config + constructors_cpp_edit + + + kdialog.h + + + updateClassStore() + access_view_mouseButtonPressed( int button, QListViewItem * item, const QPoint & p, int c ) + classNameChanged( const QString & text ) + headerChanged() + implementationChanged() + nameHandlerChanged( const QString & text ) + addBaseClass() + remBaseClass() + currBaseNameChanged( const QString & text ) + currBasePrivateSet() + currBaseProtectedSet() + currBasePublicSet() + currBaseVirtualChanged( int val ) + currBaseSelected( QListViewItem * it ) + checkObjCInheritance( int val ) + checkQWidgetInheritance( int val ) + newTabSelected( const QString & text ) + changeToPrivate() + changeToProtected() + changeToPublic() + changeToInherited() + methods_view_mouseButtonPressed( int, QListViewItem *, const QPoint &, int ) + newTabSelected( QWidget * w ) + extendFunctionality() + replaceFunctionality() + to_constructors_list_clicked() + from_constructors_list_clicked() + add_constructor_button_clicked() + rem_constructor_button_clicked() + clear_selection_button_clicked() + upbaseclass_button_clicked() + downbaseclass_button_clicked() + baseclasses_view_selectionChanged() + gtk_box_stateChanged( int ) + qobject_box_stateChanged( int ) + selectall_button_clicked() + baseclassname_changed( const QString & ) + baseIncludeChanged( const QString & ) + scopeboxActivated( int ) + classNamespaceChanged( const QString & ) + headeronly_box_stateChanged(int val) + + + + + classgeneratorconfig.h + + diff --git a/languages/cpp/cppsplitheadersourceconfig.cpp b/languages/cpp/cppsplitheadersourceconfig.cpp new file mode 100644 index 00000000..68253368 --- /dev/null +++ b/languages/cpp/cppsplitheadersourceconfig.cpp @@ -0,0 +1,82 @@ +/* + * KDevelop config for split header/source + * + * Copyright (c) 2005 Adam Treat + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "cppsplitheadersourceconfig.h" +#include "cppsupportpart.h" + +#include + +#include +#include + +QString CppSplitHeaderSourceConfig::defaultPath = QString::fromLatin1( "/kdevcppsupport/splitheadersource" ); + +CppSplitHeaderSourceConfig::CppSplitHeaderSourceConfig( CppSupportPart * part, QDomDocument* dom ) + : QObject( part ), m_part( part ), m_dom( dom ) +{ + init(); +} + +CppSplitHeaderSourceConfig::~CppSplitHeaderSourceConfig() +{} + +void CppSplitHeaderSourceConfig::init( ) +{ + m_splitEnable = + DomUtil::readBoolEntry( *m_dom, defaultPath + "/enabled", false ); + m_splitSync = + DomUtil::readBoolEntry( *m_dom, defaultPath + "/synchronize", true ); + m_splitOrientation = + DomUtil::readEntry( *m_dom, defaultPath + "/orientation", "Vertical" ); +} + +void CppSplitHeaderSourceConfig::store( ) +{ + DomUtil::writeBoolEntry( *m_dom, + defaultPath + "/enabled", + m_splitEnable ); + DomUtil::writeBoolEntry( *m_dom, + defaultPath + "/synchronize", + m_splitSync ); + DomUtil::writeEntry( *m_dom, + defaultPath + "/orientation", + m_splitOrientation ); + + emit stored(); +} + +void CppSplitHeaderSourceConfig::setSplitEnable( bool b ) +{ + m_splitEnable = b; +} + +void CppSplitHeaderSourceConfig::setAutoSync( bool b ) +{ + m_splitSync = b; +} + +void CppSplitHeaderSourceConfig::setOrientation( const QString &o ) +{ + m_splitOrientation = o; +} + +#include "cppsplitheadersourceconfig.moc" +// kate: indent-mode csands; tab-width 4; diff --git a/languages/cpp/cppsplitheadersourceconfig.h b/languages/cpp/cppsplitheadersourceconfig.h new file mode 100644 index 00000000..d975bc2c --- /dev/null +++ b/languages/cpp/cppsplitheadersourceconfig.h @@ -0,0 +1,74 @@ +/* + * KDevelop config for split header/source + * + * Copyright (c) 2005 Adam Treat + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +#ifndef CPPSPLITHEADERSOURCECONFIG_H +#define CPPSPLITHEADERSOURCECONFIG_H + +#include + +class CppSupportPart; +class QDomDocument; + +class CppSplitHeaderSourceConfig : public QObject +{ + Q_OBJECT +public: + CppSplitHeaderSourceConfig( CppSupportPart* part, QDomDocument* dom ); + virtual ~CppSplitHeaderSourceConfig(); + + bool splitEnabled() const + { + return m_splitEnable; + } + void setSplitEnable( bool b ); + + bool autoSync() const + { + return m_splitSync; + } + void setAutoSync( bool b ); + + QString orientation() const + { + return m_splitOrientation; + } + void setOrientation( const QString &o ); + +public slots: + void store(); + +private: + void init(); + +signals: + void stored(); + +private: + CppSupportPart* m_part; + QDomDocument* m_dom; + bool m_splitEnable; + bool m_splitSync; + QString m_splitOrientation; + + static QString defaultPath; +}; + +#endif +// kate: indent-mode csands; tab-width 4; diff --git a/languages/cpp/cppsupport_events.h b/languages/cpp/cppsupport_events.h new file mode 100644 index 00000000..0c266726 --- /dev/null +++ b/languages/cpp/cppsupport_events.h @@ -0,0 +1,75 @@ +/*************************************************************************** +* Copyright (C) 2003 by Roberto Raggi * +* roberto@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef __cppsupport_events_h +#define __cppsupport_events_h + +#include "kdevdeepcopy.h" + +#include +#include + +#if QT_VERSION < 0x030100 +#include +#else +#include +#endif + +enum +{ + Event_FileParsed = QEvent::User + 1000 +}; + + +class FileParsedEvent: public QCustomEvent +{ +public: + FileParsedEvent( const QString& fileName, const QValueList& problems, bool fromDisk = false ) + : QCustomEvent( Event_FileParsed ), m_fileName( deepCopy( fileName ) ), m_fromDisk( fromDisk ) + { + // the members are deep copies + QValueListConstIterator it = problems.begin(); + while ( it != problems.end() ) + { + Problem p = *it; + m_problems.append( Problem( deepCopy( p.text() ), p.line(), p.column(), p.level() ) ); + m_problems.back().setFileName( deepCopy( p.fileName() ) ); + ++it; + } + } + + QString fileName() const + { + return m_fileName; + } + QValueList problems() const + { + return m_problems; + } + + bool fromDisk() { + return m_fromDisk; + } + +private: + QString m_fileName; + QValueList m_problems; + bool m_fromDisk; + +private: + FileParsedEvent( const FileParsedEvent& source ); + void operator = ( const FileParsedEvent& source ); +}; + + +#endif // __cppsupport_events_h +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/cppsupport_utils.cpp b/languages/cpp/cppsupport_utils.cpp new file mode 100644 index 00000000..e6f80abc --- /dev/null +++ b/languages/cpp/cppsupport_utils.cpp @@ -0,0 +1,139 @@ +#include + +#include +#include +#include + +#include + +#include "cppsupport_utils.h" + +static void typeNameList( QStringList& path, QStringList & lst, const CodeModel * model ); +static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns ); +static void typeNameList( QStringList & path, QStringList & lst, ClassDom klass ); + +QStringList typeNameList( const CodeModel* model ) +{ + QStringList lst; + QStringList path; + typeNameList( path, lst, model ); + return lst; +} + +static void typeNameList( QStringList& path, QStringList & lst, const CodeModel * model ) +{ + const FileList fileList = model->fileList(); + for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ) + typeNameList( path, lst, model_cast(*it) ); +} + +static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns ) +{ + if( !ns->isFile() ) + path.push_back( ns->name() ); + + const NamespaceList namespaceList = ns->namespaceList(); + for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it ) + typeNameList( path, lst, *it ); + + const ClassList classList = ns->classList(); + for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it ) + typeNameList( path, lst, *it ); + + if( !ns->isFile() ) + path.pop_back(); +} + +static void typeNameList( QStringList & path, QStringList & lst, ClassDom klass ) +{ + path.push_back( klass->name() ); + + lst << path.join( "::" ); + + const ClassList classList = klass->classList(); + for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it ) + typeNameList( path, lst, *it ); + + path.pop_back(); +} + +static void typedefMap( QMap & map, const CodeModel * model ); +static void typedefMap( QMap & map, NamespaceDom ns ); +static void typedefMap( QMap & map, ClassDom klass ); + +QMap typedefMap( const CodeModel* model ) +{ + QMap map; + typedefMap( map, model ); + + /*We need to flatten the typedefs to avoid circular aliases. + Example: + map["Foo"] = "int"; + map["Bar"] = "Foo"; + map["Baz"] = "Bar";*/ + + QMap::iterator it = map.begin(); + for ( ; it != map.end(); ++it ) + { + while ( map.contains( map[ it.key() ] ) && + it.key() != map[ it.key() ] ) + { + map[ it.key() ] = map[ map[ it.key() ] ]; + } + } + + return map; +} + +static void typedefMap( QMap & map, const CodeModel * model ) +{ + const FileList fileList = model->fileList(); + for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ) + typedefMap( map, model_cast(*it) ); +} + +static void typedefMap( QMap & map, NamespaceDom ns ) +{ + const TypeAliasList aliasList = ns->typeAliasList(); + for( TypeAliasList::ConstIterator it=aliasList.begin(); it!=aliasList.end(); ++it ) + map[ ( *it )->name() ] = ( *it )->type(); + + const NamespaceList namespaceList = ns->namespaceList(); + for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it ) + typedefMap( map, *it ); + + const ClassList classList = ns->classList(); + for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it ) + typedefMap( map, *it ); +} + +static void typedefMap( QMap & map, ClassDom klass ) +{ + const TypeAliasList aliasList = klass->typeAliasList(); + for( TypeAliasList::ConstIterator it=aliasList.begin(); it!=aliasList.end(); ++it ) + map[ ( *it )->name() ] = ( *it )->type(); + + const ClassList classList = klass->classList(); + for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it ) + typedefMap( map, *it ); +} + +QString formattedOpeningParenthesis(bool suppressSpace) +{ + KConfig * config = kapp->config(); + config->setGroup("AStyle"); + bool use_spaces = config->readBoolEntry("PadParentheses", false); + if (not use_spaces or suppressSpace) return "("; + return "( "; +} + +QString formattedClosingParenthesis(bool suppressSpace) +{ + KConfig * config = kapp->config(); + config->setGroup("AStyle"); + bool use_spaces = config->readBoolEntry("PadParentheses", false); + if (not use_spaces or suppressSpace) return ")"; + return " )"; +} + +//kate: indent-mode csands; tab-width 4; space-indent off; diff --git a/languages/cpp/cppsupport_utils.h b/languages/cpp/cppsupport_utils.h new file mode 100644 index 00000000..9182dd08 --- /dev/null +++ b/languages/cpp/cppsupport_utils.h @@ -0,0 +1,28 @@ +/*************************************************************************** +* Copyright (C) 2003 by Roberto Raggi * +* roberto@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef __cppsupport_utils_h +#define __cppsupport_utils_h + +#include +#include + +#include "codemodel.h" + +QStringList typeNameList( const CodeModel* model ); +QMap typedefMap( const CodeModel* model ); + +QString formattedOpeningParenthesis(bool suppressSpace = false); +QString formattedClosingParenthesis(bool suppressSpace = false); + +#endif // __cppsupport_utils_h +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/cppsupportfactory.cpp b/languages/cpp/cppsupportfactory.cpp new file mode 100644 index 00000000..77a586c9 --- /dev/null +++ b/languages/cpp/cppsupportfactory.cpp @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (C) 2000-2001 by Bernd Gehrmann * + * bernd@kdevelop.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include +#include "cppsupportfactory.h" + +K_EXPORT_COMPONENT_FACTORY( libkdevcppsupport, CppSupportFactory ) + +static const KDevPluginInfo data("kdevcppsupport"); + +CppSupportFactory::CppSupportFactory() +: KDevGenericFactory( data ) +{ +} + +KInstance *CppSupportFactory::createInstance() +{ + KInstance *instance = KDevGenericFactory::createInstance(); + KStandardDirs *dirs = instance->dirs(); + dirs->addResourceType( "newclasstemplates", KStandardDirs::kde_default("data") + "kdevcppsupport/newclass/" ); + dirs->addResourceType( "pcs", KStandardDirs::kde_default( "data" ) + "kdevcppsupport/pcs/" ); + + return instance; +} + +const KDevPluginInfo * CppSupportFactory::info() +{ + return &data; +} +//kate: indent-mode csands; tab-width 4; space-indent off; + + diff --git a/languages/cpp/cppsupportfactory.h b/languages/cpp/cppsupportfactory.h new file mode 100644 index 00000000..78f53a7f --- /dev/null +++ b/languages/cpp/cppsupportfactory.h @@ -0,0 +1,33 @@ +/*************************************************************************** +* Copyright (C) 2000-2001 by Bernd Gehrmann * +* bernd@kdevelop.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef _CPPSUPPORTFACTORY_H_ +#define _CPPSUPPORTFACTORY_H_ + +#include +#include "cppsupportpart.h" + +class KDevPluginInfo; + +class CppSupportFactory : public KDevGenericFactory +{ +public: + CppSupportFactory(); + + static const KDevPluginInfo *info(); + +protected: + virtual KInstance *createInstance(); +}; + +#endif +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/cppsupportpart.cpp b/languages/cpp/cppsupportpart.cpp new file mode 100644 index 00000000..f72b168c --- /dev/null +++ b/languages/cpp/cppsupportpart.cpp @@ -0,0 +1,3186 @@ +/*************************************************************************** +* Copyright (C) 1999 by Jonas Nordin * +* jonas.nordin@syncom.se * +* Copyright (C) 2000-2001 by Bernd Gehrmann * +* bernd@kdevelop.org * +* Copyright (C) 2002-2003 by Roberto Raggi * +* roberto@kdevelop.org * +* Copyright (C) 2003-2004 by Alexander Dymo * +* adymo@mksat.net * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + + +#include "cppsupportpart.h" +#include "cppsupport_events.h" +#include "problemreporter.h" +#include "backgroundparser.h" +#include "store_walker.h" +#include "ast.h" +#include "ast_utils.h" +#include "cppcodecompletion.h" +#include "ccconfigwidget.h" +#include "KDevCppSupportIface.h" +#include "cppsupportfactory.h" +#include "catalog.h" +#include "cpp_tags.h" +#include "kdevdriver.h" +#include "cppcodecompletionconfig.h" +#include "cppsplitheadersourceconfig.h" +#include "tag_creator.h" +#include "cppsupport_utils.h" +#include "classgeneratorconfig.h" +#include "urlutil.h" +#include "creategettersetterconfiguration.h" +#include "kdevsourceformatter.h" +#include "kdevcreatefile.h" +#include "qtbuildconfig.h" +#include "kdeveditorutil.h" +#include +#include +// wizards +#include "cppnewclassdlg.h" +#include "subclassingdlg.h" +#include "addmethoddialog.h" +#include "addattributedialog.h" +#include "creategettersetterdialog.h" +// designer integration +#include "qtdesignercppintegration.h" +#include "cppimplementationwidget.h" +#include "configproblemreporter.h" +#include "codeinformationrepository.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +const bool alwaysParseInBackground = true; + +enum { KDEV_DB_VERSION = 21 }; +enum { KDEV_PCS_VERSION = 18 }; + +QStringList CppSupportPart::m_sourceMimeTypes = QStringList() << "text/x-csrc" << "text/x-c++src"; +QStringList CppSupportPart::m_headerMimeTypes = QStringList() << "text/x-chdr" << "text/x-c++hdr"; + +QStringList CppSupportPart::m_sourceExtensions = QStringList::split( ",", "c,C,cc,cpp,c++,cxx,m,mm,M" ); +QStringList CppSupportPart::m_headerExtensions = QStringList::split( ",", "h,H,hh,h++,hxx,hpp,inl,tlh,diff,ui.h" ); + +class CppDriver: public KDevDriver +{ +public: + CppDriver( CppSupportPart* cppSupport ) : KDevDriver( cppSupport, true ) + {} + + void fileParsed( ParsedFile& fileName ) + { + //kdDebug(9007) << "-----> file " << fileName << " parsed!" << endl; + + ParsedFilePointer ast = takeTranslationUnit( fileName.fileName() ); + + if ( cppSupport() ->problemReporter() ) + { + cppSupport() ->problemReporter() ->removeAllProblems( fileName.fileName() ); + + QValueList pl = problems( fileName.fileName() ); + QValueList::ConstIterator it = pl.begin(); + while ( it != pl.end() ) + { + const Problem & p = *it++; + cppSupport() ->problemReporter() ->reportProblem( fileName.fileName(), p ); + } + } + + StoreWalker walker( fileName.fileName(), cppSupport() ->codeModel() ); + + if ( cppSupport() ->codeModel() ->hasFile( fileName.fileName() ) ) + { + FileDom file = cppSupport() ->codeModel() ->fileByName( fileName.fileName() ); + cppSupport() ->removeWithReferences( fileName.fileName() ); + } + + walker.parseTranslationUnit( *ast ); + cppSupport() ->codeModel() ->addFile( walker.file() ); + remove + ( fileName.fileName() ); + + if( cppSupport()->_jd ) { + cppSupport()->_jd->backgroundState ++; + cppSupport()->_jd->lastParse = QTime::currentTime(); + } + + QFileInfo fileInfo( fileName.fileName() ); + QString path = URLUtil::canonicalPath( fileName.fileName() ); + + cppSupport()->m_timestamp[ path ] = fileInfo.lastModified(); + + cppSupport()->emitSynchronousParseReady( fileName.fileName(), ast ); + } +}; + +// ProblemReporter doesn't really depend on background parsing, so it's a bit of a mixup to +// handle them together, but it's the same config widget so... +class BackgroundParserConfig +{ + bool m_useProblemReporter; + bool m_useBackgroundParser; + int m_backgroundParseDelay; +public: + void readConfig() + { + KConfig* config = kapp->config(); + config->setGroup( "General Options" ); + m_useProblemReporter = config->readBoolEntry( "EnableProblemReporter", true ); + m_useBackgroundParser = config->readBoolEntry( "EnableCppBgParser", true ); + m_backgroundParseDelay = config->readNumEntry( "BgParserDelay", 500 ); + } + + bool useProblemReporter() { return m_useProblemReporter; } + bool useBackgroundParser() { return m_useBackgroundParser; } + int backgroudParseDelay() { return m_backgroundParseDelay; } +}; + + +CppSupportPart::CppSupportPart( QObject *parent, const char *name, const QStringList &args ) +: KDevLanguageSupport( CppSupportFactory::info(), parent, name ? name : "KDevCppSupport" ), m_backgroundParser(0), + m_activeDocument( 0 ), m_activeView( 0 ), m_activeSelection( 0 ), m_activeEditor( 0 ), m_activeViewCursor( 0 ), + m_projectClosed( true ), m_projectClosing( false ), m_valid( false ), m_isTyping( false ), m_hadErrors( false ), + _jd(0) +{ + setInstance( CppSupportFactory::instance() ); + + m_pCompletionConfig = new CppCodeCompletionConfig( this, projectDom() ); + m_pSplitHeaderSourceConfig = new CppSplitHeaderSourceConfig( this, projectDom() ); + m_pCreateGetterSetterConfiguration = new CreateGetterSetterConfiguration( this ); connect( m_pSplitHeaderSourceConfig, SIGNAL( stored() ), + this, SLOT( splitHeaderSourceConfigStored() ) ); + connect( m_pCompletionConfig, SIGNAL( stored() ), + this, SLOT( codeCompletionConfigStored() ) ); + m_qtBuildConfig = new QtBuildConfig( this, projectDom() ); + m_qtBuildConfig->store(); + + m_backgroundParserConfig = new BackgroundParserConfig; + m_backgroundParserConfig->readConfig(); + + m_driver = new CppDriver( this ); + m_problemReporter = 0; + + m_textChangedTimer = new QTimer( this ); + connect( m_textChangedTimer, SIGNAL(timeout()), this, SLOT(slotParseCurrentFile()) ); + + m_cursorMovedTimer = new QTimer( this ); + connect( m_cursorMovedTimer, SIGNAL(timeout()), this, SLOT(slotCursorPositionChanged()) ); + + +// m_deleteParserStoreTimer = new QTimer( this ); + m_saveMemoryTimer = new QTimer( this ); + m_buildSafeFileSetTimer = new QTimer( this ); +// m_functionHintTimer = new QTimer( this ); + connect( m_buildSafeFileSetTimer, SIGNAL(timeout()), this, SLOT(buildSafeFileSet()) ); + connect( m_saveMemoryTimer, SIGNAL(timeout()), this, SLOT(slotSaveMemory()) ); +// connect( m_deleteParserStoreTimer, SIGNAL(timeout()), this, SLOT(slotDeleteParserStore()) ); + resetParserStoreTimer(); + m_saveMemoryTimer->start( 240000, false ); //Free some memory every 4 minutes + // connect( m_functionHintTimer, SIGNAL(timeout()), this, SLOT(slotFunctionHint()) ); + + setXMLFile( "kdevcppsupport.rc" ); + + m_catalogList.setAutoDelete( true ); + + connect( core(), SIGNAL( projectOpened() ), this, SLOT( projectOpened() ) ); + connect( core(), SIGNAL( projectClosed() ), this, SLOT( projectClosed() ) ); + connect( core(), SIGNAL( languageChanged() ), this, SLOT( projectOpened() ) ); + connect( partController(), SIGNAL( savedFile( const KURL& ) ), + this, SLOT( savedFile( const KURL& ) ) ); + connect( core(), SIGNAL( contextMenu( QPopupMenu *, const Context * ) ), + this, SLOT( contextMenu( QPopupMenu *, const Context * ) ) ); + connect( partController(), SIGNAL( activePartChanged( KParts::Part* ) ), + this, SLOT( activePartChanged( KParts::Part* ) ) ); + connect( partController(), SIGNAL( partRemoved( KParts::Part* ) ), + this, SLOT( partRemoved( KParts::Part* ) ) ); + + connect( core(), SIGNAL( configWidget( KDialogBase* ) ), + this, SLOT( configWidget( KDialogBase* ) ) ); + + m_switchHeaderSourceAction = new KAction( i18n( "Switch Header/Implementation" ), SHIFT + Key_F12, + this, SLOT( slotSwitchHeader() ), + actionCollection(), "edit_switchheader" ); + m_switchHeaderSourceAction->setToolTip( i18n( "Switch between header and implementation files" ) ); + m_switchHeaderSourceAction->setWhatsThis( i18n( "Switch Header/Implementation

" + "If you are currently looking at a header file, this " + "brings you to the corresponding implementation file. " + "If you are looking at an implementation file (.cpp etc.), " + "this brings you to the corresponding header file." ) ); + m_switchHeaderSourceAction->setEnabled( false ); + + KAction *action; + + action = new KAction( i18n( "Complete Text" ), CTRL + Key_Space, + this, SLOT( slotCompleteText() ), + actionCollection(), "edit_complete_text" ); + action->setToolTip( i18n( "Complete current expression" ) ); + action->setWhatsThis( i18n( "Complete Text

Completes current expression using " + "memory class store for the current project and persistent class stores " + "for external libraries." ) ); + action->setEnabled( false ); + + m_createGetterSetterAction = new KAction( i18n( "Create Accessor Methods" ), 0, + this, SLOT( slotCreateAccessMethods() ), actionCollection(), + "edit_create_getter_setter" ); + + action = new KAction( i18n( "Make Member" ), 0, Key_F2, + this, SLOT( slotMakeMember() ), + actionCollection(), "edit_make_member" ); + action->setToolTip( i18n( "Make member" ) ); + action->setWhatsThis( i18n( "Make member

Creates a class member function in implementation file " + "based on the member declaration at the current line." ) ); + action->plug( &m_DummyActionWidget ); + + action = new KAction( i18n( "Navigation Menu" ), 0, CTRL + ALT + Key_Space, + this, SLOT( slotNavigate() ), + actionCollection(), "edit_navigate" ); + action->setToolTip( i18n( "Show the navigation-menu" ) ); + action->setWhatsThis( i18n( "Navigate

Shows a navigation-menu based on the type-evaluation of the item under the cursor." ) ); + action->plug( &m_DummyActionWidget ); + + + action = new KAction( i18n( "New Class..." ), "classnew", 0, + this, SLOT( slotNewClass() ), + actionCollection(), "project_newclass" ); + action->setToolTip( i18n( "Generate a new class" ) ); + action->setWhatsThis( i18n( "New Class

Calls the New Class wizard." ) ); + + m_pCompletion = 0; + + withcpp = false; + if ( args.count() == 1 && args[ 0 ] == "Cpp" ) + withcpp = true; + + // daniel + connect( core( ), SIGNAL( projectConfigWidget( KDialogBase* ) ), this, + SLOT( projectConfigWidget( KDialogBase* ) ) ); + + new KDevCppSupportIface( this ); + //(void) dcopClient(); + + m_lockupTester = new UIBlockTester( 100 ); +} + + +CppSupportPart::~CppSupportPart() +{ + delete m_lockupTester; + + if ( !m_projectClosed ) + projectClosed(); + + delete( m_driver ); + m_driver = 0; + + if ( m_backgroundParser ) + { + m_backgroundParser->close(); + // m_backgroundParser->wait(); + delete m_backgroundParser; + m_backgroundParser = 0; + } + + codeRepository() ->setMainCatalog( 0 ); + + QPtrListIterator it( m_catalogList ); + while ( Catalog * catalog = it.current() ) + { + ++it; + codeRepository() ->unregisterCatalog( catalog ); + } + + + delete m_backgroundParserConfig; + m_backgroundParserConfig = 0; + + delete m_pCompletion; + m_pCompletion = 0; + +/* mainWindow()->removeView( m_problemReporter ); + delete m_problemReporter; + m_problemReporter = 0; +*/ + delete _jd; + _jd = 0; + + kdDebug( 9007 ) << k_funcinfo << endl; +} + + +void CppSupportPart::customEvent( QCustomEvent* ev ) +{ + kdDebug( 9007 ) << "CppSupportPart::customEvent(" << ev->type() << ")" << endl; + + QTime t; + t.start(); + bool fromDisk = false; + + if ( ev->type() == int( Event_FileParsed ) ) + { + resetParserStoreTimer(); + + FileParsedEvent * event = ( FileParsedEvent* ) ev; + fromDisk = event->fromDisk(); + QString fileName = event->fileName(); + bool hasErrors = false; + if ( m_problemReporter ) + { + m_problemReporter->removeAllProblems( fileName ); + + QValueList problems = event->problems(); + QValueList::ConstIterator it = problems.begin(); + while ( it != problems.end() ) + { + const Problem & p = *it++; + if ( p.level() == Problem::Level_Error ) + hasErrors = true; + + m_problemReporter->reportProblem( fileName, p ); + } + } + ParsedFilePointer p = m_backgroundParser->translationUnit( fileName ); + if( p && !p->includedFrom().isEmpty() ) { + kdDebug( 9007 ) << "customEvent() parsed included file \"" << fileName << "\" included from \"" << p->includedFrom() << "\"" << endl; + } else { + kdDebug( 9007 ) << "customEvent() parsed file \"" << fileName << "\"" << endl; + } + + if( p && !p->includedFrom().isEmpty() ) { + if( !project()->isProjectFile( fileName ) ) { + //The file was parsed to resolve a dependency, and is not a project file + addToRepository( p ); + } else { + //It is a project-file that was parsed for whatever reason to resolve a dependency(currently it isn't handled this way) + } + } else if( !project()->isProjectFile( fileName ) || !m_parseEmitWaiting.reject( fileName ) ) { + ParseEmitWaiting::Processed p = m_parseEmitWaiting.processFile( fileName, ( !m_hadErrors && hasErrors && !fromDisk && m_isTyping && fileName == m_activeFileName ) ? ParseEmitWaiting::HadErrors : ParseEmitWaiting::None ); + parseEmit( p ); + + //Increase status-bar + if( p.hasFlag( ParseEmitWaiting::Silent ) && _jd ) { + _jd->backgroundState ++; + _jd->lastParse = QTime::currentTime(); + } + + } else { + ParseEmitWaiting::Processed p = m_fileParsedEmitWaiting.processFile( fileName ); + if( !p.hasFlag( ParseEmitWaiting::Silent ) ) + emitFileParsed( p ); + + //Increase status-bar + if( p.hasFlag( ParseEmitWaiting::Silent ) && _jd ) { + _jd->backgroundState ++; + _jd->lastParse = QTime::currentTime(); + } + } + } +} + + +void CppSupportPart::projectConfigWidget( KDialogBase* dlg ) +{ + QVBox * vbox = 0; + + vbox = dlg->addVBoxPage( i18n( "C++ Support" ), i18n( "C++ Support" ), + BarIcon( info() ->icon(), KIcon::SizeMedium ) ); + CCConfigWidget* w = new CCConfigWidget( this, vbox ); + connect( dlg, SIGNAL( okClicked( ) ), w, SLOT( accept( ) ) ); +} + +void CppSupportPart::configWidget( KDialogBase *dlg ) +{ + QVBox * vbox = dlg->addVBoxPage( i18n( "C++ Class Generator" ), i18n( "C++ Class Generator" ), + BarIcon( info() ->icon(), KIcon::SizeMedium ) ); + ClassGeneratorConfig *w = new ClassGeneratorConfig( vbox, "classgenerator config widget" ); + connect( dlg, SIGNAL( okClicked() ), w, SLOT( storeConfig() ) ); + + vbox = dlg->addVBoxPage(i18n("C++ Parsing"), i18n("C++ Parsing"), + BarIcon( "source_cpp", KIcon::SizeMedium) ); + ConfigureProblemReporter* ww = new ConfigureProblemReporter( vbox ); + ww->setPart( this ); + connect(dlg, SIGNAL(okClicked()), ww, SLOT(accept())); +} + +void CppSupportPart::activePartChanged( KParts::Part *part ) +{ + kdDebug( 9032 ) << "CppSupportPart::activePartChanged()" << endl; + + bool enabled = false; + +// m_functionHintTimer->stop(); + + if ( m_activeView ) + { + disconnect( m_activeView, SIGNAL( cursorPositionChanged() ), this, 0 ); + } + if ( m_activeDocument ) + { + disconnect( m_activeDocument, SIGNAL(textChanged()), this, 0 ); + } + + m_isTyping = false; + m_hadErrors = true; + m_activeDocument = dynamic_cast( part ); + m_activeView = part ? dynamic_cast( part->widget() ) : 0; + m_activeEditor = dynamic_cast( part ); + m_activeSelection = dynamic_cast( part ); + m_activeViewCursor = dynamic_cast( m_activeView ); + + m_activeFileName = QString::null; + + if ( m_activeDocument ) + { + m_activeFileName = URLUtil::canonicalPath( m_activeDocument->url().path() ); + QFileInfo fi( m_activeFileName ); + QString ext = fi.extension(); + if ( isSource( m_activeFileName ) || isHeader( m_activeFileName ) ) + enabled = true; + } + + actionCollection() ->action( "edit_switchheader" ) ->setEnabled( enabled ); + actionCollection() ->action( "edit_complete_text" ) ->setEnabled( enabled ); + actionCollection() ->action( "edit_make_member" ) ->setEnabled( enabled ); + + if ( !part || !part->widget() ) + return ; + + if ( m_activeDocument ) + { + connect( m_activeDocument, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) ); + m_textChangedTimer->start( 250, true ); // kick the parse timer, we might want to parse the current file + } + + if ( m_activeViewCursor ) + { + connect( m_activeView, SIGNAL( cursorPositionChanged() ), this, SLOT(slotCursorMoved()) ); +// this, SLOT( slotCursorPositionChanged() ) ); + } + + +#if 0 + KTextEditor::TextHintInterface* textHintIface = dynamic_cast( m_activeView ); + if ( !textHintIface ) + return ; + + connect( view, SIGNAL( needTextHint( int, int, QString& ) ), + this, SLOT( slotNeedTextHint( int, int, QString& ) ) ); + + textHintIface->enableTextHints( 1000 ); +#endif +} + + +void CppSupportPart::setTyping( bool typing ) { + m_isTyping = typing; + if( m_problemReporter) { + m_hadErrors &= m_problemReporter->hasErrors(m_activeFileName);///m_hadErrors generally stores whether there was an error-free state of the file. + } +} + + +void CppSupportPart::projectOpened( ) +{ + kdDebug( 9007 ) << "projectOpened( )" << endl; + + m_backgroundParser = new BackgroundParser( this, &m_eventConsumed ); + m_backgroundParser->start( QThread::IdlePriority ); + + // setup the driver + QString conf_file_name = specialHeaderName(); + if ( QFile::exists( conf_file_name ) ) + m_driver->parseFile( conf_file_name, true, true, true ); + + m_projectDirectory = URLUtil::canonicalPath( project() ->projectDirectory() ); + m_projectFileList = project() ->allFiles(); + + setupCatalog(); + + embedProblemReporter(); + + connect( core(), SIGNAL( configWidget( KDialogBase* ) ), + m_problemReporter, SLOT( configWidget( KDialogBase* ) ) ); + + connect( project( ), SIGNAL( addedFilesToProject( const QStringList & ) ), + this, SLOT( addedFilesToProject( const QStringList & ) ) ); + connect( project( ), SIGNAL( removedFilesFromProject( const QStringList & ) ), + this, SLOT( removedFilesFromProject( const QStringList & ) ) ); + connect( project( ), SIGNAL( changedFilesInProject( const QStringList & ) ), + this, SLOT( changedFilesInProject( const QStringList & ) ) ); + connect( project(), SIGNAL( projectCompiled() ), + this, SLOT( slotProjectCompiled() ) ); + + m_timestamp.clear(); + m_parseEmitWaiting.clear(); + m_fileParsedEmitWaiting.clear(); + + m_pCompletion = new CppCodeCompletion( this ); + m_projectClosed = false; + + m_buildSafeFileSetTimer->start( 500, true ); + updateParserConfiguration(); //Necessary to respect custom include-paths and such + + QTimer::singleShot( 500, this, SLOT( initialParse( ) ) ); +} + +void CppSupportPart::embedProblemReporter( bool force ) +{ + if ( force || m_backgroundParserConfig->useProblemReporter() ) + { + m_problemReporter = new ProblemReporter( this, 0, "problemReporterWidget" ); + m_problemReporter->setIcon( SmallIcon( "info" ) ); + m_problemReporter->setCaption( i18n( "Problem Reporter" ) ); + mainWindow( ) ->embedOutputView( m_problemReporter, i18n( "Problems" ), i18n( "Problem reporter" ) ); + } +} + +void CppSupportPart::removeProblemReporter() +{ + mainWindow()->removeView( m_problemReporter ); + delete m_problemReporter; + m_problemReporter = 0; +} + + +void CppSupportPart::projectClosed( ) +{ + kdDebug( 9007 ) << "projectClosed( )" << endl; + + m_projectClosing = true; + + QStringList enabledPCSs; + QValueList catalogs = codeRepository() ->registeredCatalogs(); + for ( QValueList::Iterator it = catalogs.begin(); it != catalogs.end(); ++it ) + { + Catalog* c = *it; + if ( c->enabled() ) + enabledPCSs.push_back( QFileInfo( c->dbName() ).baseName(true) ); + } + DomUtil::writeListEntry( *project() ->projectDom(), "kdevcppsupport/references", "pcs", enabledPCSs ); + + for ( QMap::const_iterator it = m_designers.begin(); + it != m_designers.end(); ++it ) + { + kdDebug( 9007 ) << "calling save settings fro designer integration" << endl; + it.data() ->saveSettings( *project() ->projectDom(), "kdevcppsupport/designerintegration" ); + } + + saveProjectSourceInfo(); + + m_pCompletionConfig->store(); + + delete _jd; + _jd = 0; + + removeProblemReporter(); + + delete m_pCompletion; + m_parseEmitWaiting.clear(); + m_fileParsedEmitWaiting.clear(); + m_pCompletion = 0; + m_projectClosed = true; + m_projectClosing = false; +} + + +void CppSupportPart::slotNavigate() { + if( codeCompletion() && m_activeView && m_activeViewCursor ) { + unsigned int curLine = 0, curCol = 0; + m_activeViewCursor->cursorPositionReal( &curLine, &curCol ); + + if( m_navigationMenu ) delete (KPopupMenu*)m_navigationMenu; + + m_navigationMenu = new KPopupMenu( m_activeView ); + + codeCompletion()->contextEvaluationMenus( m_navigationMenu, 0, curLine, curCol ); + + m_navigationMenu->move( m_activeView->mapToGlobal( m_activeViewCursor->cursorCoordinates() ) ); + if ( m_navigationMenu->count() > 0 ) + { + m_navigationMenu->show(); + } + } +} + + +void CppSupportPart::contextMenu( QPopupMenu *popup, const Context *context ) +{ + m_activeClass = 0; + m_activeFunction = 0; + m_activeVariable = 0; + m_curAttribute = 0; + m_curClass = 0; + + if ( context->hasType( Context::EditorContext ) ) + { + int id; + + m_switchHeaderSourceAction->plug( popup ); + + // CodeModelItemContext + if ( context->type() == Context::EditorContext ) + { + m_curClass = currentClass(); + if ( m_curClass != 0 ) + { + m_curAttribute = currentAttribute( m_curClass ); + if ( m_curAttribute != 0 ) + m_createGetterSetterAction->plug( popup ); + } + } + + QString text; + int atline, atcol; + MakeMemberHelper( text, atline, atcol ); + if ( !text.isEmpty() ) + { + id = popup->insertItem( i18n( "Make Member" ), this, SLOT( slotMakeMember() ) ); + popup->setWhatsThis( id, i18n( "Make member

Creates a class member function in implementation file " + "based on the member declaration at the current line." ) ); + } + + kdDebug( 9007 ) << "======> code model has the file: " << m_activeFileName << " = " << codeModel() ->hasFile( m_activeFileName ) << endl; + + bool showContextMenuExplosion = false; + bool showContextTypeEvaluation = false; + KConfig *config = CppSupportFactory::instance() ->config(); + if ( config ) + { + config->setGroup( "General" ); + showContextMenuExplosion = config->readBoolEntry( "ShowContextMenuExplosion", false ); + config->setGroup( "General" ); + showContextTypeEvaluation = config->readBoolEntry( "ShowContextTypeEvaluation", true ); + } + + + if( codeModel() ->hasFile( m_activeFileName ) ) { + + if( showContextTypeEvaluation && m_activeViewCursor != 0 ) { + if( codeCompletion() ) { + unsigned int curLine = 0, curCol = 0; + m_activeViewCursor->cursorPositionReal( &curLine, &curCol ); + + codeCompletion()->contextEvaluationMenus( popup, context, curLine, curCol ); + } + } + + + if ( showContextMenuExplosion ) + { + //kdDebug( 9007 ) << "CppSupportPart::contextMenu 1" << endl; + QString candidate; + if ( isSource( m_activeFileName ) ) + candidate = sourceOrHeaderCandidate(); + else + candidate = m_activeFileName; + + unsigned int curLine = 0, curCol = 0; + if ( m_activeViewCursor != 0 ) + m_activeViewCursor->cursorPositionReal( &curLine, &curCol ); + + //kdDebug( 9007 ) << "CppSupportPart::contextMenu 2: candidate: " << candidate << endl; + + if ( !candidate.isEmpty() && codeModel() ->hasFile( candidate ) ) + { + QPopupMenu * m2 = new QPopupMenu( popup ); + id = popup->insertItem( i18n( "Go to Declaration" ), m2 ); + popup->setWhatsThis( id, i18n( "Go to declaration

Provides a menu to select available function declarations " + "in the current file and in the corresponding header (if the current file is an implementation) or source (if the current file is a header) file." ) ); + + FileDom file2 = codeModel() ->fileByName( candidate ); + //kdDebug( 9007 ) << "CppSupportPart::contextMenu 3: " << file2->name() << endl; + + FunctionList functionList2 = CodeModelUtils::allFunctions( file2 ); + for ( FunctionList::ConstIterator it = functionList2.begin(); it != functionList2.end(); ++it ) + { + QString text = ( *it ) ->scope().join( "::" ); + //kdDebug( 9007 ) << "CppSupportPart::contextMenu 3 text: " << text << endl; + if ( !text.isEmpty() ) + { + text += "::"; + } + text += formatModelItem( *it, true ); + text = text.replace( QString::fromLatin1( "&" ), QString::fromLatin1( "&&" ) ); + int id = m2->insertItem( text, this, SLOT( gotoDeclarationLine( int ) ) ); + int line, column; + ( *it ) ->getStartPosition( &line, &column ); + m2->setItemParameter( id, line ); + } + + if ( m2->count() == 0 ) + { + popup->removeItem( id ); + } + //kdDebug( 9007 ) << "CppSupportPart::contextMenu 4" << endl; + } + + QString candidate1; + if ( isHeader( m_activeFileName ) ) + { + candidate1 = sourceOrHeaderCandidate(); + } + else + { + candidate1 = m_activeFileName; + } + //kdDebug( 9007 ) << "CppSupportPart::go to definition in " << candidate1 << endl; + if ( codeModel() ->hasFile( candidate1 ) ) + { + QPopupMenu * m = new QPopupMenu( popup ); + id = popup->insertItem( i18n( "Go to Definition" ), m ); + popup->setWhatsThis( id, i18n( "Go to definition

Provides a menu to select available function definitions " + "in the current file and in the corresponding header (if the current file is an implementation) or source (if the current file is a header) file." ) ); + + const FileDom file = codeModel() ->fileByName( candidate1 ); + const FunctionDefinitionList functionDefinitionList = CodeModelUtils::allFunctionDefinitionsDetailed( file ).functionList; + for ( FunctionDefinitionList::ConstIterator it = functionDefinitionList.begin(); it != functionDefinitionList.end(); ++it ) + { + QString text = ( *it ) ->scope().join( "::" ); + if ( !text.isEmpty() ) + { + text += "::"; + } + text += formatModelItem( *it, true ); + text = text.replace( QString::fromLatin1( "&" ), QString::fromLatin1( "&&" ) ); + int id = m->insertItem( text, this, SLOT( gotoLine( int ) ) ); + int line, column; + ( *it ) ->getStartPosition( &line, &column ); + m->setItemParameter( id, line ); + } + if ( m->count() == 0 ) + { + popup->removeItem( id ); + } + + } + } + } + + const EditorContext *econtext = static_cast( context ); + QString str = econtext->currentLine(); + if ( str.isEmpty() ) + return ; + } + else if ( context->hasType( Context::CodeModelItemContext ) ) + { + const CodeModelItemContext * mcontext = static_cast( context ); + + if ( mcontext->item() ->isClass() ) + { + m_activeClass = ( ClassModel* ) mcontext->item(); + int id = popup->insertItem( i18n( "Extract Interface..." ), this, SLOT( slotExtractInterface() ) ); + popup->setWhatsThis( id, i18n( "Extract interface

Extracts interface from the selected class and creates a new class with this interface. " + "No implementation code is extracted and no implementation code is created." ) ); + } + else if ( mcontext->item() ->isFunction() ) + { + m_activeFunction = ( FunctionModel* ) mcontext->item(); + } + } + else if ( context->hasType( Context::FileContext ) ) + { + const FileContext * fc = static_cast( context ); + //this is a .ui file and only selection contains only one such file + KURL url = fc->urls().first(); + kdDebug( 9007 ) << "file context with " << url.path() << endl; + if ( url.fileName().endsWith( ".ui" ) ) + { + m_contextFileName = url.path(); + int id = popup->insertItem( i18n( "Create or Select Implementation..." ), this, SLOT( slotCreateSubclass() ) ); + popup->setWhatsThis( id, i18n( "Create or select implementation

Creates or selects a subclass of selected form for use with integrated KDevDesigner." ) ); + } + } +} + + +QStringList makeListUnique( const QStringList& rhs ) { + QMap map; + QStringList ret; + for( QStringList::const_iterator it = rhs.begin(); it != rhs.end(); ++it ) { + if( map.find( *it ) == map.end() ) { + ret << *it; + map.insert( *it, true ); + } + } + return ret; +} + +// Makes sure that header files come first +QStringList CppSupportPart::reorder( const QStringList &list ) +{ + QStringList headers, others; + + QStringList headerExtensions = QStringList::split( ",", "h,H,hh,hxx,hpp,tlh" ); + + QString projectPath = project()->projectDirectory(); + + QStringList::ConstIterator it; + for ( it = list.begin(); it != list.end(); ++it ) + { + QString filePath = *it; + // brilliant stuff.. this method is apparently called both with + // relative and absolute paths.. + if ( !filePath.startsWith("/") ) + { + filePath = projectPath + "/" + filePath; + } + if( !isValidSource( filePath ) ) continue; + if ( headerExtensions.contains( QFileInfo( filePath ).extension() ) ) + headers << ( filePath ); + else + others << ( filePath ); + } + + return makeListUnique( headers + others ); +} + +void CppSupportPart::addedFilesToProject( const QStringList &fileList ) +{ + m_projectFileList = project() ->allFiles(); + QStringList files = reorder( fileList ); + + for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) + { + QString path = *it; + if (!path.startsWith("/")) + path = URLUtil::canonicalPath( m_projectDirectory + "/" + ( *it ) ); + + maybeParse( path ); + //emit addedSourceInfo( path ); + } + m_buildSafeFileSetTimer->start( 500, true ); +} + +void CppSupportPart::removedFilesFromProject( const QStringList &fileList ) +{ + m_projectFileList = project() ->allFiles(); + for ( QStringList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it ) + { + QString path = URLUtil::canonicalPath( m_projectDirectory + "/" + *it ); + kdDebug( 9007 ) << "=====================> remove file: " << path << endl; + + removeWithReferences( path ); + m_backgroundParser->removeFile( path ); + } + m_buildSafeFileSetTimer->start( 500, true ); +} + +void CppSupportPart::changedFilesInProject( const QStringList & fileList ) +{ + QStringList files = reorder( fileList ); + + for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) + { + QString path = URLUtil::canonicalPath( m_projectDirectory + "/" + *it ); + + maybeParse( path ); + //emit addedSourceInfo( path ); + } +} + +void CppSupportPart::savedFile( const KURL &file ) +{ + if( file.path() == m_activeFileName ) { + m_isTyping = false; + m_hadErrors = false; + maybeParse( file.path() ); + } + + Q_UNUSED( file.path() ); + +#if 0 // not needed anymore + + kdDebug( 9007 ) << "savedFile(): " << fileName.mid ( m_projectDirectory.length() + 1 ) << endl; + + if ( m_projectFileList.contains( fileName.mid ( m_projectDirectory.length() + 1 ) ) ) + { + maybeParse( fileName ); + emit addedSourceInfo( fileName ); + } +#endif +} + +QString CppSupportPart::findSourceFile() +{ + // get the path of the currently active document + QFileInfo fi( m_activeFileName ); + QString path = fi.filePath(); + QString ext = fi.extension(); + // extract the base path (full path without '.' and extension) + QString base = path.left( path.length() - ext.length() - 1 ); + QStringList candidates; + if ( QStringList::split( ',', "h,H,hh,hxx,hpp,tlh" ).contains( ext ) ) + { + candidates << ( base + ".c" ); + candidates << ( base + ".cc" ); + candidates << ( base + ".cpp" ); + candidates << ( base + ".c++" ); + candidates << ( base + ".cxx" ); + candidates << ( base + ".C" ); + candidates << ( base + ".m" ); + candidates << ( base + ".mm" ); + candidates << ( base + ".M" ); + candidates << ( base + ".inl" ); + candidates << ( base + "_impl.h" ); + } + + QStringList::ConstIterator it; + for ( it = candidates.begin(); it != candidates.end(); ++it ) + { + kdDebug( 9007 ) << "Trying " << ( *it ) << endl; + if ( QFileInfo( *it ).exists() ) + { + return * it; + } + } + return m_activeFileName; +} + +QString CppSupportPart::sourceOrHeaderCandidate( const KURL &url ) +{ + QString urlPath; + if ( url.isEmpty() ) + { + KTextEditor::Document * doc = + dynamic_cast( partController() ->activePart() ); + if ( !doc ) + return QString::null; + urlPath = doc->url().path(); + } + else + { + urlPath = url.path(); + } + // get the path of the currently active document + QFileInfo fi( urlPath ); + QString path = fi.filePath(); + // extract the exension + QString ext = fi.extension(); + if ( ext.isEmpty() ) + return QString::null; + // extract the base path (full path without '.' and extension) + QString base = path.left( path.length() - ext.length() - 1 ); + //kdDebug( 9007 ) << "base: " << base << ", ext: " << ext << endl; + // just the filename without the extension + QString fileNameWoExt = fi.fileName(); + if ( !ext.isEmpty() ) + fileNameWoExt.replace( "." + ext, "" ); + QString possibleExts; + // depending on the current extension assemble a list of + // candidate files to look for + QStringList candidates; + // special case for template classes created by the new class dialog + if ( path.endsWith( "_impl.h" ) ) + { + QString headerpath = path; + headerpath.replace( "_impl.h", ".h" ); + candidates << headerpath; + fileNameWoExt.replace( "_impl", "" ); + possibleExts = "h"; + } + // if file is a header file search for implementation file + else if ( QStringList::split( ',', "h,H,hh,hxx,hpp,tlh" ).contains( ext ) ) + { + candidates << ( base + ".c" ); + candidates << ( base + ".cc" ); + candidates << ( base + ".cpp" ); + candidates << ( base + ".c++" ); + candidates << ( base + ".cxx" ); + candidates << ( base + ".C" ); + candidates << ( base + ".m" ); + candidates << ( base + ".mm" ); + candidates << ( base + ".M" ); + candidates << ( base + ".inl" ); + candidates << ( base + "_impl.h" ); + possibleExts = "c,cc,cpp,c++,cxx,C,m,mm,M,inl,_impl.h"; + } + // if file is an implementation file, search for header file + else if ( QStringList::split( ',', "c,cc,cpp,c++,cxx,C,m,mm,M,inl" ).contains( ext ) ) + { + candidates << ( base + ".h" ); + candidates << ( base + ".H" ); + candidates << ( base + ".hh" ); + candidates << ( base + ".hxx" ); + candidates << ( base + ".hpp" ); + candidates << ( base + ".tlh" ); + possibleExts = "h,H,hh,hxx,hpp,tlh"; + } + // search for files from the assembled candidate lists, return the first + // candidate file that actually exists or QString::null if nothing is found. + QStringList::ConstIterator it; + for ( it = candidates.begin(); it != candidates.end(); ++it ) + { + //kdDebug( 9007 ) << "Trying " << ( *it ) << endl; + if ( QFileInfo( *it ).exists() ) + { + kdDebug( 9007 ) << "using: " << *it << endl; + return * it; + } + } + //kdDebug( 9007 ) << "Now searching in project files." << endl; + // Our last resort: search the project file list for matching files + QStringList::iterator fileIt; + QFileInfo candidateFileWoExt; + QString candidateFileWoExtString; + QStringList possibleExtsList = QStringList::split( ',', possibleExts ); + for ( fileIt = m_projectFileList.begin(); fileIt != m_projectFileList.end(); ++fileIt ) + { + candidateFileWoExt.setFile(*fileIt); + //kdDebug( 9007 ) << "candidate file: " << *fileIt << endl; + if( !candidateFileWoExt.extension().isEmpty() ) + candidateFileWoExtString = candidateFileWoExt.fileName().replace( "." + candidateFileWoExt.extension(), "" ); + if ( candidateFileWoExtString == fileNameWoExt ) + { + if ( possibleExtsList.contains( candidateFileWoExt.extension() ) || candidateFileWoExt.extension().isEmpty() ) + { + //kdDebug( 9007 ) << "checking if " << *fileIt << " exists" << endl; + if ( QFileInfo( *fileIt ).exists() ) + kdDebug( 9007 ) << "using: " << *fileIt << endl; + return *fileIt; + } + } + } + return QString::null; +} + +void CppSupportPart::slotSaveMemory() { + if( m_backgroundParser ) { + ///This is done so the caches are completely empty after kdevelop was idle for some time(else it would be waste of memory). The background-parsers internal lexer-cache-manager just cares about keeping the count of cached files under a specific count, but doesn't decrease that count when kdevelop is idle. + m_backgroundParser->lock(); + m_backgroundParser->saveMemory(); + m_backgroundParser->unlock(); + } +} + +void CppSupportPart::slotSwitchHeader( bool scrollOnly ) +{ + bool attemptMatch = true; + KConfig *config = CppSupportFactory::instance() ->config(); + if ( config ) + { + config->setGroup( "General" ); + attemptMatch = config->readBoolEntry( "SwitchShouldMatch", true ); + } + + // ok, both files exist. Do the codemodel have them? + if ( codeModel() ->hasFile( m_activeFileName ) && m_activeViewCursor && attemptMatch ) + { + unsigned int currentline, column; + m_activeViewCursor->cursorPositionReal( ¤tline, &column ); + + if ( switchHeaderImpl( m_activeFileName, currentline, column, scrollOnly ) ) + return; + } + + // last chance + KURL url; + url.setPath( sourceOrHeaderCandidate() ); + + if ( scrollOnly ) + return; + else if ( !splitHeaderSourceConfig()->splitEnabled() ) + partController() ->editDocument( url ); + else + partController() ->splitCurrentDocument( url ); +} + +bool CppSupportPart::switchHeaderImpl( const QString& file, int line, int col, bool scrollOnly ) +{ + bool handled = false; + + FunctionDom d; + FileDom fd = codeModel() ->fileByName( file ); + if ( fd ) { + CodeModelUtils::CodeModelHelper h( codeModel(), fd ); + d = h.functionAt( line, col ); + } + if ( d ) { + if( d->isFunctionDefinition() ) { + FunctionDom decl = findFunction( d ); + if ( decl ) { + if ( (void*)&decl != (void*)d.data() && ( !scrollOnly || decl->fileName() != file ) ) { + jumpToCodeModelItem( model_cast(decl), scrollOnly ); + handled = true; + } + } + } else { + FunctionDom def = findFunctionDefinition( d ); + if ( def ) { + if ( def != d && ( !scrollOnly || def->fileName() != file ) ) { + jumpToCodeModelItem( model_cast(def), scrollOnly ); + handled = true; + } + } + } + } + + return handled; +} + +FunctionDom CppSupportPart::findFunction( const FunctionDom& def ) +{ + // We have a definition so we're looking for a declaration. The declaration will either be the child of a namespace node (non class members) + // or the child of a class node (class member). Search recursively until we find a declaration that matches. + FunctionDom bestMatch; + FunctionDom decl = findFunctionInNamespace( codeModel()->globalNamespace(), def, codeModel()->globalNamespace()->namespaceImports(), + sourceOrHeaderCandidate( def->fileName() ), 0, bestMatch ); + return decl ? decl : bestMatch; +} + +FunctionDom CppSupportPart::findFunctionInNamespace( const NamespaceDom& ns, const FunctionDom& def, const std::set& nsImports, + const QString& candidateFile, int scopeIndex, FunctionDom& bestMatch ) +{ + FunctionDom d; + QStringList scope = def->scope(); + if ( !(scopeIndex >= (signed) scope.size()) ) { + NamespaceDom ns_next = ns->namespaceByName( scope[ scopeIndex ] ); + if ( ns_next ) { + d = findFunctionInNamespace( ns_next, def, ns_next->namespaceImports(), candidateFile, scopeIndex+1, bestMatch ); + } + if ( !d ) { + for ( std::set::const_iterator it_ns = nsImports.begin(); it_ns != nsImports.end(); ++it_ns ) { + if ( (*it_ns).fileName().str() == def->fileName() ) { + ns_next = ns->namespaceByName( (*it_ns).name() ); + if ( ns_next ) { + if ( d = findFunctionInNamespace( ns_next, def, nsImports, candidateFile, scopeIndex, bestMatch ) ) break; + } + } + } + } + if ( !d ) { + ClassList classList = ns->classByName( scope[ scopeIndex ] ); + for ( ClassList::ConstIterator it_cs = classList.begin(); it_cs != classList.end(); ) { + if ( d = findFunctionInClass( *(it_cs++), def, nsImports, candidateFile, scopeIndex+1, bestMatch ) ) break; + } + } + } + if ( !d ) { + FunctionList functionList = ns->functionByName( def->name() ); + for ( FunctionList::ConstIterator it_decl = functionList.begin(); it_decl != functionList.end(); ++it_decl ) { + if ( CodeModelUtils::compareDeclarationToDefinition( *it_decl, (FunctionDefinitionModel*) def.data(), nsImports ) ) { + ParsedFile* p = dynamic_cast( def->file()->parseResult().data() ); + if ( p ) { + if ( p->includeFiles()[ (*it_decl)->fileName() ] ) { + d = *it_decl; + break; + } else if ( (*it_decl)->fileName() == candidateFile ) { + d = *it_decl; + break; + } + } + if ( !bestMatch ) { + bestMatch = *it_decl; + } + } + } + } + return d; +} + +FunctionDom CppSupportPart::findFunctionInClass( const ClassDom& cs, const FunctionDom& def, const std::set& nsImports, + const QString& candidateFile, int scopeIndex, FunctionDom& bestMatch ) +{ + FunctionDom d; + QStringList scope = def->scope(); + if ( !(scopeIndex >= (signed) scope.size()) ) { + ClassList classList = cs->classByName( scope[ scopeIndex ] ); + for ( ClassList::ConstIterator it_cs = classList.begin(); it_cs != classList.end(); ) { + if ( d = findFunctionInClass( *(it_cs++), def, nsImports, candidateFile, scopeIndex+1, bestMatch ) ) break; + } + } + if ( !d ) { + FunctionList functionList = cs->functionByName( def->name() ); + for ( FunctionList::ConstIterator it_decl = functionList.begin(); it_decl != functionList.end(); ++it_decl ) { + if ( CodeModelUtils::compareDeclarationToDefinition( *it_decl, (FunctionDefinitionModel*) def.data(), nsImports ) ) { + ParsedFile* p = dynamic_cast( def->file()->parseResult().data() ); + if ( p ) { + if ( p->includeFiles()[ (*it_decl)->fileName() ] ) { + d = *it_decl; + break; + } else if ( (*it_decl)->fileName() == candidateFile ) { + d = *it_decl; + break; + } + } + if ( !bestMatch ) { + bestMatch = *it_decl; + } + } + } + } + return d; +} + +FunctionDom CppSupportPart::findFunctionDefinition( const FunctionDom& decl ) +{ + // We have a declaration so we're looking for a definition. The definition will be the child of some namespace node (never a class node). + // Since the definition can be the child of any namespace in its scope depending on syntax, we have to check every one. + FunctionDom def, bestMatch; + NamespaceDom ns = codeModel()->globalNamespace(); + QString candidateFile = sourceOrHeaderCandidate( decl->fileName() ); + FunctionDefinitionList functionList = ns->functionDefinitionByName( decl->name() ); + for ( FunctionDefinitionList::ConstIterator it_def = functionList.begin(); it_def != functionList.end() && !def; ++it_def ) { + if ( CodeModelUtils::compareDeclarationToDefinition( decl, *it_def, ns->namespaceImports() ) ) { + ParsedFile* p = dynamic_cast( (*it_def)->file()->parseResult().data() ); + if ( p ) { + if ( p->includeFiles()[ decl->fileName() ] ) { + def = *it_def; + } else if ( (*it_def)->fileName() == candidateFile ) { + def = *it_def; + break; + } + } + if ( !bestMatch ) { + bestMatch = *it_def; + } + } + } + QStringList scope = decl->scope(); + for ( QStringList::ConstIterator it_scope = scope.begin(); it_scope != scope.end() && !def; ++it_scope ) { + NamespaceDom ns_next = ns->namespaceByName( *it_scope ); + if ( ns_next ) { + ns = ns_next; + FunctionDefinitionList functionList = ns->functionDefinitionByName( decl->name() ); + for ( FunctionDefinitionList::ConstIterator it_def = functionList.begin(); it_def != functionList.end() && !def; ++it_def ) { + if ( CodeModelUtils::compareDeclarationToDefinition( decl, *it_def, ns->namespaceImports() ) ) { + ParsedFile* p = dynamic_cast( (*it_def)->file()->parseResult().data() ); + if ( p ) { + if ( p->includeFiles()[ decl->fileName() ] ) { + def = *it_def; + } else if ( (*it_def)->fileName() == candidateFile ) { + def = *it_def; + break; + } + } + if ( !bestMatch ) { + bestMatch = *it_def; + } + } + } + } + } + return def ? def : bestMatch; +} + +void CppSupportPart::jumpToCodeModelItem( const ItemDom& item, bool scrollOnly ) +{ + static KURL lastSyncedUrl; + static int lastSyncedLine = -1; + + int line, col; + item->getStartPosition( &line, &col ); + + KURL url( item->fileName() ); + + if ( scrollOnly ) { + KParts::ReadOnlyPart* part = partController()->partForURL( url ); + int currentLine = lastSyncedLine; + if ( part ) { + KTextEditor::ViewCursorInterface *iface = dynamic_cast(part->widget()); + if( iface ) + iface->cursorPosition( (uint*) ¤tLine, (uint*) &col ); + } + partController() ->scrollToLineColumn( url, line, -1, lastSyncedLine != currentLine || lastSyncedUrl != url ); + } else if ( !splitHeaderSourceConfig()->splitEnabled() ) + partController() ->editDocument( url, line ); + else + partController() ->splitCurrentDocument( url, line ); + lastSyncedLine = line; + lastSyncedUrl = url; +} + +KDevLanguageSupport::Features CppSupportPart::features() +{ + if ( withcpp ) + return Features( Classes | Structs | Functions | Variables | Namespaces | Declarations + | Signals | Slots | AddMethod | AddAttribute | NewClass | CreateAccessMethods ); + else + return Features ( Structs | Functions | Variables | Declarations ); +} + +QString CppSupportPart::formatClassName( const QString &name ) +{ + QString n = name; + return n.replace( ".", "::" ); +} + +QString CppSupportPart::unformatClassName( const QString &name ) +{ + QString n = name; + return n.replace( "::", "." ); +} + +bool CppSupportPart::shouldSplitDocument(const KURL &url) +{ + if ( !splitHeaderSourceConfig()->splitEnabled() ) + return false; + + KURL::List list = partController()->openURLs(); + KURL::List::ConstIterator it = list.begin(); + while ( it != list.end() ) + { + QString candidate = sourceOrHeaderCandidate( ( *it ) ); + if ( candidate.isEmpty() ) + { + ++it; + continue; + } + + KURL urlCandidate; + urlCandidate.setPath( candidate ); + if ( url == urlCandidate ) + { + // It is already open, so switch to it so + // our split view will open with it + partController() ->editDocument( ( *it ) ); + return true; + } + ++it; + } + return false; +} + +Qt::Orientation CppSupportPart::splitOrientation() const +{ + QString o = splitHeaderSourceConfig()->orientation(); + if ( o == "Vertical" ) + return Qt::Vertical; + else + return Qt::Horizontal; +} + +void CppSupportPart::slotNewClass() +{ + CppNewClassDialog dlg( this ); + dlg.exec(); +} + +void CppSupportPart::addMethod( ClassDom klass ) +{ + if ( !klass ) + { + KMessageBox::error( 0, i18n( "Please select a class." ), i18n( "Error" ) ); + return ; + } + + AddMethodDialog dlg( this, klass, mainWindow() ->main() ); + dlg.exec(); +} + +void CppSupportPart::addAttribute( ClassDom klass ) +{ + if ( !klass ) + { + KMessageBox::error( 0, i18n( "Please select a class." ), i18n( "Error" ) ); + return ; + } + + AddAttributeDialog dlg( this, klass, mainWindow() ->main() ); + dlg.exec(); +} + +void CppSupportPart::slotCompleteText() +{ + if ( !m_pCompletion ) + return ; + m_pCompletion->completeText( true ); +} + +/** + * parsing stuff for project persistent classstore and code completion + */ +void CppSupportPart::initialParse( ) +{ + // For debugging + if ( !project( ) ) + { + // messagebox ? + kdDebug( 9007 ) << "No project" << endl; + return ; + } + + parseProject( ); + m_valid = true; + return ; +} + +bool CppSupportPart::parseProject( bool force ) +{ + if( _jd ) + delete _jd->progressBar; ///Make sure the progress-bar is open + + mainWindow() ->statusBar() ->message( i18n( "Updating..." ) ); + + kapp->setOverrideCursor( waitCursor ); + + _jd = new JobData; + if( QFileInfo( project() ->projectDirectory() + "/" + project()->projectName().lower() + + ".kdevelop.pcs" ).exists()) + { + QDir d( project() ->projectDirectory()); + d.rename(project() ->projectName().lower() + ".kdevelop.pcs", + project() ->projectName() +".kdevelop.pcs"); + } + _jd->file.setName( project() ->projectDirectory() + "/" + project()->projectName() + + ".kdevelop.pcs" ); + + QString skip_file_name = project() ->projectDirectory() + "/" + + project() ->projectName() + ".kdevelop.ignore_pcs"; + QString skip_lower_file_name = project() ->projectDirectory() + "/" + + project() ->projectName().lower() + ".kdevelop.ignore_pcs"; + + if ( !force && !QFile::exists( skip_file_name ) && + !QFile::exists( skip_lower_file_name ) && _jd->file.open( IO_ReadOnly ) ) + { + _jd->stream.setDevice( &( _jd->file ) ); + + createIgnorePCSFile(); + + QString sig; + int pcs_version = 0; + _jd->stream >> sig >> pcs_version; + if ( sig == "PCS" && pcs_version == KDEV_PCS_VERSION ) + { + + int numFiles = 0; + _jd->stream >> numFiles; + kdDebug( 9007 ) << "Read " << numFiles << " files from pcs" << endl; + + for ( int i = 0; i < numFiles; ++i ) + { + QString fn; + uint ts; + uint offset; + + _jd->stream >> fn >> ts >> offset; + _jd->pcs[ fn ] = qMakePair( ts, offset ); + } + } + } + + _jd->files = reorder( modifiedFileList() ); + + QProgressBar* bar = new QProgressBar( _jd->files.count( ), mainWindow( ) ->statusBar( ) ); + bar->setMinimumWidth( 120 ); + bar->setCenterIndicator( true ); + mainWindow( ) ->statusBar( ) ->addWidget( bar ); + bar->show( ); + + _jd->progressBar = bar; + _jd->dir.setPath( m_projectDirectory ); + _jd->it = _jd->files.begin(); + _jd->reparseList = QStringList(); + _jd->backgroundCount = 0; + _jd->cycle = 0; + + QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) ); + + m_saveMemoryTimer->stop(); //Do not regularly remove cached files that may still be needed while parsing(the cache anyway be full for the whole parsing-process) + return true; +} + +void CppSupportPart::slotParseFiles() +{ + // NOTE: The checking for m_projectClosed is actually (currently) not needed. + // When the project is closed, the language support plugin is destroyed + // and as a consequence, the timer job signal never arrives at this method + + if ( !_jd ) return; // how can this possibly happen?! + + if ( _jd->cycle == 0 && !m_projectClosed && _jd->it != _jd->files.end() ) + { + _jd->progressBar->setProgress( _jd->progressBar->progress() + 1 ); + + QFileInfo fileInfo( _jd->dir, *( _jd->it ) ); + + if ( fileInfo.exists() && fileInfo.isFile() && fileInfo.isReadable() ) + { + QString absFilePath = URLUtil::canonicalPath( fileInfo.absFilePath() ); + + if ( isValidSource( absFilePath ) ) + { + QDateTime t = fileInfo.lastModified(); + + if ( ! ( m_timestamp.contains( absFilePath ) && m_timestamp[ absFilePath ] == t ) ) + { + if ( _jd->pcs.contains( absFilePath ) ) + { + _jd->stream.device() ->at( _jd->pcs[ absFilePath ].second ); + FileDom file = codeModel() ->create(); + file->read( _jd->stream ); + codeModel() ->addFile( file ); + + if( t.toTime_t() != _jd->pcs[ absFilePath ].first ) { + ///The FileDom had to be created first, so the dependencies are known + _jd->reparseList << file->name(); +/* kdDebug( 9007 ) << "File timestamp: " << ": " << t.toTime_t() << endl; + kdDebug( 9007 ) << "Stored timestamp: " << ": " << _jd->pcs[ absFilePath ].first << endl;*/ + } else { + m_timestamp[ absFilePath ] = t; +/* kdDebug( 9007 ) << "timestamp ok" << endl;*/ + } + } else { + _jd->reparseList << absFilePath; + /* kdDebug( 9007 ) << absFilePath << " put into reparse-list" << endl; + */ } + } else { +/* kdDebug( 9007 ) << absFilePath << " is already in code-model" << endl;*/ + } + } + } + + ++( _jd->it ); + QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) ); + + if( _jd->it == _jd->files.end()) { + if( _jd->reparseList.isEmpty() ) { + _jd->backgroundCount = 0; + } else { + if( alwaysParseInBackground ) { + _jd->backgroundCount = parseFilesAndDependencies( _jd->reparseList, true, false, true ); + } else { + _jd->reparseList = reorder( _jd->reparseList ); + _jd->it = _jd->reparseList.begin(); + _jd->backgroundCount = _jd->reparseList.count(); + } + _jd->progressBar->setProgress( 0 ); ///restart progress-bar for reparsing + _jd->progressBar->setTotalSteps( _jd->backgroundCount ); + } + + _jd->lastBackgroundState = -1; + _jd->backgroundState = 0; + _jd->cycle = 1; + _jd->lastParse = QTime::currentTime(); + kapp->restoreOverrideCursor( ); + } + } + else // finished or interrupted + { + if( _jd->backgroundCount <= _jd->backgroundState || m_projectClosed ) { + mainWindow( ) ->statusBar( ) ->removeWidget( _jd->progressBar ); + + if ( !m_projectClosed ) + { + kdDebug( 9007 ) << "updating sourceinfo" << endl; + kapp->restoreOverrideCursor( ); + emit updatedSourceInfo(); + mainWindow( ) ->statusBar( ) ->message( i18n( "Done" ), 2000 ); + QFile::remove( project() ->projectDirectory() + + "/" + project() ->projectName() + + ".kdevelop.ignore_pcs" ); + QFile::remove( project() ->projectDirectory() + + "/" + project() ->projectName().lower() + + ".kdevelop.ignore_pcs" ); + + } + else + { + kdDebug( 9007 ) << "ABORT" << endl; + } + + delete _jd; + _jd = 0; + m_saveMemoryTimer->start( 240000, false ); + } else { + _jd->progressBar->setProgress( _jd->backgroundState ); ///restart + _jd->progressBar->setTotalSteps( _jd->backgroundCount ); + if( _jd->lastParse.msecsTo( QTime::currentTime()) > 60000 && !m_backgroundParser->filesInQueue()) { + _jd->backgroundCount = _jd->backgroundState; ///Stop waiting if there is no progress and no file in the background-parser + QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) ); + } else { + int timeStep = 0; + if( alwaysParseInBackground ) { + QTimer::singleShot( 10, this, SLOT( slotParseFiles() ) ); + } else { + if( _jd->it == _jd->reparseList.end() ) { + /*_jd->it = _jd->files.end(); + _jd->backgroundCount = _jd->backgroundState; ///finish processing*/ + timeStep = 1; + } else { + /*///Parse the files one by one + if( _jd->lastParse.msecsTo( QTime::currentTime()) > 100 || _jd->backgroundState != _jd->lastBackgroundState ) {*/ + maybeParse( *_jd->it, false ); + ++(_jd->it); + _jd->lastBackgroundState = _jd->backgroundState; + /*}else{ + timeStep = 1; + }*/ + } + QTimer::singleShot( timeStep, this, SLOT( slotParseFiles() ) ); + } + } + } + } +} + +void CppSupportPart::maybeParse( const QString& fn, bool background ) +{ + if ( !isValidSource( fn ) ) + return ; + + QFileInfo fileInfo( fn ); + QString path = URLUtil::canonicalPath( fn ); + QDateTime t = fileInfo.lastModified(); + + if ( !fileInfo.exists() ) + return; + + QMap::Iterator it = m_timestamp.find( path ); + if ( codeModel()->hasFile( fn ) && it != m_timestamp.end() && *it == t ) + return; + + QStringList l; + l << fn; + parseFilesAndDependencies( l, background ); +} + +bool CppSupportPart::isQueued( const QString& file ) const { + //int c = m_backgroundParser->countInQueue( file ); + //if( c == 0 ) return false; + return m_parseEmitWaiting.waiting( file, ParseEmitWaiting::Silent, 2 ); //Since it may be possible that the background-parser is currently parsing the file(in an obselete state), it is allowed to have the file in the queue twice. +} + +void CppSupportPart::slotNeedTextHint( int line, int column, QString& textHint ) +{ + if ( 1 || !m_activeEditor ) + return ; + + m_backgroundParser->lock(); + TranslationUnitAST* ast = *m_backgroundParser->translationUnit( m_activeFileName ); + AST* node = 0; + if ( ast && ( node = findNodeAt( ast, line, column ) ) ) + { + + while ( node && node->nodeType() != NodeType_FunctionDefinition ) + node = node->parent(); + + if ( node ) + { + int startLine, startColumn; + int endLine, endColumn; + node->getStartPosition( &startLine, &startColumn ); + node->getEndPosition( &endLine, &endColumn ); + + if ( !node->text().isNull() ) + textHint = node->text(); + else + textHint = m_activeEditor->textLine( startLine ).simplifyWhiteSpace(); + } + } + m_backgroundParser->unlock(); +} + +void CppSupportPart::MakeMemberHelper( QString& text, int& atLine, int& atColumn ) +{ + if ( !m_activeViewCursor || !m_valid ) + return ; + + atLine = -2; + atColumn = 0; + + QString implFile = findSourceFile(); + + m_backgroundParser->lock(); + TranslationUnitAST* translationUnit = *m_backgroundParser->translationUnit( m_activeFileName ); + if ( translationUnit ) + { + bool fail = false; + unsigned int line, column; + m_activeViewCursor->cursorPositionReal( &line, &column ); + + AST* currentNode = findNodeAt( translationUnit, line, column ); + DeclaratorAST* declarator = 0; + while ( currentNode && currentNode->nodeType() != NodeType_SimpleDeclaration ) + { + if ( currentNode->nodeType() == NodeType_Declarator ) + declarator = ( DeclaratorAST* ) currentNode; + currentNode = currentNode->parent(); + } + SimpleDeclarationAST* decl = currentNode ? ( SimpleDeclarationAST* ) currentNode : 0; + + if ( decl && decl->storageSpecifier() && decl->storageSpecifier()->text().contains("friend") ) + { + kdDebug(9007) << "this is a friend declaration, don't create any definition" << endl; + fail = true; + } + + if ( !fail && decl && decl->initDeclaratorList() && !declarator ) + { + InitDeclaratorAST * i = decl->initDeclaratorList() ->initDeclaratorList().at( 0 ); + if ( i ) + declarator = i->declarator(); + } + + if ( !fail && decl && declarator && declarator->parameterDeclarationClause() ) + { + + QStringList scope; + scopeOfNode( decl, scope ); + + QString scopeStr = scope.join( "::" ); + if ( !scopeStr.isEmpty() ) + scopeStr += "::"; + + QString declStr = declaratorToString( declarator, scopeStr ).simplifyWhiteSpace(); + if ( declarator->exceptionSpecification() ) + { + declStr += QString::fromLatin1( " throw( " ); + QPtrList l = declarator->exceptionSpecification() ->nodeList(); + QPtrListIterator type_it( l ); + while ( type_it.current() ) + { + declStr += type_it.current() ->text(); + ++type_it; + + if ( type_it.current() ) + declStr += QString::fromLatin1( ", " ); + } + + declStr += QString::fromLatin1( " )" ); + } + + text += "\n\n"; + QString type = typeSpecToString( decl->typeSpec() ); + text += type; + if ( !type.isNull() ) + text += + " "; + + text += declStr + "\n{\n}"; + } + + if ( !fail ) + { + translationUnit = *m_backgroundParser->translationUnit( implFile ); + if ( translationUnit ) + translationUnit->getEndPosition( &atLine, &atColumn ); + } + + kdDebug( 9007 ) << "at line in mm: " << atLine << endl; + } + m_backgroundParser->unlock(); +} + +void CppSupportPart::slotMakeMember() +{ + QString text; + int atColumn, atLine; + MakeMemberHelper( text, atLine, atColumn ); + + if ( !text.isEmpty() ) + { + QString implFile = findSourceFile(); + + if ( !implFile.isEmpty() ) + { + partController() ->editDocument( KURL( implFile ) ); + kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers, 500 ); + } + if ( atLine == -2 ) + atLine = m_activeEditor->numLines() - 1; + + m_backgroundParser->lock () + ; + + kdDebug( 9007 ) << "at line in mm: " << atLine << " atCol: " << atColumn << endl; + kdDebug( 9007 ) << "text: " << text << endl; + if ( m_activeEditor ) + m_activeEditor->insertText( atLine, atColumn, text ); + if ( m_activeViewCursor ) + m_activeViewCursor->setCursorPositionReal( atLine + 3, 1 ); + + m_backgroundParser->unlock(); + } +} + +QStringList CppSupportPart::subclassWidget( const QString& formName ) +{ + QStringList newFileNames; + SubclassingDlg *dlg = new SubclassingDlg( this, formName, newFileNames ); + dlg->exec(); + return newFileNames; +} + +QStringList CppSupportPart::updateWidget( const QString& formName, const QString& fileName ) +{ + QStringList dummy; + SubclassingDlg *dlg = new SubclassingDlg( this, formName, fileName, dummy ); + dlg->exec(); + return dummy; +} + +void CppSupportPart::partRemoved( KParts::Part* part ) +{ + kdDebug( 9032 ) << "CppSupportPart::partRemoved()" << endl; + + if ( KTextEditor::Document * doc = dynamic_cast( part ) ) + { + + QString fileName = doc->url().path(); + if ( !isValidSource( fileName ) ) + return ; + + QString canonicalFileName = URLUtil::canonicalPath( fileName ); + m_backgroundParser->removeFile( canonicalFileName ); + m_backgroundParser->addFile( canonicalFileName, true ); + } +} + +void CppSupportPart::slotProjectCompiled() +{ + kdDebug( 9007 ) << "CppSupportPart::slotProjectCompiled()" << endl; + parseProject(); +} + +QStringList CppSupportPart::modifiedFileList() +{ + QStringList lst; + + QStringList fileList = m_projectFileList; + QStringList::Iterator it = fileList.begin(); + while ( it != fileList.end() ) + { + QString fileName = *it; + ++it; + + QFileInfo fileInfo( m_projectDirectory, fileName ); + QString path = URLUtil::canonicalPath( fileInfo.absFilePath() ); + + if ( !( isSource( path ) || isHeader( path ) ) ) + continue; + + QDateTime t = fileInfo.lastModified(); + + QMap::Iterator dictIt = m_timestamp.find( path ); + if ( fileInfo.exists() && dictIt != m_timestamp.end() && *dictIt == t ) + continue; + + lst << fileName; + } + + return lst; +} + +KTextEditor::Document * CppSupportPart::findDocument( const KURL & url ) +{ + if ( !partController() ->parts() ) + return 0; + + QPtrList parts( *partController() ->parts() ); + QPtrListIterator it( parts ); + while ( KParts::Part * part = it.current() ) + { + KTextEditor::Document * doc = dynamic_cast( part ); + if ( doc && doc->url() == url ) + return doc; + ++it; + } + + return 0; +} + +void CppSupportPart::setupCatalog( ) +{ + kdDebug( 9007 ) << "CppSupportPart::setupCatalog()" << endl; + + KStandardDirs *dirs = CppSupportFactory::instance() ->dirs(); + QStringList pcsList = dirs->findAllResources( "pcs", "*.db", false, true ); + QStringList pcsIdxList = dirs->findAllResources( "pcs", "*.idx", false, true ); + + QStringList enabledPCSs; + if ( DomUtil::elementByPath( *project() ->projectDom(), "kdevcppsupport/references" ).isNull() ) + { + for ( QStringList::Iterator it = pcsList.begin(); it != pcsList.end(); ++it ) + { + kdDebug( 9007 ) << "CppSupportPart::setupCatalog()1 " << *it << endl; + enabledPCSs.push_back( QFileInfo( *it ).baseName(true) ); + } + } + else + { + enabledPCSs = DomUtil::readListEntry( *project() ->projectDom(), "kdevcppsupport/references", "pcs" ); + } + + QStringList indexList = QStringList() << "kind" << "name" << "scope" << "fileName" << "prefix"; + + if ( pcsList.size() && pcsVersion() < KDEV_DB_VERSION ) + { + QStringList l = pcsList + pcsIdxList; + int rtn = KMessageBox::questionYesNoList( 0, i18n( "Persistent class store will be disabled: you have a wrong version of pcs installed.\nRemove old pcs files?" ), l, i18n( "C++ Support" ), KStdGuiItem::del(), KStdGuiItem::cancel() ); + if ( rtn == KMessageBox::Yes ) + { + QStringList::Iterator it = l.begin(); + while ( it != l.end() ) + { + QFile::remove + ( *it ); + ++it; + } + // @todo regenerate the pcs list + pcsList.clear(); + } + else + { + return ; + } + } + + QStringList::Iterator it = pcsList.begin(); + while ( it != pcsList.end() ) + { + kdDebug( 9007 ) << "CppSupportPart::setupCatalog()2 " << *it << endl; + Catalog * catalog = new Catalog(); + catalog->open( *it ); + catalog->setEnabled( enabledPCSs.contains( QFileInfo( *it ).baseName(true) ) ); + ++it; + + for ( QStringList::Iterator idxIt = indexList.begin(); idxIt != indexList.end(); ++idxIt ) + catalog->addIndex( ( *idxIt ).utf8() ); + + m_catalogList.append( catalog ); + codeRepository() ->registerCatalog( catalog ); + } + + setPcsVersion( KDEV_DB_VERSION ); +} + +KMimeType::List CppSupportPart::mimeTypes( ) +{ + QStringList mimeList; + mimeList += m_headerMimeTypes; + mimeList += m_sourceMimeTypes; + + KMimeType::List list; + for ( QStringList::Iterator it = mimeList.begin(); it != mimeList.end(); ++it ) + { + if ( KMimeType::Ptr mime = KMimeType::mimeType( *it ) ) + list << mime; + } + + return list; +} + +int CppSupportPart::pcsVersion() +{ + KConfig * config = CppSupportFactory::instance() ->config(); + KConfigGroupSaver cgs( config, "PCS" ); + return config->readNumEntry( "Version", 0 ); +} + +void CppSupportPart::setPcsVersion( int version ) +{ + KConfig * config = CppSupportFactory::instance() ->config(); + KConfigGroupSaver cgs( config, "PCS" ); + config->writeEntry( "Version", version ); + config->sync(); +} + +QString CppSupportPart::formatTag( const Tag & inputTag ) +{ + Tag tag = inputTag; + + switch ( tag.kind() ) + { + case Tag::Kind_Namespace: + return QString::fromLatin1( "namespace " ) + tag.name(); + + case Tag::Kind_Class: + return QString::fromLatin1( "class " ) + tag.name(); + + case Tag::Kind_Function: + case Tag::Kind_FunctionDeclaration: + { + CppFunction tagInfo( tag ); + return tagInfo.name() + "( " + tagInfo.arguments().join( ", " ) + " ) : " + tagInfo.type(); + } + break; + + case Tag::Kind_Variable: + case Tag::Kind_VariableDeclaration: + { + CppVariable tagInfo( tag ); + return tagInfo.name() + " : " + tagInfo.type(); + } + break; + } + return tag.name(); +} + +void CppSupportPart::codeCompletionConfigStored( ) +{ + if ( m_projectClosing ) return; + updateParserConfiguration(); + /* + m_backgroundParser->updateParserConfiguration(); + + KDevDriver* d = dynamic_cast( m_driver ); //The foreground-parse isn't used anymore, and could be removed + if( d ) { + d->setup(); + d->makeMacrosPersistent(); + }*/ + partController() ->setActivePart( partController()->activePart() ); +} + +void CppSupportPart::splitHeaderSourceConfigStored( ) +{ + QString o = splitHeaderSourceConfig()->orientation(); + if ( o == "Vertical" ) + emit splitOrientationChanged( Qt::Vertical ); + else if ( o == "Horizontal" ) + emit splitOrientationChanged( Qt::Horizontal ); +} + +void CppSupportPart::removeWithReferences( const QString & fileName ) +{ +kdDebug( 9007 ) << "remove with references: " << fileName << endl; + m_timestamp.remove( fileName ); + if ( !codeModel() ->hasFile( fileName ) ) + return ; + + emit aboutToRemoveSourceInfo( fileName ); + + codeModel() ->removeFile( codeModel() ->fileByName( fileName ) ); +} + +bool CppSupportPart::isValidSource( const QString& fileName ) const +{ + QFileInfo fileInfo( fileName ); + QString path = URLUtil::canonicalPath( fileInfo.absFilePath() ); + + return /*project() && project() ->isProjectFile( path ) + &&*/ ( isSource( path ) || isHeader( path ) ) + && !QFile::exists( fileInfo.dirPath( true ) + "/.kdev_ignore" ); +} + +QString CppSupportPart::formatModelItem( const CodeModelItem *item, bool shortDescription ) +{ + if ( item->isFunction() || item->isFunctionDefinition() ) + { + const FunctionModel * model = static_cast( item ); + QString function; + QString args; + ArgumentList argumentList = model->argumentList(); + for ( ArgumentList::const_iterator it = argumentList.begin(); it != argumentList.end(); ++it ) + { + args.isEmpty() ? args += "" : args += ", " ; + args += formatModelItem( ( *it ).data() ); + } + if ( !shortDescription ) + function += ( model->isVirtual() ? QString( "virtual " ) : QString( "" ) ) + model->resultType() + " "; + + function += model->name() + "(" + args + ")" + ( model->isConstant() ? QString( " const" ) : QString( "" ) ) + + ( model->isAbstract() ? QString( " = 0" ) : QString( "" ) ); + + return function; + } + else if ( item->isVariable() ) + { + const VariableModel * model = static_cast( item ); + if ( shortDescription ) + return model->name(); + return model->type() + " " + model->name(); + } + else if ( item->isArgument() ) + { + const ArgumentModel * model = static_cast( item ); + QString arg; + if ( !shortDescription ) + arg += model->type() + " "; + arg += model->name(); + if ( !shortDescription ) + arg += model->defaultValue().isEmpty() ? QString( "" ) : QString( " = " ) + model->defaultValue(); + return arg.stripWhiteSpace(); + } + else + return KDevLanguageSupport::formatModelItem( item, shortDescription ); +} + +void CppSupportPart::addClass() +{ + slotNewClass(); +} + +void CppSupportPart::saveProjectSourceInfo() +{ + const FileList fileList = codeModel() ->fileList(); + + if ( !project() || fileList.isEmpty() ) + return ; + + QFile f( project() ->projectDirectory() + "/" + + project() ->projectName() + ".kdevelop.pcs" ); + if ( !f.open( IO_WriteOnly ) ) + return ; + + m_backgroundParser->lock(); + + createIgnorePCSFile(); + + QDataStream stream( &f ); + QMap offsets; + + QString pcs( "PCS" ); + stream << pcs << KDEV_PCS_VERSION; + + stream << int( fileList.size() ); + for ( FileList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it ) + { + const FileDom dom = ( *it ); + stream << dom->name() << m_timestamp[ dom->name() ].toTime_t(); + if( m_timestamp.find( dom->name() ) == m_timestamp.end() ) { + kdDebug( 9007 ) << dom->name() << ": timestamp is missing " << endl; + } + offsets.insert( dom->name(), stream.device() ->at() ); + stream << ( uint ) 0; // dummy offset + } + + for ( FileList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it ) + { + const FileDom dom = ( *it ); + int offset = stream.device() ->at(); + + dom->write( stream ); + + int end = stream.device() ->at(); + + stream.device() ->at( offsets[ dom->name() ] ); + stream << offset; + stream.device() ->at( end ); + } + + QFile::remove( project() ->projectDirectory() + "/" + + project() ->projectName() + ".kdevelop.ignore_pcs" ); + QFile::remove( project() ->projectDirectory() + "/" + + project() ->projectName().lower() + ".kdevelop.ignore_pcs" ); + + m_backgroundParser->unlock(); +} + +QString CppSupportPart::extractInterface( const ClassDom& klass ) +{ + QString txt; + QTextStream stream( &txt, IO_WriteOnly ); + + QString name = klass->name() + "Interface"; + QString ind; + ind.fill( QChar( ' ' ), 4 ); + + stream + << "class " << name << "\n" + << "{" << "\n" + << "public:" << "\n" + << ind << name << "() {}" << "\n" + << ind << "virtual ~" << name << "() {}" << "\n" + << "\n"; + + const FunctionList functionList = klass->functionList(); + for ( FunctionList::ConstIterator it = functionList.begin(); it != functionList.end(); ++it ) + { + const FunctionDom& fun = *it; + + if ( !fun->isVirtual() || fun->name().startsWith( "~" ) ) + continue; + + stream << ind << formatModelItem( fun ); + if ( !fun->isAbstract() ) + stream << " = 0"; + + stream << ";\n"; + } + + stream + << "\n" + << "private:" << "\n" + << ind << name << "( const " << name << "& source );" << "\n" + << ind << "void operator = ( const " << name << "& source );" << "\n" + << "};" << "\n\n"; + + return txt; +} + +void CppSupportPart::slotExtractInterface( ) +{ + if ( !m_activeClass ) + return ; + + QFileInfo fileInfo( m_activeClass->fileName() ); + QString ifaceFileName = fileInfo.dirPath( true ) + "/" + m_activeClass->name().lower() + "_interface.h"; + if ( QFile::exists( ifaceFileName ) ) + { + KMessageBox::error( mainWindow() ->main(), i18n( "File %1 already exists" ).arg( ifaceFileName ), + i18n( "C++ Support" ) ); + } + else + { + QString text = extractInterface( m_activeClass ); + + QFile f( ifaceFileName ); + if ( f.open( IO_WriteOnly ) ) + { + QTextStream stream( &f ); + stream + << "#ifndef __" << m_activeClass->name().upper() << "_INTERFACE_H" << "\n" + << "#define __" << m_activeClass->name().upper() << "_INTERFACE_H" << "\n" + << "\n" + << extractInterface( m_activeClass ) + << "\n" + << "#endif // __" << m_activeClass->name().upper() << "_INTERFACE_H" << "\n"; + f.close(); + + project() ->addFile( ifaceFileName ); + } + } + + m_activeClass = 0; +} + +void CppSupportPart::gotoLine( int line ) +{ + if ( isHeader( m_activeFileName ) ) + { + KURL url; + url.setPath( sourceOrHeaderCandidate() ); + partController() ->editDocument( url, line ); + } + else + m_activeViewCursor->setCursorPositionReal( line, 0 ); +} + +FileDom CppSupportPart::fileByName( const QString& name) { + return codeModel()->fileByName( name ); +} + + +int CppSupportPart::parseFilesAndDependencies( QStringList files, bool background, bool parseFirst, bool silent ) { + QMap fileGroups; + int nextGroup = 0; + + for( QStringList::iterator it = files.begin(); it != files.end(); ++it ) { + FileDom d = fileByName( *it ); + + QStringList lst; + if( !d ) { + lst << *it; + }else{ + lst = codeModel()->getGroupStrings( d->groupId() ); +/* kdDebug( 9007 ) << "adding group of: " << *it << ":\n" << " which is " << lst.join("\n") << "\n\n";*/ + if( lst.count() > 10 ) { + lst = codeModel()->getGroupStrings( d->groupId() ); + } + } + int cgroup = nextGroup; + nextGroup++; + + if( fileGroups.find( *it ) != fileGroups.end() ) + cgroup = fileGroups[*it]; + + for( QStringList::iterator lit = lst.begin(); lit != lst.end(); ++lit ) + fileGroups[*lit] = cgroup; + } + + QValueVector groups; + groups.resize( nextGroup ); + + ///put the groups together + for( QMap::iterator it = fileGroups.begin(); it != fileGroups.end(); ++it ) { + groups[*it] << it.key(); + } + + for( int a = 0; a < nextGroup; a++ ) { + QStringList group = reorder( groups[a] ); + + +/* kdDebug( 9007 ) << "reparsing the following group: " << ":\n" << group.join("\n") << "\n\n";*/ + if( background ) { + + m_backgroundParser->lock(); + + if( !group.isEmpty() ) { + if( !parseFirst ) + m_parseEmitWaiting.addGroup( group, silent ? ParseEmitWaiting::Silent : ParseEmitWaiting::None ); + else + m_parseEmitWaiting.addGroupFront( group, silent ? ParseEmitWaiting::Silent : ParseEmitWaiting::None ); + if( !silent ) { + if( !parseFirst ) + m_fileParsedEmitWaiting.addGroup( group, silent ? ParseEmitWaiting::Silent : ParseEmitWaiting::None ); + else + m_fileParsedEmitWaiting.addGroupFront( group, silent ? ParseEmitWaiting::Silent : ParseEmitWaiting::None ); + } + } + + if( parseFirst && !group.empty() ) { + for(QStringList::iterator it = --group.end(); it != group.end(); ) { + backgroundParser()->addFileFront(*it); + if( it == group.begin() ) { + it = group.end(); + } else { + --it; + } + } + } else { + for(QStringList::iterator it = group.begin(); it != group.end(); ++it) { + backgroundParser()->addFile(*it); + } + } + + m_backgroundParser->unlock(); + + } else { + for(QStringList::iterator it = group.begin(); it != group.end(); ++it) { + m_driver->parseFile( *it ); + } + } + } + + return fileGroups.count(); +} + +int CppSupportPart::parseFileAndDependencies( const QString & fileName, bool background, bool parseFirst, bool silent ) { + if(! isValidSource( fileName ) ) return 0; + +// kdDebug( 9007 ) << "reparsing dependencies of " << fileName << "\n"; + + return parseFilesAndDependencies( fileName, background, parseFirst, silent ); +} + +void CppSupportPart::parseEmit( ParseEmitWaiting::Processed files ) { + if( files.res.isEmpty() ) return; + + bool modelHasFiles = true; + + for( QStringList::iterator it = files.res.begin(); it != files.res.end(); ++it ) { + if( !codeModel()->hasFile( *it ) ) modelHasFiles = false; + } + + int oldFileCount = codeModel()->fileList().count(); + + if( (files.flag & ParseEmitWaiting::HadErrors) && modelHasFiles && !files.hasFlag( ParseEmitWaiting::Silent ) ) { + mainWindow() ->statusBar() ->message( "File parsed, but not updating code-model because of errors", 2000 ); + kdDebug( 9007 ) << "not updating code-model because at least one file has errors" << endl; + // for( QStringList::iterator it = files.res.begin(); it != files.res.end(); ++it ) + // m_backgroundParser->removeFile( *it ); + } else { + ///update timestamps + for( QStringList::iterator it = files.res.begin(); it != files.res.end(); ++it ) { + if( !codeModel()->hasFile( *it ) ) modelHasFiles = false; + QString& fileName = *it; + + QFileInfo fileInfo( fileName ); + QString path = URLUtil::canonicalPath( fileName ); + + if ( !fileInfo.exists() ) { + removeWithReferences( path ); + continue ; + } + + m_timestamp[ path ] = fileInfo.lastModified(); + } + + if( files.hasFlag( ParseEmitWaiting::Silent ) && !alwaysParseInBackground ) + return; + + m_backgroundParser->lock(); + + QStringList l = files.res; + + QMap wholeResult; + QStringList missing; + + QMap newFiles; + + while(!l.isEmpty() ) { + QString fileName = l.front(); + + if( !m_backgroundParser->hasTranslationUnit( fileName ) ) { + kdDebug( 9007 ) << "error: translation-unit is missing: " << fileName << endl; + missing << fileName; + } else { + if ( ParsedFilePointer ast = m_backgroundParser->translationUnit( fileName ) ) + { + if ( true /*!hasErrors*/ ) + { + FileDom oldFile = codeModel()->fileByName( fileName ); + + StoreWalker walker( fileName, codeModel() ); + walker.setOverrides( newFiles ); + + walker.parseTranslationUnit( *ast ); + + if( oldFile ) { + newFiles[fileName] = walker.file(); + + ///update timestamps + QFileInfo fileInfo( fileName ); + QString path = URLUtil::canonicalPath( fileName ); + + m_timestamp[ path ] = fileInfo.lastModified(); + } else { + codeModel() ->addFile( walker.file() ); + } + + if( walker.file() ) { + QStringList grp = walker.file()->wholeGroupStrings(); + for( QStringList::const_iterator it = grp.begin(); it != grp.end(); ++it ) + wholeResult[*it] = true; + } + } + } else { + kdDebug( 9007 ) << "failed to parse " << fileName << endl; + } + } + + + l.pop_front(); + } + + bool canUpdate = true; + for( QMap::const_iterator it = newFiles.begin(); it != newFiles.end(); ++it ) { + FileDom oldFile = codeModel()->fileByName( it.key() ); + + if( !oldFile || !oldFile->canUpdate( *it ) ) { + canUpdate = false; + break; + } + } + + if( canUpdate ) { + ///Update the code-model + for( QMap::const_iterator it = newFiles.begin(); it != newFiles.end(); ++it ) { + FileDom oldFile = codeModel()->fileByName( it.key() ); + oldFile->update( *it ); + codeModel()->mergeGroups( oldFile->groupId(), (*it)->groupId() ); ///Merge parsing-groups together + } + } else { + ///Remove the current files and replace them with the new ones + for( QMap::const_iterator it = newFiles.begin(); it != newFiles.end(); ++it ) { + removeWithReferences( it.key() ); + codeModel()->addFile( *it ); + } + } + /* + ///make the list unique + + l.clear(); + for( QMap::const_iterator it = wholeResult.begin(); it != wholeResult.end(); ++it ) + l << it.key();*/ + + m_backgroundParser->unlock(); + + if( !missing.isEmpty() ) { + kdDebug( 9007 ) << "error: translation-units were missing: " << missing << endl; + //don't reparse missing units, because it may cause the whole project to be reparsed + // parseFilesAndDependencies( missing, true, false, files.hasFlag( ParseEmitWaiting::Silent ) ); + } + + if( files.hasFlag( ParseEmitWaiting::Silent ) ) { + if( alwaysParseInBackground ) + for( QStringList::iterator it = files.res.begin(); it != files.res.end(); ++it ) + m_backgroundParser->removeFile( *it ); + } else { + if( !canUpdate ) { ///If the current model could be updated, do not emit addedSourceInfo(..) and remove the units from the parser, because nobody will be using them + QStringList l = files.res; + while(!l.isEmpty() ) { + emit aboutToRemoveSourceInfo( l.front() ); + emit removedSourceInfo( l.front() ); + emit addedSourceInfo( l.front() ); + l.pop_front(); + } + + if( !files.hasFlag( ParseEmitWaiting::Silent ) ) + emitFileParsed( files ); + } else { + QStringList l = files.res; + while( !l.isEmpty() ) { + emit codeModelUpdated( l.front() ); + emit aboutToRemoveSourceInfo( l.front() ); + emit removedSourceInfo( l.front() ); + emit addedSourceInfo( l.front() ); + l.pop_front(); + } + } + } + kdDebug( 9007 ) << "files in code-model after parseEmit: " << codeModel()->fileList().count() << " before: " << oldFileCount << endl; + } +} + +/*void CppSupportPart::recomputeCodeModel( const QString& fileName ) +{*/ + +//} + +void CppSupportPart::emitSynchronousParseReady( const QString& file, ParsedFilePointer unit ) { + emit synchronousParseReady( file, unit ); +} + +void CppSupportPart::emitFileParsed( QStringList l ) +{ + while( !l.isEmpty() ) { + emit fileParsed( l.front() ); + l.pop_front(); + } +} + +bool CppSupportPart::isHeader( const QString& fileName ) const +{ + /*KMimeType::Ptr ptr = KMimeType::findByPath( fileName ); + if ( ptr && m_headerMimeTypes.contains( ptr->name() ) ) + return true;*/ + + return ( m_headerExtensions.findIndex( QFileInfo( fileName ).extension() ) != -1 ); +} + +bool CppSupportPart::isSource( const QString& fileName ) const +{ + /*KMimeType::Ptr ptr = KMimeType::findByPath( fileName ); + if ( ptr && m_sourceMimeTypes.contains( ptr->name() ) ) + return true;*/ + + return ( m_sourceExtensions.findIndex( QFileInfo( fileName ).extension() ) != -1 ); +} + +void CppSupportPart::gotoDeclarationLine( int line ) +{ + if ( isHeader( m_activeFileName ) ) + m_activeViewCursor->setCursorPositionReal( line, 0 ); + else + { + KURL url; + url.setPath( sourceOrHeaderCandidate() ); + partController() ->editDocument( url, line ); + } +} + +void CppSupportPart::removeCatalog( const QString & dbName ) +{ + if ( !QFile::exists( dbName ) ) + return ; + + QValueList catalogs = codeRepository() ->registeredCatalogs(); + Catalog* c = 0; + for ( QValueList::Iterator it = catalogs.begin(); it != catalogs.end(); ++it ) + { + if ( ( *it ) ->dbName() == dbName ) + { + c = *it; + break; + } + } + + if ( c ) + { + codeRepository() ->unregisterCatalog( c ); + m_catalogList.remove( c ); + } + + QFileInfo fileInfo( dbName ); + QDir dir( fileInfo.dir( true ) ); + QStringList indexList = QStringList() << "kind" << "name" << "scope" << "fileName" << "prefix"; + for(QStringList::Iterator iter = indexList.begin(); iter != indexList.end(); iter++) + { + QStringList fileList = dir.entryList( fileInfo.baseName(true) +"." +(*iter) + ".idx" ); + for ( QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it ) + { + QString idxName = fileInfo.dirPath( true ) + "/" + *it; + kdDebug( 9007 ) << "=========> remove db index: " << idxName << endl; + dir.remove( *it ); + } + } + dir.remove( fileInfo.fileName() ); +} + +void CppSupportPart::addCatalog( Catalog * catalog ) +{ + m_catalogList.append( catalog ); + codeRepository() ->registerCatalog( catalog ); +} + +FunctionDefinitionDom CppSupportPart::functionDefinitionAt( int line, int column ) +{ + if ( !codeModel() ->hasFile( m_activeFileName ) ) + return FunctionDefinitionDom(); + + CodeModelUtils::CodeModelHelper h( codeModel(), codeModel()->fileByName( m_activeFileName ) ); + + FunctionDom d = h.functionAt( line, column, CodeModelUtils::CodeModelHelper::Definition ); + if( d ) { + FunctionDefinitionModel* m = dynamic_cast( d.data() ); + if( m ) return FunctionDefinitionDom( m ); + } + return FunctionDefinitionDom(); +} + +FunctionDefinitionDom CppSupportPart::currentFunctionDefinition( ) +{ + if ( !this->m_activeViewCursor ) + return FunctionDefinitionDom(); + + unsigned int line, column; + this->m_activeViewCursor->cursorPositionReal( &line, &column ); + return functionDefinitionAt( line, column ); +} + +void CppSupportPart::slotCursorPositionChanged() +{ + if ( codeCompletion() ) + { + unsigned int line = 0; + unsigned int column = 0; + if ( KDevEditorUtil::currentPositionReal( &line, &column, dynamic_cast( partController()->activePart() ) ) ) + { + QString typeInfoString = codeCompletion()->createTypeInfoString( line, column ); + mainWindow()->statusBar()->message( typeInfoString ); + } + } + + // m_functionHintTimer->changeInterval( 1000 ); + if ( splitHeaderSourceConfig()->splitEnabled() + && splitHeaderSourceConfig()->autoSync() ) + slotSwitchHeader( true ); +} + +/* +void CppSupportPart::slotFunctionHint( ) +{ + kdDebug( 9007 ) << "=======> compute current function definition" << endl; +// m_functionHintTimer->stop(); + if ( FunctionDefinitionDom fun = currentFunctionDefinition() ) + { + QStringList scope = fun->scope(); + QString funName = scope.join( "::" ); + if ( !funName.isEmpty() ) + funName += "::"; + + funName += formatModelItem( fun, true ); + + mainWindow() ->statusBar() ->message( funName, 2000 ); + } +} +*/ + +void CppSupportPart::createIgnorePCSFile( ) +{ + static QCString skip_me( "ignore me\n" ); + + QString skip_file_name = project() ->projectDirectory() + "/" + + project() ->projectName() + ".kdevelop.ignore_pcs"; + QFile skip_pcs_file( skip_file_name ); + if ( skip_pcs_file.open( IO_WriteOnly ) ) + { + skip_pcs_file.writeBlock( skip_me ); + skip_pcs_file.close(); + } +} + +QString CppSupportPart::specialHeaderName( bool local ) const +{ + if ( local ) + return ::locateLocal( "data", "kdevcppsupport/configuration", CppSupportFactory::instance() ); + + return ::locate( "data", "kdevcppsupport/configuration", CppSupportFactory::instance() ); +} + +void CppSupportPart::updateParserConfiguration() +{ + m_backgroundParser->updateParserConfiguration(); + + QString conf_file_name = specialHeaderName(); + + m_driver->removeAllMacrosInFile( conf_file_name ); + dynamic_cast(m_driver)->setup(); + m_driver->parseFile( conf_file_name, true, true, true ); + + m_buildSafeFileSetTimer->start( 500, true ); + parseProject( true ); +} + +const Driver* CppSupportPart::driver() const { + return m_driver; +} + +Driver* CppSupportPart::driver() { + return m_driver; +} + +KDevDesignerIntegration * CppSupportPart::designer( KInterfaceDesigner::DesignerType type ) +{ + KDevDesignerIntegration * des = 0; + switch ( type ) + { + case KInterfaceDesigner::Glade: + case KInterfaceDesigner::QtDesigner: + des = m_designers[ type ]; + if ( des == 0 ) + { + CppImplementationWidget * impl = new CppImplementationWidget( this ); + des = new QtDesignerCppIntegration( this, impl ); + des->loadSettings( *project() ->projectDom(), "kdevcppsupport/designerintegration" ); + m_designers[ type ] = des; + } + break; + } + return des; +} + + +void CppSupportPart::resetParserStoreTimer() { + // m_deleteParserStoreTimer->start(10000); ///try to empty the store regularly +} + +void CppSupportPart::slotDeleteParserStore() { + /* if( !m_backgroundParser->filesInQueue() ) + m_backgroundParser->removeAllFiles(); + else + resetParserStoreTimer();*/ +} + + +void CppSupportPart::slotCreateSubclass() +{ + QFileInfo fi( m_contextFileName ); + if ( fi.extension( false ) != "ui" ) + return ; + QtDesignerCppIntegration *des = dynamic_cast( designer( KInterfaceDesigner::QtDesigner ) ); + if ( des ) + des->selectImplementation( m_contextFileName ); +} + +void CppSupportPart::addMethod( ClassDom aClass, const QString& name, const QString type, + const QString& parameters, CodeModelItem::Access accessType, + bool isConst, bool isInline, bool isVirtual, bool isPureVirtual, + const QString& implementation ) +{ + partController() ->editDocument( KURL( aClass->fileName() ) ); + KTextEditor::EditInterface* editIface = dynamic_cast( partController() ->activePart() ); + if ( !editIface ) + { + /// @fixme show messagebox + return ; + } + QString declarationString = type + " " + name + "(" + parameters + ")" + ( isConst ? " const" : "" ); + + KDevSourceFormatter* sourceFormatter = extension( "KDevelop/SourceFormatter" ); + + QString finalDeclaration = ( ( isVirtual || isPureVirtual ) ? "\nvirtual " : "\n" + declarationString + + ( isPureVirtual ? " = 0 " : "" ) + + ( isInline ? "\n{\n" + implementation + "\n}\n" : ";" ) ); + + if ( sourceFormatter != 0 ) + finalDeclaration = sourceFormatter->formatSource( finalDeclaration ); + + QString indentString = "\t"; + + if ( sourceFormatter != 0 ) + indentString = sourceFormatter->indentString(); + + editIface->insertText( findInsertionLineMethod( aClass, accessType ), 0, + finalDeclaration.replace( "\n", "\n\t" ) + "\n" ); + + backgroundParser() ->addFile( aClass->fileName() ); + if ( isInline || isPureVirtual ) + return ; + + // construct fully qualified name for method definition + QString fullyQualifiedName = aClass->scope().join("::"); + if (! fullyQualifiedName.isEmpty()) + { + fullyQualifiedName += "::"; + } + fullyQualifiedName += aClass->name() + "::" + name; + + QString definitionString = "\n" + type + " " + fullyQualifiedName + "(" + parameters + ")" + ( isConst ? " const" : "" ) + "\n{\n" + implementation + "\n}\n"; + + if ( sourceFormatter != 0 ) + definitionString = sourceFormatter->formatSource( definitionString ); + + QFileInfo info( aClass->fileName() ); + QString implementationFile = info.dirPath( true ) + "/" + info.baseName() + ".cpp" ; + QFileInfo fileInfo( implementationFile ); + KDevCreateFile* createFileSupport = extension( "KDevelop/CreateFile" ); + if ( !QFile::exists( fileInfo.absFilePath() ) && createFileSupport != 0 ) + createFileSupport->createNewFile( fileInfo.extension(), fileInfo.dirPath( true ), fileInfo.baseName() ); + + partController() ->editDocument( KURL( implementationFile ) ); + editIface = dynamic_cast( partController() ->activePart() ); + if ( !editIface ) + return ; //@fixme errorverdoedelung + + editIface->insertLine( editIface->numLines(), QString::fromLatin1( "" ) ); + editIface->insertText( editIface->numLines() - 1, 0, definitionString ); + backgroundParser() ->addFile( implementationFile ); +} + +ClassDom CppSupportPart::currentClass( ) const +{ + FileDom file = codeModel() ->fileByName( m_activeFileName ); + if ( file == 0 || m_activeViewCursor == 0 ) + return 0; + + unsigned int curLine, curCol; + m_activeViewCursor->cursorPositionReal( &curLine, &curCol ); + + CodeModelUtils::CodeModelHelper h( codeModel(), file ); + + return h.classAt( curLine, curCol ); +} + +VariableDom CppSupportPart::currentAttribute( ClassDom curClass ) const +{ + if ( m_activeViewCursor == 0 || curClass == 0 ) + return 0; + + unsigned int line, col; + m_activeViewCursor->cursorPositionReal( &line, &col ); + + VariableList vars = curClass->variableList(); + + for ( VariableList::iterator i = vars.begin(); i != vars.end(); ++i ) + { + int startLine, startCol; + ( *i ) ->getStartPosition( &startLine, &startCol ); + if ( startLine < (int)line || ( startLine == (int)line && startCol <= (int)col ) ) + { + int endLine, endCol; + ( *i ) ->getEndPosition( &endLine, &endCol ); + if ( endLine > (int)line || ( endLine == (int)line && endCol >= (int)col ) ) + return * i; + } + } + return 0; +} + +void CppSupportPart::slotCreateAccessMethods( ) +{ + if ( m_curAttribute == 0 || m_curClass == 0 ) + return ; + + CreateGetterSetterDialog dlg ( this, m_curClass, m_curAttribute ); + dlg.exec(); +} + +int CppSupportPart::findInsertionLineMethod( ClassDom aClass, CodeModelItem::Access access ) +{ + int line, column; + aClass->getEndPosition( &line, &column ); + + int point = CodeModelUtils::findLastMethodLine( aClass, access ); + + if ( point == -1 ) + { + KTextEditor::EditInterface * editIface = dynamic_cast( partController() ->activePart() ); + if ( !editIface ) + return -1; + + editIface->insertLine( line - 1, CodeModelUtils::accessSpecifierToString( access ) + ":\n" ); + return line; + } + + return point + 1; +} + +int CppSupportPart::findInsertionLineVariable( ClassDom aClass, CodeModelItem::Access access ) +{ + int line, column; + aClass->getEndPosition( &line, &column ); + + int point = CodeModelUtils::findLastVariableLine( aClass, access ); + + if ( point == -1 ) + { + KTextEditor::EditInterface * editIface = dynamic_cast( partController() ->activePart() ); + if ( !editIface ) + return -1; + + editIface->insertLine( line - 1, CodeModelUtils::accessSpecifierToString( access ) + ":\n" ); + return line; + } + + return point; +} + +void CppSupportPart::createAccessMethods( ClassDom theClass, VariableDom theVariable ) +{ + m_curClass = theClass; + m_curAttribute = theVariable; + + slotCreateAccessMethods(); +} + +void CppSupportPart::slotCursorMoved() +{ + m_cursorMovedTimer->start( 250, true ); +} + +void CppSupportPart::slotTextChanged() +{ + setTyping( true ); ///@todo check if this is really needed + + if ( m_backgroundParserConfig->useBackgroundParser() ) + { + m_textChangedTimer->start( m_backgroundParserConfig->backgroudParseDelay(), true ); + } +} + +void CppSupportPart::slotParseCurrentFile() +{ + if( isValid() && !isQueued( m_activeFileName ) ) + { + parseFileAndDependencies( m_activeFileName, true, true ); + } +} + +void CppSupportPart::updateBackgroundParserConfig() +{ + BackgroundParserConfig config; + config.readConfig(); + + if ( m_backgroundParserConfig->useProblemReporter() && !config.useProblemReporter() ) + { + removeProblemReporter(); + } + else if ( !m_backgroundParserConfig->useProblemReporter() && config.useProblemReporter() ) + { + embedProblemReporter( true ); + } + + *m_backgroundParserConfig = config; +} + +const SynchronizedFileSet& CppSupportPart::safeFileSet() const { + return m_safeProjectFiles; +} + +SynchronizedFileSet& CppSupportPart::safeFileSet() { + return m_safeProjectFiles; +} + +void CppSupportPart::buildSafeFileSet() { + if( codeCompletion() == 0 ) //probably the project has already been closed + return; + SynchronizedFileSet::SetType files; //everything that goes into this set must be deep-copied + + kdDebug( 9007 ) << "CppSupportPart:: rebuilding safe-file-set" << endl; + for( QStringList::const_iterator it = m_projectFileList.begin(); it != m_projectFileList.end(); ++it ) { + QFileInfo fi( *it ); + QString file = *it; + if( fi.isRelative() ) { + fi.setFile( QDir(m_projectDirectory), *it ); + file = fi.absFilePath(); + } + + //deep-copy + files.insert( QString::fromUtf8(file.utf8()) ); + } + + ///Now get all translation-units from the code-repository + QValueList args; + + args << Catalog::QueryArgument( "kind", Tag::Kind_TranslationUnit ); + + QValueList tags( codeCompletion()->repository()->query( args ) ); + + for( QValueList::const_iterator it = tags.begin(); it != tags.end(); ++it ) { + files.insert( (*it).fileName() + "||" + (*it).attribute("macroValueHash").toString() + "||" + (*it).attribute("macroIdHash").toString() ); + } + m_safeProjectFiles.setFiles( files ); +} + +void CppSupportPart::addToRepository( ParsedFilePointer file ) { + QString catalogString( "automatic_" + KURL::encode_string_no_slash(m_projectDirectory) ); + + KStandardDirs *dirs = CppSupportFactory::instance() ->dirs(); + + QString dbName = dirs->saveLocation( "data", "kdevcppsupport/pcs" ) + catalogString + ".db"; + + Catalog* catalog = 0; + ///First check if the catalog is already there + QValueList catalogs = codeRepository()->registeredCatalogs(); + for( QValueList::const_iterator it = catalogs.begin(); it != catalogs.end(); ++it ) { + if( (*it)->dbName() == dbName ) { + catalog = *it; + break; + } + } + + if( !catalog ) { + kdDebug( 9007 ) << "creating new catalog named " << catalogString << " for automatic filling" << endl; + //QStringList indexList = QStringList() << "kind" << "name" << "scope" << "fileName" << "prefix"; + catalog = new Catalog; + catalog->open( dbName ); + catalog->addIndex( "kind" ); + catalog->addIndex( "name" ); + catalog->addIndex( "scope" ); + catalog->addIndex( "prefix" ); + catalog->addIndex( "fileName" ); + /* + for ( QStringList::Iterator idxIt = indexList.begin(); idxIt != indexList.end(); ++idxIt ) + catalog->addIndex( ( *idxIt ).utf8() );*/ + addCatalog( catalog ); + } + catalog->setEnabled( true ); + + ///Now check if the file was already parsed with the same parameters, if yes don't parse again(auto-update is currently not supported, when major changes have been done in the libraries, the repository should be deleted) + QValueList args; + + bool compatibleParsed = false; + Tag compatibleParsedTag; + + args << Catalog::QueryArgument( "kind", Tag::Kind_TranslationUnit ); + args << Catalog::QueryArgument( "fileName", file->fileName() ); + QValueList tags( catalog->query( args ) ); + if( !tags.isEmpty() ) { + for( QValueList::const_iterator it = tags.begin(); it != tags.end(); ++it ) { + if( (*it).hasAttribute( "cppparsedfile" ) ) { + QVariant v = (*it).attribute( "cppparsedfile" ); + ///@todo reenable this + /*QByteArray b = v.toByteArray(); + if( !b.isEmpty() ) { + //Would be much more efficient not to do this deserialization + ParsedFile f(b); + if( f.usedMacros().valueHash() == file->usedMacros().valueHash() && f.usedMacros().idHash() == file->usedMacros().idHash() && f.includeFiles().hash() == file->includeFiles().hash() ) { + ///Do not reparse the file, it seems to already be in the repository in a similar state + if( (*it).attribute( "includedFrom" ).toString() == file->includedFrom() ) return; + + ///It is probable that the same state has already been parsed, but there seems to be no such tag yet(the tag will be added) + compatibleParsed = true; + compatibleParsedTag = *it; + break; + } + }*/ + } + } + } + + if( compatibleParsed ) { + ///Add a Tag that makes sure that the file will not be parsed again + compatibleParsedTag.setAttribute( "includedFrom", file->includedFrom() ); + QByteArray data; + QDataStream s( data, IO_WriteOnly ); + file->write( s ); + compatibleParsedTag.setAttribute( "cppparsedfile", data ); + catalog->addItem( compatibleParsedTag ); + return; + } + + kdDebug( 9007 ) << "parsing translation-unit " << file->fileName() << " into catalog " << catalogString << endl; + TagCreator w( file->fileName(), catalog ); + w.parseTranslationUnit( *file ); + codeRepository()->touchCatalog( catalog ); + + m_safeProjectFiles.insert( file->fileName() + "||" + QString("%1").arg(file->usedMacros().valueHash()) + "||" + QString("%1").arg(file->usedMacros().idHash()) ); +} + +QString CppSupportPart::findHeaderSimple( const QString &header ) +{ + QStringList::ConstIterator it; + for ( it = m_projectFileList.begin(); it != m_projectFileList.end(); ++it ) + { + QString s = *it; + if (s == header) + return s; + if ( ( s.right( header.length() ) == header ) && ( s[s.length() - header.length() - 1] == '/' ) ) + return s; + } + + return QString::null; +} + +UIBlockTester::UIBlockTesterThread::UIBlockTesterThread( UIBlockTester& parent ) : QThread(), m_parent( parent ), m_stop(false) { +} + +void UIBlockTester::UIBlockTesterThread::run() { + while(!m_stop) { + msleep( m_parent.m_msecs / 10 ); + m_parent.m_timeMutex.lock(); + QDateTime t = QDateTime::currentDateTime(); + uint msecs = m_parent.m_lastTime.time().msecsTo( t.time() ); + if( msecs > m_parent.m_msecs ) { + m_parent.lockup(); + m_parent.m_lastTime = t; + } + m_parent.m_timeMutex.unlock(); + } +} + +void UIBlockTester::UIBlockTesterThread::stop() { + m_stop = true; +} + +UIBlockTester::UIBlockTester( uint milliseconds ) : m_thread( *this ), m_msecs( milliseconds ) { + m_timer = new QTimer( this ); + m_timer->start( milliseconds/10 ); + connect( m_timer, SIGNAL(timeout()), this, SLOT(timer()) ); + timer(); + m_thread.start(); +} +UIBlockTester::~UIBlockTester() { + m_thread.stop(); + m_thread.wait(); +} + +void UIBlockTester::timer() { + m_timeMutex.lock(); + m_lastTime = QDateTime::currentDateTime(); + m_timeMutex.unlock(); +} + +void UIBlockTester::lockup() { + //std::cout << "UIBlockTester: lockup of the UI for " << m_msecs << endl; ///kdDebug(..) is not thread-safe.. + int a = 1; ///Place breakpoint here +} + +#include "cppsupportpart.moc" +//kate: indent-mode csands; tab-width 4; space-indent off; + + diff --git a/languages/cpp/cppsupportpart.h b/languages/cpp/cppsupportpart.h new file mode 100644 index 00000000..e01d5115 --- /dev/null +++ b/languages/cpp/cppsupportpart.h @@ -0,0 +1,661 @@ +/*************************************************************************** +* Copyright (C) 1999 by Jonas Nordin * +* jonas.nordin@syncom.se * +* Copyright (C) 2000-2001 by Bernd Gehrmann * +* bernd@kdevelop.org * +* Copyright (C) 2002-2003 by Roberto Raggi * +* roberto@kdevelop.org * +* Copyright (C) 2003-2004 by Alexander Dymo * +* adymo@mksat.net * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#ifndef _CPPSUPPORTPART_H_ +#define _CPPSUPPORTPART_H_ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "driver.h" + + +///A class that helps detecting what exactly makes the UI block. To use it, just place a breakpoint on UIBlockTester::lockup() and inspect the execution-position of the main thread +class UIBlockTester : public QObject { + Q_OBJECT + class UIBlockTesterThread : public QThread { + public: + UIBlockTesterThread( UIBlockTester& parent ); + void run(); + void stop(); + private: + UIBlockTester& m_parent; + bool m_stop; + }; + friend class UIBlockTesterThread; +public: + + ///@param milliseconds when the ui locks for .. milliseconds, lockup() is called + UIBlockTester( uint milliseconds ); + ~UIBlockTester(); + +private slots: + void timer(); + +protected: + virtual void lockup(); + +private: + UIBlockTesterThread m_thread; + QDateTime m_lastTime; + QMutex m_timeMutex; + QTimer * m_timer; + uint m_msecs; +}; + +class Context; +class CppCodeCompletion; +class CppCodeCompletionConfig; +class CppSplitHeaderSourceConfig; +class CreateGetterSetterConfiguration; +class QtBuildConfig; +class ProblemReporter; +class BackgroundParser; +class Catalog; +class QLabel; +class QProgressBar; +class QStringList; +class QListViewItem; +class TranslationUnitAST; +class QTimer; +class KListView; +class Driver; +class KPopupMenu; +class BackgroundParserConfig; +class KAction; + +namespace KParts +{ + class Part; +} +namespace KTextEditor +{ + class Document; + class View; + class EditInterface; + class SelectionInterface; + class ViewCursorInterface; +} + + +class SynchronizedFileSet +{ +public: + typedef __gnu_cxx::hash_set< HashedString > SetType; + SynchronizedFileSet() + {} + + bool isEmpty() const + { + QMutexLocker locker( &m_mutex ); + return m_fileSet.empty(); + } + + uint count() const + { + QMutexLocker locker( &m_mutex ); + return m_fileSet.size(); + } + + void clear() + { + QMutexLocker locker( &m_mutex ); + m_fileSet.clear(); + } + + void setFiles( const SetType& files ) { + QMutexLocker locker( &m_mutex ); + m_fileSet = files; + } + + void insert( const HashedString& str ) + { + HashedString s( QString::fromUtf8(str.str().utf8()) ); + QMutexLocker locker( &m_mutex ); + + m_fileSet.insert( s ); + } + + bool contains( const HashedString& str ) const { + QMutexLocker locker( &m_mutex ); + return m_fileSet.find( str ) != m_fileSet.end(); + } + +private: + mutable QMutex m_mutex; + SetType m_fileSet; +}; + +class CppSupportPart : public KDevLanguageSupport +{ + Q_OBJECT + +public: + CppSupportPart( QObject *parent, const char *name, const QStringList &args ); + virtual ~CppSupportPart(); + + bool isValid() const + { + return m_valid; + } + + QString specialHeaderName( bool local = false ) const; + void updateParserConfiguration(); + void updateBackgroundParserConfig(); + + // @fixme - isValid is used to avoid using the problem reporter + // when a project is first parsed. This because the problem reporter + // is currently a great slowdown for large projects (see bug #73671) + ProblemReporter* problemReporter() const + { + return isValid() ? static_cast( m_problemReporter ) : 0; + } + + /** parses the file and all files that belong to it using the background-parser */ + int parseFileAndDependencies( const QString& fileName, bool background = true, bool parseFirst = false, bool silent = false ); + int parseFilesAndDependencies( QStringList files, bool background = true, bool parseFirst = false, bool silent = false ); + + BackgroundParser* backgroundParser() const + { + return m_backgroundParser; + } + CppCodeCompletion* codeCompletion() const + { + return m_pCompletion; + } + CppCodeCompletionConfig* codeCompletionConfig() const + { + return m_pCompletionConfig; + } + CppSplitHeaderSourceConfig* splitHeaderSourceConfig() const + { + return m_pSplitHeaderSourceConfig; + } + CreateGetterSetterConfiguration* createGetterSetterConfiguration() const + { + return m_pCreateGetterSetterConfiguration; + } + + /** + Get a pointer to the QtBuildConfig object + @return A pointer to the QtBuildConfig object. + */ + inline QtBuildConfig* qtBuildConfig() const { return m_qtBuildConfig; } + + const QPtrList& catalogList() const + { + return m_catalogList; + } + void addCatalog( Catalog* catalog ); + void removeCatalog( const QString& dbName ); + + bool isValidSource( const QString& fileName ) const; + + virtual void customEvent( QCustomEvent* ev ); + + virtual QStringList subclassWidget( const QString& formName ); + virtual QStringList updateWidget( const QString& formName, const QString& fileName ); + + FunctionDefinitionDom currentFunctionDefinition(); + FunctionDefinitionDom functionDefinitionAt( int line, int column ); + + + KTextEditor::Document* findDocument( const KURL& url ); + static KConfig *config(); + + virtual QString formatTag( const Tag& tag ); + virtual QString formatModelItem( const CodeModelItem *item, bool shortDescription = false ); + virtual void addClass(); + + QString extractInterface( const ClassDom& klass ); + + bool isHeader( const QString& fileName ) const; + bool isSource( const QString& fileName ) const; + + //uses the old simple algorithm to find the header + QString findHeaderSimple( const QString &header ); + + virtual KDevDesignerIntegration *designer( KInterfaceDesigner::DesignerType type ); + + void setTyping( bool typing ); + + /** + * Add a new method to a class. + * @param aClass The class to which the method should be added. + * @param name The name of the method. + * @param type The return type of the method. + * @param parameters A string containing the parameters + * (including names, default values, but no '(' , ')', e.g.: "int, const QString& aString"). + * @param accessType The access specifier e.g. CodeModelItem::PUBLIC. + * @param isConst true if method is const. + * @param isInline true if method should be declared inline. + * @param isVirtual true if method is virtual(this is ignored if isPureVirtual is true) + * @param isPureVirtual true if method is pure virtual (this overrides any value of isVirtual) + * @param implementation a optional implementation, if this is not set the method body will be empty. + * @author Jonas Jacobi + */ + virtual void addMethod( ClassDom aClass, const QString& name, const QString type, const QString& parameters, CodeModelItem::Access accessType, bool isConst, bool isInline, bool isVirtual, bool isPureVirtual, const QString& implementation = "" ); + + void createAccessMethods( ClassDom theClass, VariableDom theVariable ); + + bool isQueued( const QString& file ) const; + bool switchHeaderImpl( const QString& file, int line, int col, bool scrollOnly = false ); + + const Driver* driver() const; + + Driver* driver(); + + ///thread-safe, returns the thread-safe set of all files that do not need to be parsed when being included, either because they are part of the project and parsed anyway, or because they are already in the code-repository + const SynchronizedFileSet& safeFileSet() const; + SynchronizedFileSet& safeFileSet(); +signals: + void fileParsed( const QString& fileName ); + ///Emitted whenever a file was parsed, but the code-model could be updated(the file in the code-model did not have to be replaced) + void codeModelUpdated( const QString& fileName ); + ///Emitted whenever a translation-unit was parsed in the main thread + void synchronousParseReady( const QString& file, ParsedFilePointer unit ); + +protected: + virtual KDevLanguageSupport::Features features(); + virtual KMimeType::List mimeTypes(); + virtual QString formatClassName( const QString &name ); + virtual QString unformatClassName( const QString &name ); + virtual bool shouldSplitDocument( const KURL &url ); + virtual Qt::Orientation splitOrientation() const; + virtual void addMethod( ClassDom klass ); + virtual void addAttribute( ClassDom klass ); + +private slots: + void activePartChanged( KParts::Part *part ); + void partRemoved( KParts::Part* part ); + void projectOpened(); + void projectClosed(); + void savedFile( const KURL &fileName ); + void configWidget( KDialogBase *dlg ); + void projectConfigWidget( KDialogBase *dlg ); + void contextMenu( QPopupMenu *popup, const Context *context ); + void addedFilesToProject( const QStringList &fileList ); + void removedFilesFromProject( const QStringList &fileList ); + void changedFilesInProject( const QStringList & fileList ); + void slotProjectCompiled(); + void setupCatalog(); + void codeCompletionConfigStored(); + void splitHeaderSourceConfigStored(); + // void recomputeCodeModel( const QString& fileName ); + void slotNavigate(); + void slotNewClass(); + void slotSwitchHeader( bool scrollOnly = false ); + void slotCompleteText(); + void slotMakeMember(); + void slotExtractInterface(); + void slotCursorPositionChanged(); +// void slotFunctionHint(); + void gotoLine( int line ); + void gotoDeclarationLine( int line ); + void emitFileParsed( QStringList l ); + void slotParseFiles(); + void slotCreateSubclass(); + void slotCreateAccessMethods(); + void slotDeleteParserStore(); + void slotSaveMemory(); + void slotTextChanged(); + void slotCursorMoved(); + void slotParseCurrentFile(); + void embedProblemReporter( bool force = false ); + void removeProblemReporter(); + + + void slotNeedTextHint( int, int, QString& ); + + /** + * loads, parses and creates both classstores needed + */ + void initialParse( ); + + /** + * only parses the current project + */ + bool parseProject( bool force = false ); + +private: + + void resetParserStoreTimer(); + /** + * Get a linenumber in which a new method with a specific access specifier can be inserted. + * If there isn't a "section" with access, such a "section" gets inserted and the resulting place is returned. + * @param aClass the class one wants to insert a method to. + * @param access the access specifier the new method should have. + * @return A linenumber where the new method can be inserted + * or -1 if partController()->activePart() is no KTextEditorInterface. + * @author Jonas Jacobi + */ + int findInsertionLineMethod( ClassDom aClass, CodeModelItem::Access access ); + /** + * Same as above, just returns a insertion line for a variable instead of a method + */ + int findInsertionLineVariable( ClassDom aClass, CodeModelItem::Access access ); + + + /** + * Get a class declaration which is "around" the current cursor position. + * @return The class declaration which is "around" the current cursor position, + * in the case of nested classes this is the innermost fitting class. If there is no + * class declared at the current cursor position, 0 is returned. + * @author Jonas Jacobi + */ + ClassDom currentClass() const; + /** + * Get the class attribute of curClass, which is declared at the current cursor position. + * @param curClass the class to search for attributes. + * @return the attribute declared at the current cursor position or 0, if no attribute is declared there. + * @author Jonas Jacobi + */ + VariableDom currentAttribute( ClassDom curClass ) const; + + /** + * checks if a file has to be parsed + */ + FileDom fileByName( const QString& name); + void maybeParse( const QString& fileName, bool background = true ); + void removeWithReferences( const QString& fileName ); + void createIgnorePCSFile(); + + void MakeMemberHelper( QString& text, int& atline, int& atcol ); + + QString sourceOrHeaderCandidate( const KURL &url = KURL() ); + + FunctionDom findFunction( const FunctionDom& def ); + FunctionDom findFunctionInNamespace( const NamespaceDom& ns, const FunctionDom& def, const std::set& nsImports, + const QString& candidateFile, int scopeIndex, FunctionDom& bestMatch ); + FunctionDom findFunctionInClass( const ClassDom& cs, const FunctionDom& def, const std::set& nsImports, + const QString& candidateFile, int scopeIndex, FunctionDom& bestMatch ); + FunctionDom findFunctionDefinition( const FunctionDom& decl ); + + void jumpToCodeModelItem( const ItemDom& item, bool scrollOnly ); + + QStringList modifiedFileList(); + QString findSourceFile(); + int pcsVersion(); + void setPcsVersion( int version ); + + void saveProjectSourceInfo(); + QStringList reorder( const QStringList& list ); + + CppCodeCompletion* m_pCompletion; + CppCodeCompletionConfig* m_pCompletionConfig; + CppSplitHeaderSourceConfig* m_pSplitHeaderSourceConfig; + + CreateGetterSetterConfiguration* m_pCreateGetterSetterConfiguration; + KAction * m_createGetterSetterAction; + KAction * m_switchHeaderSourceAction; + + QtBuildConfig* m_qtBuildConfig; + + bool withcpp; + QString m_contextFileName; + + VariableDom m_curAttribute; + ClassDom m_curClass; + QGuardedPtr< ProblemReporter > m_problemReporter; + BackgroundParser* m_backgroundParser; + UIBlockTester* m_lockupTester; + + KTextEditor::Document* m_activeDocument; + KTextEditor::View* m_activeView; + KTextEditor::SelectionInterface* m_activeSelection; + KTextEditor::EditInterface* m_activeEditor; + KTextEditor::ViewCursorInterface* m_activeViewCursor; + QString m_activeFileName; + + QMap m_designers; + + QWaitCondition m_eventConsumed; + bool m_projectClosed; + bool m_projectClosing; + + QMap m_timestamp; + bool m_valid; + bool m_isTyping; + bool m_hadErrors; ///Whether there were already errors when the user started typing + + QPtrList m_catalogList; + Driver* m_driver; + QString m_projectDirectory; + QStringList m_projectFileList; + + ClassDom m_activeClass; + FunctionDom m_activeFunction; + VariableDom m_activeVariable; + + QGuardedPtr m_navigationMenu; + +// QTimer* m_functionHintTimer; +// QTimer* m_deleteParserStoreTimer; + QTimer* m_saveMemoryTimer; + QTimer * m_textChangedTimer; + QTimer * m_cursorMovedTimer; + QTimer* m_buildSafeFileSetTimer; + + class ParseEmitWaiting { + public: + enum Flags { + None = 0, + HadErrors = 1, + HadQueueProblem = 2, + Silent = 4 + }; + private: + struct Item { + QStringList first; + QStringList second; + Flags flags; + Item() : flags(None) { + } + Item( QStringList f, QStringList s, Flags fl = None ) : first( f ), second( s ), flags( fl ) + { + } + }; + //typedef QPair Item; ///The files we are waiting fore, and the files we already got + typedef QValueList< Item > List; + List m_waiting; + + + QStringList harvestUntil( List::iterator targIt ) { + List::iterator it = m_waiting.begin(); + QStringList ret; + while( it != targIt && it != m_waiting.end() ) { + ret += (*it).first; + it = m_waiting.erase( it ); + } + return ret; + } + + public: + void addGroup( QStringList& files, Flags flag = None ) { + m_waiting << Item(files, QStringList(), flag); + } + void addGroupFront( QStringList& files, Flags flag = None ) { + m_waiting.push_front( Item(files, QStringList(), flag) ); + } + void clear() { + m_waiting.clear(); + } + + ///files that were not requested must not be processed, since they maybe do not respect the group-relationships. + bool reject( QString file ) { + for( List::iterator it = m_waiting.begin(); it != m_waiting.end(); ++it) { + if( (*it).first.find( file ) != (*it).first.end() ) { + return false; + } + } + return true; + } + + bool waiting( QString file, Flags forbidFlags = None, int count = 1 ) const { + int hits = 0; + for( List::const_iterator it = m_waiting.begin(); it != m_waiting.end(); ++it) { + if( (*it).first.find( file ) != (*it).first.end() ) { + if( ((Flags)((*it).flags & forbidFlags )) == None ) { + hits++; + if( hits >= count ) return true; + } + } + } + return false; + } + + struct Processed { + QStringList res; + Flags flag; + Processed() : flag(None) { + } + Processed(const QStringList& l , Flags f = None ) : res( l ), flag( f ) { + } + operator QStringList() { + return res; + } + + bool hadQueueProblem() { + return flag & HadQueueProblem; + } + + bool hasFlag( Flags f ) const { + return f & flag; + } + // surely a copy paste implementation? +/* + bool hasFlag( Flags flag ) const { + return flag & HadQueueProblem; + } +*/ + }; + + + private: + ///Just return all files that have been parsed + Processed errorRecover( QString currentFile ) { + QStringList ret; + kdDebug( 9007 ) << "ParseEmitWaiting: error in the waiting-chain" << endl; + for( List::iterator it = m_waiting.begin(); it != m_waiting.end(); ++it) { + ret += (*it).second; + } + if( !currentFile.isEmpty() ) ret << currentFile; + m_waiting.clear(); + return Processed( ret, HadQueueProblem ); + } + public: + + ///returns the parsed-messages that should be emitted + Processed processFile( QString file, Flags flag = None ) { + QStringList ret; + for( List::iterator it = m_waiting.begin(); it != m_waiting.end(); ++it) { + if( (*it).first.find( file ) != (*it).first.end() ) { + if( (*it).second.find( file ) == (*it).second.end() ) { + (*it).flags = (Flags) ((*it).flags | flag); + (*it).second << file; + if( (*it).second.count() == (*it).first.count() ) { + Flags f = (*it).flags; + if( it != m_waiting.begin() ) { + kdDebug( 9007 ) << "ParseEmitWaiting: the chain has multiple groups waiting, they are flushed" << endl; + f = (Flags)(f | HadQueueProblem); + } + return Processed( harvestUntil( ++it ), f ); + } else { + ///The file was registered, now wait for the next + return QStringList(); + } + } else { + ///The file has already been parsed + kdDebug( 9007 ) << "ParseEmitWaiting: file has been parsed twice" << endl; + return errorRecover( file ); + } + } + } + + kdDebug( 9007 ) << "ParseEmitWaiting: file \"" << file << "\" has no group waiting for it" << endl; + ret << file; + return Processed( ret, HadQueueProblem ); + } + }; + + ParseEmitWaiting m_parseEmitWaiting; + ParseEmitWaiting m_fileParsedEmitWaiting; + +private slots: + void parseEmit( ParseEmitWaiting::Processed files ); + void buildSafeFileSet(); +private: + + SynchronizedFileSet m_safeProjectFiles; + BackgroundParserConfig * m_backgroundParserConfig; + + static QStringList m_sourceMimeTypes; + static QStringList m_headerMimeTypes; + + static QStringList m_sourceExtensions; + static QStringList m_headerExtensions; + + friend class KDevCppSupportIface; + friend class CppDriver; + + // we need something to plug actions that are not in any menu + // into in order for their shortcuts to work + QWidget m_DummyActionWidget; + + void addToRepository( ParsedFilePointer ); + void emitSynchronousParseReady( const QString& file, ParsedFilePointer unit ); + + struct JobData + { + QDir dir; + QGuardedPtr progressBar; + QStringList::Iterator it; + QStringList files; + int cycle; + int backgroundCount; + int lastBackgroundState; + int backgroundState; + QStringList reparseList; + QMap< QString, QPair > pcs; + QDataStream stream; + QFile file; + QTime lastParse; + + ~JobData() + { + delete progressBar; + } + }; + + JobData * _jd; +}; + +#endif +// kate: indent-mode csands; tab-width 4; + diff --git a/languages/cpp/cpptemplates b/languages/cpp/cpptemplates new file mode 100644 index 00000000..e55181c0 --- /dev/null +++ b/languages/cpp/cpptemplates @@ -0,0 +1,22 @@ + + +