From 5c994c4c82d4e46e897d0b1d2b15dcacd921e3ee Mon Sep 17 00:00:00 2001 From: peterdell Date: Sun, 26 Sep 2021 22:54:47 +0200 Subject: [PATCH] Split preferences per language. --- .../compiler/merlin32/Merlin32Compiler.xml | 2 +- .../src/com/wudsn/ide/lng/LanguagePlugin.java | 27 ++- .../com/wudsn/ide/lng/LanguageUtility.java | 67 ++++++++ .../src/com/wudsn/ide/lng/Target.java | 2 +- .../src/com/wudsn/ide/lng/TargetUtility.java | 49 ++++++ .../src/com/wudsn/ide/lng/Texts.java | 6 +- .../src/com/wudsn/ide/lng/Texts.properties | 12 +- .../com/wudsn/ide/lng/Texts_de_DE.properties | 6 +- .../com/wudsn/ide/lng/compiler/Compiler.xml | 2 +- .../ide/lng/compiler/CompilerDefinition.java | 157 +++++++++++------- .../wudsn/ide/lng/compiler/CompilerHelp.java | 79 +++++++++ .../ide/lng/compiler/CompilerRegistry.java | 4 +- .../lng/compiler/syntax/CompilerSyntax.java | 3 + .../wudsn/ide/lng/compiler/syntax/Opcode.java | 96 +++++------ .../LanguageContentAssistProcessor.java | 2 +- .../wudsn/ide/lng/editor/LanguageEditor.java | 12 +- ...anguageEditorCompileAndRunCommandMenu.java | 2 +- .../editor/LanguageEditorCompileCommand.java | 30 ++-- ...guageEditorCompilerHelpCommandHandler.java | 12 +- .../lng/editor/LanguageRuleBasedScanner.java | 28 ++-- .../ide/lng/editor/LanguageSourceScanner.java | 2 +- .../LanguageSourceViewerConfiguration.java | 15 +- .../lng/preferences/LanguagePreferences.java | 87 +++++----- .../LanguagePreferencesCompilersPage.java | 2 +- .../preferences/LanguagePreferencesPage.java | 2 +- .../lng/preferences/LanguagesPreferences.java | 130 +++++++++++++++ .../pas/compiler/mp/MadPascalCompiler.java | 16 +- .../lng/pas/compiler/mp/MadPascalCompiler.xml | 18 ++ .../mp/MadPascalCompilerProcessLogParser.java | 59 +++++++ .../mp/MadPascalCompilerSourceParser.java | 70 ++++++++ .../com/wudsn/ide/snd/player/SoundInfo.java | 2 +- 31 files changed, 785 insertions(+), 216 deletions(-) create mode 100644 com.wudsn.ide.asm/src/com/wudsn/ide/lng/LanguageUtility.java create mode 100644 com.wudsn.ide.asm/src/com/wudsn/ide/lng/TargetUtility.java create mode 100644 com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerHelp.java create mode 100644 com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagesPreferences.java create mode 100644 com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompiler.xml create mode 100644 com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompilerProcessLogParser.java create mode 100644 com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompilerSourceParser.java diff --git a/com.wudsn.ide.asm.compilers/src/com/wudsn/ide/lng/asm/compiler/merlin32/Merlin32Compiler.xml b/com.wudsn.ide.asm.compilers/src/com/wudsn/ide/lng/asm/compiler/merlin32/Merlin32Compiler.xml index 1adaf1fd..a910f8fc 100644 --- a/com.wudsn.ide.asm.compilers/src/com/wudsn/ide/lng/asm/compiler/merlin32/Merlin32Compiler.xml +++ b/com.wudsn.ide.asm.compilers/src/com/wudsn/ide/lng/asm/compiler/merlin32/Merlin32Compiler.xml @@ -19,7 +19,7 @@ modes="idl=$47,abl=$4f,idly=$57,alx=$5f"/> - + preferencesChangeListeners; /** @@ -117,7 +118,7 @@ public final class LanguagePlugin extends AbstractIDEPlugin { @Override public void start(BundleContext context) throws Exception { super.start(context); - preferences = new LanguagePreferences(getPreferenceStore()); + preferences = new LanguagesPreferences(getPreferenceStore()); plugin = this; try { compilerRegistry.init(); @@ -141,7 +142,9 @@ public final class LanguagePlugin extends AbstractIDEPlugin { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(JFaceResources.TEXT_FONT) || event.getProperty().equals(BLOCK_SELECTION_MODE_FONT)) { - firePreferencesChangeEvent(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTES); + for (Language language : languages) { + firePreferencesChangeEvent(language, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTES); + } } } @@ -221,13 +224,20 @@ public final class LanguagePlugin extends AbstractIDEPlugin { * * @return The preferences, not null. */ - public LanguagePreferences getPreferences() { + public LanguagesPreferences getPreferences() { if (preferences == null) { throw new IllegalStateException("Field 'preferences' must not be null."); } return preferences; } + public LanguagePreferences getLanguagePreferences(Language language) { + if (language == null) { + throw new IllegalArgumentException("Parameter 'language' must not be null."); + } + return getPreferences().getLanguagePreferences(language); + } + /** * Adds a listener for immediate preferences changes. * @@ -257,19 +267,22 @@ public final class LanguagePlugin extends AbstractIDEPlugin { /** * Fire the change events for all registered listeners. * + * @param language + * * @param changedPropertyNames The set of property changed property names, not * null. * * @since 1.6.3 */ - public void firePreferencesChangeEvent(Set changedPropertyNames) { + public void firePreferencesChangeEvent(Language language, Set changedPropertyNames) { if (changedPropertyNames == null) { throw new IllegalArgumentException("Parameter 'changedPropertyNames' must not be null."); } if (!changedPropertyNames.isEmpty()) { - + LanguagePreferences languagPreferences = getLanguagePreferences(language); for (Object listener : preferencesChangeListeners.getListeners()) { - ((LanguagePreferencesChangeListener) listener).preferencesChanged(preferences, changedPropertyNames); + ((LanguagePreferencesChangeListener) listener).preferencesChanged(languagPreferences, + changedPropertyNames); } } } diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/LanguageUtility.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/LanguageUtility.java new file mode 100644 index 00000000..ac1adfe0 --- /dev/null +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/LanguageUtility.java @@ -0,0 +1,67 @@ +/** + * Copyright (C) 2009 - 2021 Peter Dell + * + * This file is part of WUDSN IDE. + * + * WUDSN IDE 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. + * + * WUDSN IDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WUDSN IDE. If not, see . + */ +package com.wudsn.ide.lng; + +/** + * Utility class for languages + * + * @author Peter Dell + * + * @since 1.7.2 + */ +public final class LanguageUtility { + + /** + * Creation is private. + */ + private LanguageUtility() { + } + + /** + * Gets the text for type of compilers for a language. + * + * @param language The language, not null. + * @return The text, not empty and not null. + */ + public static String getCompilerTextLower(Language language) { + switch (language) { + case ASM: + return "assembler"; + + case PAS: + return "compiler"; + + } + throw new IllegalArgumentException("Unknown language '" + language + "'."); + + } + + public static String getCompilerPreferencesText(Language language) { + switch (language) { + case ASM: + return "Languages/Assemblers"; + + case PAS: + return "Languages/Compilers"; + + } + throw new IllegalArgumentException("Unknown language '" + language + "'."); + + } +} diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Target.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Target.java index 6a4af57d..bd5793cd 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Target.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Target.java @@ -19,7 +19,7 @@ package com.wudsn.ide.lng; /** - * Enum for the supported CPUs. Used for restricting the visible instructions. + * Enum for the supported targets. Used for restricting the visible instructions. * * @author Peter Dell * diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/TargetUtility.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/TargetUtility.java new file mode 100644 index 00000000..b0499f43 --- /dev/null +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/TargetUtility.java @@ -0,0 +1,49 @@ +/** + * Copyright (C) 2009 - 2021 Peter Dell + * + * This file is part of WUDSN IDE. + * + * WUDSN IDE 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. + * + * WUDSN IDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WUDSN IDE. If not, see . + */ +package com.wudsn.ide.lng; + +/** + * Enum for the supported targets. Used for restricting the visible instructions. + * + * @author Peter Dell + * + * @since 1.7.2 + */ +public final class TargetUtility { + + private TargetUtility() { + + } + + /** + * Gets the language for a target. + * + * @param target The target, not null. + * @return The language, not null. + */ + public static Language getLanguage(Target target) { + if (target == null) { + throw new IllegalArgumentException("Parameter 'target' must not be null."); + } + if (target.equals(Target.PASCAL)) { + return Language.PAS; + } + return Language.ASM; + } +} diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts.java index 729f50f5..27e6e3ea 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts.java @@ -25,7 +25,6 @@ import org.eclipse.osgi.util.NLS; //COMPILER_HYPERLINK_DETECTOR_OPEN_SOURCE_WITH_LANGUAGE_EDITOR=Öffnen mit {0} Editor //LANGUAGE_BREAKPOINT_TOGGLE_TYPE_MENU_TEXT={0} Breakpoints // -//TOC_COMPILERS_TOPIC_LABEL={0} //MESSAGE_E100=Path to '{0}' {1} executable is not set in the '{2}' preferences. //MESSAGE_E101=The {0} '{1}' does not specify default parameters. //MESSAGE_E102=The {1} '{1}' does not specify a help file path. @@ -224,6 +223,7 @@ public final class Texts extends NLS { public static String TOC_COMPILER_GENERAL_TOPIC_LABEL; public static String TOC_COMPILER_NAME_LABEL; public static String TOC_COMPILER_HOME_PAGE_LABEL; + public static String TOC_COMPILER_HELP_DOCUMENTS_LABEL; public static String TOC_COMPILER_DEFAULT_HARDWARE_LABEL; public static String TOC_COMPILER_SUPPORTED_TARGETS_LABEL; public static String TOC_COMPILER_DEFAULT_PARAMETERS_LABEL; @@ -248,7 +248,9 @@ public final class Texts extends NLS { public static String TOC_HARDWARE_DEFAULT_PARAMETERS_LABEL; public static String TOC_TARGETS_TOPIC_LABEL; - public static String TOC_TARGETS_NAME_LABEL; + public static String TOC_TARGET_NAME_LABEL; + public static String TOC_TARGET_LANGUAGE_LABEL; + public static String TOC_TARGET_OPCODE_LABEL; /** diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts.properties b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts.properties index ad571860..0d2419b4 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts.properties +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts.properties @@ -120,6 +120,7 @@ TOC_COMPILERS_TOPIC_LABEL={0} TOC_COMPILER_GENERAL_TOPIC_LABEL=General TOC_COMPILER_NAME_LABEL=Name TOC_COMPILER_HOME_PAGE_LABEL=Home Page +TOC_COMPILER_HELP_DOCUMENTS_LABEL=Help Documents TOC_COMPILER_DEFAULT_HARDWARE_LABEL=Default Hardware TOC_COMPILER_SUPPORTED_TARGETS_LABEL=Supported Targets TOC_COMPILER_DEFAULT_PARAMETERS_LABEL=Default Parameters @@ -159,13 +160,14 @@ TOC_HARDWARE_HOME_PAGE_LABEL=Home Page TOC_HARDWARE_DEFAULT_PARAMETERS_LABEL=Default Parameters TOC_TARGETS_TOPIC_LABEL=Targets -TOC_TARGETS_NAME_LABEL=Target +TOC_TARGET_NAME_LABEL=Target +TOC_TARGET_LANGUAGE_LABEL=Language TOC_TARGET_OPCODE_LABEL=Opcode MESSAGE_E100=Path to '{0}' {1} executable is not set in the '{2}' preferences. MESSAGE_E101=The {0} '{1}' does not specify default parameters. -MESSAGE_E102=The {1} '{1}' does not specify a help file path. -MESSAGE_E103=Path to '{0}' {1} executable in the preferences points to non-existing file '{1}'. +MESSAGE_E102=The {0} '{1}' does not specify help document paths. +MESSAGE_E103=Path to '{0}' {1} executable in the '{2}' preferences points to non-existing file '{3}'. MESSAGE_E104=Output file extension must be set in the preferences of {0} '{1}' or via the annotation '{2}'. MESSAGE_E105=Cannot execute {0} process '{1}' in working directory '{2}'. System error: {3} MESSAGE_E106=Output file '{0}' cannot be opened for writing. End all applications which may keep the file open. @@ -192,8 +194,8 @@ MESSAGE_E126=Output file created but empty. Check the error messages and the con MESSAGE_E127={0} process ended with return code {1}. Check the error messages and the console log. MESSAGE_E128=Hardware not specified. Specify one of the following valid values '{0}'. MESSAGE_E129=Main source file specifies or defaults to hardware '{0}' while include file specifies or defaults to hardware '{1}'. -MESSAGE_E130=Help for the '{0}' {1} cannot be displayed because the path to the compiler executable is not set in the preferences. -MESSAGE_E131=Help for the '{0}' {1} cannot be displayed because no help file was found in the paths '{2}' relative to the compiler executable path '{3}'. +MESSAGE_E130=Help for the '{0}' {1} cannot be displayed because the path to the executable is not set in the '{2}' preferences. +MESSAGE_E131=Help for the '{0}' {1} cannot be displayed because no help file was found in the paths '{2}' relative to the executable path '{3}'. MESSAGE_E132=Disk image file '{0}' does not exist. Create a bootable disk image where the output file '{1}' can be stored. MESSAGE_E133=Disk image file '{0}' is not writeable. Make the disk image file is writeable, so the output file '{1}' can be stored. MESSAGE_E134=Disk image file '{0}' cannot be opened for reading. System error: {1} diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts_de_DE.properties b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts_de_DE.properties index 21131877..266f41ba 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts_de_DE.properties +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/Texts_de_DE.properties @@ -118,6 +118,7 @@ TOC_COMPILERS_TOPIC_LABEL={0} TOC_COMPILER_GENERAL_TOPIC_LABEL=Allgemein TOC_COMPILER_NAME_LABEL=Name TOC_COMPILER_HOME_PAGE_LABEL=Home Page +TOC_COMPILER_HELP_DOCUMENTS_LABEL=Hilfe Dokomente TOC_COMPILER_DEFAULT_HARDWARE_LABEL=Standardhardware TOC_COMPILER_SUPPORTED_TARGETS_LABEL=Unterstütze Ziele TOC_COMPILER_DEFAULT_PARAMETERS_LABEL=Standardparameter @@ -158,11 +159,12 @@ TOC_HARDWARE_DEFAULT_PARAMETERS_LABEL=Standardparameter TOC_TARGETS_TOPIC_LABEL=Ziele TOC_TARGET_NAME_LABEL=Ziel +TOC_TARGET_LANGUAGE_LABEL=Sprache TOC_TARGET_OPCODE_LABEL=Opcode MESSAGE_E100=Pfad zur ausführbaren Datei des Kompilers '{0}' ist in den '{1}' Voreinstellungen nicht angegeben. -MESSAGE_E101=Der Kompiler '{0}' definiert keine Standardparameter. -MESSAGE_E102=Der Kompiler '{0}' getHelpFile keine Pfade zu Hilfe-Dateien. +MESSAGE_E101=Der {0} '{1}' definiert keine Standardparameter. +MESSAGE_E102=Der {0} '{1}' definiert keine Pfade zu Hilfedokumenten. MESSAGE_E103=Pfad zur ausführbaren Datei des Kompilers '{0}' in den Voreinstellungen verweist auf die nicht existierende Datei '{1}'. MESSAGE_E104=Ausgabe-Dateierweiterung muss in den Voreinstellungen des Kompilers '{0}' oder mit der Annotation '{1}' angegeben werden. MESSAGE_E105=Kompilerprozess '{0}' kann im Arbeitsverzeichnis '{1}' nicht ausgeführt werden. Systemfehler: {2} diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/Compiler.xml b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/Compiler.xml index 4908df16..7ed714ed 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/Compiler.xml +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/Compiler.xml @@ -1,7 +1,7 @@ - + diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerDefinition.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerDefinition.java index bd7f1c65..b0acb3ac 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerDefinition.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerDefinition.java @@ -22,19 +22,20 @@ package com.wudsn.ide.lng.compiler; import java.io.File; import java.util.List; import java.util.Locale; -import java.util.StringTokenizer; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; -import com.wudsn.ide.base.common.FileUtility; import com.wudsn.ide.base.common.StringUtility; import com.wudsn.ide.base.common.TextUtility; import com.wudsn.ide.base.hardware.Hardware; +import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.LanguagePlugin; +import com.wudsn.ide.lng.LanguageUtility; import com.wudsn.ide.lng.Target; import com.wudsn.ide.lng.Texts; +import com.wudsn.ide.lng.compiler.CompilerHelp.HelpDocument; import com.wudsn.ide.lng.compiler.syntax.CompilerSyntax; /** @@ -47,7 +48,7 @@ import com.wudsn.ide.lng.compiler.syntax.CompilerSyntax; public final class CompilerDefinition implements Comparable { // Language - private String language; + private Language language; // Id private String id; @@ -55,7 +56,7 @@ public final class CompilerDefinition implements Comparable private String className; // Installation and use. - private String helpFilePaths; + private String helpDocumentPaths; private String homePageURL; // Editing and source parsing. @@ -81,7 +82,7 @@ public final class CompilerDefinition implements Comparable * * @return The key that uniquely identifies the compiler, not null. */ - public static String getKey(String language, String id) { + public static String getKey(Language language, String id) { if (language == null) { throw new IllegalStateException("Field 'language' must not be null for this or for argument."); } @@ -89,7 +90,7 @@ public final class CompilerDefinition implements Comparable throw new IllegalStateException("Field 'id' must not be null for this or for argument."); } - return language + "/" + id; + return language.name() + "/" + id; } /** @@ -115,15 +116,15 @@ public final class CompilerDefinition implements Comparable if (StringUtility.isEmpty(language)) { throw new IllegalArgumentException("Parameter 'language' must not be empty."); } - this.language = language; + this.language = Language.valueOf(language); } /** * Gets the language of the compiler. * - * @return The language of the compiler, not empty and not null. + * @return The language of the compiler, not null. */ - public final String getLanguage() { + public final Language getLanguage() { if (language == null) { throw new IllegalStateException("Field 'language' must not be null."); } @@ -243,43 +244,46 @@ public final class CompilerDefinition implements Comparable * Sets the help file paths to locate the help file for the compiler. Called by * {@link CompilerRegistry} only. * - * @param helpFilePaths The relative file path to locate the help file for the - * compiler based on the folder of the executable. ".", - * ".." and "/" may be used to specify the path. A path may - * end with a language in the form "(en)". Multiple paths - * are separated by ",". May be empty or null. + * @param helpDocumentPaths The relative file path starting with "." to locate + * the help file for the compiler based on the folder + * of the executable. ".". ".." and "/" may be used to + * specify the file path. Alternatively the path can be + * an absolute URL. A path may end with a language in + * the form "(en)". Multiple paths are separated by + * ",". May be empty or null. */ - final void setHelpFilePaths(String helpFilePaths) { - if (helpFilePaths == null) { - helpFilePaths = ""; + final void setHelpDocumentPaths(String helpDocumentPaths) { + if (helpDocumentPaths == null) { + helpDocumentPaths = ""; } - this.helpFilePaths = helpFilePaths; + this.helpDocumentPaths = helpDocumentPaths; } /** * Gets the help file paths to locate the help file for the compiler. * - * @return The relative file path to locate the help file for the compiler based - * on the folder of the executable. ".", ".." and "/" may be used to - * specify the path. A path may end with a language in the form - * "(en)".Multiple paths are separated by ",". The result may be empty, - * not null. + * @return The relative file path starting with "." to locate the help file for + * the compiler based on the folder of the executable. ".". ".." and "/" + * may be used to specify the file path. Alternatively the path can be + * an absolute URL. A path may end with a language in the form "(en)". + * Multiple paths are separated by ",". May be empty or + * null. */ - public final String getHelpFilePaths() { - if (helpFilePaths == null) { - throw new IllegalStateException("Field 'helpFilePaths' must not be null."); + public final String getHelpDocumentPaths() { + if (helpDocumentPaths == null) { + throw new IllegalStateException("Field 'helpDocumentPaths' must not be null."); } - return helpFilePaths; + return helpDocumentPaths; } /** - * Determines if this compiler offers a help file at all. + * Determines if this compiler offers help at all. * * @return true if this compiler offers a help file, * false otherwise. */ - public final boolean hasHelpFile() { - return StringUtility.isSpecified(helpFilePaths); + public final boolean hasHelpDocumentPaths() { + return StringUtility.isSpecified(helpDocumentPaths); } /** @@ -294,57 +298,82 @@ public final class CompilerDefinition implements Comparable * does not specify a help path or no help file can be * found. */ - public final File getHelpFile(String compilerExecutablePath) throws CoreException { + public final List getHelpDocuments(String compilerExecutablePath) throws CoreException { if (compilerExecutablePath == null) { throw new IllegalArgumentException("Parameter 'compilerExecutablePath' must not be null."); } - if (StringUtility.isEmpty(compilerExecutablePath)) { - // ERROR: Help for the '{0}' compiler cannot be - // displayed because the path to the compiler executable - // is not set in the preferences. - throw new CoreException( - new Status(IStatus.ERROR, LanguagePlugin.ID, TextUtility.format(Texts.MESSAGE_E130, name))); + String compilerText = LanguageUtility.getCompilerTextLower(language); + if (!hasHelpDocumentPaths()) { + // INFO: The {0} '{1}' does not specify help document paths. + throw new CoreException(new Status(IStatus.INFO, LanguagePlugin.ID, + TextUtility.format(Texts.MESSAGE_E102, compilerText, name))); } - if (!hasHelpFile()) { - // ERROR: The compiler '{0}' does not specify a help file path. - throw new CoreException( - new Status(IStatus.ERROR, LanguagePlugin.ID, TextUtility.format(Texts.MESSAGE_E102, name))); + String compilerPreferencesText = LanguageUtility.getCompilerPreferencesText(language); + if (StringUtility.isEmpty(compilerExecutablePath)) { + // ERROR: Help for the '{0}' {1} cannot be displayed because the path to the + // compiler executable is not set in the {2} preferences. + throw new CoreException(new Status(IStatus.ERROR, LanguagePlugin.ID, + TextUtility.format(Texts.MESSAGE_E130, name, compilerText, compilerPreferencesText))); } + return CompilerHelp.getHelpDocuments(helpDocumentPaths, compilerExecutablePath); + + } + + public final HelpDocument getHelpForCurrentLocale(String compilerExecutablePath) throws CoreException { + List helpDocuments = getHelpDocuments(compilerExecutablePath); + String localeLanguage = Locale.getDefault().getLanguage(); - File firstFile = null; - File firstLanguageFile = null; - StringTokenizer tokenizer = new StringTokenizer(helpFilePaths, ","); - while (tokenizer.hasMoreTokens()) { - String helpFilePath = tokenizer.nextToken().trim(); - String helpFileLanguage = ""; - int index = helpFilePath.lastIndexOf("("); - if (index > 0) { - helpFileLanguage = helpFilePath.substring(index + 1, index + 3); - helpFilePath = helpFilePath.substring(0, index - 1).trim(); - } - File file = FileUtility - .getCanonicalFile(new File(new File(compilerExecutablePath).getParent(), helpFilePath)); - if (file.exists()) { + + // Find the first existing local file and the first existing local file with + // matching language. + HelpDocument firstFile = null; + HelpDocument firstLanguageFile = null; + for (HelpDocument helpDocument : helpDocuments) { + + if (helpDocument.file != null && helpDocument.file.exists()) { if (firstFile == null) { - firstFile = file; + firstFile = helpDocument; } - if (firstLanguageFile == null && helpFileLanguage.equals(localeLanguage)) { - firstLanguageFile = file; + if (firstLanguageFile == null && helpDocument.language.equals(localeLanguage)) { + firstLanguageFile = helpDocument; } } } + // Use language specific file if present, use first file otherwise. - File result = firstLanguageFile; + HelpDocument result = firstLanguageFile; if (result == null) { result = firstFile; } + + // No local file specified or found. Try the URIs. if (result == null) { - // ERROR: Help for the '{0}' compiler cannot be displayed because no - // help file was found in the paths '{1}' for the compiler - // executable path '{0}'. - throw new CoreException(new Status(IStatus.ERROR, LanguagePlugin.ID, - TextUtility.format(Texts.MESSAGE_E131, name, helpFilePaths, compilerExecutablePath))); + for (HelpDocument helpDocument : helpDocuments) { + if (helpDocument.uri != null) { + if (firstFile == null) { + firstFile = helpDocument; + } + if (firstLanguageFile == null && helpDocument.language.equals(localeLanguage)) { + firstLanguageFile = helpDocument; + } + } + } + + // Use language specific URI if present, use first URI otherwise. + result = firstLanguageFile; + if (result == null) { + result = firstFile; + } + } + + // No local file specified or found and no URIs found. + if (result == null) { + + // ERROR: Help for the '{0}' {1} cannot be displayed because no help file was + // found in the paths '{2}' relative to the executable path '{3}'. + throw new CoreException(new Status(IStatus.ERROR, LanguagePlugin.ID, TextUtility.format(Texts.MESSAGE_E131, + name, LanguageUtility.getCompilerTextLower(language), helpDocumentPaths, compilerExecutablePath))); } return result; diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerHelp.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerHelp.java new file mode 100644 index 00000000..4512c321 --- /dev/null +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerHelp.java @@ -0,0 +1,79 @@ +/** + * Copyright (C) 2009 - 2021 Peter Dell + * + * This file is part of WUDSN IDE. + * + * WUDSN IDE 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. + * + * WUDSN IDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WUDSN IDE. If not, see . + */ + +package com.wudsn.ide.lng.compiler; + +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +import com.wudsn.ide.base.common.FileUtility; +import com.wudsn.ide.base.common.StringUtility; + +/** + * Compiler help access. + * + * @author Peter Dell + * + * @since 1.7.2 + */ +public final class CompilerHelp { + + public static class HelpDocument { + public String path; + public String language; + public File file; + public URI uri; + } + + public static List getHelpDocuments(String helpDocumentPaths, String compilerExecutablePath) { + List helpDocuments = new ArrayList(); + + StringTokenizer tokenizer = new StringTokenizer(helpDocumentPaths, ","); + while (tokenizer.hasMoreTokens()) { + String helpFilePath = tokenizer.nextToken().trim(); + String helpFileLanguage = ""; + int index = helpFilePath.lastIndexOf("("); + if (index > 0) { + helpFileLanguage = helpFilePath.substring(index + 1, index + 3); + helpFilePath = helpFilePath.substring(0, index - 1).trim(); + } + HelpDocument helpDocument = new HelpDocument(); + helpDocument.path = helpFilePath; + helpDocument.language = helpFileLanguage; + + // Relative paths are local files. + if (helpFilePath.startsWith(".") && StringUtility.isSpecified(compilerExecutablePath)) { + helpDocument.file = FileUtility + .getCanonicalFile(new File(new File(compilerExecutablePath).getParent(), helpFilePath)); + } else { + try { + helpDocument.uri = new URI(helpFilePath); + } catch (URISyntaxException ex) { + throw new RuntimeException("Invalid URI for '" + helpFilePath + "' help file path", ex); + } + } + helpDocuments.add(helpDocument); + } + return helpDocuments; + } +} \ No newline at end of file diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerRegistry.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerRegistry.java index 65900a0c..717827f6 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerRegistry.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/CompilerRegistry.java @@ -97,7 +97,7 @@ public final class CompilerRegistry { compilerDefinition.setId(configurationElement.getAttribute("id")); compilerDefinition.setName(configurationElement.getAttribute("name")); compilerDefinition.setClassName(configurationElement.getAttribute("class")); - compilerDefinition.setHelpFilePaths(configurationElement.getAttribute("helpFilePaths")); + compilerDefinition.setHelpDocumentPaths(configurationElement.getAttribute("helpDocumentPaths")); compilerDefinition.setHomePageURL(configurationElement.getAttribute("homePageURL")); compilerDefinition.setDefaultParameters(configurationElement.getAttribute("defaultParameters")); @@ -192,7 +192,7 @@ public final class CompilerRegistry { } List result = new ArrayList(); for (CompilerDefinition compilerDefinition : compilerDefinitionList) { - if (compilerDefinition.getLanguage().equals(language.name())) { + if (compilerDefinition.getLanguage().equals(language)) { result.add(compilerDefinition); } } diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/syntax/CompilerSyntax.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/syntax/CompilerSyntax.java index ab720811..2900a7e3 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/syntax/CompilerSyntax.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/syntax/CompilerSyntax.java @@ -486,6 +486,9 @@ public final class CompilerSyntax { try { InputStream inputStream = compilerClass.getResourceAsStream(syntaxFileName); + if (inputStream==null) { + throw new RuntimeException("Cannot create parser for file '" + syntaxFileName + "'. Resource not found in class path."); + } parser.parse(inputStream, xmlHandler); } catch (SAXParseException ex) { throw new RuntimeException("Cannot create parser for file '" + syntaxFileName + "'. Error in line " diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/syntax/Opcode.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/syntax/Opcode.java index 20ff1db4..55cd43e2 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/syntax/Opcode.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/compiler/syntax/Opcode.java @@ -19,7 +19,7 @@ package com.wudsn.ide.lng.compiler.syntax; -import java.util.ArrayList; +import java.util.*; import java.util.List; import java.util.Set; import java.util.TreeSet; @@ -31,18 +31,56 @@ public final class Opcode extends Instruction { public static final int MAX_OPCODES = 256; public final static class OpcodeAddressingMode { + + private static Map addressingModeText; + + static { + addressingModeText = new TreeMap(); + + // 6502 mode. + addressingModeText.put("abs", " abs"); // Absolute + addressingModeText.put("abx", " abs,x"); // Absolute withX + addressingModeText.put("aby", " abs,y"); // Absolute with Y + addressingModeText.put("imm", " #$nn"); // Immediate + addressingModeText.put("imp", ""); // Implied + addressingModeText.put("ind", " (abs)"); // Indirect absolute + addressingModeText.put("izx", " (zp,x)"); // Indirect zero page with X + addressingModeText.put("izy", " (zp),y"); // Indirect zero page with Y + addressingModeText.put("rel", " rel"); // Relative + addressingModeText.put("zp", " zp"); // Zero page + addressingModeText.put("zpx", " zp,x"); // Zero page with X + addressingModeText.put("zpy", " zp,y"); // Zero page with Y + + // 65816 modes. Some are equals to 6502 mode, but have different a code. + addressingModeText.put("abl", " abs (long)"); // Absolute long + addressingModeText.put("alx", " abs,x (long)"); // Absolute long with X + addressingModeText.put("bm", " $nn,$mm"); // Block move + addressingModeText.put("dp", " dp"); // Direct page + addressingModeText.put("dpx", " dp,x"); // Direct page with X + addressingModeText.put("dpy", " dp,y"); // Direct page with Y + addressingModeText.put("ial", " (abs) (long)"); // Indirect absolute long + addressingModeText.put("idl", " (abs) (long)"); // Indirect absolute long for JMP + addressingModeText.put("iax", " (abs,x) (long)"); // Indirect absolute long with X + addressingModeText.put("idly", " (abs),y (long)"); // Indirect absolute long with Y + addressingModeText.put("idp", " (dp)"); // Indirect direct page + addressingModeText.put("isy", " ($00,S),Y"); // Stack indirect with Y in first 64k + addressingModeText.put("rell", " rel (long)"); // Relative long + addressingModeText.put("sr", "$00,S"); // Stack in first 64k + + } + private Opcode opcode; - private Set cpus; + private Set targets; private String addressingMode; private int opcodeValue; - OpcodeAddressingMode(Opcode opcode, Set cpus, String addressingMode, int opcodeValue) { + OpcodeAddressingMode(Opcode opcode, Set targets, String addressingMode, int opcodeValue) { if (opcode == null) { throw new IllegalArgumentException("Parameter 'opcode' must not be null."); } - if (cpus == null) { + if (targets == null) { throw new IllegalArgumentException( - "Parameter 'cpus' must not be null for opcode '" + opcode.getName() + "'."); + "Parameter 'targets' must not be null for opcode '" + opcode.getName() + "'."); } if (addressingMode == null) { throw new IllegalArgumentException( @@ -54,7 +92,7 @@ public final class Opcode extends Instruction { } this.opcode = opcode; - this.cpus = cpus; + this.targets = targets; this.addressingMode = addressingMode; this.opcodeValue = opcodeValue; } @@ -64,7 +102,7 @@ public final class Opcode extends Instruction { } public Set getCPUs() { - return cpus; + return targets; } public String getAddressingMode() { @@ -74,47 +112,9 @@ public final class Opcode extends Instruction { public String getFormattedText() { StringBuffer result = new StringBuffer(opcode.getName()); - if (addressingMode.equals("imp")) { - - } else if (addressingMode.equals("imm")) { - result.append(" #$nn"); - } else if (addressingMode.equals("zp")) { - result.append(" zp"); - } else if (addressingMode.equals("zpx")) { - result.append(" zp,x"); - } else if (addressingMode.equals("zpy")) { - result.append(" zp,y"); - } else if (addressingMode.equals("izx")) { - result.append(" (zp,x)"); - } else if (addressingMode.equals("izy")) { - result.append(" (zp),y"); - } else if (addressingMode.equals("abs")) { - result.append(" abs"); - } else if (addressingMode.equals("abx")) { - result.append(" abs,x"); - } else if (addressingMode.equals("aby")) { - result.append(" abs,y"); - } else if (addressingMode.equals("ind")) { - result.append(" (abs)"); - } else if (addressingMode.equals("rel")) { - result.append(" rel"); - } else - - // 65816 modes - if (addressingMode.equals("abl")) { - result.append(" adr (long)"); - } else if (addressingMode.equals("bm")) { - result.append(" $nn,$nn"); - } else if (addressingMode.equals("dp")) { - result.append(" (zp)"); - } else if (addressingMode.equals("ial")) { - result.append(" abs (long)"); - } else if (addressingMode.equals("iax")) { - result.append(" (abs,x)"); - } else if (addressingMode.equals("idp")) { - result.append(" (zp)"); - } else if (addressingMode.equals("rell")) { - result.append(" rel (long)"); + String text = addressingModeText.get(addressingMode); + if (text != null) { + result.append(text); } else { throw new RuntimeException( "Unmapped addressing mode " + addressingMode + " for opcode " + opcode.getName()); diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageContentAssistProcessor.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageContentAssistProcessor.java index bcb8970a..4e0ef186 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageContentAssistProcessor.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageContentAssistProcessor.java @@ -305,7 +305,7 @@ final class LanguageContentAssistProcessor implements IContentAssistProcessor { if (proposalList == null) { throw new IllegalArgumentException("Parameter 'proposalList' must not be null."); } - LanguagePreferences languagePreferences = editor.getPlugin().getPreferences(); + LanguagePreferences languagePreferences = editor.getLanguagePreferences(); int offset = region.getOffset(); boolean lowerCase; diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditor.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditor.java index 5fce56a1..32797745 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditor.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditor.java @@ -66,6 +66,7 @@ import com.wudsn.ide.lng.compiler.parser.CompilerSourceParserTreeObject; import com.wudsn.ide.lng.compiler.parser.CompilerSourcePartitionScanner; import com.wudsn.ide.lng.outline.LanguageOutlinePage; import com.wudsn.ide.lng.preferences.CompilerPreferences; +import com.wudsn.ide.lng.preferences.LanguagePreferences; /** * The language editor. @@ -153,13 +154,22 @@ public abstract class LanguageEditor extends TextEditor { return plugin; } + /** + * Gets the language preferences. + * + * @return The language preferences, not null. + */ + public final LanguagePreferences getLanguagePreferences() { + return plugin.getLanguagePreferences(getCompilerDefinition().getLanguage()); + } + /** * Gets the compiler preferences. * * @return The compiler preferences, not null. */ public final CompilerPreferences getCompilerPreferences() { - return plugin.getPreferences().getCompilerPreferences(getCompilerDefinition(), getHardware()); + return getLanguagePreferences().getCompilerPreferences(getCompilerDefinition(), getHardware()); } /** diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompileAndRunCommandMenu.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompileAndRunCommandMenu.java index 1aa28387..68097a3c 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompileAndRunCommandMenu.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompileAndRunCommandMenu.java @@ -37,7 +37,7 @@ public final class LanguageEditorCompileAndRunCommandMenu extends WorkbenchWindo public LanguageEditorCompileAndRunCommandMenu() { if (System.getProperty("user.name").equals("JAC")) { - new Exception("JAC! Test for Startup!").printStackTrace(); +// new Exception("JAC! Test for Startup!").printStackTrace(); } } diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompileCommand.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompileCommand.java index 79c1a4bc..76986a1c 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompileCommand.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompileCommand.java @@ -56,8 +56,10 @@ import com.wudsn.ide.base.common.MarkerUtility; import com.wudsn.ide.base.common.NumberUtility; import com.wudsn.ide.base.common.ProcessWithLogs; import com.wudsn.ide.base.common.StringUtility; +import com.wudsn.ide.base.common.TextUtility; import com.wudsn.ide.base.hardware.Hardware; import com.wudsn.ide.lng.LanguagePlugin; +import com.wudsn.ide.lng.LanguageUtility; import com.wudsn.ide.lng.HardwareUtility; import com.wudsn.ide.lng.Texts; import com.wudsn.ide.lng.breakpoint.LanguageBreakpoint; @@ -246,20 +248,23 @@ final class LanguageEditorCompileCommand { } // Get and check path to compiler executable. - String compilerExecutablePath = plugin.getPreferences().getCompilerExecutablePath(compilerDefinition.getId()); + String compilerDefinitionText = LanguageUtility.getCompilerTextLower(compilerDefinition.getLanguage()); + String compilerPreferencesText = LanguageUtility.getCompilerPreferencesText(compilerDefinition.getLanguage()); + + String compilerExecutablePath = languageEditor.getLanguagePreferences() + .getCompilerExecutablePath(compilerDefinition.getId()); if (StringUtility.isEmpty(compilerExecutablePath)) { - // ERROR: Path to '{0}' compiler executable is not set in the - // preferences. - createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E100, - compilerDefinition.getName()); + // ERROR: Path to '{0}' {1} executable is not set in the '{2}' preferences. + createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E100, compilerDefinitionText, + compilerDefinition.getName(), compilerPreferencesText); return false; } File compilerExecutableFile = new File(compilerExecutablePath); if (!compilerExecutableFile.exists()) { - // Path to '{0}' compiler executable in the preferences points - // to non-existing file '{1}'. - createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E103, compilerDefinition.getName(), - compilerExecutablePath); + // ERROR: Path to '{0}' {1} executable in the {2} preferences points to + // non-existing file '{3}'. + createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E103, compilerDefinitionText, + compilerDefinition.getName(), compilerPreferencesText, compilerExecutablePath); return false; } @@ -278,9 +283,10 @@ final class LanguageEditorCompileCommand { compilerParameters = compilerParameters.trim(); String compilerParameterArray[] = compilerParameters.split(" "); if (compilerParameterArray.length == 0) { - // ERROR: The compiler '{0}' does not specify default + // ERROR: The {0} '{1}' does not specify default // parameters. - createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E101); + createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E101, compilerDefinitionText, + compilerDefinition.getId()); return false; } @@ -716,7 +722,7 @@ final class LanguageEditorCompileCommand { }); - String positioningMode = plugin.getPreferences().getEditorCompileCommandPositioningMode(); + String positioningMode = languageEditor.getLanguagePreferences().getEditorCompileCommandPositioningMode(); boolean ignoreWarnings = positioningMode.equals(LanguageEditorCompileCommandPositioningMode.FIRST_ERROR); IMarker firstWarningMarker = null; IMarker firstErrorMarker = null; diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompilerHelpCommandHandler.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompilerHelpCommandHandler.java index dc284baf..e9297ae4 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompilerHelpCommandHandler.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageEditorCompilerHelpCommandHandler.java @@ -33,6 +33,7 @@ import org.eclipse.ui.handlers.HandlerUtil; import com.wudsn.ide.lng.LanguagePlugin; import com.wudsn.ide.lng.compiler.CompilerDefinition; +import com.wudsn.ide.lng.compiler.CompilerHelp.HelpDocument; import com.wudsn.ide.lng.preferences.LanguagePreferences; /** @@ -57,12 +58,17 @@ public final class LanguageEditorCompilerHelpCommandHandler extends AbstractHand languageEditor = (LanguageEditor) editor; CompilerDefinition compilerDefinition = languageEditor.getCompilerDefinition(); - LanguagePreferences languagePreferences = LanguagePlugin.getInstance().getPreferences(); + LanguagePreferences languagePreferences = languageEditor.getLanguagePreferences(); String compilerExecutablePath = languagePreferences.getCompilerExecutablePath(compilerDefinition.getId()); try { - File file = compilerDefinition.getHelpFile(compilerExecutablePath); - Program.launch(file.getPath()); + HelpDocument helpDocument = compilerDefinition.getHelpForCurrentLocale(compilerExecutablePath); + if (helpDocument.file != null) { + Program.launch(helpDocument.file.getPath()); + } else { + Program.launch(helpDocument.uri.toString()); + + } } catch (CoreException ex) { // ERROR: Display text from core exception. diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageRuleBasedScanner.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageRuleBasedScanner.java index e78f964b..1773d190 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageRuleBasedScanner.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageRuleBasedScanner.java @@ -25,7 +25,6 @@ import org.eclipse.jface.text.TextAttribute; import org.eclipse.jface.text.rules.RuleBasedScanner; import org.eclipse.jface.text.rules.Token; -import com.wudsn.ide.lng.LanguagePlugin; import com.wudsn.ide.lng.preferences.LanguagePreferences; import com.wudsn.ide.lng.preferences.TextAttributeConverter; @@ -37,28 +36,32 @@ import com.wudsn.ide.lng.preferences.TextAttributeConverter; */ final class LanguageRuleBasedScanner extends RuleBasedScanner { - /** Default Token for the text attributes * */ - private Token defaultToken; - - /** Key for preference store * */ + // Key for preference store + private LanguagePreferences languagePreferences; private String preferencesKey; + // Default Token for the text attributes + private Token defaultToken; + /** * Creates a new instance. Called by {@link LanguageSourceViewerConfiguration}. * - * @param preferencesKey The preference key to listen to for text attribute - * changes, not null.. + * @param languagePreferences The language preferences, not null. + * @param preferencesKey The preference key to listen to for text attribute + * changes, not null. */ - LanguageRuleBasedScanner(String preferencesKey) { + LanguageRuleBasedScanner(LanguagePreferences languagePreferences, String preferencesKey) { + if (languagePreferences == null) { + throw new IllegalArgumentException("Parameter 'language' must not be null."); + } if (preferencesKey == null) { throw new IllegalArgumentException("Parameter 'preferencesKey' must not be null."); } - + this.languagePreferences = languagePreferences; this.preferencesKey = preferencesKey; - LanguagePreferences preferences = LanguagePlugin.getInstance().getPreferences(); - defaultToken = new Token(preferences.getEditorTextAttribute(preferencesKey)); + defaultToken = new Token(languagePreferences.getEditorTextAttribute(preferencesKey)); super.setDefaultReturnToken(defaultToken); } @@ -88,7 +91,8 @@ final class LanguageRuleBasedScanner extends RuleBasedScanner { throw new IllegalArgumentException("Parameter 'changedPropertyNames' must not be null."); } boolean refresh = false; - if (changedPropertyNames.contains(preferencesKey)) { + if (preferences.getLanguage().equals(languagePreferences.getLanguage()) + && changedPropertyNames.contains(preferencesKey)) { TextAttributeConverter.dispose((TextAttribute) defaultToken.getData()); defaultToken.setData(preferences.getEditorTextAttribute(preferencesKey)); refresh = true; diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageSourceScanner.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageSourceScanner.java index c8bb464f..13fa5633 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageSourceScanner.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageSourceScanner.java @@ -433,7 +433,7 @@ final class LanguageSourceScanner extends RuleBasedScanner { } LanguagePreferences preferences; Token token; - preferences = editor.getPlugin().getPreferences(); + preferences = editor.getLanguagePreferences(); token = new Token(preferences.getEditorTextAttribute(textAttributeName)); tokens.put(textAttributeName, token); return token; diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageSourceViewerConfiguration.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageSourceViewerConfiguration.java index 6d862682..5c3f786a 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageSourceViewerConfiguration.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/editor/LanguageSourceViewerConfiguration.java @@ -81,8 +81,7 @@ final class LanguageSourceViewerConfiguration extends TextSourceViewerConfigurat /** * Creates a new instance. Called by {@link LanguageEditor#initializeEditor()}. * - * @param editor The underlying language editor, not - * null. + * @param editor The underlying language editor, not null. * * @param preferenceStore The preferences store, not null. */ @@ -154,8 +153,7 @@ final class LanguageSourceViewerConfiguration extends TextSourceViewerConfigurat @Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { ContentAssistant assistant = new ContentAssistant(); - assistant.setContentAssistProcessor(new LanguageContentAssistProcessor(editor), - IDocument.DEFAULT_CONTENT_TYPE); + assistant.setContentAssistProcessor(new LanguageContentAssistProcessor(editor), IDocument.DEFAULT_CONTENT_TYPE); assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE); assistant.enableAutoActivation(true); assistant.enableAutoInsert(true); @@ -173,19 +171,22 @@ final class LanguageSourceViewerConfiguration extends TextSourceViewerConfigurat PresentationReconciler reconciler = new PresentationReconciler(); DefaultDamagerRepairer dr; - commentSingleScanner = new LanguageRuleBasedScanner( + LanguagePreferences languagePreferences = editor.getLanguagePreferences(); + + commentSingleScanner = new LanguageRuleBasedScanner(languagePreferences, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT); dr = new DefaultDamagerRepairer(commentSingleScanner); reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE); reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_SINGLE); - commentMultipleScanner = new LanguageRuleBasedScanner( + commentMultipleScanner = new LanguageRuleBasedScanner(languagePreferences, LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_COMMENT); dr = new DefaultDamagerRepairer(commentMultipleScanner); reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE); reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_COMMENT_MULTIPLE); - stringScanner = new LanguageRuleBasedScanner(LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING); + stringScanner = new LanguageRuleBasedScanner(languagePreferences, + LanguagePreferencesConstants.EDITOR_TEXT_ATTRIBUTE_STRING); dr = new DefaultDamagerRepairer(stringScanner); reconciler.setDamager(dr, CompilerSourcePartitionScanner.PARTITION_STRING); reconciler.setRepairer(dr, CompilerSourcePartitionScanner.PARTITION_STRING); diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferences.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferences.java index ff2fe150..fe4b6e53 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferences.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferences.java @@ -25,9 +25,11 @@ import org.eclipse.jface.text.TextAttribute; import com.wudsn.ide.base.common.AbstractIDEPlugin; import com.wudsn.ide.base.common.StringUtility; import com.wudsn.ide.base.hardware.Hardware; +import com.wudsn.ide.lng.Language; import com.wudsn.ide.lng.compiler.CompilerDefinition; import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase; import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode; + /** * Facade class for typed access to the plugin preferences. * @@ -38,35 +40,29 @@ public final class LanguagePreferences { /** * The preference store to which all calls are delegated. */ - private IPreferenceStore preferenceStore; + private LanguagesPreferences languagesPreferences; + private Language language; /** * Created by {@link AbstractIDEPlugin} only. * - * @param preferenceStore The preference store, not null. + * @param languagesPreferences The languages preferences, not null. */ - public LanguagePreferences(IPreferenceStore preferenceStore) { - if (preferenceStore == null) { - throw new IllegalArgumentException("Parameter 'preferenceStore' must not be null."); + public LanguagePreferences(LanguagesPreferences languagesPreferences, Language language) { + if (languagesPreferences == null) { + throw new IllegalArgumentException("Parameter 'languagesPreferences' must not be null."); } - this.preferenceStore = preferenceStore; + if (language == null) { + throw new IllegalArgumentException("Parameter 'language' must not be null."); + } + this.languagesPreferences = languagesPreferences; + this.language = language; } - /** - * Gets the text attribute for a token type. - * - * @param name The name of the preferences for the token type, see - * {@link LanguagePreferencesConstants}. - * - * @return The text attribute, not null. - */ - public TextAttribute getEditorTextAttribute(String name) { - if (name == null) { - throw new IllegalArgumentException("Parameter 'name' must not be null."); - } - return TextAttributeConverter.fromString(preferenceStore.getString(name)); + public Language getLanguage() { + return language; } - + /** * Gets the default case content assist. * @@ -109,9 +105,10 @@ public final class LanguagePreferences { /** * Gets the preferences for a compiler. * - * @param compilerDefinition The compiler definition, not empty and not null. - * @param hardware The preferences or null if the compiler is not - * active for that hardware. + * @param compilerDefinition The compiler definition, not empty and not + * null. + * @param hardware The preferences or null if the + * compiler is not active for that hardware. * * @return The compiler preferences, not null. */ @@ -127,6 +124,21 @@ public final class LanguagePreferences { } + /** + * Gets the current value of the boolean preference with the given name. Returns + * the default value false if there is no preference with the given + * name, or if the current value cannot be treated as a boolean. + * + * @param name The name of the preference, not null. + * @return The preference value. + */ + boolean getBoolean(String name) { + if (name == null) { + throw new IllegalArgumentException("Parameter 'name' must not be null."); + } + return languagesPreferences.getBoolean(language.name() + "." + name); + } + /** * Gets the current value of the string-valued preference with the given name. * Returns the default-default value (the empty string "" ) if @@ -138,32 +150,25 @@ public final class LanguagePreferences { */ String getString(String name) { if (name == null) { - throw new IllegalArgumentException("Parameter 'key' must not be null."); + throw new IllegalArgumentException("Parameter 'name' must not be null."); } - String result; - result = preferenceStore.getString(name); - if (result == null) { - result = ""; - } else { - result = result.trim(); - } - - return result; + return languagesPreferences.getString(language.name() + "." + name); } /** - * Gets the current value of the boolean preference with the given name. Returns - * the default-default value false if there is no preference with - * the given name, or if the current value cannot be treated as a boolean. + * Gets the text attribute for a token type. * - * @param name The name of the preference, not null. - * @return The preference value. + * @param name The name of the preferences for the token type, see + * {@link LanguagePreferencesConstants}. + * + * @return The text attribute, not null. */ - boolean getBoolean(String name) { + public TextAttribute getEditorTextAttribute(String name) { if (name == null) { - throw new IllegalArgumentException("Parameter 'key' must not be null."); + throw new IllegalArgumentException("Parameter 'name' must not be null."); } - return preferenceStore.getBoolean(name); + return languagesPreferences.getEditorTextAttribute(language.name() + "." + name); + } } \ No newline at end of file diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferencesCompilersPage.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferencesCompilersPage.java index aa4e940d..d5928d23 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferencesCompilersPage.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferencesCompilersPage.java @@ -457,7 +457,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer throw new IllegalArgumentException("Parameter 'tab' must not be null."); } - LanguagePreferences languagePreferences = plugin.getPreferences(); + LanguagePreferences languagePreferences = plugin.getLanguagePreferences(language); boolean enabled = StringUtility.isSpecified(languagePreferences.getCompilerExecutablePath(tab.compilerId)); diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferencesPage.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferencesPage.java index 44a9a0d7..31363353 100644 --- a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferencesPage.java +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagePreferencesPage.java @@ -507,7 +507,7 @@ public abstract class LanguagePreferencesPage extends FieldEditorPreferencePage public boolean performOk() { if (super.performOk()) { saveChanges(); - plugin.firePreferencesChangeEvent(changedPropertyNames); + plugin.firePreferencesChangeEvent(language, changedPropertyNames); return true; } return false; diff --git a/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagesPreferences.java b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagesPreferences.java new file mode 100644 index 00000000..26d2eb97 --- /dev/null +++ b/com.wudsn.ide.asm/src/com/wudsn/ide/lng/preferences/LanguagesPreferences.java @@ -0,0 +1,130 @@ +/** + * Copyright (C) 2009 - 2021 Peter Dell + * + * This file is part of WUDSN IDE. + * + * WUDSN IDE 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. + * + * WUDSN IDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WUDSN IDE. If not, see . + */ + +package com.wudsn.ide.lng.preferences; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.text.TextAttribute; + +import com.wudsn.ide.base.common.AbstractIDEPlugin; +import com.wudsn.ide.base.common.StringUtility; +import com.wudsn.ide.base.hardware.Hardware; +import com.wudsn.ide.lng.Language; +import com.wudsn.ide.lng.compiler.CompilerDefinition; +import com.wudsn.ide.lng.editor.LanguageContentAssistProcessorDefaultCase; +import com.wudsn.ide.lng.editor.LanguageEditorCompileCommandPositioningMode; +/** + * Facade class for typed access to the plugin preferences. + * + * @author Peter Dell + */ +public final class LanguagesPreferences { + + /** + * The preference store to which all calls are delegated. + */ + private IPreferenceStore preferenceStore; + + /** + * Created by {@link AbstractIDEPlugin} only. + * + * @param preferenceStore The preference store, not null. + */ + public LanguagesPreferences(IPreferenceStore preferenceStore) { + if (preferenceStore == null) { + throw new IllegalArgumentException("Parameter 'preferenceStore' must not be null."); + } + this.preferenceStore = preferenceStore; + } + + + + /** + * Gets the preferences for a language. + * + * @param language The language, not null. + * + * @return The language preferences, not null. + */ + public LanguagePreferences getLanguagePreferences(Language language) { + if (language == null) { + throw new IllegalArgumentException("Parameter 'language' must not be null."); + } + + + return new LanguagePreferences(this, language); + + } + + + /** + * Gets the current value of the boolean preference with the given name. Returns + * the default-default value false if there is no preference with + * the given name, or if the current value cannot be treated as a boolean. + * + * @param name The name of the preference, not null. + * @return The preference value. + */ + boolean getBoolean(String name) { + if (name == null) { + throw new IllegalArgumentException("Parameter 'key' must not be null."); + } + return preferenceStore.getBoolean(name); + } + + /** + * Gets the current value of the string-valued preference with the given name. + * Returns the default-default value (the empty string "" ) if + * there is no preference with the given name, or if the current value cannot be + * treated as a string. + * + * @param name The name of the preference, not null. + * @return The preference value, may be empty, not null. + */ + String getString(String name) { + if (name == null) { + throw new IllegalArgumentException("Parameter 'key' must not be null."); + } + String result; + result = preferenceStore.getString(name); + if (result == null) { + result = ""; + } else { + result = result.trim(); + } + + return result; + } + + /** + * Gets the text attribute for a token type. + * + * @param name The name of the preferences for the token type, see + * {@link LanguagePreferencesConstants}. + * + * @return The text attribute, not null. + */ + TextAttribute getEditorTextAttribute(String name) { + if (name == null) { + throw new IllegalArgumentException("Parameter 'name' must not be null."); + } + return TextAttributeConverter.fromString(preferenceStore.getString(name)); + } + +} \ No newline at end of file diff --git a/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompiler.java b/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompiler.java index c3d32ab1..bb07ddf7 100644 --- a/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompiler.java +++ b/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompiler.java @@ -18,6 +18,20 @@ */ package com.wudsn.ide.lng.pas.compiler.mp; -public class MadPascalCompiler { +import com.wudsn.ide.lng.compiler.Compiler; +import com.wudsn.ide.lng.compiler.CompilerProcessLogParser; +import com.wudsn.ide.lng.compiler.parser.CompilerSourceParser; + +public class MadPascalCompiler extends Compiler { + + @Override + public CompilerSourceParser createSourceParser() { + return new MadPascalCompilerSourceParser(); + } + + @Override + public CompilerProcessLogParser createLogParser() { + return new MadPascalCompilerProcessLogParser(); + } } diff --git a/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompiler.xml b/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompiler.xml new file mode 100644 index 00000000..3eec8b83 --- /dev/null +++ b/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompiler.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompilerProcessLogParser.java b/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompilerProcessLogParser.java new file mode 100644 index 00000000..5ebfa29e --- /dev/null +++ b/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompilerProcessLogParser.java @@ -0,0 +1,59 @@ +/** + * Copyright (C) 2009 - 2021 Peter Dell + * + * This file is part of WUDSN IDE. + * + * WUDSN IDE 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. + * + * WUDSN IDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WUDSN IDE. If not, see . + */ + +package com.wudsn.ide.lng.pas.compiler.mp; + +import java.io.BufferedReader; +import java.io.StringReader; +import java.util.List; + +import org.eclipse.core.runtime.CoreException; + +import com.wudsn.ide.lng.compiler.CompilerProcessLogParser; +import com.wudsn.ide.lng.compiler.CompilerSymbol; + +/** + * Process log parser for {@link MadsCompiler}. + * + * @author Peter Dell + */ +final class MadPascalCompilerProcessLogParser extends CompilerProcessLogParser { + + private BufferedReader bufferedReader; + + @Override + protected void initialize() { + bufferedReader = new BufferedReader(new StringReader(outputLog)); + } + + @Override + protected void findNextMarker() { + + + } + + @Override + public void addCompilerSymbols(List compilerSymbols) throws CoreException { + if (compilerSymbols == null) { + throw new IllegalArgumentException("Parameter 'compilerSymbols' must not be null."); + } + + } + +} \ No newline at end of file diff --git a/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompilerSourceParser.java b/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompilerSourceParser.java new file mode 100644 index 00000000..a375e7b8 --- /dev/null +++ b/com.wudsn.ide.pas/src/com/wudsn/ide/lng/pas/compiler/mp/MadPascalCompilerSourceParser.java @@ -0,0 +1,70 @@ +/** + * Copyright (C) 2009 - 2021 Peter Dell + * + * This file is part of WUDSN IDE. + * + * WUDSN IDE 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. + * + * WUDSN IDE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with WUDSN IDE. If not, see . + */ + +package com.wudsn.ide.lng.pas.compiler.mp; + +import com.wudsn.ide.lng.compiler.parser.CompilerSourceParser; + +/** + * Source parser for {@link MadsCompiler}. + * + * @author Peter Dell + */ +final class MadPascalCompilerSourceParser extends CompilerSourceParser { + + @Override + protected void parseLine(int startOffset, String symbol, int symbolOffset, String instruction, + int instructionOffset, String operand, String comment) { + +// if (symbol.length() > 0) { +// +// if (instruction.equals("=") || instruction.equals("EQU")) { +// createEquateDefinitionChild(startOffset, startOffset + symbolOffset, symbol, operand, comment); +// +// } else { +// createLabelDefinitionChild(startOffset, startOffset + symbolOffset, symbol, comment); +// } +// +// } // Symbol not empty +// +// // TODO Make .VAR an own type of instruction +// if (instruction.equals(".VAR") || instruction.equals(".ZPVAR")) { +// operand = operand.trim(); +// int index = operand.indexOf('='); +// String variable; +// String value; +// if (index < 0) { +// variable = operand; +// value = ""; +// } else { +// variable = operand.substring(0, index).trim(); +// value = operand.substring(index).trim(); +// if (value.startsWith("=")) { +// value = value.substring(1).trim(); +// } +// } +// if (value.length() > 0) { +// createEquateDefinitionChild(startOffset, startOffset + instructionOffset, variable, value, comment); +// } else { +// createLabelDefinitionChild(startOffset, startOffset + instructionOffset, variable, comment); +// } +// +// } + } +} diff --git a/com.wudsn.ide.snd/src/com/wudsn/ide/snd/player/SoundInfo.java b/com.wudsn.ide.snd/src/com/wudsn/ide/snd/player/SoundInfo.java index a11a100f..50630b40 100644 --- a/com.wudsn.ide.snd/src/com/wudsn/ide/snd/player/SoundInfo.java +++ b/com.wudsn.ide.snd/src/com/wudsn/ide/snd/player/SoundInfo.java @@ -125,7 +125,7 @@ public interface SoundInfo { public int getPlayerAddress(); /** - * Gets the music address or -1 if the moduls type does not have + * Gets the music address or -1 if the module type does not have * one. * * @return TODO