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/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 + 42 files changed, 2565 insertions(+) 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 (limited to 'languages/fortran') diff --git a/languages/fortran/Makefile.am b/languages/fortran/Makefile.am new file mode 100644 index 00000000..ac6f5be2 --- /dev/null +++ b/languages/fortran/Makefile.am @@ -0,0 +1,20 @@ +# Here resides the Fortran 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 = file_templates app_templates compiler doc + +kde_module_LTLIBRARIES = libkdevfortransupport.la +libkdevfortransupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libkdevfortransupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la + +libkdevfortransupport_la_SOURCES = fortransupportpart.cpp fixedformparser.cpp ftnchekconfigwidget.cpp ftnchekconfigwidgetbase.ui + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdevfortransupport.desktop + +rcdir = $(kde_datadir)/kdevfortransupport +rc_DATA = kdevfortransupport.rc diff --git a/languages/fortran/README.dox b/languages/fortran/README.dox new file mode 100644 index 00000000..65a4e645 --- /dev/null +++ b/languages/fortran/README.dox @@ -0,0 +1,48 @@ +/** \class FortranSupportPart +This is Fortran language support plugin. + +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 Bernd Gehrmann + +\maintainer $AUTHOR$ +\maintainer 2nd maintainer full name +... +\maintainer nth maintainer full name + +\feature Fortran language support +\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part. + +\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/fortran/app_templates/Makefile.am b/languages/fortran/app_templates/Makefile.am new file mode 100644 index 00000000..056dc759 --- /dev/null +++ b/languages/fortran/app_templates/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = fortranhello +profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/FortranIDE +profiles_DATA = fortran.appwizard diff --git a/languages/fortran/app_templates/fortran.appwizard b/languages/fortran/app_templates/fortran.appwizard new file mode 100644 index 00000000..7cd8232e --- /dev/null +++ b/languages/fortran/app_templates/fortran.appwizard @@ -0,0 +1,2 @@ +[General] +List=fortranhello diff --git a/languages/fortran/app_templates/fortranhello/.kdev_ignore b/languages/fortran/app_templates/fortranhello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/fortran/app_templates/fortranhello/Makefile.am b/languages/fortran/app_templates/fortranhello/Makefile.am new file mode 100644 index 00000000..ba97453d --- /dev/null +++ b/languages/fortran/app_templates/fortranhello/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = main.f src-Makefile.am fortran-Makefile.am fortran-Makefile.cvs \ + configure.in fortranhello.png app.kdevelop +templateName = fortranhello + +### 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/fortran/app_templates/fortranhello/app.kdevelop b/languages/fortran/app_templates/fortranhello/app.kdevelop new file mode 100644 index 00000000..b4abc5ae --- /dev/null +++ b/languages/fortran/app_templates/fortranhello/app.kdevelop @@ -0,0 +1,113 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevAutoProject + Fortran77 + + Fortran + + + KDevVisualBoyAdvance + KDevCTags + + + + + src/%{APPNAMELC} + + + src/%{APPNAMELC} + true + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + c++_bugs_gcc + clanlib + w3c-dom-level2-html + 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/fortran/app_templates/fortranhello/configure.in b/languages/fortran/app_templates/fortranhello/configure.in new file mode 100644 index 00000000..e1b885a7 --- /dev/null +++ b/languages/fortran/app_templates/fortranhello/configure.in @@ -0,0 +1,10 @@ +AC_INIT(configure.in) + +AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION}) +AM_CONFIG_HEADER(config.h) + +AC_LANG_FORTRAN77 +AC_PROG_F77 +AC_F77_LIBRARY_LDFLAGS + +AC_OUTPUT(Makefile src/Makefile) diff --git a/languages/fortran/app_templates/fortranhello/fortran-Makefile.am b/languages/fortran/app_templates/fortranhello/fortran-Makefile.am new file mode 100644 index 00000000..02520f20 --- /dev/null +++ b/languages/fortran/app_templates/fortranhello/fortran-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/fortran/app_templates/fortranhello/fortran-Makefile.cvs b/languages/fortran/app_templates/fortranhello/fortran-Makefile.cvs new file mode 100644 index 00000000..d1607023 --- /dev/null +++ b/languages/fortran/app_templates/fortranhello/fortran-Makefile.cvs @@ -0,0 +1,8 @@ +default: all + +all: + aclocal + autoheader + automake + autoconf + diff --git a/languages/fortran/app_templates/fortranhello/fortranhello b/languages/fortran/app_templates/fortranhello/fortranhello new file mode 100644 index 00000000..1028a814 --- /dev/null +++ b/languages/fortran/app_templates/fortranhello/fortranhello @@ -0,0 +1,10 @@ +# KDE Config File +[General] +Name=Simple Hello world program +Name[fr]=Un simple programme de test Hello world +Icon=fortranhello.png +Category=Fortran +Comment=Generates a simple Hello world program in Fortran +Comment[fr]=Gnre un simple programme de test du type Hello world dans le language FORTRAN. +FileTemplates=f,None +ShowFilesAfterGeneration=src/APPNAMELC.f diff --git a/languages/fortran/app_templates/fortranhello/fortranhello.kdevtemplate b/languages/fortran/app_templates/fortranhello/fortranhello.kdevtemplate new file mode 100644 index 00000000..b6580853 --- /dev/null +++ b/languages/fortran/app_templates/fortranhello/fortranhello.kdevtemplate @@ -0,0 +1,140 @@ +# 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=fortranhello.png +Category=Fortran +Comment=Generates a simple Hello world program in Fortran +Comment[ca]=Genera un simple programa de Hello world en Fortran +Comment[da]=Genererer et simpelt Goddag verden program i Fortran +Comment[de]=Erstellt ein einfaches "Hello World"-Programm in Fortran +Comment[el]=Δημιουργία ενός απλού προγράμματος Γεια σου σε Fortran +Comment[es]=Genera un sencillo programa «Hola mundo» en Fortran +Comment[et]=Lihtsa "Tere, maailm" programmi loomine Fortranis +Comment[eu]="Kaixo mundua" programa sinple bat sortzen du Fortran lengoaian +Comment[fa]=یک برنامۀ سادۀ Hello world در فرترن تولید می‌کند +Comment[fr]=Génère un programme « Bonjour monde » simple en Fortran +Comment[gl]=Xera un programa sinxelo Ola mundo en Fortran +Comment[hu]=Létrehoz egy egyszerű Hello world programot Fortran nyelven +Comment[it]=Genera un semplice programma di "Hello world" in Fortran +Comment[ja]=簡単な Hello world プログラムを Fortran で作成します +Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in Fortran op +Comment[ne]=फोर्ट्रानमा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ +Comment[nl]=Genereert een eenvoudig Hello World-programma in Fortran +Comment[pl]=Generuje prosty program Witaj świecie w Fortranie +Comment[pt]=Gera um programa simples Olá Mundo em Fortran +Comment[pt_BR]=Gera um programa simples Olá Mundo em Fortran +Comment[ru]=Создание простой программы Hello world на Fortran +Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program vo Fortran +Comment[sr]=Прави једноставан „Здраво свете“ у Fortran-у +Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ u Fortran-u +Comment[sv]=Skapar ett enkelt Hello world-program i Fortran +Comment[tr]=Fortran'da basit bir Merhaba Dünya programı yaratır. +Comment[zh_CN]=生成一个简单的 Fortran 语言 Hello world 程序 +Comment[zh_TW]=產生一個簡單的 Fortran Hello world 程式 +FileTemplates=f,None +ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.f +Archive=fortranhello.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}/fortran-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE3] +Type=install +Source=%{src}/fortran-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.f +Dest=%{dest}/src/%{APPNAMELC}.f + +[MSG] +Type=message +Comment=a simple "Hello world" program in fortran was created in %{dest} +Comment[ca]=Un simple programa de "Hello world" en fortran ha estat creat en %{dest} +Comment[da]=et simpelt "Goddag verden" program i fortran blev oprettet i %{dest} +Comment[de]=Ein einfaches "Hello World"-Programm in Fortran wurde in %{dest} erstellt. +Comment[el]=Ένα απλό πρόγραμμα "Γεια σου κόσμε" σε fortran δημιουργήθηκε στο %{dest} +Comment[es]=Un sencillo programa «Hola mundo» en Fortran ha sido creado en %{dest} +Comment[et]=Lihtne "Tere, maailm" programm Fortranis 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 en Fortran a été créé dans %{dest} +Comment[gl]=Creouse un programa sinxelo "Ola mundo" en fortran en %{dest} +Comment[hu]=Létrejött egy egyszerű, Fortran nyelvű Hello world program itt: %{dest} +Comment[it]=È stato creato un semplice programma di "Hello world" in Fortran in %{dest} +Comment[ja]=Fortran で記述された簡単な Hello world プログラムを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm in Fortran opstellt +Comment[ne]=फोर्ट्रानमा साधारण "हेल्लो वोल्ड" कार्यक्रम %{dest} मा सिर्जना गरियो +Comment[nl]=een eenvoudig "Hello World"-programma in Fortran is aangemaakt in %{dest} +Comment[pl]=Prosty program "Witaj świecie" w Fortranie został utworzony w %{dest} +Comment[pt]=Foi criado um programa simples "Olá mundo" em Fortran em %{dest} +Comment[pt_BR]=Foi criado um programa simples "Olá mundo" em Fortran em %{dest} +Comment[ru]=Простая программа "Hello world" на Fortran создана в %{dest} +Comment[sk]=Jednoduchý "Ahoj svet" program vo Fortran bol vytvorený v %{dest} +Comment[sr]=Једноставан „Здраво свете“ у Fortran-у направљен је у %{dest} +Comment[sr@Latn]=Jednostavan „Zdravo svete“ u Fortran-u napravljen je u %{dest} +Comment[sv]=Ett enkelt "Hello world"-program i Fortran skapades i %{dest} +Comment[tr]=Fortran'da basit bir "Merhaba Dünya" programı %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 创建了一个简单的 Fortran 语言“Hello world”程序 +Comment[zh_TW]=一個 fortran 的簡單的 "Hello world" 程式已建立於 %{dest} diff --git a/languages/fortran/app_templates/fortranhello/fortranhello.png b/languages/fortran/app_templates/fortranhello/fortranhello.png new file mode 100644 index 00000000..888d4f13 Binary files /dev/null and b/languages/fortran/app_templates/fortranhello/fortranhello.png differ diff --git a/languages/fortran/app_templates/fortranhello/main.f b/languages/fortran/app_templates/fortranhello/main.f new file mode 100644 index 00000000..3f5d29ca --- /dev/null +++ b/languages/fortran/app_templates/fortranhello/main.f @@ -0,0 +1,7 @@ +c +c This is the Hello World example +c + program hello + print *,'Hello World!' + stop + end diff --git a/languages/fortran/app_templates/fortranhello/src-Makefile.am b/languages/fortran/app_templates/fortranhello/src-Makefile.am new file mode 100644 index 00000000..f3f03092 --- /dev/null +++ b/languages/fortran/app_templates/fortranhello/src-Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = %{APPNAMELC} +%{APPNAMELC}_SOURCES = %{APPNAMELC}.f + +# set the include path found by configure +INCLUDES= $(all_includes) + +# the library search path. +%{APPNAMELC}_LDFLAGS = $(all_libraries) diff --git a/languages/fortran/compiler/Makefile.am b/languages/fortran/compiler/Makefile.am new file mode 100644 index 00000000..3489a85c --- /dev/null +++ b/languages/fortran/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 = pgioptions + diff --git a/languages/fortran/compiler/pgioptions/Makefile.am b/languages/fortran/compiler/pgioptions/Makefile.am new file mode 100644 index 00000000..3c3dd54e --- /dev/null +++ b/languages/fortran/compiler/pgioptions/Makefile.am @@ -0,0 +1,18 @@ +# Here resides the pgi option dialog plugin. +# This defines the options for the Portland Group compiler + +INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extras \ + $(all_includes) + +kde_module_LTLIBRARIES = libkdevpgioptions.la +libkdevpgioptions_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN) +libkdevpgioptions_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \ + $(top_builddir)/lib/interfaces/extras/libkdevextras.la + +libkdevpgioptions_la_SOURCES = pgioptionsfactory.cpp pgioptionsplugin.cpp + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdevpghpfoptions.desktop kdevpgf77options.desktop + diff --git a/languages/fortran/compiler/pgioptions/kdevpgf77options.desktop b/languages/fortran/compiler/pgioptions/kdevpgf77options.desktop new file mode 100644 index 00000000..8af14494 --- /dev/null +++ b/languages/fortran/compiler/pgioptions/kdevpgf77options.desktop @@ -0,0 +1,53 @@ +[Desktop Entry] +Type=Service +Exec=pgf77 +Comment=Portland Group Fortran77 Compiler +Comment[br]=Dastumer Fortran 77 ar strollad Portland +Comment[ca]=Compilador Fortran 77 de Portland Group +Comment[da]=Portland Group Fortran77 oversætter +Comment[el]=Μεταγλωττιστής Fortran77 ομάδας Portland +Comment[es]=Compilador de Fortran 77 de Portland Group +Comment[et]=Portland Group Fortran77 kompilaator +Comment[eu]=Portland Group Fortran77 konpiladorea +Comment[fa]=مترجم فرترن ۷۷ گروه Portland +Comment[fr]=Compilateur Fortran77 du Portland Group +Comment[gl]=Compilador de Fortran77 de Portland Group +Comment[hi]=पोर्टलैंड समूह फ़ोरट्रॉन77 कम्पायलर +Comment[hu]=Portland Group Fortran 77 fordítóprogram +Comment[is]=Portland Group Fortran77 þýðandi +Comment[it]=Compilatore per Portland Group Fortran77 +Comment[ja]=Portland グループ Fortran77 コンパイラ +Comment[nds]=Portland Group-Fortran77-Kompilerer +Comment[ne]=पोर्टल्यान्ड समूह फोर्ट्रान ७७ कम्पाइलर +Comment[nl]=Portland Group Fortran77-compiler +Comment[pl]=Kompilator Portland Group Fortran77 +Comment[pt]=Compilador de Fortran77 do Portland Group +Comment[pt_BR]=Compilador Portland Group Fortran77 +Comment[ru]=Компилятор Portland Group Fortran77 +Comment[sk]=Portland Group Fortran77 kompilátor +Comment[sl]=Prevajalnik za Portland Group Fortran77 +Comment[sr]=Преводилац Fortran-а 77 од Portland Group-а +Comment[sr@Latn]=Prevodilac Fortran-a 77 od Portland Group-a +Comment[sv]=Portland gruppens Fortran 77-kompilator +Comment[ta]=பொர்ட்லான்ட் குழு பொர்ட்ரான் 77 தொகுப்பி +Comment[tg]=Талфифгари Portland Group Fortran77 +Comment[tr]=Portland Grubu Fortran 77 Derleyicisi +Comment[zh_CN]=Portland Group Fortran77 编译器 +Comment[zh_TW]=Portland Group Fortran 77 編譯器 +Name=Pgf77Options +Name[da]=Portland Group Fortran77 indstillinger +Name[de]=Pgf77-Einstellungen (KDevelop) +Name[hi]=पीजीएफ़77विकल्प +Name[nds]=Pgf77-Instellen (KDevelop) +Name[pl]=Opcje Pgf77 +Name[sk]=Pgf77 možnosti +Name[sl]=Možnosti Pgf77 +Name[sv]=Alternativ för pgf77 +Name[ta]=Pgf77 விருப்பங்கள் +Name[tg]=Pgf77Интихобҳо +Name[zh_TW]=Pgf77 選項 +ServiceTypes=KDevelop/CompilerOptions +X-KDE-Library=libkdevpgioptions +X-KDevelop-Version=5 +X-KDevelop-Language=Fortran +X-KDevelop-Args=pgf77 diff --git a/languages/fortran/compiler/pgioptions/kdevpghpfoptions.desktop b/languages/fortran/compiler/pgioptions/kdevpghpfoptions.desktop new file mode 100644 index 00000000..56923deb --- /dev/null +++ b/languages/fortran/compiler/pgioptions/kdevpghpfoptions.desktop @@ -0,0 +1,50 @@ +[Desktop Entry] +Type=Service +Exec=pghpf +Comment=Portland Group High Performance Fortran compiler +Comment[ca]=Compilador Fortran d'altes prestacions de Portland Group +Comment[da]=Portland Group Fortran oversætter +Comment[de]=Portland Group High Performance Fortran Compiler +Comment[el]=Μεταγλωττιστής υψηλής ταχύτητας Fortran της ομάδας Portland +Comment[es]=Compilador de Fortran de alto rendimiento de Portland Group +Comment[et]=Portland Groupi suure jõudlusega Fortrani kompilaator +Comment[eu]=Portland Group-en errendimendu handiko Fortran konpiladorea +Comment[fa]=مترجم فرترن با کارایی بالای گروه Portland +Comment[fr]=Compilateur Fortran hautes performances du Portland Group +Comment[gl]=Compilador de High Performance Fortran de Portland Group +Comment[hi]=पोर्टलैंड समूह उच्च परफ़ार्मेंस फ़ोरट्रॉन कम्पायलर +Comment[hu]=Portland Group nagyteljesítményű Fortran fordítóprogram +Comment[it]=Compilatore ad alte prestazioni per Fortran del Portland Group +Comment[ja]=Portland グループ ハイパフォーマンス Fortran コンパイラ +Comment[nds]=Portland Group-Hoochleistenkompilerer för Fortran +Comment[ne]=पोर्टल्यान्ड समूह उच्च कार्यसम्पादन फोर्ट्रान कम्पाइलर +Comment[nl]=Portland Group High Performance Fortran-compiler +Comment[pl]=Kompilator Portland Group High Performance Fortran +Comment[pt]=Compilador Portland Group High Performance Fortran +Comment[pt_BR]=Compilador Portland Group Alta Performance +Comment[ru]=Компилятор Portland Group High Performance Fortran +Comment[sk]=Portland Group vysoko výkonný Fortran kompilátor +Comment[sr]=Преводилац Fortran-а високих перформанси, из Portland Group-а +Comment[sr@Latn]=Prevodilac Fortran-a visokih performansi, iz Portland Group-a +Comment[sv]=Portland gruppens högprestanda Fortran 77-kompilator +Comment[ta]=பொர்ட்லான்ட் குழு உயர் செயல்பாடு பொர்ட்ரான் தொகுப்பி +Comment[tg]=Талфифгари Portland Group High Performance Fortran +Comment[tr]=Portland Grubu Yüksek Başarımlı Fortran Derleyicisi +Comment[zh_CN]=Portland Group 高性能 Fortran 编译器 +Comment[zh_TW]=Portland Group 高效能 Fortran 編譯器 +Name=PghpfOptions +Name[da]=Portland Group oversætter-indstillinger +Name[de]=Pghpf-Einstellungen (KDevelop) +Name[hi]=पीजीएचपीएफ़-विकल्प +Name[nds]=Pghpf-Optschonen +Name[pl]=Opcje Pghpf +Name[sk]=Pghpf možnosti +Name[sv]=Alternativ för pghpf +Name[ta]=Pghpf விருப்பங்கள் +Name[tg]=PghpfИнтихобҳо +Name[zh_TW]=Pghpf 選項 +ServiceTypes=KDevelop/CompilerOptions +X-KDE-Library=libkdevpgioptions +X-KDevelop-Version=5 +X-KDevelop-Language=Fortran +X-KDevelop-Args=pghpf diff --git a/languages/fortran/compiler/pgioptions/pgioptionsfactory.cpp b/languages/fortran/compiler/pgioptions/pgioptionsfactory.cpp new file mode 100644 index 00000000..5fad6630 --- /dev/null +++ b/languages/fortran/compiler/pgioptions/pgioptionsfactory.cpp @@ -0,0 +1,69 @@ +/*************************************************************************** + * Copyright (C) 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 "pgioptionsplugin.h" +#include "pgioptionsfactory.h" + + +extern "C" { + + void *init_libkdevpgioptions() + { + return new PgiOptionsFactory; + } + +} + + +PgiOptionsFactory::PgiOptionsFactory(QObject *parent, const char *name) + : KLibFactory(parent, name) +{ + instance(); +} + + +PgiOptionsFactory::~PgiOptionsFactory() +{ + delete s_instance; + s_instance = 0; +} + + +QObject *PgiOptionsFactory::createObject(QObject *parent, const char *name, + const char * /*classname*/, const QStringList &args) +{ + if (args.count() > 0 && qstrcmp(args[0].latin1(), "pghpf") == 0) { + kdDebug(9021) << "Building PgiOptions for PGHPF" << endl; + return new PgiOptionsPlugin(PgiOptionsPlugin::PGHPF, parent, name); + } else if (args.count() > 0 && qstrcmp(args[0].latin1(), "pgf77") == 0) { + kdDebug(9021) << "Building PgiOptions for PGF77" << endl; + return new PgiOptionsPlugin(PgiOptionsPlugin::PGF77, parent, name); + } else { + kdDebug(9021) << "Wrong args for kdevpgioptions library" << endl; + if (args.count() > 0) + kdDebug(9021) << args[0] << endl; + return 0; + } +} + + +KInstance *PgiOptionsFactory::s_instance = 0; +KInstance *PgiOptionsFactory::instance() +{ + if (!s_instance) + s_instance = new KInstance("kdevpgioptions"); + + return s_instance; +} + +#include "pgioptionsfactory.moc" diff --git a/languages/fortran/compiler/pgioptions/pgioptionsfactory.h b/languages/fortran/compiler/pgioptions/pgioptionsfactory.h new file mode 100644 index 00000000..9e3113a7 --- /dev/null +++ b/languages/fortran/compiler/pgioptions/pgioptionsfactory.h @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 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 _PGIOPTIONSFACTORY_H_ +#define _PGIOPTIONSFACTORY_H_ + +#include + + +class PgiOptionsFactory : public KLibFactory +{ + Q_OBJECT + +public: + PgiOptionsFactory( QObject *parent=0, const char *name=0 ); + ~PgiOptionsFactory(); + + virtual QObject* createObject( QObject *parent, const char *name, + const char *classname, const QStringList &args); + static KInstance *instance(); + +private: + static KInstance *s_instance; +}; + +#endif diff --git a/languages/fortran/compiler/pgioptions/pgioptionsplugin.cpp b/languages/fortran/compiler/pgioptions/pgioptionsplugin.cpp new file mode 100644 index 00000000..8bed362e --- /dev/null +++ b/languages/fortran/compiler/pgioptions/pgioptionsplugin.cpp @@ -0,0 +1,324 @@ +/*************************************************************************** + * Copyright (C) 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 "pgioptionsplugin.h" + + +const char * const optimization_flags[] = { + "-Mautopar", + "-Mextract", + "-Minline", + "-Mipa", + 0 +}; + + +const char * const hpf_flags[] = { + "-Mbackslash", + "-Mcmf", + "-Mdclchk", + "-Mextend", + "-Mf90", + "-Mnofree", + "-Mstandard", + "-Mupcase", + "-Mbyteswapio", + "-Mdepchk", + "-Mdlines", + "-Mg", + "-Mftn", + "-Minfo", + "-Minform", + "-Mkeepft", + "-Mkeepstaticn", + "-Mmpi", + "-Mmpl", + "-Mlist", + "-Mnohpfc", + "-Mnoindependent", + "-Mnoprelink", + "-Moverlap", + "-Mpreprocess", + "-Mprof", + "-Mpvm", + "-Mr8", + "-Mrecursive", + "-Mreplicate", + "-Mrpm", + "-Mrpm1", + "-M[no]sequence", + "-Msmp", + "-Mstats", + 0 +}; + + + +class GeneralTab : public QWidget +{ +public: + GeneralTab( QWidget *parent=0, const char *name=0 ); + ~GeneralTab(); + + void readFlags(QStringList *str); + void writeFlags(QStringList *str); +}; + + +class OptimizationTab : public QWidget +{ +public: + OptimizationTab( PgiOptionsPlugin::Type type, QWidget *parent=0, const char *name=0 ); + ~OptimizationTab(); + + void readFlags(QStringList *str); + void writeFlags(QStringList *str); + +private: + QRadioButton *Odefault, *O0, *O1, *O2; + QListView *optBox; +}; + + +class HpfTab : public QWidget +{ +public: + HpfTab( QWidget *parent=0, const char *name=0 ); + ~HpfTab(); + + void readFlags(QStringList *str); + void writeFlags(QStringList *str); + +private: + QListView *hpfBox; +}; + + +OptimizationTab::OptimizationTab(PgiOptionsPlugin::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); + + if (type == PgiOptionsPlugin::PGHPF) { + optBox = new QListView(this); + optBox->addColumn(QString::null); + optBox->header()->hide(); + for (const char * const *p = optimization_flags; *p; ++p) { + new QCheckListItem(optBox, *p, QCheckListItem::CheckBox); + kdDebug() << (*p) << endl; + } + } else + optBox = 0; + + QApplication::sendPostedEvents(this, QEvent::ChildInserted); + layout->addStretch(); +} + + +OptimizationTab::~OptimizationTab() +{} + + +void OptimizationTab::readFlags(QStringList *list) +{ + if (optBox) { + QListViewItem *item = optBox->firstChild(); + for (; item; item = item->nextSibling()) { + QStringList::Iterator sli = list->find(item->text(0)); + if (sli != list->end()) { + static_cast(item)->setOn(true); + list->remove(sli); + } + } + } + + 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) +{ + if (optBox) { + QListViewItem *item = optBox->firstChild(); + for (; item; item = item->nextSibling()) + if (static_cast(item)->isOn()) + (*list) << item->text(0); + } + + if (O0->isChecked()) + (*list) << "-O0"; + else if (O1->isChecked()) + (*list) << "-O1"; + else if (O2->isChecked()) + (*list) << "-O2"; +} + + +HpfTab::HpfTab(QWidget *parent, const char *name) + : QWidget(parent, name) +{ + QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + layout->setAutoAdd(true); + + hpfBox = new QListView(this); + hpfBox->addColumn(QString::null); + hpfBox->header()->hide(); + for (const char * const *p = hpf_flags; *p; ++p) + new QCheckListItem(hpfBox, *p, QCheckListItem::CheckBox); + + QApplication::sendPostedEvents(this, QEvent::ChildInserted); + layout->addStretch(); +} + + +HpfTab::~HpfTab() +{} + + +void HpfTab::readFlags(QStringList *list) +{ + QListViewItem *item = hpfBox->firstChild(); + for (; item; item = item->nextSibling()) { + QStringList::Iterator sli = list->find(item->text(0)); + if (sli != list->end()) { + static_cast(item)->setOn(true); + list->remove(sli); + } + } +} + + +void HpfTab::writeFlags(QStringList *list) +{ + QListViewItem *item = hpfBox->firstChild(); + for (; item; item = item->nextSibling()) { + if (static_cast(item)->isOn()) + (*list) << item->text(0); + } +} + + +PgiOptionsDialog::PgiOptionsDialog(PgiOptionsPlugin::Type type, QWidget *parent, const char *name) + : KDialogBase(Tabbed, (type == PgiOptionsPlugin::PGHPF)? i18n("PGHPF Compiler Options") : i18n("PGF77 Compiler Options"), + Ok|Cancel, Ok, parent, name, true) +{ + QVBox *vbox; + + // vbox = addVBoxPage(i18n("General")); + // general = new GeneralTab(vbox, "general tab"); + + vbox = addVBoxPage(i18n("Optimization")); + optimization = new OptimizationTab(type, vbox, "optimization tab"); + + if (type == PgiOptionsPlugin::PGHPF) { + vbox = addVBoxPage(i18n("HPF")); + hpf = new HpfTab(vbox, "optimization tab"); + } else + hpf = 0; + +} + + +PgiOptionsDialog::~PgiOptionsDialog() +{ +} + + +void PgiOptionsDialog::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 (hpf) + hpf->readFlags(&flaglist); + optimization->readFlags(&flaglist); + // general->readFlags(&flaglist); +} + + +QString PgiOptionsDialog::flags() const +{ + QStringList flaglist; + + if (hpf) + hpf->writeFlags(&flaglist); + optimization->writeFlags(&flaglist); + // general->writeFlags(&flaglist); + + QString flags; + QStringList::ConstIterator li; + for (li = flaglist.begin(); li != flaglist.end(); ++li) { + flags += (*li); + flags += " "; + } + + flags.truncate(flags.length()-1); + return flags; +} + + +PgiOptionsPlugin::PgiOptionsPlugin(Type type, QObject *parent, const char *name) + : KDevCompilerOptions(parent, name) +{ + pgitype = type; +} + + +PgiOptionsPlugin::~PgiOptionsPlugin() +{} + + +QString PgiOptionsPlugin::exec(QWidget *parent, const QString &flags) +{ + PgiOptionsDialog *dlg = new PgiOptionsDialog(pgitype, parent, "pgi options dialog"); + QString newFlags = flags; + dlg->setFlags(flags); + if (dlg->exec() == QDialog::Accepted) + newFlags = dlg->flags(); + delete dlg; + return newFlags; +} + +#include "pgioptionsplugin.moc" diff --git a/languages/fortran/compiler/pgioptions/pgioptionsplugin.h b/languages/fortran/compiler/pgioptions/pgioptionsplugin.h new file mode 100644 index 00000000..dfbf4547 --- /dev/null +++ b/languages/fortran/compiler/pgioptions/pgioptionsplugin.h @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 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 _PGIOPTIONSPLUGIN_H_ +#define _PGIOPTIONSPLUGIN_H_ + +#include + +#include "kdevcompileroptions.h" + +class GeneralTab; +class OptimizationTab; +class HpfTab; + + +class PgiOptionsPlugin : public KDevCompilerOptions +{ + Q_OBJECT + +public: + enum Type { PGHPF, PGF77 }; + + PgiOptionsPlugin( Type type, QObject *parent=0, const char *name=0 ); + ~PgiOptionsPlugin(); + + virtual QString exec(QWidget *parent, const QString &flags); + +private: + Type pgitype; +}; + + +class PgiOptionsDialog : public KDialogBase +{ +public: + PgiOptionsDialog(PgiOptionsPlugin::Type type, QWidget *parent=0, const char *name=0 ); + ~PgiOptionsDialog(); + + void setFlags(const QString &flags); + QString flags() const; + +private: + OptimizationTab *optimization; + HpfTab *hpf; +}; + +#endif diff --git a/languages/fortran/doc/Makefile.am b/languages/fortran/doc/Makefile.am new file mode 100644 index 00000000..5e7eab51 --- /dev/null +++ b/languages/fortran/doc/Makefile.am @@ -0,0 +1,6 @@ +tocdir = ${kde_datadir}/kdevdocumentation/tocs +toc_DATA = fortran_bugs_gcc.toc + +#indexdir = ${kde_datadir}/devdoctreeview/indices +#index_DATA = + diff --git a/languages/fortran/doc/fortran_bugs_gcc.toc b/languages/fortran/doc/fortran_bugs_gcc.toc new file mode 100644 index 00000000..444a2a05 --- /dev/null +++ b/languages/fortran/doc/fortran_bugs_gcc.toc @@ -0,0 +1,7 @@ + + +Fortran bugs (GCC) + + + + diff --git a/languages/fortran/file_templates/Makefile.am b/languages/fortran/file_templates/Makefile.am new file mode 100644 index 00000000..2a8e4365 --- /dev/null +++ b/languages/fortran/file_templates/Makefile.am @@ -0,0 +1,2 @@ +templatedir = $(kde_datadir)/kdevfilecreate/file-templates +template_DATA = f f77 f90 f95 for fpp ftn diff --git a/languages/fortran/file_templates/f b/languages/fortran/file_templates/f new file mode 100644 index 00000000..909182fc --- /dev/null +++ b/languages/fortran/file_templates/f @@ -0,0 +1,11 @@ +c +c Preprocessed Fortran Implementation: $MODULE$ +c +c Description: +c +c +c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +c +c Copyright: See COPYING file that comes with this distribution +c + diff --git a/languages/fortran/file_templates/f77 b/languages/fortran/file_templates/f77 new file mode 100644 index 00000000..a3628bc1 --- /dev/null +++ b/languages/fortran/file_templates/f77 @@ -0,0 +1,11 @@ +c +c Fortran 77 Implementation: $MODULE$ +c +c Description: +c +c +c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +c +c Copyright: See COPYING file that comes with this distribution +c + diff --git a/languages/fortran/file_templates/f90 b/languages/fortran/file_templates/f90 new file mode 100644 index 00000000..b3800d65 --- /dev/null +++ b/languages/fortran/file_templates/f90 @@ -0,0 +1,11 @@ +c +c Fortran 90 Implementation: $MODULE$ +c +c Description: +c +c +c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +c +c Copyright: See COPYING file that comes with this distribution +c + diff --git a/languages/fortran/file_templates/f95 b/languages/fortran/file_templates/f95 new file mode 100644 index 00000000..a4f452cf --- /dev/null +++ b/languages/fortran/file_templates/f95 @@ -0,0 +1,11 @@ +c +c Fortran 95 Implementation: $MODULE$ +c +c Description: +c +c +c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +c +c Copyright: See COPYING file that comes with this distribution +c + diff --git a/languages/fortran/file_templates/for b/languages/fortran/file_templates/for new file mode 100644 index 00000000..909182fc --- /dev/null +++ b/languages/fortran/file_templates/for @@ -0,0 +1,11 @@ +c +c Preprocessed Fortran Implementation: $MODULE$ +c +c Description: +c +c +c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +c +c Copyright: See COPYING file that comes with this distribution +c + diff --git a/languages/fortran/file_templates/fpp b/languages/fortran/file_templates/fpp new file mode 100644 index 00000000..d8a7ad6c --- /dev/null +++ b/languages/fortran/file_templates/fpp @@ -0,0 +1,11 @@ +c +c Fortran Implementation: $MODULE$ +c +c Description: +c +c +c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +c +c Copyright: See COPYING file that comes with this distribution +c + diff --git a/languages/fortran/file_templates/ftn b/languages/fortran/file_templates/ftn new file mode 100644 index 00000000..a3628bc1 --- /dev/null +++ b/languages/fortran/file_templates/ftn @@ -0,0 +1,11 @@ +c +c Fortran 77 Implementation: $MODULE$ +c +c Description: +c +c +c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$ +c +c Copyright: See COPYING file that comes with this distribution +c + diff --git a/languages/fortran/fixedformparser.cpp b/languages/fortran/fixedformparser.cpp new file mode 100644 index 00000000..7084fbba --- /dev/null +++ b/languages/fortran/fixedformparser.cpp @@ -0,0 +1,94 @@ +/*************************************************************************** + * Copyright (C) 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 "fixedformparser.h" + +#include +#include +#include +#include + + +FixedFormParser::FixedFormParser(CodeModel* model) +{ + m_model = model; + + functionre.setPattern("(integer|real|logical|complex|character|" + "double(precision)?)function([^(]+).*"); + subroutinere.setPattern("subroutine([^(]+).*"); + + functionre.setCaseSensitive( false ); + subroutinere.setCaseSensitive( false ); +} + + +void FixedFormParser::process(const QCString &line, const QString &fileName, int lineNum) +{ + QCString simplified; + int l = line.length(); + for (int i=0; i < l; ++i) + if (line[i] != ' ') + simplified += line[i]; + + if ( simplified.isEmpty() ) return; + + QString name; + if (functionre.search(simplified) != -1) + name = functionre.cap(3); + else if (subroutinere.search(simplified) != -1) + name = subroutinere.cap(1); + else + return; + + FunctionDom method = m_model->create(); + method->setName(name); + method->setFileName(fileName); + method->setStartPosition(lineNum, 0); + + if( !m_file->hasFunction(method->name()) ) + m_file->addFunction(method); +} + + +void FixedFormParser::parse(const QString &fileName) +{ + QFile f(QFile::encodeName(fileName)); + if (!f.open(IO_ReadOnly)) + return; + QTextStream stream(&f); + + m_file = m_model->create(); + m_file->setName( fileName ); + + QCString line; + int lineNum=0, startLineNum=0; + while (!stream.atEnd()) { + ++lineNum; + QCString str = stream.readLine().local8Bit(); + if (!str.isEmpty() && QCString("*Cc#!").find(str[0]) != -1) + continue; + // Continuation line + if (str.length() > 6 && str.left(5) == " " && str[5] != ' ') { + line += str.right(str.length()-6); + continue; + } + // An initial or invalid line. We don't care + // about validity + process(line, fileName, startLineNum); + line = str.right(str.length()-6); + startLineNum = lineNum-1; + } + process(line, fileName, startLineNum); + + f.close(); + + m_model->addFile( m_file ); +} diff --git a/languages/fortran/fixedformparser.h b/languages/fortran/fixedformparser.h new file mode 100644 index 00000000..a7016510 --- /dev/null +++ b/languages/fortran/fixedformparser.h @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright (C) 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 _FIXEDFORMPARSER_H_ +#define _FIXEDFORMPARSER_H_ + +#include +#include +#include +#include + + +class FixedFormParser +{ +public: + FixedFormParser(CodeModel* model); + + void parse(const QString &fileName); + +private: + void process(const QCString &line, const QString &fileName, int lineNum); + CodeModel* m_model; + FileDom m_file; + QRegExp functionre, subroutinere; +}; + +#endif diff --git a/languages/fortran/fortransupportpart.cpp b/languages/fortran/fortransupportpart.cpp new file mode 100644 index 00000000..e0c0bde9 --- /dev/null +++ b/languages/fortran/fortransupportpart.cpp @@ -0,0 +1,287 @@ +/*************************************************************************** + * Copyright (C) 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. * + * * + * The tooltips for ftnchek contained in this source file are taken * + * from the ftnchek man page. ftnchek is written by Robert Moniot and * + * others. * + * * + ***************************************************************************/ + +#include "fortransupportpart.h" +#include "ftnchekconfigwidget.h" +#include "fixedformparser.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 FortranSupportFactory; +static const KDevPluginInfo data("kdevfortransupport"); +K_EXPORT_COMPONENT_FACTORY( libkdevfortransupport, FortranSupportFactory( data ) ) + +FortranSupportPart::FortranSupportPart(QObject *parent, const char *name, const QStringList &) + : KDevLanguageSupport(&data, parent, name ? name : "FortranSupportPart") +{ + setInstance(FortranSupportFactory::instance()); + + setXMLFile("kdevfortransupport.rc"); + + 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&)) ); + + KAction *action; + + action = new KAction( i18n("&Ftnchek"), 0, + this, SLOT(slotFtnchek()), + actionCollection(), "project_ftnchek" ); + action->setToolTip(i18n("Run ftnchek")); + action->setWhatsThis(i18n("Run ftnchek

Runs ftnchek to check fortran programs for semantic errors. Configure ftnchek options in project settings dialog, Ftnchek tab.")); + + parser = 0; +} + + +FortranSupportPart::~FortranSupportPart() +{} + + +void FortranSupportPart::slotFtnchek() +{ + // Do something smarter here... + if (makeFrontend()->isRunning()) { + KMessageBox::sorry(0, i18n("There is currently a job running.")); + return; + } + + if (partController()->saveAllFiles()==false) + return; //user cancelled + + QDomDocument &dom = *projectDom(); + + QString cmdline = "cd "; + cmdline += KProcess::quote(project()->projectDirectory()); + cmdline += "&& ftnchek -nonovice "; + + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/division")) + cmdline += "-division "; + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/extern")) + cmdline += "-extern "; + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/declare")) + cmdline += "-declare "; + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/pure")) + cmdline += "-pure "; + + cmdline += "-arguments="; + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/argumentsall")) + cmdline += "all "; + else + cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/argumentsonly") + " "; + + cmdline += "-common="; + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/commonall")) + cmdline += "all "; + else + cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/commononly") + " "; + + cmdline += "-truncation="; + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/truncationall")) + cmdline += "all "; + else + cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/truncationonly") + " "; + + cmdline += "-usage="; + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/usageall")) + cmdline += "all "; + else + cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/usageonly") + " "; + + cmdline += "-f77="; + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/f77all")) + cmdline += "all "; + else + cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/f77only") + " "; + + cmdline += "-portability="; + if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/portabilityall")) + cmdline += "all "; + else + cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/portabilityonly") + " "; + + QStringList list = project()->allFiles(); + QStringList::ConstIterator it; + for (it = list.begin(); it != list.end(); ++it) { + QFileInfo fi(*it); + QString extension = fi.extension(); + if (extension == "f77" || extension == "f" || extension == "for" + || extension == "ftn") { + cmdline += *it + " "; + } + } + + makeFrontend()->queueCommand(QString::null, cmdline); +} + + +void FortranSupportPart::projectConfigWidget(KDialogBase *dlg) +{ + QVBox *vbox = dlg->addVBoxPage(i18n("Ftnchek"), i18n("Ftnchek"), BarIcon("kdevelop", KIcon::SizeMedium)); + FtnchekConfigWidget *w = new FtnchekConfigWidget(*projectDom(), vbox, "ftnchek config widget"); + connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); +} + + +void FortranSupportPart::projectOpened() +{ + kdDebug(9019) << "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 + parser = new FixedFormParser(codeModel()); + + QTimer::singleShot(0, this, SLOT(initialParse())); +} + + +void FortranSupportPart::projectClosed() +{ + delete parser; + parser = 0; +} + + +void FortranSupportPart::maybeParse(const QString fileName) +{ + QFileInfo fi(fileName); + QString extension = fi.extension(); + if (extension == "f77" || extension == "f" || extension == "for" || extension == "ftn") { + + if( codeModel()->hasFile(fileName) ){ + emit aboutToRemoveSourceInfo( fileName ); + codeModel()->removeFile( codeModel()->fileByName(fileName) ); + } + + parser->parse(fileName); + } +} + + +void FortranSupportPart::initialParse() +{ + kdDebug(9019) << "initialParse()" << endl; + + if (project()) { + kapp->setOverrideCursor(waitCursor); + QStringList files = project()->allFiles(); + for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) { + QFileInfo fileInfo( project()->projectDirectory(), *it ); + kdDebug(9019) << "maybe parse " << fileInfo.absFilePath() << endl; + maybeParse( fileInfo.absFilePath() ); + } + + emit updatedSourceInfo(); + kapp->restoreOverrideCursor(); + } else { + kdDebug(9019) << "No project" << endl; + } +} + + +void FortranSupportPart::addedFilesToProject(const QStringList &fileList) +{ + kdDebug(9019) << "addedFilesToProject()" << endl; + + QStringList::ConstIterator it; + + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + QFileInfo fileInfo( project()->projectDirectory(), *it ); + QString path = fileInfo.absFilePath(); + maybeParse( path ); + emit addedSourceInfo( path ); + } + + //emit updatedSourceInfo(); +} + + +void FortranSupportPart::removedFilesFromProject(const QStringList &fileList) +{ + kdDebug(9019) << "removedFilesFromProject()" << endl; + + QStringList::ConstIterator it; + + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + QFileInfo fileInfo( project()->projectDirectory(), *it ); + QString path = fileInfo.absFilePath(); + + if( codeModel()->hasFile(path) ){ + emit aboutToRemoveSourceInfo( path ); + codeModel()->removeFile( codeModel()->fileByName(path) ); + } + } + + //emit updatedSourceInfo(); +} + + +void FortranSupportPart::savedFile(const KURL &fileName) +{ + kdDebug(9019) << "savedFile()" << endl; + + if (project()->allFiles().contains(fileName.path().mid ( project()->projectDirectory().length() + 1 ))) { + maybeParse(fileName.path()); + emit addedSourceInfo( fileName.path() ); + } +} + + +KDevLanguageSupport::Features FortranSupportPart::features() +{ + return Features(Functions); +} + +KDevMakeFrontend * FortranSupportPart::makeFrontend( ) +{ + return extension("KDevelop/MakeFrontend"); +} + +#include "fortransupportpart.moc" diff --git a/languages/fortran/fortransupportpart.h b/languages/fortran/fortransupportpart.h new file mode 100644 index 00000000..52dcba5a --- /dev/null +++ b/languages/fortran/fortransupportpart.h @@ -0,0 +1,53 @@ +/*************************************************************************** + * Copyright (C) 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 _FORTRANSUPPORTPART_H_ +#define _FORTRANSUPPORTPART_H_ + +class FixedFormParser; +class KDialogBase; +class QStringList; +class KDevMakeFrontend; + +#include "kdevlanguagesupport.h" + + +class FortranSupportPart : public KDevLanguageSupport +{ + Q_OBJECT + +public: + FortranSupportPart( QObject *parent, const char *name, const QStringList & ); + ~FortranSupportPart(); + +protected: + virtual KDevLanguageSupport::Features features(); + +private slots: + void slotFtnchek(); + void projectConfigWidget(KDialogBase *dlg); + void projectOpened(); + void projectClosed(); + void savedFile(const KURL &fileName); + void addedFilesToProject(const QStringList &fileList); + void removedFilesFromProject(const QStringList &fileList); + + // Internal + void initialParse(); + +private: + void maybeParse(const QString fileName); + KDevMakeFrontend *makeFrontend(); + + FixedFormParser *parser; +}; + +#endif diff --git a/languages/fortran/ftnchekconfigwidget.cpp b/languages/fortran/ftnchekconfigwidget.cpp new file mode 100644 index 00000000..fd4f7a87 --- /dev/null +++ b/languages/fortran/ftnchekconfigwidget.cpp @@ -0,0 +1,290 @@ +/*************************************************************************** + * Copyright (C) 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 "ftnchekconfigwidget.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "domutil.h" + + +class FtnchekItem : public QCheckListItem +{ +public: + FtnchekItem(QListView *parent, const QString &flagstr, + const QString &description) + : QCheckListItem(parent, flagstr, QCheckListItem::CheckBox), + flag(flagstr), desc(description) + { + setText(1, desc); + } + + static void readFlagsToListView(QListView *listview, QStringList *list); + static void writeFlagsFromListView(QListView *listview, QStringList *list); + +private: + QString flag; + QString desc; + friend class FtnchekToolTip; +}; + + +void FtnchekItem::readFlagsToListView(QListView *listview, QStringList *list) +{ + QListViewItem *item = listview->firstChild(); + for (; item; item = item->nextSibling()) { + FtnchekItem *flitem = static_cast(item); + QStringList::Iterator sli = list->find(flitem->flag); + if (sli != list->end()) { + flitem->setOn(true); + list->remove(sli); + } + } +} + + +void FtnchekItem::writeFlagsFromListView(QListView *listview, QStringList *list) +{ + (*list).clear(); + + QListViewItem *item = listview->firstChild(); + for (; item; item = item->nextSibling()) { + FtnchekItem *flitem = static_cast(item); + if (flitem->isOn()) + (*list) << flitem->flag; + } +} + + +class FtnchekToolTip : public QToolTip +{ +public: + FtnchekToolTip(QWidget *parent) + : QToolTip(parent) + {} +protected: + void maybeTip(const QPoint &pos) + { + QListView *listview = static_cast(parentWidget()); + QListViewItem *item = listview->itemAt(pos); + FtnchekItem *flitem = static_cast(item); + + if (item) + tip(listview->itemRect(item), flitem->desc); + } +}; + + +const char *arguments_flags[] = { + "arrayness", I18N_NOOP("Warn about inconsistent use of arguments that use arrays"), + "type", I18N_NOOP("Warn about dummy arguments of a data type different from " + "the actual arguments"), + "function-type", I18N_NOOP("Warn if the invocation assumes a different data type for the return type, " + "different from the actual return type"), + "number", I18N_NOOP("Warn about invoking a subprogram with an incorrect number of arguments"), + 0, 0 +}; + + +const char *common_flags[] = { + "dimension", I18N_NOOP("Corresponding arrays in each declaration of a block must agree in size " + "and number of dimensions"), + "exact", I18N_NOOP("The comparison of two blocks is done variable-by-variable"), + "length", I18N_NOOP("Warn if different declarations of the same block are not equal in total length"), + "type", I18N_NOOP("In each declaration of a block, corresponding memory locations " + "must agree in data type"), + 0, 0 +}; + + +const char *truncation_flags[] = { + "int-div-exponent", I18N_NOOP("Use of the result of integer division as an exponent"), + "int-div-real", I18N_NOOP("Conversion of an expression involving an integer division to real"), + "int-div-zero", I18N_NOOP("Division in an integer constant expression that yields a result of zero"), + 0, 0 +}; + + +const char *usage_flags[] = { + "arg-alias", I18N_NOOP("A scalar dummy argument is actually the same as another " + "and is (or may be) modified"), + "arg-array-alias", I18N_NOOP("A dummy argument which is an array or array element " + "is the same array as another and is modified"), + "arg-common-alias", I18N_NOOP("A scalar dummy argument is the same as a common variable in " + "the subprogram, and either is modified"), + 0, 0 +}; + + +const char *f77_flags[] = { + "accept-type", I18N_NOOP("ACCEPT and TYPE I/O statements"), + "array-bounds", I18N_NOOP("Expressions defining array bounds that contain array " + "elements or function references"), + "assignment-stmt", I18N_NOOP("Assignment statements involving arrays"), + 0, 0 +}; + + +const char *portability_flags[] = { + "backslash", I18N_NOOP("Backslash characters in strings"), + "common-alignment", I18N_NOOP("COMMON block variables not in descending order of storage sizes"), + "hollerith", I18N_NOOP("Hollerith constants"), + 0, 0 +}; + + +FtnchekConfigWidget::FtnchekConfigWidget(QDomDocument &projectDom, QWidget *parent, const char *name) + : FtnchekConfigWidgetBase(parent, name), dom(projectDom) +{ + arguments_group = new QButtonGroup; + arguments_group->insert(argumentsall_button); + arguments_group->insert(argumentsonly_button); + common_group = new QButtonGroup; + common_group->insert(commonall_button); + common_group->insert(commononly_button); + truncation_group = new QButtonGroup; + truncation_group->insert(truncationall_button); + truncation_group->insert(truncationonly_button); + usage_group = new QButtonGroup; + usage_group->insert(usageall_button); + usage_group->insert(usageonly_button); + f77_group = new QButtonGroup; + f77_group->insert(f77all_button); + f77_group->insert(f77only_button); + portability_group = new QButtonGroup; + portability_group->insert(portabilityall_button); + portability_group->insert(portabilityonly_button); + + arguments_listview->header()->hide(); + new FtnchekToolTip(arguments_listview); + + common_listview->header()->hide(); + new FtnchekToolTip(common_listview); + + truncation_listview->header()->hide(); + new FtnchekToolTip(truncation_listview); + + usage_listview->header()->hide(); + new FtnchekToolTip(usage_listview); + + f77_listview->header()->hide(); + new FtnchekToolTip(f77_listview); + + portability_listview->header()->hide(); + new FtnchekToolTip(portability_listview); + + for (const char **p = arguments_flags; *p; p += 2) + new FtnchekItem(arguments_listview, QString::fromUtf8(*p), i18n(*(p+1))); + + for (const char **p = common_flags; *p; p += 2) + new FtnchekItem(common_listview, QString::fromUtf8(*p), i18n(*(p+1))); + + for (const char **p = truncation_flags; *p; p += 2) + new FtnchekItem(truncation_listview, QString::fromUtf8(*p), i18n(*(p+1))); + + for (const char **p = usage_flags; *p; p += 2) + new FtnchekItem(usage_listview, QString::fromUtf8(*p), i18n(*(p+1))); + + for (const char **p = f77_flags; *p; p += 2) + new FtnchekItem(f77_listview, QString::fromUtf8(*p), i18n(*(p+1))); + + for (const char **p = portability_flags; *p; p += 2) + new FtnchekItem(portability_listview, QString::fromUtf8(*p), i18n(*(p+1))); + + readConfig(); +} + + +FtnchekConfigWidget::~FtnchekConfigWidget() +{ + delete arguments_group; + delete common_group; + delete truncation_group; + delete usage_group; + delete f77_group; + delete portability_group; +} + + +void FtnchekConfigWidget::accept() +{ + storeConfig(); +} + + +void FtnchekConfigWidget::readConfig() +{ + division_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/division")); + extern_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/extern")); + declare_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/declare")); + pure_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/pure")); + + argumentsall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/argumentsall")); + commonall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/commonall")); + truncationall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/truncationall")); + usageall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/usageall")); + f77all_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/f77all")); + portabilityall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/portabilityall")); + + QStringList list; + + list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/argumentsonly")); + FtnchekItem::readFlagsToListView(arguments_listview, &list); + list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/commononly")); + FtnchekItem::readFlagsToListView(common_listview, &list); + list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/truncationonly")); + FtnchekItem::readFlagsToListView(truncation_listview, &list); + list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/usageonly")); + FtnchekItem::readFlagsToListView(usage_listview, &list); + list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/f77only")); + FtnchekItem::readFlagsToListView(f77_listview, &list); + list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/portabilityonly")); + FtnchekItem::readFlagsToListView(portability_listview, &list); +} + + +void FtnchekConfigWidget::storeConfig() +{ + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/division", division_box->isChecked()); + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/extern", extern_box->isChecked()); + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/declare", declare_box->isChecked()); + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/pure", pure_box->isChecked()); + + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/argumentsall", argumentsall_button->isChecked()); + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/commonall", commonall_button->isChecked()); + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/truncationall", truncationall_button->isChecked()); + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/usageall", usageall_button->isChecked()); + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/f77all", f77all_button->isChecked()); + DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/portabilityall", portabilityall_button->isChecked()); + + QStringList list; + + FtnchekItem::writeFlagsFromListView(arguments_listview, &list); + DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/argumentsonly", list.join(",")); + FtnchekItem::writeFlagsFromListView(common_listview, &list); + DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/commononly", list.join(",")); + FtnchekItem::writeFlagsFromListView(truncation_listview, &list); + DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/truncationonly", list.join(",")); + FtnchekItem::writeFlagsFromListView(usage_listview, &list); + DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/usageonly", list.join(",")); + FtnchekItem::writeFlagsFromListView(f77_listview, &list); + DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/f77only", list.join(",")); + FtnchekItem::writeFlagsFromListView(portability_listview, &list); + DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/portabilityonly", list.join(",")); +} + +#include "ftnchekconfigwidget.moc" diff --git a/languages/fortran/ftnchekconfigwidget.h b/languages/fortran/ftnchekconfigwidget.h new file mode 100644 index 00000000..053b2598 --- /dev/null +++ b/languages/fortran/ftnchekconfigwidget.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 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 _FTNCHEKCONFIGWIDGET_H_ +#define _FTNCHEKCONFIGWIDGET_H_ + +#include +#include "ftnchekconfigwidgetbase.h" + +class QButtonGroup; + +class FtnchekConfigWidget : public FtnchekConfigWidgetBase +{ + Q_OBJECT + +public: + FtnchekConfigWidget(QDomDocument &projectDom, QWidget *parent, const char *name); + ~FtnchekConfigWidget(); + +public slots: + void accept(); + +private: + void readConfig(); + void storeConfig(); + + QButtonGroup *arguments_group, *common_group; + QButtonGroup *truncation_group, *usage_group; + QButtonGroup *f77_group, *portability_group; + QDomDocument dom; +}; + +#endif diff --git a/languages/fortran/ftnchekconfigwidgetbase.ui b/languages/fortran/ftnchekconfigwidgetbase.ui new file mode 100644 index 00000000..b6bb2184 --- /dev/null +++ b/languages/fortran/ftnchekconfigwidgetbase.ui @@ -0,0 +1,584 @@ + +FtnchekConfigWidgetBase + + + ftcheck_config_widget + + + + 0 + 0 + 798 + 507 + + + + Ftnchek Options + + + + unnamed + + + 0 + + + 0 + + + + TabWidget4 + + + + tab + + + &1 + + + + unnamed + + + + extern_box + + + &External subprograms without definition + + + + + division_box + + + &Divisions + + + + + declare_box + + + &Identifiers without explicit type + + + + + pure_box + + + &Assume functions have no side effects + + + + + Spacer2_3 + + + Vertical + + + Preferred + + + + 20 + 20 + + + + + + TextLabel1 + + + Ar&guments: + + + argumentsall_button + + + + + argumentsall_button + + + All + + + false + + + + + argumentsonly_button + + + Only the following: + + + true + + + + + Spacer4 + + + Horizontal + + + Preferred + + + + 20 + 20 + + + + + + Spacer3 + + + Vertical + + + Preferred + + + + 20 + 20 + + + + + + commonall_button + + + All + + + + + commononly_button + + + Only the following: + + + true + + + + + + + + + true + + + true + + + + + + + + true + + + true + + + + arguments_listview + + + NoColumn + + + + + + + + + true + + + true + + + + + + + + true + + + true + + + + common_listview + + + NoColumn + + + + + TextLabel2 + + + Common &blocks: + + + commonall_button + + + + + + + tab + + + &2 + + + + unnamed + + + + truncationonly_button + + + Only the following: + + + true + + + + + TextLabel4 + + + &Truncation and roundoff errors: + + + truncationall_button + + + + + truncationall_button + + + All + + + + + TextLabel3 + + + &Use of variables: + + + usageall_button + + + + + usageall_button + + + All + + + + + + + + + true + + + true + + + + + + + + true + + + true + + + + truncation_listview + + + NoColumn + + + + + usageonly_button + + + Only the following: + + + true + + + + + Spacer1_2 + + + Horizontal + + + Preferred + + + + 20 + 20 + + + + + + + + + + true + + + true + + + + + + + + true + + + true + + + + usage_listview + + + NoColumn + + + + + + + tab + + + &3 + + + + unnamed + + + + f77all_button + + + All + + + + + f77only_button + + + Only the following: + + + true + + + + + + + + + true + + + true + + + + + + + + true + + + true + + + + f77_listview + + + NoColumn + + + + + + + + + true + + + true + + + + + + + + true + + + true + + + + portability_listview + + + NoColumn + + + + + Spacer2 + + + Horizontal + + + Preferred + + + + 20 + 20 + + + + + + TextLabel4_2 + + + Fortran 77 language &extensions: + + + f77all_button + + + + + TextLabel3_2 + + + Other &portability warnings: + + + portabilityall_button + + + + + portabilityall_button + + + All + + + + + portabilityonly_button + + + Only the following: + + + true + + + + + + + + + declare_box + pure_box + extern_box + division_box + argumentsall_button + argumentsonly_button + arguments_listview + commonall_button + commononly_button + common_listview + TabWidget4 + truncationall_button + truncationonly_button + truncation_listview + usageall_button + usageonly_button + usage_listview + f77all_button + f77only_button + f77_listview + portabilityall_button + portabilityonly_button + portability_listview + + + kdialog.h + + + + diff --git a/languages/fortran/kdevfortransupport.desktop b/languages/fortran/kdevfortransupport.desktop new file mode 100644 index 00000000..ad4f8185 --- /dev/null +++ b/languages/fortran/kdevfortransupport.desktop @@ -0,0 +1,80 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=Fortran 77 Support +Comment[ca]=Suport per a Fortran 77 +Comment[da]=Fortran 77 understøttelse +Comment[de]=Unterstützung für Fortran 77 für KDevelop +Comment[el]=Υποστήριξη Fortran 77 +Comment[es]=Soporte para Fortran 77 +Comment[et]=Fortran 77 toetus +Comment[eu]=Fortran 77 euskarria +Comment[fa]=پشتیبانی فرترن ۷۷ +Comment[fr]=Prise en charge du langage Fortran77 +Comment[ga]=Tacaíocht Fortran 77 +Comment[gl]=Soporte para Fortran 77 +Comment[hi]=फ़ोरट्रॉन 77 समर्थन +Comment[hu]=Fortran 77-támogatás +Comment[is]=Fortran 77 stuðningur +Comment[it]=Supporto per Fortran 77 +Comment[ja]=Fortran 77 サポート +Comment[nds]=Ünnerstütten för Fortran 77 +Comment[ne]=फोर्ट्रान ७७ समर्थन +Comment[nl]=Ondersteuning voor Fortran 77 +Comment[pl]=Obsługa Fortrana 77 +Comment[pt]=Suporte a Fortran 77 +Comment[pt_BR]=Suporte ao Fortran 77 +Comment[ru]=Поддержка языка Fortran 77 +Comment[sk]=Fortran 77 podpora +Comment[sl]=Podpora za Fortran 77 +Comment[sr]=Подршка за Fortran 77 +Comment[sr@Latn]=Podrška za Fortran 77 +Comment[sv]=Fortran 77-stöd +Comment[ta]=பொர்ட்ரான் 77 ஆதரவு +Comment[tg]=Ёрӣ намудани забони 77 Support +Comment[tr]=Fortran 77 Desteği +Comment[zh_CN]=Fortran 77 支持 +Comment[zh_TW]=Fortran 77 支援 +Name=KDevFortranSupport +Name[da]=KDevelop Fortran77 understøttelse +Name[nds]=Fortran-Ünnerstütten för KDevelop +Name[pl]=KDevObsługaFortrana +Name[sk]=KDev Fortran podpora +Name[sv]=KDevelop Fortran-stöd +Name[zh_TW]=KDevelop Fortran 支援 +GenericName=Fortran 77 Support +GenericName[ca]=Suport per a Fortran 77 +GenericName[da]=Fortran 77 understøttelse +GenericName[de]=Unterstützung für Fortran 77 +GenericName[el]=Υποστήριξη Fortran 77 +GenericName[es]=Soporte para Fortran 77 +GenericName[et]=Fortran 77 toetus +GenericName[eu]=Fortran 77 euskarria +GenericName[fa]=پشتیبانی فرترن ۷۷ +GenericName[fr]=Prise en charge du langage Fortran 77 +GenericName[ga]=Tacaíocht Fortran 77 +GenericName[gl]=Soporte para Fortran 77 +GenericName[hi]=फ़ोरट्रॉन 77 समर्थन +GenericName[hu]=Fortran 77-támogatás +GenericName[it]=Supporto Fortran 77 +GenericName[ja]=Fortran 77 サポート +GenericName[nds]=Ünnerstütten för Fortran-77 +GenericName[ne]=फोर्ट्रान ७७ समर्थन +GenericName[nl]=Ondersteuning voor Fortran 77 +GenericName[pl]=Obsługa Fortrana 77 +GenericName[pt]=Suporte a Fortran 77 +GenericName[pt_BR]=Suporte ao Fortran 77 +GenericName[ru]=Поддержка языка Fortran 77 +GenericName[sk]=Fortran 77 podpora +GenericName[sl]=Podpora za Fortran 77 +GenericName[sr]=Подршка за Fortran 77 +GenericName[sr@Latn]=Podrška za Fortran 77 +GenericName[sv]=Fortran 77-stöd +GenericName[tg]=Ёрӣ намудани забони 77 Support +GenericName[tr]=Fortran 77 Desteği +GenericName[zh_CN]=Fortran 77 支持 +GenericName[zh_TW]=Fortran 77 支援 +ServiceTypes=KDevelop/LanguageSupport +X-KDE-Library=libkdevfortransupport +X-KDevelop-Version=5 +X-KDevelop-Language=Fortran77 diff --git a/languages/fortran/kdevfortransupport.rc b/languages/fortran/kdevfortransupport.rc new file mode 100644 index 00000000..40e3f80a --- /dev/null +++ b/languages/fortran/kdevfortransupport.rc @@ -0,0 +1,9 @@ + + + +

+ + + + + -- cgit v1.2.3