Permalink
Browse files

added net.sf.* plugins

darcs-hash:20050613070823-ad775-0724b43ca496104cfea36d4bf912621774d8307c.gz
  • Loading branch information...
leiffrenzel committed Jun 13, 2005
1 parent ab0bf03 commit 3efa6c87d8e628796179133a32e2345274ff6b0c
Showing with 9,789 additions and 0 deletions.
  1. +16 −0 de.leiffrenzel.fp.haskell.core/src/de/leiffrenzel/fp/haskell/core/HaskellCoreException.java
  2. +125 −0 de.leiffrenzel.fp.haskell.core/src/de/leiffrenzel/fp/haskell/core/HaskellCorePlugin.java
  3. +7 −0 net.sf.eclipsefp.haskell.core.parser.test/.classpath
  4. +28 −0 net.sf.eclipsefp.haskell.core.parser.test/.project
  5. +15 −0 net.sf.eclipsefp.haskell.core.parser.test/META-INF/MANIFEST.MF
  6. +4 −0 net.sf.eclipsefp.haskell.core.parser.test/build.properties
  7. +22 −0 ...clipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/AllTests_PDESuite.java
  8. +102 −0 ...fp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/CompilationUnit_PDETest.java
  9. +362 −0 ...sefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/HaskellParser_PDETest.java
  10. +113 −0 ...efp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/HaskellProjectTestCase.java
  11. +4 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/001/Main.hs
  12. +10 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/002/Main.hs
  13. +4 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/003/Main.hs
  14. +10 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/004/Main.hs
  15. +10 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/005/Main.hs
  16. +7 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/006/Main.hs
  17. +7 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/007/Main.hs
  18. +6 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/008/Main.hs
  19. +6 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/009/Main.hs
  20. +4 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/010/Main.hs
  21. +3 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/011/Main.hs
  22. +8 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/012/Main.hs
  23. +7 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/013/Main.hs
  24. +3 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/014/Main.hs
  25. +9 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/015/Main.hs
  26. +3 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/016/Main.hs
  27. +3 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/017/Main.hs
  28. +5 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/018/Main.hs
  29. +7 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/019/Main.hs
  30. +1 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/020/Main.hs
  31. +4 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/021/Main.hs
  32. +6 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/022/Main.hs
  33. +41 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/023/Main.hs
  34. +4 −0 net.sf.eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/res/024/Main.hs
  35. +73 −0 ....eclipsefp.haskell.core.parser.test/src/net/sf/eclipsefp/haskell/core/parser/test/TestPlugin.java
  36. +2 −0 net.sf.eclipsefp.haskell.core.parser.win32/.checkstyle
  37. +11 −0 net.sf.eclipsefp.haskell.core.parser.win32/.externalToolBuilders/Build_native_parser_dll.launch
  38. +38 −0 net.sf.eclipsefp.haskell.core.parser.win32/.project
  39. +8 −0 net.sf.eclipsefp.haskell.core.parser.win32/INTERNAL/conf/build.bat
  40. +7 −0 net.sf.eclipsefp.haskell.core.parser.win32/META-INF/MANIFEST.MF
  41. +6 −0 net.sf.eclipsefp.haskell.core.parser.win32/build.properties
  42. +5 −0 net.sf.eclipsefp.haskell.core.parser.win32/fragment.xml
  43. BIN net.sf.eclipsefp.haskell.core.parser.win32/os/win32/x86/nativeparser.dll
  44. +690 −0 net.sf.eclipsefp.haskell.core.parser.win32/src/ParserImpl.hs
  45. +385 −0 net.sf.eclipsefp.haskell.core.parser.win32/src/bridge.c
  46. +182 −0 net.sf.eclipsefp.haskell.core.parser.win32/src/marshal.h
  47. +6 −0 net.sf.eclipsefp.haskell.core.parser/.checkstyle
  48. +7 −0 net.sf.eclipsefp.haskell.core.parser/.classpath
  49. +2 −0 net.sf.eclipsefp.haskell.core.parser/.options
  50. +34 −0 net.sf.eclipsefp.haskell.core.parser/.project
  51. +312 −0 net.sf.eclipsefp.haskell.core.parser/.settings/org.eclipse.jdt.core.prefs
  52. +11 −0 net.sf.eclipsefp.haskell.core.parser/.settings/org.eclipse.jdt.ui.prefs
  53. +13 −0 net.sf.eclipsefp.haskell.core.parser/META-INF/MANIFEST.MF
  54. +5 −0 net.sf.eclipsefp.haskell.core.parser/build.properties
  55. +11 −0 net.sf.eclipsefp.haskell.core.parser/plugin.xml
  56. +61 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ClassDeclaration.java
  57. +116 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/CompilationUnit.java
  58. +49 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/Constructor.java
  59. +48 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/DataDeclaration.java
  60. +59 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/Declaration.java
  61. +29 −0 ...sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/DefaultDeclaration.java
  62. +17 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ExportAbsolute.java
  63. +18 −0 ...f.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ExportModuleContent.java
  64. +52 −0 ...f.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ExportSpecification.java
  65. +17 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ExportThingAll.java
  66. +37 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ExportThingWith.java
  67. +49 −0 ...ipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ExportThingWithComponent.java
  68. +17 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ExportVariable.java
  69. +75 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/FunctionBinding.java
  70. +33 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/IElementTypes.java
  71. +151 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/Import.java
  72. +17 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ImportAbsolute.java
  73. +56 −0 ...f.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ImportSpecification.java
  74. +17 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ImportThingAll.java
  75. +37 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ImportThingWith.java
  76. +49 −0 ...ipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ImportThingWithComponent.java
  77. +17 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ImportVariable.java
  78. +99 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/InfixDeclaration.java
  79. +17 −0 ...f.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/InstanceDeclaration.java
  80. +49 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/Match.java
  81. +241 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/Module.java
  82. +179 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/NativeParser.java
  83. +52 −0 ...sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/NativeParserBridge.java
  84. +19 −0 ...sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/NewTypeDeclaration.java
  85. +57 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/ParserPlugin.java
  86. +29 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/PatternBinding.java
  87. +63 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/SourceLocation.java
  88. +18 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/TypeDeclaration.java
  89. +48 −0 net.sf.eclipsefp.haskell.core.parser/src/net/sf/eclipsefp/haskell/core/parser/TypeSignature.java
  90. +6 −0 net.sf.eclipsefp.haskell.haddock/.checkstyle
  91. +7 −0 net.sf.eclipsefp.haskell.haddock/.classpath
  92. +2 −0 net.sf.eclipsefp.haskell.haddock/.options
  93. +34 −0 net.sf.eclipsefp.haskell.haddock/.project
  94. +312 −0 net.sf.eclipsefp.haskell.haddock/.settings/org.eclipse.jdt.core.prefs
  95. +11 −0 net.sf.eclipsefp.haskell.haddock/.settings/org.eclipse.jdt.ui.prefs
  96. +19 −0 net.sf.eclipsefp.haskell.haddock/META-INF/MANIFEST.MF
  97. +8 −0 net.sf.eclipsefp.haskell.haddock/build.properties
  98. BIN net.sf.eclipsefp.haskell.haddock/icons/full/etool16/haddock.gif
  99. BIN net.sf.eclipsefp.haskell.haddock/icons/full/wizban/haddockexport.gif
  100. +6 −0 net.sf.eclipsefp.haskell.haddock/plugin.properties
  101. +35 −0 net.sf.eclipsefp.haskell.haddock/plugin.xml
  102. +63 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/HaddockPlugin.java
  103. +271 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/core/HaddockInfo.java
  104. +18 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/core/HaddockUtil.java
  105. +49 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/core/IHaddockParameters.java
  106. +61 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/core/InterfaceList.java
  107. +34 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/core/InterfaceListEntry.java
  108. +12 −0 ...askell.haddock/src/net/sf/eclipsefp/haskell/haddock/core/preferences/IHaddockPreferenceNames.java
  109. +26 −0 ....haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/core/preferences/PreferenceInitializer.java
  110. +27 −0 ...lipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/ShortParamDescriptions.properties
  111. +59 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/UITexts.java
  112. +94 −0 ...ell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/configuratorpage/HaddockConfiguratorPage.java
  113. +86 −0 ...kell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/configuratorpage/HaddockExecutableProbe.java
  114. +49 −0 ...lipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/CheckBoxTreeAndListLP.java
  115. +66 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/CheckboxListCP.java
  116. +705 −0 ...efp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/CheckboxTreeAndListViewer.java
  117. +138 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/CheckboxTreeCP.java
  118. +119 −0 ....eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/DialogSettingsUtil.java
  119. +90 −0 ...eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/HaddockExportWizard.java
  120. +128 −0 ...psefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/HaddockExportWizardPage.java
  121. +203 −0 ....eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/InterfaceListBlock.java
  122. +207 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/InterfacePage.java
  123. +141 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/OptionsPage.java
  124. +134 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/SelectionPage.java
  125. +96 −0 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/op/GenerateDocs.java
  126. +6 −0 net.sf.eclipsefp.haskell.hugs/.checkstyle
  127. +7 −0 net.sf.eclipsefp.haskell.hugs/.classpath
  128. +4 −0 net.sf.eclipsefp.haskell.hugs/.options
  129. +28 −0 net.sf.eclipsefp.haskell.hugs/.project
  130. +312 −0 net.sf.eclipsefp.haskell.hugs/.settings/org.eclipse.jdt.core.prefs
  131. +11 −0 net.sf.eclipsefp.haskell.hugs/.settings/org.eclipse.jdt.ui.prefs
  132. +17 −0 net.sf.eclipsefp.haskell.hugs/META-INF/MANIFEST.MF
  133. +8 −0 net.sf.eclipsefp.haskell.hugs/build.properties
  134. BIN net.sf.eclipsefp.haskell.hugs/icons/full/etool16/hugs16.gif
  135. BIN net.sf.eclipsefp.haskell.hugs/icons/full/wizban/hugs.png
  136. +2 −0 net.sf.eclipsefp.haskell.hugs/plugin.properties
  137. +53 −0 net.sf.eclipsefp.haskell.hugs/plugin.xml
  138. +6 −0 net.sf.eclipsefp.haskell.refactoring/.checkstyle
  139. +7 −0 net.sf.eclipsefp.haskell.refactoring/.classpath
  140. +34 −0 net.sf.eclipsefp.haskell.refactoring/.project
  141. +312 −0 net.sf.eclipsefp.haskell.refactoring/.settings/org.eclipse.jdt.core.prefs
  142. +11 −0 net.sf.eclipsefp.haskell.refactoring/.settings/org.eclipse.jdt.ui.prefs
  143. +21 −0 net.sf.eclipsefp.haskell.refactoring/META-INF/MANIFEST.MF
  144. +4 −0 net.sf.eclipsefp.haskell.refactoring/build.properties
  145. +13 −0 net.sf.eclipsefp.haskell.refactoring/plugin.xml
  146. +125 −0 ...askell.refactoring/src/net/sf/eclipsefp/haskell/refactoring/internal/core/changes/BaseChange.java
  147. +104 −0 ...actoring/src/net/sf/eclipsefp/haskell/refactoring/internal/core/changes/RenameResourceChange.java
  148. +23 −0 ...toring/src/net/sf/eclipsefp/haskell/refactoring/internal/core/refactorings/IRenameModuleInfo.java
  149. +171 −0 ...ing/src/net/sf/eclipsefp/haskell/refactoring/internal/core/refactorings/RenameModuleDelegate.java
  150. +78 −0 ...ng/src/net/sf/eclipsefp/haskell/refactoring/internal/core/refactorings/RenameModuleProcessor.java
  151. +29 −0 .../src/net/sf/eclipsefp/haskell/refactoring/internal/core/refactorings/RenameModuleRefactoring.java
  152. +69 −0 ...askell.refactoring/src/net/sf/eclipsefp/haskell/refactoring/internal/ui/HaskellRefactoringUI.java
  153. +91 −0 ...askell.refactoring/src/net/sf/eclipsefp/haskell/refactoring/internal/ui/actions/RenameModule.java
  154. +117 −0 ...ll.refactoring/src/net/sf/eclipsefp/haskell/refactoring/internal/ui/wizards/RenameModuleInfo.java
  155. +116 −0 ...factoring/src/net/sf/eclipsefp/haskell/refactoring/internal/ui/wizards/RenameModuleInputPage.java
  156. +28 −0 ....refactoring/src/net/sf/eclipsefp/haskell/refactoring/internal/ui/wizards/RenameModuleWizard.java
@@ -0,0 +1,16 @@
+// Copyright (c) 2003-2005 by Leif Frenzel - see http://leiffrenzel.de
+package de.leiffrenzel.fp.haskell.core;
+
+/** <p>The common exception type for exceptions that occure in the Haskell
+ * Core classes.</p>
+ *
+ * @author Leif Frenzel
+ */
+public class HaskellCoreException extends Exception {
+
+ /** <p>constructs a new HaskellCoreException with the specified
+ * message.</p> */
+ public HaskellCoreException( final String message ) {
+ super( message );
+ }
+}
@@ -0,0 +1,125 @@
+// Copyright (c) 2003-2005 by Leif Frenzel - see http://leiffrenzel.de
+package de.leiffrenzel.fp.haskell.core;
+
+import org.eclipse.core.runtime.*;
+import org.osgi.framework.BundleContext;
+
+import de.leiffrenzel.fp.haskell.core.compiler.CompilerManager;
+import de.leiffrenzel.fp.haskell.core.halamo.Halamo;
+import de.leiffrenzel.fp.haskell.core.parser.ParserManager;
+import de.leiffrenzel.fp.haskell.core.preferences.ICorePreferenceNames;
+
+
+/** The main plugin class to be used in the desktop.
+ *
+ * @author The mighty PDE wizard
+ */
+public class HaskellCorePlugin extends Plugin {
+
+ // extension points
+ public static final String ID_EXT_POINT_COMPILERS = "haskellCompilers";
+ public static final String ID_EXT_POINT_PARSERS = "haskellParsers";
+
+ private static HaskellCorePlugin plugin;
+
+
+ public HaskellCorePlugin() {
+ plugin = this;
+ }
+
+ public void start( final BundleContext context ) throws Exception {
+ super.start( context );
+
+ collectCompilerInfo();
+ collectParserInfo();
+ try {
+ // TODO temp (to register as listener)
+ Halamo.getInstance().initialize();
+ } catch( CoreException ex ) {
+ String message = "Serious problem: could not initialize the Haskell "
+ + "language model.";
+ HaskellCorePlugin.log( message, ex );
+ }
+ }
+
+ /** <p>returns the shared instance.</p> */
+ public static HaskellCorePlugin getDefault() {
+ return plugin;
+ }
+
+ public static String getPluginId() {
+ return getDefault().getBundle().getSymbolicName();
+ }
+
+
+ // logging and tracing
+ //////////////////////
+
+ public static void log( final String message, final int severity ) {
+ String id = getPluginId();
+ Status status = new Status( severity, id, IStatus.OK, message, null );
+ getDefault().getLog().log( status );
+ }
+
+ public static void log( final String message, final Throwable thr ) {
+ String id = getPluginId();
+ Status status = new Status( IStatus.ERROR, id, IStatus.OK, message, thr );
+ getDefault().getLog().log( status );
+ }
+
+ public static boolean isTracing( final String optionId ) {
+ String option = getPluginId() + "/trace/" + optionId;
+ String value = Platform.getDebugOption( option );
+ return value != null && value.equals( "true" );
+ }
+
+
+ // helping methods
+ //////////////////
+
+ /** reads compiler infos out of the extensions declared in the manifest
+ * and registers them with the compiler manager.
+ *
+ * All compiler management is delegated to the CompilerManager singleton.
+ */
+ private void collectCompilerInfo() {
+ IConfigurationElement[] elements = getExtensions( ID_EXT_POINT_COMPILERS );
+ for( int i = 0; i < elements.length; i++ ) {
+ String compilerId = elements[ i ].getAttribute( "id" );
+ CompilerManager.getInstance().registerCompiler( compilerId,
+ elements[ i ] );
+ }
+ String pref = "";
+ try {
+ String name = ICorePreferenceNames.SELECTED_COMPILER;
+ pref = getPluginPreferences().getString( name );
+ CompilerManager.getInstance().selectCompiler( pref );
+ } catch ( Exception ex ) {
+ String msg = "Problem when selecting compiler '" + pref + "'.";
+ HaskellCorePlugin.log( msg, ex );
+ }
+ }
+
+ private void collectParserInfo() {
+ IConfigurationElement[] elements = getExtensions( ID_EXT_POINT_PARSERS );
+ for( int i = 0; i < elements.length; i++ ) {
+ try {
+ String parserId = elements[ i ].getAttribute( "id" );
+ if( parserId == null ) {
+ String msg = "Haskell parser declaration is missing id attribute "
+ + "and will be ignored.";
+ log( msg, null );
+ } else {
+ ParserManager.getInstance().registerParser( parserId, elements[ i ] );
+ }
+ } catch( final CoreException ex ) {
+ getLog().log( ex.getStatus() );
+ }
+ }
+ }
+
+ private IConfigurationElement[] getExtensions( final String key ) {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ return registry.getConfigurationElementsFor( getPluginId(), key );
+ }
+}
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>net.sf.eclipsefp.haskell.core.parser.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Parser Tests
+Bundle-SymbolicName: net.sf.eclipsefp.haskell.core.parser.test; singleton:=true
+Bundle-Version: 0.8.0
+Bundle-ClassPath: haskellcoreparsertest.jar
+Bundle-Activator: net.sf.eclipsefp.haskell.core.parser.test.TestPlugin
+Bundle-Vendor: eclipsefp.sourcefourge.net
+Bundle-Localization: plugin
+Require-Bundle: de.leiffrenzel.fp.haskell.core,
+ net.sf.eclipsefp.haskell.core.parser,
+ org.eclipse.core.resources,
+ org.eclipse.core.runtime,
+ org.junit
+Eclipse-AutoStart: true
@@ -0,0 +1,4 @@
+source.haskellcoreparsertest.jar = src/
+output.haskellcoreparsertest.jar = bin/
+bin.includes = META-INF/,\
+ haskellcoreparsertest.jar
@@ -0,0 +1,22 @@
+// Copyright (c) 2004-2005 by Leif Frenzel
+// See http://leiffrenzel.de
+package net.sf.eclipsefp.haskell.core.parser;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/** <p>collects all test cases in this plugin.</p>
+ *
+ * @author Leif Frenzel
+ */
+public class AllTests_PDESuite extends TestCase {
+
+ public static TestSuite suite() {
+ TestSuite result = new TestSuite();
+
+ result.addTestSuite( CompilationUnit_PDETest.class );
+ result.addTestSuite( HaskellParser_PDETest.class );
+
+ return result;
+ }
+}
@@ -0,0 +1,102 @@
+// Copyright (c) 2004-2005 by Leif Frenzel
+// See http://leiffrenzel.de
+package net.sf.eclipsefp.haskell.core.parser;
+
+import org.eclipse.core.resources.IFile;
+
+import de.leiffrenzel.fp.haskell.core.halamo.*;
+import de.leiffrenzel.fp.haskell.core.parser.IHaskellParser;
+import de.leiffrenzel.fp.haskell.core.parser.ParserManager;
+
+
+/** <p>tests for compilation units (src location support).</p>
+ *
+ * @author Leif Frenzel
+ */
+public class CompilationUnit_PDETest extends HaskellProjectTestCase {
+
+ public void testEmptyCU() throws Exception {
+ // an empty compilation unit has an implicit Main module at position 0,0
+ // (apart from leading comment lines like in the target file, which makes
+ // it in this case position 1,0 )
+ ICompilationUnit cu = loadCU( "020" );
+ ISourceLocation sl1 = cu.getNextLocation( new SourceLocation( 0, 0 ) );
+ assertTrue( sl1 != null );
+ assertEquals( 1, sl1.getLine() );
+ assertEquals( 0, sl1.getColumn() );
+ ISourceLocation sl2 = cu.getNextLocation( new SourceLocation( 3, 3 ) );
+ assertTrue( sl2 == null );
+ }
+
+ public void testSingleSrcLoc() throws Exception {
+ ICompilationUnit cu = loadCU( "021" );
+ ISourceLocation sl1 = cu.getNextLocation( new SourceLocation( 0, 0 ) );
+ assertTrue( sl1 != null );
+ assertEquals( 1, sl1.getLine() );
+ assertEquals( 0, sl1.getColumn() );
+
+ ISourceLocation sl2 = cu.getNextLocation( new SourceLocation( 3, 3 ) );
+ assertTrue( sl2 == null );
+ }
+
+ public void testTwoSrcLocs() throws Exception {
+ ICompilationUnit cu = loadCU( "022" );
+ ISourceLocation sl1 = cu.getNextLocation( new SourceLocation( 0, 0 ) );
+ assertTrue( sl1 != null );
+ assertEquals( 1, sl1.getLine() );
+ assertEquals( 0, sl1.getColumn() );
+
+ ISourceLocation sl2 = cu.getNextLocation( new SourceLocation( 3, 3 ) );
+ assertTrue( sl2 != null );
+ assertEquals( 5, sl2.getLine() );
+ assertEquals( 0, sl2.getColumn() );
+
+ ISourceLocation sl3 = cu.getNextLocation( new SourceLocation( 6, 3 ) );
+ assertTrue( sl3 == null );
+ }
+
+ public void testLotsOfLocs() throws Exception {
+ ICompilationUnit cu = loadCU( "023" );
+ ISourceLocation sl1 = cu.getNextLocation( new SourceLocation( 0, 0 ) );
+ assertEquals( 1, sl1.getLine() );
+ assertEquals( 0, sl1.getColumn() );
+
+ ISourceLocation sl2 = cu.getNextLocation( sl1 );
+ assertEquals( 5, sl2.getLine() );
+ assertEquals( 0, sl2.getColumn() );
+
+ ISourceLocation sl3 = cu.getNextLocation( sl2 );
+ assertEquals( 6, sl3.getLine() );
+ assertEquals( 0, sl3.getColumn() );
+
+ ISourceLocation sl4 = cu.getNextLocation( sl3 );
+ assertEquals( 7, sl4.getLine() );
+ assertEquals( 0, sl4.getColumn() );
+
+ ISourceLocation sl5 = cu.getNextLocation( sl4 );
+ assertEquals( 9, sl5.getLine() );
+ assertEquals( 0, sl5.getColumn() );
+
+ ISourceLocation sl6 = cu.getNextLocation( sl5 );
+ assertEquals( 12, sl6.getLine() );
+ assertEquals( 0, sl6.getColumn() );
+
+ ISourceLocation sl7 = cu.getNextLocation( new SourceLocation( 39, 3 ) );
+ assertEquals( 40, sl7.getLine() );
+ assertEquals( 0, sl7.getColumn() );
+
+ ISourceLocation sl8 = cu.getNextLocation( sl7 );
+ assertTrue( sl8 == null );
+ }
+
+ // helping methods
+ //////////////////
+
+ private ICompilationUnit loadCU( final String name ) throws Exception {
+ importSourceFile( "Main.hs", name, "Main.hs" );
+ IFile file = getProject().getFile( "src/Main.hs" );
+ assertTrue( file.exists() );
+ IHaskellParser parser = ParserManager.getInstance().getParser();
+ return parser.parse( file );
+ }
+}
Oops, something went wrong.

0 comments on commit 3efa6c8

Please sign in to comment.