From df216e32e134fee3dfd861208acb1a1fcba8c417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Sat, 28 Nov 2026 12:16:18 +0100 Subject: [PATCH] fix(check): make GenerateTestLanguage reproduce the test language GenerateTestLanguage.mwe2 now regenerates the committed sources of the test language, and regenerate.sh checks it. The test language keeps the editor features it had: - Content assist moves to the new bundle com.avaloq.tools.ddk.check.test.runtime.ide, where Xtext 2.43 generates the content assist parser (genericIde, XtextAntlrGeneratorFragment2). The UI requires it. - ContentAssistFragment2 and CodetemplatesGeneratorFragment2 generate the proposal provider and the templates bindings; the templates preference page stays in plugin.xml. - DDK's FormatterFragment2 binds TestLanguageFormatter and the DDK node model formatter and streamer, as the legacy FormatFragment did. - Java stubs only (preferXtendStubs = false), and BundleVersionStripperFragment as in the other DDK workflows. org.objectweb.asm keeps the optional version range that TypesGeneratorFragment2 adds. - ValidatorFragment2 binds TestLanguageValidator (formerly TestLanguageJavaValidator) with the ImportUri and NamesAreUnique checks the legacy validator composed, so the GREETING_NAME_PREFIX warning stays. - TestLanguageGeneratorNaming keeps the activator com.avaloq.tools.ddk.check.ui.internal.TestLanguageActivator, which the UI manifest and the tests use. - The metamodel stays in src-gen/com/avaloq/tools/ddk/check, where plugin.xml and build.properties expect it. - TestLanguageGenerator extends AbstractGenerator, as the runtime module binds IGenerator2. The Check output in dsl-gen is not touched by the workflow's cleaners. Fixes #1672 Co-Authored-By: Claude Opus 5.5 --- .github/scripts/regenerate.sh | 1 - .../.classpath | 12 + .../.project | 81 +++ .../.settings/.gitignore | 0 .../META-INF/MANIFEST.MF | 14 + .../build.properties | 4 + .../pom.xml | 13 + .../services/org.eclipse.xtext.ISetup | 1 + .../ide/AbstractTestLanguageIdeModule.java | 60 ++ ...artialTestLanguageContentAssistParser.java | 15 +- .../antlr/TestLanguageParser.java | 78 ++ .../antlr/internal/InternalTestLanguage.g | 177 ++--- .../internal/InternalTestLanguage.tokens | 0 .../internal/InternalTestLanguageLexer.java | 78 +- .../internal/InternalTestLanguageParser.java | 168 +++-- .../ddk/check/ide/TestLanguageIdeModule.java | 17 + .../ddk/check/ide/TestLanguageIdeSetup.java | 31 + .../META-INF/MANIFEST.MF | 11 +- .../plugin.xml_gen | 684 +++++++++--------- .../ui/AbstractTestLanguageUiModule.java | 383 ++++++---- ...estLanguageExecutableExtensionFactory.java | 14 +- .../AbstractTestLanguageProposalProvider.java | 15 +- .../antlr/TestLanguageParser.java | 72 -- .../ui/internal/TestLanguageActivator.java | 39 +- .../GenerateTestLanguage.mwe2.launch | 2 +- .../META-INF/MANIFEST.MF | 11 +- .../plugin.xml_gen | 19 +- .../AbstractTestLanguageRuntimeModule.java | 267 ++++--- .../tools/ddk/check/TestLanguage.genmodel | 8 +- .../TestLanguageStandaloneSetupGenerated.java | 34 +- .../TestLanguageAntlrTokenFileProvider.java | 4 +- .../parser/antlr/TestLanguageParser.java | 23 +- .../antlr/internal/InternalTestLanguage.g | 162 ++--- .../internal/InternalTestLanguageLexer.java | 74 +- .../internal/InternalTestLanguageParser.java | 161 +++-- .../AbstractTestLanguageScopeProvider.java | 9 + ...AbstractTestLanguageSemanticSequencer.java | 4 + .../services/TestLanguageGrammarAccess.java | 102 ++- .../ddk/check/testLanguage/Greeting.java | 5 +- .../tools/ddk/check/testLanguage/Model.java | 5 +- .../testLanguage/TestLanguageFactory.java | 1 + .../testLanguage/TestLanguagePackage.java | 1 + .../check/testLanguage/impl/GreetingImpl.java | 5 +- .../check/testLanguage/impl/ModelImpl.java | 2 + .../impl/TestLanguageFactoryImpl.java | 4 + .../impl/TestLanguagePackageImpl.java | 13 +- .../util/TestLanguageAdapterFactory.java | 1 + .../testLanguage/util/TestLanguageSwitch.java | 1 + .../AbstractTestLanguageJavaValidator.java | 22 - .../AbstractTestLanguageValidator.java | 23 + .../tools/ddk/check/GenerateTestLanguage.mwe2 | 38 +- .../generator/TestLanguageGenerator.java | 14 +- .../TestLanguageGeneratorModule.java | 27 + .../TestLanguageGeneratorNaming.java | 27 + ...idator.java => TestLanguageValidator.java} | 4 +- ddk-parent/pom.xml | 1 + 56 files changed, 1731 insertions(+), 1311 deletions(-) create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/.classpath create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/.project create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/.settings/.gitignore create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/META-INF/MANIFEST.MF create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/build.properties create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/pom.xml create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/META-INF/services/org.eclipse.xtext.ISetup create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/AbstractTestLanguageIdeModule.java rename {com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui => com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide}/contentassist/antlr/PartialTestLanguageContentAssistParser.java (66%) create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/TestLanguageParser.java rename {com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui => com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide}/contentassist/antlr/internal/InternalTestLanguage.g (55%) rename {com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui => com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide}/contentassist/antlr/internal/InternalTestLanguage.tokens (100%) rename {com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui => com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide}/contentassist/antlr/internal/InternalTestLanguageLexer.java (89%) rename {com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui => com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide}/contentassist/antlr/internal/InternalTestLanguageParser.java (73%) create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/src/com/avaloq/tools/ddk/check/ide/TestLanguageIdeModule.java create mode 100644 com.avaloq.tools.ddk.check.test.runtime.ide/src/com/avaloq/tools/ddk/check/ide/TestLanguageIdeSetup.java delete mode 100644 com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/TestLanguageParser.java create mode 100644 com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/scoping/AbstractTestLanguageScopeProvider.java delete mode 100644 com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/validation/AbstractTestLanguageJavaValidator.java create mode 100644 com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/validation/AbstractTestLanguageValidator.java create mode 100644 com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGeneratorModule.java create mode 100644 com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGeneratorNaming.java rename com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/validation/{TestLanguageJavaValidator.java => TestLanguageValidator.java} (90%) diff --git a/.github/scripts/regenerate.sh b/.github/scripts/regenerate.sh index 3bf84e14ee..31336cba43 100755 --- a/.github/scripts/regenerate.sh +++ b/.github/scripts/regenerate.sh @@ -15,7 +15,6 @@ EXCLUDE=( # Workflows whose committed output still differs from what they generate, with the issue that fixes each. KNOWN_DRIFT=( - com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/GenerateTestLanguage.mwe2 # #1672 ) root=$(git rev-parse --show-toplevel) diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/.classpath b/com.avaloq.tools.ddk.check.test.runtime.ide/.classpath new file mode 100644 index 0000000000..bd17204a15 --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/.project b/com.avaloq.tools.ddk.check.test.runtime.ide/.project new file mode 100644 index 0000000000..f5e6138ab0 --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/.project @@ -0,0 +1,81 @@ + + + com.avaloq.tools.ddk.check.test.runtime.ide + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + org.eclipse.xtext.ui.shared.xtextNature + + + + .checkstyle + 1 + PARENT-1-PROJECT_LOC/ddk-configuration/.checkstyle + + + .fbprefs + 1 + PARENT-1-PROJECT_LOC/ddk-configuration/.fbprefs + + + .pmd + 1 + PARENT-1-PROJECT_LOC/ddk-configuration/.pmd + + + .settings/edu.umd.cs.findbugs.plugin.eclipse.prefs + 1 + PARENT-1-PROJECT_LOC/ddk-configuration/.settings/edu.umd.cs.findbugs.plugin.eclipse.prefs + + + .settings/org.eclipse.core.resources.prefs + 1 + PARENT-1-PROJECT_LOC/ddk-configuration/.settings/org.eclipse.core.resources.prefs + + + .settings/org.eclipse.core.runtime.prefs + 1 + PARENT-1-PROJECT_LOC/ddk-configuration/.settings/org.eclipse.core.runtime.prefs + + + .settings/org.eclipse.jdt.core.prefs + 1 + PARENT-1-PROJECT_LOC/ddk-configuration/.settings/org.eclipse.jdt.core.prefs + + + .settings/org.eclipse.jdt.ui.prefs + 1 + PARENT-1-PROJECT_LOC/ddk-configuration/.settings/org.eclipse.jdt.ui.prefs + + + .settings/org.eclipse.pde.core.prefs + 1 + PARENT-1-PROJECT_LOC/ddk-configuration/.settings/org.eclipse.pde.core.prefs + + + diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/.settings/.gitignore b/com.avaloq.tools.ddk.check.test.runtime.ide/.settings/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/META-INF/MANIFEST.MF b/com.avaloq.tools.ddk.check.test.runtime.ide/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..aa8ed837e3 --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: com.avaloq.tools.ddk.check.test.runtime.ide +Bundle-Vendor: Avaloq Group AG +Bundle-Version: 17.3.1.qualifier +Bundle-SymbolicName: com.avaloq.tools.ddk.check.test.runtime.ide; singleton:=true +Bundle-ActivationPolicy: lazy +Require-Bundle: com.avaloq.tools.ddk.check.test.runtime, + org.eclipse.xtext.ide, + org.antlr.runtime +Bundle-RequiredExecutionEnvironment: JavaSE-21 +Automatic-Module-Name: com.avaloq.tools.ddk.check.test.runtime.ide +Export-Package: com.avaloq.tools.ddk.check.ide.contentassist.antlr, + com.avaloq.tools.ddk.check.ide.contentassist.antlr.internal diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/build.properties b/com.avaloq.tools.ddk.check.test.runtime.ide/build.properties new file mode 100644 index 0000000000..7ed56c2b7c --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/build.properties @@ -0,0 +1,4 @@ +source.. = src/,\ + src-gen/ +bin.includes = META-INF/,\ + . diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/pom.xml b/com.avaloq.tools.ddk.check.test.runtime.ide/pom.xml new file mode 100644 index 0000000000..35c9d395fb --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + + ddk-parent + com.avaloq.tools.ddk + 18.0.1-SNAPSHOT + ../ddk-parent + + 17.3.1-SNAPSHOT + + com.avaloq.tools.ddk.check.test.runtime.ide + eclipse-plugin + \ No newline at end of file diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/META-INF/services/org.eclipse.xtext.ISetup b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/META-INF/services/org.eclipse.xtext.ISetup new file mode 100644 index 0000000000..b3ac664065 --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/META-INF/services/org.eclipse.xtext.ISetup @@ -0,0 +1 @@ +com.avaloq.tools.ddk.check.ide.TestLanguageIdeSetup diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/AbstractTestLanguageIdeModule.java b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/AbstractTestLanguageIdeModule.java new file mode 100644 index 0000000000..e7ff07955d --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/AbstractTestLanguageIdeModule.java @@ -0,0 +1,60 @@ +/* + * generated by Xtext + */ +package com.avaloq.tools.ddk.check.ide; + +import com.avaloq.tools.ddk.check.ide.contentassist.antlr.TestLanguageParser; +import com.avaloq.tools.ddk.check.ide.contentassist.antlr.internal.InternalTestLanguageLexer; +import com.google.inject.Binder; +import com.google.inject.name.Names; +import org.eclipse.xtext.ide.DefaultIdeModule; +import org.eclipse.xtext.ide.LexerIdeBindings; +import org.eclipse.xtext.ide.editor.contentassist.FQNPrefixMatcher; +import org.eclipse.xtext.ide.editor.contentassist.IPrefixMatcher; +import org.eclipse.xtext.ide.editor.contentassist.IProposalConflictHelper; +import org.eclipse.xtext.ide.editor.contentassist.antlr.AntlrProposalConflictHelper; +import org.eclipse.xtext.ide.editor.contentassist.antlr.IContentAssistParser; +import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer; +import org.eclipse.xtext.ide.refactoring.IRenameStrategy2; +import org.eclipse.xtext.ide.server.rename.IRenameService2; +import org.eclipse.xtext.ide.server.rename.RenameService2; + +/** + * Manual modifications go to {@link TestLanguageIdeModule}. + */ +@SuppressWarnings("all") +public abstract class AbstractTestLanguageIdeModule extends DefaultIdeModule { + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public void configureContentAssistLexer(Binder binder) { + binder.bind(Lexer.class) + .annotatedWith(Names.named(LexerIdeBindings.CONTENT_ASSIST)) + .to(InternalTestLanguageLexer.class); + } + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindIContentAssistParser() { + return TestLanguageParser.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindIProposalConflictHelper() { + return AntlrProposalConflictHelper.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2 + public Class bindIPrefixMatcher() { + return FQNPrefixMatcher.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2 + public Class bindIRenameService2() { + return RenameService2.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2 + public Class bindIRenameStrategy2() { + return IRenameStrategy2.DefaultImpl.class; + } + +} diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/PartialTestLanguageContentAssistParser.java b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/PartialTestLanguageContentAssistParser.java similarity index 66% rename from com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/PartialTestLanguageContentAssistParser.java rename to com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/PartialTestLanguageContentAssistParser.java index b35416a3a2..c44ee625ee 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/PartialTestLanguageContentAssistParser.java +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/PartialTestLanguageContentAssistParser.java @@ -1,21 +1,16 @@ /* * generated by Xtext */ -package com.avaloq.tools.ddk.check.ui.contentassist.antlr; +package com.avaloq.tools.ddk.check.ide.contentassist.antlr; import java.util.Collection; import java.util.Collections; - import org.eclipse.xtext.AbstractRule; -import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; +import org.eclipse.xtext.ide.editor.contentassist.antlr.FollowElement; +import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; import org.eclipse.xtext.util.PolymorphicDispatcher; -/* - * Template CodetemplatesGeneratorFragment.xpt - */ -public class PartialTestLanguageContentAssistParser extends TestLanguageParser implements IPartialContentAssistParser { +public class PartialTestLanguageContentAssistParser extends TestLanguageParser { private AbstractRule rule; @@ -23,7 +18,7 @@ public class PartialTestLanguageContentAssistParser extends TestLanguageParser i public void initializeFor(AbstractRule rule) { this.rule = rule; } - + @Override protected Collection getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/TestLanguageParser.java b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/TestLanguageParser.java new file mode 100644 index 0000000000..4172b854d1 --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/TestLanguageParser.java @@ -0,0 +1,78 @@ +/* + * generated by Xtext + */ +package com.avaloq.tools.ddk.check.ide.contentassist.antlr; + +import com.avaloq.tools.ddk.check.ide.contentassist.antlr.internal.InternalTestLanguageParser; +import com.avaloq.tools.ddk.check.services.TestLanguageGrammarAccess; +import com.google.common.collect.ImmutableMap; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import java.util.Map; +import org.eclipse.xtext.AbstractElement; +import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser; + +public class TestLanguageParser extends AbstractContentAssistParser { + + @Singleton + public static final class NameMappings { + + private final Map mappings; + + @Inject + public NameMappings(TestLanguageGrammarAccess grammarAccess) { + ImmutableMap.Builder builder = ImmutableMap.builder(); + init(builder, grammarAccess); + this.mappings = builder.build(); + } + + public String getRuleName(AbstractElement element) { + return mappings.get(element); + } + + private static void init(ImmutableMap.Builder builder, TestLanguageGrammarAccess grammarAccess) { + builder.put(grammarAccess.getGreetingAccess().getGroup(), "rule__Greeting__Group__0"); + builder.put(grammarAccess.getModelAccess().getGreetingsAssignment(), "rule__Model__GreetingsAssignment"); + builder.put(grammarAccess.getGreetingAccess().getNameAssignment_1(), "rule__Greeting__NameAssignment_1"); + } + } + + @Inject + private NameMappings nameMappings; + + @Inject + private TestLanguageGrammarAccess grammarAccess; + + @Override + protected InternalTestLanguageParser createParser() { + InternalTestLanguageParser result = new InternalTestLanguageParser(null); + result.setGrammarAccess(grammarAccess); + return result; + } + + @Override + protected String getRuleName(AbstractElement element) { + return nameMappings.getRuleName(element); + } + + @Override + protected String[] getInitialHiddenTokens() { + return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" }; + } + + public TestLanguageGrammarAccess getGrammarAccess() { + return this.grammarAccess; + } + + public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) { + this.grammarAccess = grammarAccess; + } + + public NameMappings getNameMappings() { + return nameMappings; + } + + public void setNameMappings(NameMappings nameMappings) { + this.nameMappings = nameMappings; + } +} diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguage.g b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguage.g similarity index 55% rename from com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguage.g rename to com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguage.g index f3b89ba287..2d0f350d88 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguage.g +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguage.g @@ -5,19 +5,18 @@ grammar InternalTestLanguage; options { superClass=AbstractInternalContentAssistParser; - } @lexer::header { -package com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal; +package com.avaloq.tools.ddk.check.ide.contentassist.antlr.internal; // Hack: Use our own Lexer superclass by means of import. // Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer; +import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer; } @parser::header { -package com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal; +package com.avaloq.tools.ddk.check.ide.contentassist.antlr.internal; import java.io.InputStream; import org.eclipse.xtext.*; @@ -27,37 +26,31 @@ import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.parser.antlr.XtextTokenStream; import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA; +import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; +import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.DFA; import com.avaloq.tools.ddk.check.services.TestLanguageGrammarAccess; } - @parser::members { - - private TestLanguageGrammarAccess grammarAccess; - - public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } - - @Override - protected Grammar getGrammar() { - return grammarAccess.getGrammar(); - } - - @Override - protected String getValueForTokenName(String tokenName) { - return tokenName; - } - -} + private TestLanguageGrammarAccess grammarAccess; + public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) { + this.grammarAccess = grammarAccess; + } + @Override + protected Grammar getGrammar() { + return grammarAccess.getGrammar(); + } + @Override + protected String getValueForTokenName(String tokenName) { + return tokenName; + } +} // Entry rule entryRuleModel -entryRuleModel +entryRuleModel : { before(grammarAccess.getModelRule()); } ruleModel @@ -66,26 +59,23 @@ entryRuleModel ; // Rule Model -ruleModel - @init { +ruleModel + @init { int stackSize = keepStackSize(); - } + } : -( -{ before(grammarAccess.getModelAccess().getGreetingsAssignment()); } -(rule__Model__GreetingsAssignment)* -{ after(grammarAccess.getModelAccess().getGreetingsAssignment()); } -) - + ( + { before(grammarAccess.getModelAccess().getGreetingsAssignment()); } + (rule__Model__GreetingsAssignment)* + { after(grammarAccess.getModelAccess().getGreetingsAssignment()); } + ) ; finally { restoreStackSize(stackSize); } - - // Entry rule entryRuleGreeting -entryRuleGreeting +entryRuleGreeting : { before(grammarAccess.getGreetingRule()); } ruleGreeting @@ -94,31 +84,25 @@ entryRuleGreeting ; // Rule Greeting -ruleGreeting - @init { +ruleGreeting + @init { int stackSize = keepStackSize(); - } + } : -( -{ before(grammarAccess.getGreetingAccess().getGroup()); } -(rule__Greeting__Group__0) -{ after(grammarAccess.getGreetingAccess().getGroup()); } -) - + ( + { before(grammarAccess.getGreetingAccess().getGroup()); } + (rule__Greeting__Group__0) + { after(grammarAccess.getGreetingAccess().getGroup()); } + ) ; finally { restoreStackSize(stackSize); } - - - - - rule__Greeting__Group__0 - @init { + @init { int stackSize = keepStackSize(); - } + } : rule__Greeting__Group__0__Impl rule__Greeting__Group__1 @@ -128,28 +112,24 @@ finally { } rule__Greeting__Group__0__Impl - @init { + @init { int stackSize = keepStackSize(); - } + } : ( -{ before(grammarAccess.getGreetingAccess().getHelloKeyword_0()); } - - 'Hello' - -{ after(grammarAccess.getGreetingAccess().getHelloKeyword_0()); } + { before(grammarAccess.getGreetingAccess().getHelloKeyword_0()); } + 'Hello' + { after(grammarAccess.getGreetingAccess().getHelloKeyword_0()); } ) - ; finally { restoreStackSize(stackSize); } - rule__Greeting__Group__1 - @init { + @init { int stackSize = keepStackSize(); - } + } : rule__Greeting__Group__1__Impl rule__Greeting__Group__2 @@ -159,26 +139,24 @@ finally { } rule__Greeting__Group__1__Impl - @init { + @init { int stackSize = keepStackSize(); - } + } : ( -{ before(grammarAccess.getGreetingAccess().getNameAssignment_1()); } -(rule__Greeting__NameAssignment_1) -{ after(grammarAccess.getGreetingAccess().getNameAssignment_1()); } + { before(grammarAccess.getGreetingAccess().getNameAssignment_1()); } + (rule__Greeting__NameAssignment_1) + { after(grammarAccess.getGreetingAccess().getNameAssignment_1()); } ) - ; finally { restoreStackSize(stackSize); } - rule__Greeting__Group__2 - @init { + @init { int stackSize = keepStackSize(); - } + } : rule__Greeting__Group__2__Impl ; @@ -187,62 +165,51 @@ finally { } rule__Greeting__Group__2__Impl - @init { + @init { int stackSize = keepStackSize(); - } + } : ( -{ before(grammarAccess.getGreetingAccess().getExclamationMarkKeyword_2()); } - - '!' - -{ after(grammarAccess.getGreetingAccess().getExclamationMarkKeyword_2()); } + { before(grammarAccess.getGreetingAccess().getExclamationMarkKeyword_2()); } + '!' + { after(grammarAccess.getGreetingAccess().getExclamationMarkKeyword_2()); } ) - ; finally { restoreStackSize(stackSize); } - - - - - - - rule__Model__GreetingsAssignment - @init { + @init { int stackSize = keepStackSize(); - } + } : -( -{ before(grammarAccess.getModelAccess().getGreetingsGreetingParserRuleCall_0()); } - ruleGreeting{ after(grammarAccess.getModelAccess().getGreetingsGreetingParserRuleCall_0()); } -) - + ( + { before(grammarAccess.getModelAccess().getGreetingsGreetingParserRuleCall_0()); } + ruleGreeting + { after(grammarAccess.getModelAccess().getGreetingsGreetingParserRuleCall_0()); } + ) ; finally { restoreStackSize(stackSize); } rule__Greeting__NameAssignment_1 - @init { + @init { int stackSize = keepStackSize(); - } + } : -( -{ before(grammarAccess.getGreetingAccess().getNameIDTerminalRuleCall_1_0()); } - RULE_ID{ after(grammarAccess.getGreetingAccess().getNameIDTerminalRuleCall_1_0()); } -) - + ( + { before(grammarAccess.getGreetingAccess().getNameIDTerminalRuleCall_1_0()); } + RULE_ID + { after(grammarAccess.getGreetingAccess().getNameIDTerminalRuleCall_1_0()); } + ) ; finally { restoreStackSize(stackSize); } - RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; RULE_INT : ('0'..'9')+; @@ -256,5 +223,3 @@ RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; RULE_WS : (' '|'\t'|'\r'|'\n')+; RULE_ANY_OTHER : .; - - diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguage.tokens b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguage.tokens similarity index 100% rename from com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguage.tokens rename to com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguage.tokens diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguageLexer.java b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguageLexer.java similarity index 89% rename from com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguageLexer.java rename to com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguageLexer.java index d3b169c64d..e786e88f67 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguageLexer.java +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguageLexer.java @@ -1,8 +1,8 @@ -package com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal; +package com.avaloq.tools.ddk.check.ide.contentassist.antlr.internal; // Hack: Use our own Lexer superclass by means of import. // Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer; +import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer; import org.antlr.runtime.*; @@ -82,10 +82,10 @@ public final void mRULE_ID() throws RecognitionException { try { int _type = RULE_ID; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:246:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // InternalTestLanguage.g:246:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalTestLanguage.g:213:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + // InternalTestLanguage.g:213:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* { - // InternalTestLanguage.g:246:11: ( '^' )? + // InternalTestLanguage.g:213:11: ( '^' )? int alt1=2; int LA1_0 = input.LA(1); @@ -94,7 +94,7 @@ public final void mRULE_ID() throws RecognitionException { } switch (alt1) { case 1 : - // InternalTestLanguage.g:246:11: '^' + // InternalTestLanguage.g:213:11: '^' { match('^'); @@ -112,7 +112,7 @@ public final void mRULE_ID() throws RecognitionException { recover(mse); throw mse;} - // InternalTestLanguage.g:246:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalTestLanguage.g:213:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* loop2: do { int alt2=2; @@ -161,10 +161,10 @@ public final void mRULE_INT() throws RecognitionException { try { int _type = RULE_INT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:248:10: ( ( '0' .. '9' )+ ) - // InternalTestLanguage.g:248:12: ( '0' .. '9' )+ + // InternalTestLanguage.g:215:10: ( ( '0' .. '9' )+ ) + // InternalTestLanguage.g:215:12: ( '0' .. '9' )+ { - // InternalTestLanguage.g:248:12: ( '0' .. '9' )+ + // InternalTestLanguage.g:215:12: ( '0' .. '9' )+ int cnt3=0; loop3: do { @@ -178,7 +178,7 @@ public final void mRULE_INT() throws RecognitionException { switch (alt3) { case 1 : - // InternalTestLanguage.g:248:13: '0' .. '9' + // InternalTestLanguage.g:215:13: '0' .. '9' { matchRange('0','9'); @@ -210,10 +210,10 @@ public final void mRULE_STRING() throws RecognitionException { try { int _type = RULE_STRING; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:250:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // InternalTestLanguage.g:250:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalTestLanguage.g:217:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) + // InternalTestLanguage.g:217:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) { - // InternalTestLanguage.g:250:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalTestLanguage.g:217:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) int alt6=2; int LA6_0 = input.LA(1); @@ -231,10 +231,10 @@ else if ( (LA6_0=='\'') ) { } switch (alt6) { case 1 : - // InternalTestLanguage.g:250:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' + // InternalTestLanguage.g:217:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' { match('\"'); - // InternalTestLanguage.g:250:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* + // InternalTestLanguage.g:217:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* loop4: do { int alt4=3; @@ -250,7 +250,7 @@ else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>= switch (alt4) { case 1 : - // InternalTestLanguage.g:250:21: '\\\\' . + // InternalTestLanguage.g:217:21: '\\\\' . { match('\\'); matchAny(); @@ -258,7 +258,7 @@ else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>= } break; case 2 : - // InternalTestLanguage.g:250:28: ~ ( ( '\\\\' | '\"' ) ) + // InternalTestLanguage.g:217:28: ~ ( ( '\\\\' | '\"' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -283,10 +283,10 @@ else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>= } break; case 2 : - // InternalTestLanguage.g:250:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' + // InternalTestLanguage.g:217:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' { match('\''); - // InternalTestLanguage.g:250:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* + // InternalTestLanguage.g:217:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* loop5: do { int alt5=3; @@ -302,7 +302,7 @@ else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>= switch (alt5) { case 1 : - // InternalTestLanguage.g:250:54: '\\\\' . + // InternalTestLanguage.g:217:54: '\\\\' . { match('\\'); matchAny(); @@ -310,7 +310,7 @@ else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>= } break; case 2 : - // InternalTestLanguage.g:250:61: ~ ( ( '\\\\' | '\\'' ) ) + // InternalTestLanguage.g:217:61: ~ ( ( '\\\\' | '\\'' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -353,12 +353,12 @@ public final void mRULE_ML_COMMENT() throws RecognitionException { try { int _type = RULE_ML_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:252:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // InternalTestLanguage.g:252:19: '/*' ( options {greedy=false; } : . )* '*/' + // InternalTestLanguage.g:219:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) + // InternalTestLanguage.g:219:19: '/*' ( options {greedy=false; } : . )* '*/' { match("/*"); - // InternalTestLanguage.g:252:24: ( options {greedy=false; } : . )* + // InternalTestLanguage.g:219:24: ( options {greedy=false; } : . )* loop7: do { int alt7=2; @@ -383,7 +383,7 @@ else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) { switch (alt7) { case 1 : - // InternalTestLanguage.g:252:52: . + // InternalTestLanguage.g:219:52: . { matchAny(); @@ -413,12 +413,12 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { try { int _type = RULE_SL_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:254:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // InternalTestLanguage.g:254:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? + // InternalTestLanguage.g:221:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) + // InternalTestLanguage.g:221:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? { match("//"); - // InternalTestLanguage.g:254:24: (~ ( ( '\\n' | '\\r' ) ) )* + // InternalTestLanguage.g:221:24: (~ ( ( '\\n' | '\\r' ) ) )* loop8: do { int alt8=2; @@ -431,7 +431,7 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { switch (alt8) { case 1 : - // InternalTestLanguage.g:254:24: ~ ( ( '\\n' | '\\r' ) ) + // InternalTestLanguage.g:221:24: ~ ( ( '\\n' | '\\r' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -451,7 +451,7 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { } } while (true); - // InternalTestLanguage.g:254:40: ( ( '\\r' )? '\\n' )? + // InternalTestLanguage.g:221:40: ( ( '\\r' )? '\\n' )? int alt10=2; int LA10_0 = input.LA(1); @@ -460,9 +460,9 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { } switch (alt10) { case 1 : - // InternalTestLanguage.g:254:41: ( '\\r' )? '\\n' + // InternalTestLanguage.g:221:41: ( '\\r' )? '\\n' { - // InternalTestLanguage.g:254:41: ( '\\r' )? + // InternalTestLanguage.g:221:41: ( '\\r' )? int alt9=2; int LA9_0 = input.LA(1); @@ -471,7 +471,7 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { } switch (alt9) { case 1 : - // InternalTestLanguage.g:254:41: '\\r' + // InternalTestLanguage.g:221:41: '\\r' { match('\r'); @@ -503,10 +503,10 @@ public final void mRULE_WS() throws RecognitionException { try { int _type = RULE_WS; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:256:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // InternalTestLanguage.g:256:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalTestLanguage.g:223:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) + // InternalTestLanguage.g:223:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ { - // InternalTestLanguage.g:256:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalTestLanguage.g:223:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ int cnt11=0; loop11: do { @@ -560,8 +560,8 @@ public final void mRULE_ANY_OTHER() throws RecognitionException { try { int _type = RULE_ANY_OTHER; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:258:16: ( . ) - // InternalTestLanguage.g:258:18: . + // InternalTestLanguage.g:225:16: ( . ) + // InternalTestLanguage.g:225:18: . { matchAny(); diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguageParser.java b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguageParser.java similarity index 73% rename from com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguageParser.java rename to com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguageParser.java index 8937b0bcdc..67a6c4af41 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/internal/InternalTestLanguageParser.java +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/src-gen/com/avaloq/tools/ddk/check/ide/contentassist/antlr/internal/InternalTestLanguageParser.java @@ -1,4 +1,4 @@ -package com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal; +package com.avaloq.tools.ddk.check.ide.contentassist.antlr.internal; import java.io.InputStream; import org.eclipse.xtext.*; @@ -8,8 +8,8 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.parser.antlr.XtextTokenStream; import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA; +import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; +import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.DFA; import com.avaloq.tools.ddk.check.services.TestLanguageGrammarAccess; @@ -52,32 +52,30 @@ public InternalTestLanguageParser(TokenStream input, RecognizerSharedState state public String getGrammarFileName() { return "InternalTestLanguage.g"; } - - private TestLanguageGrammarAccess grammarAccess; - - public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } - - @Override - protected Grammar getGrammar() { - return grammarAccess.getGrammar(); - } - - @Override - protected String getValueForTokenName(String tokenName) { - return tokenName; - } + private TestLanguageGrammarAccess grammarAccess; + + public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) { + this.grammarAccess = grammarAccess; + } + + @Override + protected Grammar getGrammar() { + return grammarAccess.getGrammar(); + } + @Override + protected String getValueForTokenName(String tokenName) { + return tokenName; + } // $ANTLR start "entryRuleModel" - // InternalTestLanguage.g:60:1: entryRuleModel : ruleModel EOF ; + // InternalTestLanguage.g:53:1: entryRuleModel : ruleModel EOF ; public final void entryRuleModel() throws RecognitionException { try { - // InternalTestLanguage.g:61:1: ( ruleModel EOF ) - // InternalTestLanguage.g:62:1: ruleModel EOF + // InternalTestLanguage.g:54:1: ( ruleModel EOF ) + // InternalTestLanguage.g:55:1: ruleModel EOF { before(grammarAccess.getModelRule()); pushFollow(FOLLOW_1); @@ -103,20 +101,20 @@ public final void entryRuleModel() throws RecognitionException { // $ANTLR start "ruleModel" - // InternalTestLanguage.g:69:1: ruleModel : ( ( rule__Model__GreetingsAssignment )* ) ; + // InternalTestLanguage.g:62:1: ruleModel : ( ( rule__Model__GreetingsAssignment )* ) ; public final void ruleModel() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:73:2: ( ( ( rule__Model__GreetingsAssignment )* ) ) - // InternalTestLanguage.g:74:1: ( ( rule__Model__GreetingsAssignment )* ) + // InternalTestLanguage.g:66:2: ( ( ( rule__Model__GreetingsAssignment )* ) ) + // InternalTestLanguage.g:67:2: ( ( rule__Model__GreetingsAssignment )* ) { - // InternalTestLanguage.g:74:1: ( ( rule__Model__GreetingsAssignment )* ) - // InternalTestLanguage.g:75:1: ( rule__Model__GreetingsAssignment )* + // InternalTestLanguage.g:67:2: ( ( rule__Model__GreetingsAssignment )* ) + // InternalTestLanguage.g:68:3: ( rule__Model__GreetingsAssignment )* { before(grammarAccess.getModelAccess().getGreetingsAssignment()); - // InternalTestLanguage.g:76:1: ( rule__Model__GreetingsAssignment )* + // InternalTestLanguage.g:69:3: ( rule__Model__GreetingsAssignment )* loop1: do { int alt1=2; @@ -129,7 +127,7 @@ public final void ruleModel() throws RecognitionException { switch (alt1) { case 1 : - // InternalTestLanguage.g:76:2: rule__Model__GreetingsAssignment + // InternalTestLanguage.g:69:4: rule__Model__GreetingsAssignment { pushFollow(FOLLOW_3); rule__Model__GreetingsAssignment(); @@ -168,11 +166,11 @@ public final void ruleModel() throws RecognitionException { // $ANTLR start "entryRuleGreeting" - // InternalTestLanguage.g:88:1: entryRuleGreeting : ruleGreeting EOF ; + // InternalTestLanguage.g:78:1: entryRuleGreeting : ruleGreeting EOF ; public final void entryRuleGreeting() throws RecognitionException { try { - // InternalTestLanguage.g:89:1: ( ruleGreeting EOF ) - // InternalTestLanguage.g:90:1: ruleGreeting EOF + // InternalTestLanguage.g:79:1: ( ruleGreeting EOF ) + // InternalTestLanguage.g:80:1: ruleGreeting EOF { before(grammarAccess.getGreetingRule()); pushFollow(FOLLOW_1); @@ -198,21 +196,21 @@ public final void entryRuleGreeting() throws RecognitionException { // $ANTLR start "ruleGreeting" - // InternalTestLanguage.g:97:1: ruleGreeting : ( ( rule__Greeting__Group__0 ) ) ; + // InternalTestLanguage.g:87:1: ruleGreeting : ( ( rule__Greeting__Group__0 ) ) ; public final void ruleGreeting() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:101:2: ( ( ( rule__Greeting__Group__0 ) ) ) - // InternalTestLanguage.g:102:1: ( ( rule__Greeting__Group__0 ) ) + // InternalTestLanguage.g:91:2: ( ( ( rule__Greeting__Group__0 ) ) ) + // InternalTestLanguage.g:92:2: ( ( rule__Greeting__Group__0 ) ) { - // InternalTestLanguage.g:102:1: ( ( rule__Greeting__Group__0 ) ) - // InternalTestLanguage.g:103:1: ( rule__Greeting__Group__0 ) + // InternalTestLanguage.g:92:2: ( ( rule__Greeting__Group__0 ) ) + // InternalTestLanguage.g:93:3: ( rule__Greeting__Group__0 ) { before(grammarAccess.getGreetingAccess().getGroup()); - // InternalTestLanguage.g:104:1: ( rule__Greeting__Group__0 ) - // InternalTestLanguage.g:104:2: rule__Greeting__Group__0 + // InternalTestLanguage.g:94:3: ( rule__Greeting__Group__0 ) + // InternalTestLanguage.g:94:4: rule__Greeting__Group__0 { pushFollow(FOLLOW_2); rule__Greeting__Group__0(); @@ -245,14 +243,14 @@ public final void ruleGreeting() throws RecognitionException { // $ANTLR start "rule__Greeting__Group__0" - // InternalTestLanguage.g:118:1: rule__Greeting__Group__0 : rule__Greeting__Group__0__Impl rule__Greeting__Group__1 ; + // InternalTestLanguage.g:102:1: rule__Greeting__Group__0 : rule__Greeting__Group__0__Impl rule__Greeting__Group__1 ; public final void rule__Greeting__Group__0() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:122:1: ( rule__Greeting__Group__0__Impl rule__Greeting__Group__1 ) - // InternalTestLanguage.g:123:2: rule__Greeting__Group__0__Impl rule__Greeting__Group__1 + // InternalTestLanguage.g:106:1: ( rule__Greeting__Group__0__Impl rule__Greeting__Group__1 ) + // InternalTestLanguage.g:107:2: rule__Greeting__Group__0__Impl rule__Greeting__Group__1 { pushFollow(FOLLOW_4); rule__Greeting__Group__0__Impl(); @@ -283,17 +281,17 @@ public final void rule__Greeting__Group__0() throws RecognitionException { // $ANTLR start "rule__Greeting__Group__0__Impl" - // InternalTestLanguage.g:130:1: rule__Greeting__Group__0__Impl : ( 'Hello' ) ; + // InternalTestLanguage.g:114:1: rule__Greeting__Group__0__Impl : ( 'Hello' ) ; public final void rule__Greeting__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:134:1: ( ( 'Hello' ) ) - // InternalTestLanguage.g:135:1: ( 'Hello' ) + // InternalTestLanguage.g:118:1: ( ( 'Hello' ) ) + // InternalTestLanguage.g:119:1: ( 'Hello' ) { - // InternalTestLanguage.g:135:1: ( 'Hello' ) - // InternalTestLanguage.g:136:1: 'Hello' + // InternalTestLanguage.g:119:1: ( 'Hello' ) + // InternalTestLanguage.g:120:2: 'Hello' { before(grammarAccess.getGreetingAccess().getHelloKeyword_0()); match(input,11,FOLLOW_2); @@ -320,14 +318,14 @@ public final void rule__Greeting__Group__0__Impl() throws RecognitionException { // $ANTLR start "rule__Greeting__Group__1" - // InternalTestLanguage.g:149:1: rule__Greeting__Group__1 : rule__Greeting__Group__1__Impl rule__Greeting__Group__2 ; + // InternalTestLanguage.g:129:1: rule__Greeting__Group__1 : rule__Greeting__Group__1__Impl rule__Greeting__Group__2 ; public final void rule__Greeting__Group__1() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:153:1: ( rule__Greeting__Group__1__Impl rule__Greeting__Group__2 ) - // InternalTestLanguage.g:154:2: rule__Greeting__Group__1__Impl rule__Greeting__Group__2 + // InternalTestLanguage.g:133:1: ( rule__Greeting__Group__1__Impl rule__Greeting__Group__2 ) + // InternalTestLanguage.g:134:2: rule__Greeting__Group__1__Impl rule__Greeting__Group__2 { pushFollow(FOLLOW_5); rule__Greeting__Group__1__Impl(); @@ -358,21 +356,21 @@ public final void rule__Greeting__Group__1() throws RecognitionException { // $ANTLR start "rule__Greeting__Group__1__Impl" - // InternalTestLanguage.g:161:1: rule__Greeting__Group__1__Impl : ( ( rule__Greeting__NameAssignment_1 ) ) ; + // InternalTestLanguage.g:141:1: rule__Greeting__Group__1__Impl : ( ( rule__Greeting__NameAssignment_1 ) ) ; public final void rule__Greeting__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:165:1: ( ( ( rule__Greeting__NameAssignment_1 ) ) ) - // InternalTestLanguage.g:166:1: ( ( rule__Greeting__NameAssignment_1 ) ) + // InternalTestLanguage.g:145:1: ( ( ( rule__Greeting__NameAssignment_1 ) ) ) + // InternalTestLanguage.g:146:1: ( ( rule__Greeting__NameAssignment_1 ) ) { - // InternalTestLanguage.g:166:1: ( ( rule__Greeting__NameAssignment_1 ) ) - // InternalTestLanguage.g:167:1: ( rule__Greeting__NameAssignment_1 ) + // InternalTestLanguage.g:146:1: ( ( rule__Greeting__NameAssignment_1 ) ) + // InternalTestLanguage.g:147:2: ( rule__Greeting__NameAssignment_1 ) { before(grammarAccess.getGreetingAccess().getNameAssignment_1()); - // InternalTestLanguage.g:168:1: ( rule__Greeting__NameAssignment_1 ) - // InternalTestLanguage.g:168:2: rule__Greeting__NameAssignment_1 + // InternalTestLanguage.g:148:2: ( rule__Greeting__NameAssignment_1 ) + // InternalTestLanguage.g:148:3: rule__Greeting__NameAssignment_1 { pushFollow(FOLLOW_2); rule__Greeting__NameAssignment_1(); @@ -405,14 +403,14 @@ public final void rule__Greeting__Group__1__Impl() throws RecognitionException { // $ANTLR start "rule__Greeting__Group__2" - // InternalTestLanguage.g:178:1: rule__Greeting__Group__2 : rule__Greeting__Group__2__Impl ; + // InternalTestLanguage.g:156:1: rule__Greeting__Group__2 : rule__Greeting__Group__2__Impl ; public final void rule__Greeting__Group__2() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:182:1: ( rule__Greeting__Group__2__Impl ) - // InternalTestLanguage.g:183:2: rule__Greeting__Group__2__Impl + // InternalTestLanguage.g:160:1: ( rule__Greeting__Group__2__Impl ) + // InternalTestLanguage.g:161:2: rule__Greeting__Group__2__Impl { pushFollow(FOLLOW_2); rule__Greeting__Group__2__Impl(); @@ -438,17 +436,17 @@ public final void rule__Greeting__Group__2() throws RecognitionException { // $ANTLR start "rule__Greeting__Group__2__Impl" - // InternalTestLanguage.g:189:1: rule__Greeting__Group__2__Impl : ( '!' ) ; + // InternalTestLanguage.g:167:1: rule__Greeting__Group__2__Impl : ( '!' ) ; public final void rule__Greeting__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:193:1: ( ( '!' ) ) - // InternalTestLanguage.g:194:1: ( '!' ) + // InternalTestLanguage.g:171:1: ( ( '!' ) ) + // InternalTestLanguage.g:172:1: ( '!' ) { - // InternalTestLanguage.g:194:1: ( '!' ) - // InternalTestLanguage.g:195:1: '!' + // InternalTestLanguage.g:172:1: ( '!' ) + // InternalTestLanguage.g:173:2: '!' { before(grammarAccess.getGreetingAccess().getExclamationMarkKeyword_2()); match(input,12,FOLLOW_2); @@ -475,17 +473,17 @@ public final void rule__Greeting__Group__2__Impl() throws RecognitionException { // $ANTLR start "rule__Model__GreetingsAssignment" - // InternalTestLanguage.g:215:1: rule__Model__GreetingsAssignment : ( ruleGreeting ) ; + // InternalTestLanguage.g:183:1: rule__Model__GreetingsAssignment : ( ruleGreeting ) ; public final void rule__Model__GreetingsAssignment() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:219:1: ( ( ruleGreeting ) ) - // InternalTestLanguage.g:220:1: ( ruleGreeting ) + // InternalTestLanguage.g:187:1: ( ( ruleGreeting ) ) + // InternalTestLanguage.g:188:2: ( ruleGreeting ) { - // InternalTestLanguage.g:220:1: ( ruleGreeting ) - // InternalTestLanguage.g:221:1: ruleGreeting + // InternalTestLanguage.g:188:2: ( ruleGreeting ) + // InternalTestLanguage.g:189:3: ruleGreeting { before(grammarAccess.getModelAccess().getGreetingsGreetingParserRuleCall_0()); pushFollow(FOLLOW_2); @@ -516,17 +514,17 @@ public final void rule__Model__GreetingsAssignment() throws RecognitionException // $ANTLR start "rule__Greeting__NameAssignment_1" - // InternalTestLanguage.g:230:1: rule__Greeting__NameAssignment_1 : ( RULE_ID ) ; + // InternalTestLanguage.g:198:1: rule__Greeting__NameAssignment_1 : ( RULE_ID ) ; public final void rule__Greeting__NameAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); - + try { - // InternalTestLanguage.g:234:1: ( ( RULE_ID ) ) - // InternalTestLanguage.g:235:1: ( RULE_ID ) + // InternalTestLanguage.g:202:1: ( ( RULE_ID ) ) + // InternalTestLanguage.g:203:2: ( RULE_ID ) { - // InternalTestLanguage.g:235:1: ( RULE_ID ) - // InternalTestLanguage.g:236:1: RULE_ID + // InternalTestLanguage.g:203:2: ( RULE_ID ) + // InternalTestLanguage.g:204:3: RULE_ID { before(grammarAccess.getGreetingAccess().getNameIDTerminalRuleCall_1_0()); match(input,RULE_ID,FOLLOW_2); diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/src/com/avaloq/tools/ddk/check/ide/TestLanguageIdeModule.java b/com.avaloq.tools.ddk.check.test.runtime.ide/src/com/avaloq/tools/ddk/check/ide/TestLanguageIdeModule.java new file mode 100644 index 0000000000..484e9849c6 --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/src/com/avaloq/tools/ddk/check/ide/TestLanguageIdeModule.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright (c) 2026 Avaloq Group AG and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Avaloq Group AG - initial API and implementation + *******************************************************************************/ +package com.avaloq.tools.ddk.check.ide; + +/** + * Use this class to register ide components. + */ +public class TestLanguageIdeModule extends AbstractTestLanguageIdeModule { +} diff --git a/com.avaloq.tools.ddk.check.test.runtime.ide/src/com/avaloq/tools/ddk/check/ide/TestLanguageIdeSetup.java b/com.avaloq.tools.ddk.check.test.runtime.ide/src/com/avaloq/tools/ddk/check/ide/TestLanguageIdeSetup.java new file mode 100644 index 0000000000..edccb3ef4a --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime.ide/src/com/avaloq/tools/ddk/check/ide/TestLanguageIdeSetup.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2026 Avaloq Group AG and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Avaloq Group AG - initial API and implementation + *******************************************************************************/ +package com.avaloq.tools.ddk.check.ide; + +import org.eclipse.xtext.util.Modules2; + +import com.avaloq.tools.ddk.check.TestLanguageRuntimeModule; +import com.avaloq.tools.ddk.check.TestLanguageStandaloneSetup; +import com.google.inject.Guice; +import com.google.inject.Injector; + + +/** + * Initialization support for running Xtext languages as language servers. + */ +public class TestLanguageIdeSetup extends TestLanguageStandaloneSetup { + + @Override + public Injector createInjector() { + return Guice.createInjector(Modules2.mixin(new TestLanguageRuntimeModule(), new TestLanguageIdeModule())); + } + +} diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/META-INF/MANIFEST.MF b/com.avaloq.tools.ddk.check.test.runtime.ui/META-INF/MANIFEST.MF index e4dab8ba64..112906c529 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/META-INF/MANIFEST.MF +++ b/com.avaloq.tools.ddk.check.test.runtime.ui/META-INF/MANIFEST.MF @@ -6,6 +6,7 @@ Bundle-Version: 17.3.1.qualifier Bundle-SymbolicName: com.avaloq.tools.ddk.check.test.runtime.ui; singleton:=true Bundle-ActivationPolicy: lazy Require-Bundle: com.avaloq.tools.ddk.check.test.runtime;visibility:=reexport, + com.avaloq.tools.ddk.check.test.runtime.ide, org.eclipse.xtext.ui, org.eclipse.ui.editors;bundle-version="3.5.0", org.eclipse.ui.ide;bundle-version="3.5.0", @@ -14,16 +15,14 @@ Require-Bundle: com.avaloq.tools.ddk.check.test.runtime;visibility:=reexport, org.eclipse.xtext.builder, org.antlr.runtime, org.eclipse.xtext.common.types.ui, - org.eclipse.xtext.ui.codetemplates.ui, org.eclipse.compare, - com.avaloq.tools.ddk.check.runtime.core + com.avaloq.tools.ddk.check.runtime.core, + org.eclipse.xtext.ui.codetemplates.ui Import-Package: org.apache.commons.logging, org.apache.log4j Bundle-RequiredExecutionEnvironment: JavaSE-21 -Export-Package: com.avaloq.tools.ddk.check.ui.contentassist.antlr, - com.avaloq.tools.ddk.check.ui.internal, - com.avaloq.tools.ddk.check.ui.contentassist, +Export-Package: com.avaloq.tools.ddk.check.ui.internal, com.avaloq.tools.ddk.check.ui.quickfix, - com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal + com.avaloq.tools.ddk.check.ui.contentassist Bundle-Activator: com.avaloq.tools.ddk.check.ui.internal.TestLanguageActivator Automatic-Module-Name: com.avaloq.tools.ddk.check.test.runtime.ui diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/plugin.xml_gen b/com.avaloq.tools.ddk.check.test.runtime.ui/plugin.xml_gen index ca03735452..01eca6a1b3 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/plugin.xml_gen +++ b/com.avaloq.tools.ddk.check.test.runtime.ui/plugin.xml_gen @@ -1,293 +1,290 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - + + + + + + + + + + + + - - + point="org.eclipse.emf.ecore.extension_parser"> + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - + + + @@ -295,16 +292,15 @@ - - - + + + - - @@ -334,37 +330,37 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - @@ -374,52 +370,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/AbstractTestLanguageUiModule.java b/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/AbstractTestLanguageUiModule.java index 6ab4822043..eb9e799f84 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/AbstractTestLanguageUiModule.java +++ b/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/AbstractTestLanguageUiModule.java @@ -1,201 +1,286 @@ - /* * generated by Xtext */ package com.avaloq.tools.ddk.check.ui; +import com.avaloq.tools.ddk.check.ide.contentassist.antlr.PartialTestLanguageContentAssistParser; +import com.avaloq.tools.ddk.check.ide.contentassist.antlr.TestLanguageParser; +import com.avaloq.tools.ddk.check.ide.contentassist.antlr.internal.InternalTestLanguageLexer; +import com.avaloq.tools.ddk.check.ui.contentassist.TestLanguageProposalProvider; +import com.avaloq.tools.ddk.check.ui.labeling.TestLanguageDescriptionLabelProvider; +import com.avaloq.tools.ddk.check.ui.labeling.TestLanguageLabelProvider; +import com.avaloq.tools.ddk.check.ui.outline.TestLanguageOutlineTreeProvider; +import com.avaloq.tools.ddk.check.ui.quickfix.TestLanguageQuickfixProvider; +import com.google.inject.Binder; +import com.google.inject.Provider; +import com.google.inject.name.Names; +import org.eclipse.compare.IViewerCreator; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.eclipse.xtext.builder.BuilderParticipant; +import org.eclipse.xtext.builder.EclipseOutputConfigurationProvider; +import org.eclipse.xtext.builder.IXtextBuilderParticipant; +import org.eclipse.xtext.builder.builderState.IBuilderState; +import org.eclipse.xtext.builder.clustering.CurrentDescriptions; +import org.eclipse.xtext.builder.impl.PersistentDataAwareDirtyResource; +import org.eclipse.xtext.builder.nature.NatureAddingEditorCallback; +import org.eclipse.xtext.builder.preferences.BuilderPreferenceAccess; +import org.eclipse.xtext.common.types.ui.DefaultCommonTypesUiModule; +import org.eclipse.xtext.generator.IContextualOutputConfigurationProvider; +import org.eclipse.xtext.ide.LexerIdeBindings; +import org.eclipse.xtext.ide.editor.contentassist.antlr.IContentAssistParser; +import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer; +import org.eclipse.xtext.ide.editor.partialEditing.IPartialEditingContentAssistParser; +import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider; +import org.eclipse.xtext.parser.antlr.ITokenDefProvider; +import org.eclipse.xtext.parser.antlr.LexerProvider; +import org.eclipse.xtext.resource.IResourceDescriptions; +import org.eclipse.xtext.resource.containers.IAllContainersState; +import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider; +import org.eclipse.xtext.service.SingletonBinding; +import org.eclipse.xtext.ui.UIBindings; +import org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator; +import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialEditingContentAssistContextFactory; +import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.PartialEditingContentAssistContextFactory; +import org.eclipse.xtext.ui.codetemplates.ui.preferences.AdvancedTemplatesPreferencePage; +import org.eclipse.xtext.ui.codetemplates.ui.preferences.TemplatesLanguageConfiguration; +import org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistrar; +import org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistry; +import org.eclipse.xtext.ui.compare.DefaultViewerCreator; +import org.eclipse.xtext.ui.editor.DocumentBasedDirtyResource; +import org.eclipse.xtext.ui.editor.IXtextEditorCallback; +import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext; +import org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher; +import org.eclipse.xtext.ui.editor.contentassist.IContentProposalProvider; +import org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper; +import org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher; +import org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper; +import org.eclipse.xtext.ui.editor.contentassist.antlr.DelegatingContentAssistContextFactory; +import org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider; +import org.eclipse.xtext.ui.editor.outline.impl.IOutlineTreeStructureProvider; +import org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer; +import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionProvider; +import org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage; +import org.eclipse.xtext.ui.refactoring.IDependentElementsCalculator; +import org.eclipse.xtext.ui.refactoring.IReferenceUpdater; +import org.eclipse.xtext.ui.refactoring.IRenameRefactoringProvider; +import org.eclipse.xtext.ui.refactoring.IRenameStrategy; +import org.eclipse.xtext.ui.refactoring.impl.DefaultDependentElementsCalculator; +import org.eclipse.xtext.ui.refactoring.impl.DefaultReferenceUpdater; +import org.eclipse.xtext.ui.refactoring.impl.DefaultRenameRefactoringProvider; +import org.eclipse.xtext.ui.refactoring.impl.DefaultRenameStrategy; +import org.eclipse.xtext.ui.refactoring.ui.DefaultRenameSupport; +import org.eclipse.xtext.ui.refactoring.ui.IRenameSupport; +import org.eclipse.xtext.ui.refactoring.ui.RefactoringPreferences; +import org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider; +import org.eclipse.xtext.ui.shared.Access; /** - * Manual modifications go to {com.avaloq.tools.ddk.check.ui.TestLanguageUiModule} + * Manual modifications go to {@link TestLanguageUiModule}. */ @SuppressWarnings("all") -public abstract class AbstractTestLanguageUiModule extends org.eclipse.xtext.common.types.ui.DefaultCommonTypesUiModule { - +public abstract class AbstractTestLanguageUiModule extends DefaultCommonTypesUiModule { + public AbstractTestLanguageUiModule(AbstractUIPlugin plugin) { super(plugin); } + // contributed by org.eclipse.xtext.xtext.generator.ImplicitFragment + public Provider provideIAllContainersState() { + return Access.getJavaProjectsState(); + } - // contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment - public com.google.inject.Provider provideIAllContainersState() { - return org.eclipse.xtext.ui.shared.Access.getJavaProjectsState(); + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindIProposalConflictHelper() { + return AntlrProposalConflictHelper.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindIProposalConflictHelper() { - return org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper.class; + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public void configureContentAssistLexer(Binder binder) { + binder.bind(Lexer.class) + .annotatedWith(Names.named(LexerIdeBindings.CONTENT_ASSIST)) + .to(InternalTestLanguageLexer.class); } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public void configureHighlightingLexer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING)).to(com.avaloq.tools.ddk.check.parser.antlr.internal.InternalTestLanguageLexer.class); + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public void configureHighlightingLexer(Binder binder) { + binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class) + .annotatedWith(Names.named(LexerIdeBindings.HIGHLIGHTING)) + .to(com.avaloq.tools.ddk.check.parser.antlr.internal.InternalTestLanguageLexer.class); } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public void configureHighlightingTokenDefProvider(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.parser.antlr.ITokenDefProvider.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING)).to(org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class); + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public void configureHighlightingTokenDefProvider(Binder binder) { + binder.bind(ITokenDefProvider.class) + .annotatedWith(Names.named(LexerIdeBindings.HIGHLIGHTING)) + .to(AntlrTokenDefProvider.class); } - - // contributed by org.eclipse.xtext.generator.exporting.QualifiedNamesFragment - public Class bindIDependentElementsCalculator() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultDependentElementsCalculator.class; + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindContentAssistContext$Factory() { + return DelegatingContentAssistContextFactory.class; } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptionsBuilderScope(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE)).to(org.eclipse.xtext.builder.clustering.CurrentDescriptions.ResourceSetAware.class); + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindIContentAssistParser() { + return TestLanguageParser.class; } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIXtextEditorCallback() { - return org.eclipse.xtext.builder.nature.NatureAddingEditorCallback.class; + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public void configureContentAssistLexerProvider(Binder binder) { + binder.bind(InternalTestLanguageLexer.class).toProvider(LexerProvider.create(InternalTestLanguageLexer.class)); } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIContextualOutputConfigurationProvider() { - return org.eclipse.xtext.builder.EclipseOutputConfigurationProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2 + public Class bindIDependentElementsCalculator() { + return DefaultDependentElementsCalculator.class; } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptionsPersisted(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(org.eclipse.xtext.builder.builderState.IBuilderState.class); + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public void configureIResourceDescriptionsBuilderScope(Binder binder) { + binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE)).to(CurrentDescriptions.ResourceSetAware.class); } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindDocumentBasedDirtyResource() { - return org.eclipse.xtext.builder.impl.PersistentDataAwareDirtyResource.class; + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public Class bindIXtextEditorCallback() { + return NatureAddingEditorCallback.class; } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public Class bindIXtextBuilderParticipant() { - return org.eclipse.xtext.builder.BuilderParticipant.class; + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public Class bindIContextualOutputConfigurationProvider() { + return EclipseOutputConfigurationProvider.class; } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public org.eclipse.core.resources.IWorkspaceRoot bindIWorkspaceRootToInstance() { - return org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot(); + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public void configureIResourceDescriptionsPersisted(Binder binder) { + binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(IBuilderState.class); } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public void configureBuilderPreferenceStoreInitializer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class).annotatedWith(com.google.inject.name.Names.named("builderPreferenceInitializer")).to(org.eclipse.xtext.builder.preferences.BuilderPreferenceAccess.Initializer.class); + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public Class bindDocumentBasedDirtyResource() { + return PersistentDataAwareDirtyResource.class; } - - // contributed by org.eclipse.xtext.ui.generator.labeling.LabelProviderFragment - public Class bindILabelProvider() { - return com.avaloq.tools.ddk.check.ui.labeling.TestLanguageLabelProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2 + public Class bindIXtextBuilderParticipant() { + return BuilderParticipant.class; } - - // contributed by org.eclipse.xtext.ui.generator.labeling.LabelProviderFragment - public void configureResourceUIServiceLabelProvider(com.google.inject.Binder binder) { - binder.bind(org.eclipse.jface.viewers.ILabelProvider.class).annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class).to(com.avaloq.tools.ddk.check.ui.labeling.TestLanguageDescriptionLabelProvider.class); + + // contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2 + public IWorkspaceRoot bindIWorkspaceRootToInstance() { + return ResourcesPlugin.getWorkspace().getRoot(); } - - // contributed by org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment - public Class bindIOutlineTreeProvider() { - return com.avaloq.tools.ddk.check.ui.outline.TestLanguageOutlineTreeProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2 + public void configureBuilderPreferenceStoreInitializer(Binder binder) { + binder.bind(IPreferenceStoreInitializer.class) + .annotatedWith(Names.named("builderPreferenceInitializer")) + .to(BuilderPreferenceAccess.Initializer.class); } - - // contributed by org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment - public Class bindIOutlineTreeStructureProvider() { - return com.avaloq.tools.ddk.check.ui.outline.TestLanguageOutlineTreeProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.labeling.LabelProviderFragment2 + public Class bindILabelProvider() { + return TestLanguageLabelProvider.class; } - - // contributed by org.eclipse.xtext.ui.generator.quickfix.QuickfixProviderFragment - public Class bindIssueResolutionProvider() { - return com.avaloq.tools.ddk.check.ui.quickfix.TestLanguageQuickfixProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.labeling.LabelProviderFragment2 + public void configureResourceUIServiceLabelProvider(Binder binder) { + binder.bind(ILabelProvider.class).annotatedWith(ResourceServiceDescriptionLabelProvider.class).to(TestLanguageDescriptionLabelProvider.class); } - - // contributed by org.eclipse.xtext.ui.generator.contentAssist.JavaBasedContentAssistFragment - public Class bindIContentProposalProvider() { - return com.avaloq.tools.ddk.check.ui.contentassist.TestLanguageProposalProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.outline.OutlineTreeProviderFragment2 + public Class bindIOutlineTreeProvider() { + return TestLanguageOutlineTreeProvider.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public Class bindContentAssistContext$Factory() { - return org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.outline.OutlineTreeProviderFragment2 + public Class bindIOutlineTreeStructureProvider() { + return TestLanguageOutlineTreeProvider.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public Class bindIContentAssistParser() { - return com.avaloq.tools.ddk.check.ui.contentassist.antlr.TestLanguageParser.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.quickfix.QuickfixProviderFragment2 + public Class bindIssueResolutionProvider() { + return TestLanguageQuickfixProvider.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public void configureContentAssistLexerProvider(com.google.inject.Binder binder) { - binder.bind(com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal.InternalTestLanguageLexer.class).toProvider(org.eclipse.xtext.parser.antlr.LexerProvider.create(com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal.InternalTestLanguageLexer.class)); + + // contributed by org.eclipse.xtext.xtext.generator.ui.contentAssist.ContentAssistFragment2 + public Class bindIContentProposalProvider() { + return TestLanguageProposalProvider.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public void configureContentAssistLexer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.CONTENT_ASSIST)).to(com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal.InternalTestLanguageLexer.class); + + // contributed by org.eclipse.xtext.xtext.generator.ui.templates.CodetemplatesGeneratorFragment2 + public Provider provideTemplatesLanguageConfiguration() { + return AccessibleCodetemplatesActivator.getTemplatesLanguageConfigurationProvider(); } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindPrefixMatcher() { - return org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.templates.CodetemplatesGeneratorFragment2 + public Provider provideLanguageRegistry() { + return AccessibleCodetemplatesActivator.getLanguageRegistry(); } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public com.google.inject.Provider provideTemplatesLanguageConfiguration() { - return org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getTemplatesLanguageConfigurationProvider(); + + // contributed by org.eclipse.xtext.xtext.generator.ui.templates.CodetemplatesGeneratorFragment2 + @SingletonBinding(eager=true) + public Class bindLanguageRegistrar() { + return LanguageRegistrar.class; } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public com.google.inject.Provider provideLanguageRegistry() { - return org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getLanguageRegistry(); + + // contributed by org.eclipse.xtext.xtext.generator.ui.templates.CodetemplatesGeneratorFragment2 + public Class bindXtextTemplatePreferencePage() { + return AdvancedTemplatesPreferencePage.class; } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - @org.eclipse.xtext.service.SingletonBinding(eager=true) public Class bindLanguageRegistrar() { - return org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistrar.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.templates.CodetemplatesGeneratorFragment2 + public Class bindIPartialEditingContentAssistParser() { + return PartialTestLanguageContentAssistParser.class; } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public Class bindXtextTemplatePreferencePage() { - return org.eclipse.xtext.ui.codetemplates.ui.preferences.AdvancedTemplatesPreferencePage.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.templates.CodetemplatesGeneratorFragment2 + public Class bindIPartialEditingContentAssistContextFactory() { + return PartialEditingContentAssistContextFactory.class; } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public Class bindIPartialContentAssistParser() { - return com.avaloq.tools.ddk.check.ui.contentassist.antlr.PartialTestLanguageContentAssistParser.class; + + // contributed by org.eclipse.xtext.xtext.generator.types.TypesGeneratorFragment2 + public Class bindPrefixMatcher() { + return FQNPrefixMatcher.class; } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIRenameStrategy() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultRenameStrategy.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2 + public void configureIPreferenceStoreInitializer(Binder binder) { + binder.bind(IPreferenceStoreInitializer.class) + .annotatedWith(Names.named("RefactoringPreferences")) + .to(RefactoringPreferences.Initializer.class); } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIReferenceUpdater() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultReferenceUpdater.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2 + public Class bindIRenameStrategy() { + return DefaultRenameStrategy.class; } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public void configureIPreferenceStoreInitializer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class).annotatedWith(com.google.inject.name.Names.named("RefactoringPreferences")).to(org.eclipse.xtext.ui.refactoring.ui.RefactoringPreferences.Initializer.class); + + // contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2 + public Class bindIReferenceUpdater() { + return DefaultReferenceUpdater.class; } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIRenameRefactoringProvider() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultRenameRefactoringProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2 + public Class bindIRenameRefactoringProvider() { + return DefaultRenameRefactoringProvider.class; } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIRenameSupport$Factory() { - return org.eclipse.xtext.ui.refactoring.ui.DefaultRenameSupport.Factory.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2 + public Class bindIRenameSupport$Factory() { + return DefaultRenameSupport.Factory.class; } - - // contributed by org.eclipse.xtext.ui.generator.compare.CompareFragment - public Class bindIViewerCreator() { - return org.eclipse.xtext.ui.compare.DefaultViewerCreator.class; + + // contributed by org.eclipse.xtext.xtext.generator.ui.compare.CompareFragment2 + public Class bindIViewerCreator() { + return DefaultViewerCreator.class; } - - // contributed by org.eclipse.xtext.ui.generator.compare.CompareFragment - public void configureCompareViewerTitle(com.google.inject.Binder binder) { - binder.bind(String.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.UIBindings.COMPARE_VIEWER_TITLE)).toInstance("TestLanguage Compare"); + + // contributed by org.eclipse.xtext.xtext.generator.ui.compare.CompareFragment2 + public void configureCompareViewerTitle(Binder binder) { + binder.bind(String.class).annotatedWith(Names.named(UIBindings.COMPARE_VIEWER_TITLE)).toInstance("TestLanguage Compare"); } - - + } diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/TestLanguageExecutableExtensionFactory.java b/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/TestLanguageExecutableExtensionFactory.java index 31e604a664..21ac19c5e8 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/TestLanguageExecutableExtensionFactory.java +++ b/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/TestLanguageExecutableExtensionFactory.java @@ -3,12 +3,11 @@ */ package com.avaloq.tools.ddk.check.ui; +import com.avaloq.tools.ddk.check.ui.internal.TestLanguageActivator; +import com.google.inject.Injector; import org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory; import org.osgi.framework.Bundle; - -import com.google.inject.Injector; - -import com.avaloq.tools.ddk.check.ui.internal.TestLanguageActivator; +import org.osgi.framework.FrameworkUtil; /** * This class was generated. Customizations should only happen in a newly @@ -18,12 +17,13 @@ public class TestLanguageExecutableExtensionFactory extends AbstractGuiceAwareEx @Override protected Bundle getBundle() { - return TestLanguageActivator.getInstance().getBundle(); + return FrameworkUtil.getBundle(TestLanguageActivator.class); } @Override protected Injector getInjector() { - return TestLanguageActivator.getInstance().getInjector(TestLanguageActivator.COM_AVALOQ_TOOLS_DDK_CHECK_TESTLANGUAGE); + TestLanguageActivator activator = TestLanguageActivator.getInstance(); + return activator != null ? activator.getInjector(TestLanguageActivator.COM_AVALOQ_TOOLS_DDK_CHECK_TESTLANGUAGE) : null; } - + } diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/AbstractTestLanguageProposalProvider.java b/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/AbstractTestLanguageProposalProvider.java index e3289f5ca5..9f937935d4 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/AbstractTestLanguageProposalProvider.java +++ b/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/AbstractTestLanguageProposalProvider.java @@ -4,25 +4,26 @@ package com.avaloq.tools.ddk.check.ui.contentassist; import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.*; -import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; +import org.eclipse.xtext.Assignment; +import org.eclipse.xtext.RuleCall; +import org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider; import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext; +import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; /** - * Represents a generated, default implementation of superclass {@link org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider}. + * Represents a generated, default implementation of superclass {@link TerminalsProposalProvider}. * Methods are dynamically dispatched on the first parameter, i.e., you can override them * with a more concrete subtype. */ -@SuppressWarnings("all") -public class AbstractTestLanguageProposalProvider extends org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider { - +public abstract class AbstractTestLanguageProposalProvider extends TerminalsProposalProvider { + public void completeModel_Greetings(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } public void completeGreeting_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); } - + public void complete_Model(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override } diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/TestLanguageParser.java b/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/TestLanguageParser.java deleted file mode 100644 index e7cbca3c9e..0000000000 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/contentassist/antlr/TestLanguageParser.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * generated by Xtext - */ -package com.avaloq.tools.ddk.check.ui.contentassist.antlr; - -import java.util.Collection; -import java.util.Map; -import java.util.HashMap; - -import org.antlr.runtime.RecognitionException; -import org.eclipse.xtext.AbstractElement; -import org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; - -import com.google.inject.Inject; - -import com.avaloq.tools.ddk.check.services.TestLanguageGrammarAccess; - -public class TestLanguageParser extends AbstractContentAssistParser { - - @Inject - private TestLanguageGrammarAccess grammarAccess; - - private Map nameMappings; - - @Override - protected com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal.InternalTestLanguageParser createParser() { - com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal.InternalTestLanguageParser result = new com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal.InternalTestLanguageParser(null); - result.setGrammarAccess(grammarAccess); - return result; - } - - @Override - protected String getRuleName(AbstractElement element) { - if (nameMappings == null) { - nameMappings = new HashMap() { - private static final long serialVersionUID = 1L; - { - put(grammarAccess.getGreetingAccess().getGroup(), "rule__Greeting__Group__0"); - put(grammarAccess.getModelAccess().getGreetingsAssignment(), "rule__Model__GreetingsAssignment"); - put(grammarAccess.getGreetingAccess().getNameAssignment_1(), "rule__Greeting__NameAssignment_1"); - } - }; - } - return nameMappings.get(element); - } - - @Override - protected Collection getFollowElements(AbstractInternalContentAssistParser parser) { - try { - com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal.InternalTestLanguageParser typedParser = (com.avaloq.tools.ddk.check.ui.contentassist.antlr.internal.InternalTestLanguageParser) parser; - typedParser.entryRuleModel(); - return typedParser.getFollowElements(); - } catch(RecognitionException ex) { - throw new RuntimeException(ex); - } - } - - @Override - protected String[] getInitialHiddenTokens() { - return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" }; - } - - public TestLanguageGrammarAccess getGrammarAccess() { - return this.grammarAccess; - } - - public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } -} diff --git a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/internal/TestLanguageActivator.java b/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/internal/TestLanguageActivator.java index 8ebe1fdc25..7af716cd0b 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/internal/TestLanguageActivator.java +++ b/com.avaloq.tools.ddk.check.test.runtime.ui/src-gen/com/avaloq/tools/ddk/check/ui/internal/TestLanguageActivator.java @@ -3,33 +3,33 @@ */ package com.avaloq.tools.ddk.check.ui.internal; +import com.avaloq.tools.ddk.check.TestLanguageRuntimeModule; +import com.avaloq.tools.ddk.check.ui.TestLanguageUiModule; +import com.google.inject.Guice; +import com.google.inject.Injector; import java.util.Collections; +import java.util.HashMap; import java.util.Map; - import org.apache.log4j.Logger; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.xtext.ui.shared.SharedStateModule; import org.eclipse.xtext.util.Modules2; import org.osgi.framework.BundleContext; -import com.google.common.collect.Maps; -import com.google.inject.Guice; -import com.google.inject.Injector; -import com.google.inject.Module; - /** * This class was generated. Customizations should only happen in a newly * introduced subclass. */ public class TestLanguageActivator extends AbstractUIPlugin { - + + public static final String PLUGIN_ID = "com.avaloq.tools.ddk.check.test.runtime.ui"; public static final String COM_AVALOQ_TOOLS_DDK_CHECK_TESTLANGUAGE = "com.avaloq.tools.ddk.check.TestLanguage"; private static final Logger logger = Logger.getLogger(TestLanguageActivator.class); private static TestLanguageActivator INSTANCE; - private Map injectors = Collections.synchronizedMap(Maps. newHashMapWithExpectedSize(1)); + private Map injectors = Collections.synchronizedMap(new HashMap<>(2)); @Override public void start(BundleContext context) throws Exception { @@ -60,10 +60,10 @@ public Injector getInjector(String language) { protected Injector createInjector(String language) { try { - Module runtimeModule = getRuntimeModule(language); - Module sharedStateModule = getSharedStateModule(); - Module uiModule = getUiModule(language); - Module mergedModule = Modules2.mixin(runtimeModule, sharedStateModule, uiModule); + com.google.inject.Module runtimeModule = getRuntimeModule(language); + com.google.inject.Module sharedStateModule = getSharedStateModule(); + com.google.inject.Module uiModule = getUiModule(language); + com.google.inject.Module mergedModule = Modules2.mixin(runtimeModule, sharedStateModule, uiModule); return Guice.createInjector(mergedModule); } catch (Exception e) { logger.error("Failed to create injector for " + language); @@ -71,25 +71,24 @@ protected Injector createInjector(String language) { throw new RuntimeException("Failed to create injector for " + language, e); } } - - protected Module getRuntimeModule(String grammar) { + + protected com.google.inject.Module getRuntimeModule(String grammar) { if (COM_AVALOQ_TOOLS_DDK_CHECK_TESTLANGUAGE.equals(grammar)) { - return new com.avaloq.tools.ddk.check.TestLanguageRuntimeModule(); + return new TestLanguageRuntimeModule(); } - throw new IllegalArgumentException(grammar); } - protected Module getUiModule(String grammar) { + protected com.google.inject.Module getUiModule(String grammar) { if (COM_AVALOQ_TOOLS_DDK_CHECK_TESTLANGUAGE.equals(grammar)) { - return new com.avaloq.tools.ddk.check.ui.TestLanguageUiModule(this); + return new TestLanguageUiModule(this); } - throw new IllegalArgumentException(grammar); } - protected Module getSharedStateModule() { + protected com.google.inject.Module getSharedStateModule() { return new SharedStateModule(); } + } diff --git a/com.avaloq.tools.ddk.check.test.runtime/GenerateTestLanguage.mwe2.launch b/com.avaloq.tools.ddk.check.test.runtime/GenerateTestLanguage.mwe2.launch index 8bef09dbbd..c23b26a5fb 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/GenerateTestLanguage.mwe2.launch +++ b/com.avaloq.tools.ddk.check.test.runtime/GenerateTestLanguage.mwe2.launch @@ -1,6 +1,6 @@ - + diff --git a/com.avaloq.tools.ddk.check.test.runtime/META-INF/MANIFEST.MF b/com.avaloq.tools.ddk.check.test.runtime/META-INF/MANIFEST.MF index 4fab518092..77b5b99018 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/META-INF/MANIFEST.MF +++ b/com.avaloq.tools.ddk.check.test.runtime/META-INF/MANIFEST.MF @@ -23,11 +23,12 @@ Require-Bundle: org.eclipse.xtext;visibility:=reexport, org.eclipse.core.runtime, com.avaloq.tools.ddk.check.lib, com.avaloq.tools.ddk.check.core, - org.eclipse.xtext.xbase.lib -Import-Package: org.eclipse.xtext.xbase.lib, org.apache.logging.log4j + org.eclipse.xtext.xbase.lib, + org.objectweb.asm;bundle-version="[9.9.1,10.0.0)";resolution:=optional +Import-Package: org.eclipse.xtext.xbase.lib, org.apache.logging.log4j, + org.apache.log4j Bundle-RequiredExecutionEnvironment: JavaSE-21 Export-Package: com.avaloq.tools.ddk.check, - com.avaloq.tools.ddk.check.formatting, com.avaloq.tools.ddk.check.generator, com.avaloq.tools.ddk.check.parser.antlr, com.avaloq.tools.ddk.check.parser.antlr.internal, @@ -37,6 +38,6 @@ Export-Package: com.avaloq.tools.ddk.check, com.avaloq.tools.ddk.check.testLanguage, com.avaloq.tools.ddk.check.testLanguage.impl, com.avaloq.tools.ddk.check.testLanguage.util, - com.avaloq.tools.ddk.check.validation + com.avaloq.tools.ddk.check.validation, + com.avaloq.tools.ddk.check.formatting Automatic-Module-Name: com.avaloq.tools.ddk.check.test.runtime - diff --git a/com.avaloq.tools.ddk.check.test.runtime/plugin.xml_gen b/com.avaloq.tools.ddk.check.test.runtime/plugin.xml_gen index a2613f8756..237577b6ac 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/plugin.xml_gen +++ b/com.avaloq.tools.ddk.check.test.runtime/plugin.xml_gen @@ -1,17 +1,10 @@ - - - - - - - - - - + + + diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/AbstractTestLanguageRuntimeModule.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/AbstractTestLanguageRuntimeModule.java index 7c232dcd9a..221b51e70d 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/AbstractTestLanguageRuntimeModule.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/AbstractTestLanguageRuntimeModule.java @@ -3,18 +3,64 @@ */ package com.avaloq.tools.ddk.check; -import java.util.Properties; - -import org.eclipse.xtext.Constants; - +import com.avaloq.tools.ddk.check.formatting.TestLanguageFormatter; +import com.avaloq.tools.ddk.check.generator.TestLanguageGenerator; +import com.avaloq.tools.ddk.check.parser.antlr.TestLanguageAntlrTokenFileProvider; +import com.avaloq.tools.ddk.check.parser.antlr.TestLanguageParser; +import com.avaloq.tools.ddk.check.parser.antlr.internal.InternalTestLanguageLexer; +import com.avaloq.tools.ddk.check.scoping.TestLanguageScopeProvider; +import com.avaloq.tools.ddk.check.serializer.TestLanguageSemanticSequencer; +import com.avaloq.tools.ddk.check.serializer.TestLanguageSyntacticSequencer; +import com.avaloq.tools.ddk.check.services.TestLanguageGrammarAccess; +import com.avaloq.tools.ddk.check.validation.TestLanguageValidator; +import com.avaloq.tools.ddk.xtext.formatting.DirectNodeModelStreamer; +import com.avaloq.tools.ddk.xtext.formatting.RegionNodeModelFormatter; import com.google.inject.Binder; +import com.google.inject.Provider; import com.google.inject.name.Names; +import java.util.Properties; +import org.eclipse.xtext.Constants; +import org.eclipse.xtext.IGrammarAccess; +import org.eclipse.xtext.common.types.DefaultCommonTypesRuntimeModule; +import org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider; +import org.eclipse.xtext.formatting.IFormatter; +import org.eclipse.xtext.formatting.INodeModelFormatter; +import org.eclipse.xtext.formatting.INodeModelStreamer; +import org.eclipse.xtext.generator.IGenerator2; +import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; +import org.eclipse.xtext.naming.IQualifiedNameProvider; +import org.eclipse.xtext.parser.IParser; +import org.eclipse.xtext.parser.ITokenToStringConverter; +import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider; +import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter; +import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; +import org.eclipse.xtext.parser.antlr.ITokenDefProvider; +import org.eclipse.xtext.parser.antlr.Lexer; +import org.eclipse.xtext.parser.antlr.LexerBindings; +import org.eclipse.xtext.parser.antlr.LexerProvider; +import org.eclipse.xtext.resource.IContainer; +import org.eclipse.xtext.resource.IResourceDescriptions; +import org.eclipse.xtext.resource.containers.IAllContainersState; +import org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider; +import org.eclipse.xtext.resource.containers.StateBasedContainerManager; +import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider; +import org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions; +import org.eclipse.xtext.scoping.IGlobalScopeProvider; +import org.eclipse.xtext.scoping.IScopeProvider; +import org.eclipse.xtext.scoping.IgnoreCaseLinking; +import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider; +import org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider; +import org.eclipse.xtext.serializer.ISerializer; +import org.eclipse.xtext.serializer.impl.Serializer; +import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer; +import org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer; +import org.eclipse.xtext.service.SingletonBinding; /** - * Manual modifications go to {com.avaloq.tools.ddk.check.TestLanguageRuntimeModule} + * Manual modifications go to {@link TestLanguageRuntimeModule}. */ @SuppressWarnings("all") -public abstract class AbstractTestLanguageRuntimeModule extends org.eclipse.xtext.common.types.DefaultCommonTypesRuntimeModule { +public abstract class AbstractTestLanguageRuntimeModule extends DefaultCommonTypesRuntimeModule { protected Properties properties = null; @@ -33,134 +79,137 @@ public void configureFileExtensions(Binder binder) { binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("checktest"); } - // contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment - public java.lang.ClassLoader bindClassLoaderToInstance() { + // contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2 + public ClassLoader bindClassLoaderToInstance() { return getClass().getClassLoader(); } - - // contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment - public Class bindIGrammarAccess() { - return com.avaloq.tools.ddk.check.services.TestLanguageGrammarAccess.class; + + // contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2 + public Class bindIGrammarAccess() { + return TestLanguageGrammarAccess.class; } - - // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment - public Class bindISemanticSequencer() { - return com.avaloq.tools.ddk.check.serializer.TestLanguageSemanticSequencer.class; + + // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 + public Class bindISemanticSequencer() { + return TestLanguageSemanticSequencer.class; } - - // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment - public Class bindISyntacticSequencer() { - return com.avaloq.tools.ddk.check.serializer.TestLanguageSyntacticSequencer.class; + + // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 + public Class bindISyntacticSequencer() { + return TestLanguageSyntacticSequencer.class; } - - // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment - public Class bindISerializer() { - return org.eclipse.xtext.serializer.impl.Serializer.class; + + // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 + public Class bindISerializer() { + return Serializer.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindIParser() { - return com.avaloq.tools.ddk.check.parser.antlr.TestLanguageParser.class; + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindIParser() { + return TestLanguageParser.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindITokenToStringConverter() { - return org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter.class; + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindITokenToStringConverter() { + return AntlrTokenToStringConverter.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindIAntlrTokenFileProvider() { - return com.avaloq.tools.ddk.check.parser.antlr.TestLanguageAntlrTokenFileProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindIAntlrTokenFileProvider() { + return TestLanguageAntlrTokenFileProvider.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindLexer() { - return com.avaloq.tools.ddk.check.parser.antlr.internal.InternalTestLanguageLexer.class; + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindLexer() { + return InternalTestLanguageLexer.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public com.google.inject.Provider provideInternalTestLanguageLexer() { - return org.eclipse.xtext.parser.antlr.LexerProvider.create(com.avaloq.tools.ddk.check.parser.antlr.internal.InternalTestLanguageLexer.class); + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindITokenDefProvider() { + return AntlrTokenDefProvider.class; } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public void configureRuntimeLexer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME)).to(com.avaloq.tools.ddk.check.parser.antlr.internal.InternalTestLanguageLexer.class); + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Provider provideInternalTestLanguageLexer() { + return LexerProvider.create(InternalTestLanguageLexer.class); } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindITokenDefProvider() { - return org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public void configureRuntimeLexer(Binder binder) { + binder.bind(Lexer.class) + .annotatedWith(Names.named(LexerBindings.RUNTIME)) + .to(InternalTestLanguageLexer.class); } - - // contributed by org.eclipse.xtext.generator.validation.JavaValidatorFragment - @org.eclipse.xtext.service.SingletonBinding(eager=true) public Class bindTestLanguageJavaValidator() { - return com.avaloq.tools.ddk.check.validation.TestLanguageJavaValidator.class; + + // contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2 + @SingletonBinding(eager=true) + public Class bindTestLanguageValidator() { + return TestLanguageValidator.class; } - - // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment - public Class bindIScopeProvider() { - return com.avaloq.tools.ddk.check.scoping.TestLanguageScopeProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2 + public Class bindIScopeProvider() { + return TestLanguageScopeProvider.class; } - - // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment - public void configureIScopeProviderDelegate(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.scoping.IScopeProvider.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.class); + + // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2 + public void configureIScopeProviderDelegate(Binder binder) { + binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(ImportedNamespaceAwareLocalScopeProvider.class); } - - // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment - public void configureIgnoreCaseLinking(com.google.inject.Binder binder) { - binder.bindConstant().annotatedWith(org.eclipse.xtext.scoping.IgnoreCaseLinking.class).to(false); + + // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2 + public void configureIgnoreCaseLinking(Binder binder) { + binder.bindConstant().annotatedWith(IgnoreCaseLinking.class).to(false); } - - // contributed by org.eclipse.xtext.generator.exporting.QualifiedNamesFragment - public Class bindIQualifiedNameProvider() { - return org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2 + public Class bindIQualifiedNameProvider() { + return DefaultDeclarativeQualifiedNameProvider.class; } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIContainer$Manager() { - return org.eclipse.xtext.resource.containers.StateBasedContainerManager.class; + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public Class bindIContainer$Manager() { + return StateBasedContainerManager.class; } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIAllContainersState$Provider() { - return org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider.class; + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public Class bindIAllContainersState$Provider() { + return ResourceSetBasedAllContainersStateProvider.class; } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptions(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.class); + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public void configureIResourceDescriptions(Binder binder) { + binder.bind(IResourceDescriptions.class).to(ResourceSetBasedResourceDescriptions.class); } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptionsPersisted(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.class); + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public void configureIResourceDescriptionsPersisted(Binder binder) { + binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(ResourceSetBasedResourceDescriptions.class); } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public Class bindIGenerator() { - return com.avaloq.tools.ddk.check.generator.TestLanguageGenerator.class; + + // contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2 + public Class bindIGenerator2() { + return TestLanguageGenerator.class; } - - // contributed by com.avaloq.tools.ddk.xtext.format.generator.FormatFragment - public Class bindIFormatter() { - return com.avaloq.tools.ddk.check.formatting.TestLanguageFormatter.class; + + // contributed by org.eclipse.xtext.xtext.generator.types.TypesGeneratorFragment2 + public Class bindIGlobalScopeProvider() { + return TypesAwareDefaultGlobalScopeProvider.class; } - - // contributed by com.avaloq.tools.ddk.xtext.format.generator.FormatFragment - public Class bindINodeModelFormatter() { - return com.avaloq.tools.ddk.xtext.formatting.RegionNodeModelFormatter.class; + + // contributed by com.avaloq.tools.ddk.xtext.generator.formatting.FormatterFragment2 + public Class bindIFormatter() { + return TestLanguageFormatter.class; } - - // contributed by com.avaloq.tools.ddk.xtext.format.generator.FormatFragment - public Class bindINodeModelStreamer() { - return com.avaloq.tools.ddk.xtext.formatting.DirectNodeModelStreamer.class; + + // contributed by com.avaloq.tools.ddk.xtext.generator.formatting.FormatterFragment2 + public Class bindINodeModelFormatter() { + return RegionNodeModelFormatter.class; } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIGlobalScopeProvider() { - return org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider.class; + + // contributed by com.avaloq.tools.ddk.xtext.generator.formatting.FormatterFragment2 + public Class bindINodeModelStreamer() { + return DirectNodeModelStreamer.class; } - + } diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/TestLanguage.genmodel b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/TestLanguage.genmodel index 2af3bb9245..a794978771 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/TestLanguage.genmodel +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/TestLanguage.genmodel @@ -1,13 +1,11 @@ + complianceLevel="17.0" copyrightFields="false" runtimeVersion="2.36"> + fileExtensions="checktest" ecorePackage="TestLanguage.ecore#/"> diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/TestLanguageStandaloneSetupGenerated.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/TestLanguageStandaloneSetupGenerated.java index 9e5be3fac4..f7e51a43be 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/TestLanguageStandaloneSetupGenerated.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/TestLanguageStandaloneSetupGenerated.java @@ -3,22 +3,22 @@ */ package com.avaloq.tools.ddk.check; +import com.avaloq.tools.ddk.check.testLanguage.TestLanguagePackage; +import com.google.inject.Guice; +import com.google.inject.Injector; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.xtext.ISetup; +import org.eclipse.xtext.common.TerminalsStandaloneSetup; +import org.eclipse.xtext.resource.IResourceFactory; +import org.eclipse.xtext.resource.IResourceServiceProvider; -import com.google.inject.Guice; -import com.google.inject.Injector; - -/** - * Generated from StandaloneSetup.xpt! - */ @SuppressWarnings("all") public class TestLanguageStandaloneSetupGenerated implements ISetup { @Override public Injector createInjectorAndDoEMFRegistration() { - org.eclipse.xtext.common.TerminalsStandaloneSetup.doSetup(); + TerminalsStandaloneSetup.doSetup(); Injector injector = createInjector(); register(injector); @@ -26,21 +26,17 @@ public Injector createInjectorAndDoEMFRegistration() { } public Injector createInjector() { - return Guice.createInjector(new com.avaloq.tools.ddk.check.TestLanguageRuntimeModule()); + return Guice.createInjector(new TestLanguageRuntimeModule()); } public void register(Injector injector) { - if (!EPackage.Registry.INSTANCE.containsKey("http://www.avaloq.com/tools/ddk/check/TestLanguage")) { - EPackage.Registry.INSTANCE.put("http://www.avaloq.com/tools/ddk/check/TestLanguage", com.avaloq.tools.ddk.check.testLanguage.TestLanguagePackage.eINSTANCE); - } - - org.eclipse.xtext.resource.IResourceFactory resourceFactory = injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class); - org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider = injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class); - Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("checktest", resourceFactory); - org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("checktest", serviceProvider); + if (!EPackage.Registry.INSTANCE.containsKey("http://www.avaloq.com/tools/ddk/check/TestLanguage")) { + EPackage.Registry.INSTANCE.put("http://www.avaloq.com/tools/ddk/check/TestLanguage", TestLanguagePackage.eINSTANCE); + } + IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); + IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); - - - + Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("checktest", resourceFactory); + IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("checktest", serviceProvider); } } diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/TestLanguageAntlrTokenFileProvider.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/TestLanguageAntlrTokenFileProvider.java index 428723e134..514aaae028 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/TestLanguageAntlrTokenFileProvider.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/TestLanguageAntlrTokenFileProvider.java @@ -7,10 +7,10 @@ import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; public class TestLanguageAntlrTokenFileProvider implements IAntlrTokenFileProvider { - + @Override public InputStream getAntlrTokenFile() { ClassLoader classLoader = getClass().getClassLoader(); - return classLoader.getResourceAsStream("com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguage.tokens"); + return classLoader.getResourceAsStream("com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguage.tokens"); } } diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/TestLanguageParser.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/TestLanguageParser.java index a279de94ab..50443a2a53 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/TestLanguageParser.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/TestLanguageParser.java @@ -3,37 +3,38 @@ */ package com.avaloq.tools.ddk.check.parser.antlr; +import com.avaloq.tools.ddk.check.parser.antlr.internal.InternalTestLanguageParser; +import com.avaloq.tools.ddk.check.services.TestLanguageGrammarAccess; import com.google.inject.Inject; - +import org.eclipse.xtext.parser.antlr.AbstractAntlrParser; import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import com.avaloq.tools.ddk.check.services.TestLanguageGrammarAccess; -public class TestLanguageParser extends org.eclipse.xtext.parser.antlr.AbstractAntlrParser { - +public class TestLanguageParser extends AbstractAntlrParser { + @Inject private TestLanguageGrammarAccess grammarAccess; - + @Override protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); } + @Override - protected com.avaloq.tools.ddk.check.parser.antlr.internal.InternalTestLanguageParser createParser(XtextTokenStream stream) { - return new com.avaloq.tools.ddk.check.parser.antlr.internal.InternalTestLanguageParser(stream, getGrammarAccess()); + protected InternalTestLanguageParser createParser(XtextTokenStream stream) { + return new InternalTestLanguageParser(stream, getGrammarAccess()); } - + @Override protected String getDefaultRuleName() { return "Model"; } - + public TestLanguageGrammarAccess getGrammarAccess() { return this.grammarAccess; } - + public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) { this.grammarAccess = grammarAccess; } - } diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguage.g b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguage.g index f656d0777f..71f8a3b1bb 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguage.g +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguage.g @@ -5,7 +5,6 @@ grammar InternalTestLanguage; options { superClass=AbstractInternalAntlrParser; - } @lexer::header { @@ -17,7 +16,7 @@ import org.eclipse.xtext.parser.antlr.Lexer; } @parser::header { -package com.avaloq.tools.ddk.check.parser.antlr.internal; +package com.avaloq.tools.ddk.check.parser.antlr.internal; import org.eclipse.xtext.*; import org.eclipse.xtext.parser.*; @@ -35,120 +34,113 @@ import com.avaloq.tools.ddk.check.services.TestLanguageGrammarAccess; @parser::members { private TestLanguageGrammarAccess grammarAccess; - + public InternalTestLanguageParser(TokenStream input, TestLanguageGrammarAccess grammarAccess) { this(input); this.grammarAccess = grammarAccess; registerRules(grammarAccess.getGrammar()); } - + @Override protected String getFirstRuleName() { - return "Model"; + return "Model"; } - + @Override protected TestLanguageGrammarAccess getGrammarAccess() { return grammarAccess; } + } -@rulecatch { - catch (RecognitionException re) { - recover(input,re); +@rulecatch { + catch (RecognitionException re) { + recover(input,re); appendSkippedTokens(); - } + } } - - - // Entry rule entryRuleModel -entryRuleModel returns [EObject current=null] - : +entryRuleModel returns [EObject current=null]: { newCompositeNode(grammarAccess.getModelRule()); } - iv_ruleModel=ruleModel - { $current=$iv_ruleModel.current; } - EOF -; + iv_ruleModel=ruleModel + { $current=$iv_ruleModel.current; } + EOF; // Rule Model -ruleModel returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( -( - { - newCompositeNode(grammarAccess.getModelAccess().getGreetingsGreetingParserRuleCall_0()); - } - lv_greetings_0_0=ruleGreeting { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getModelRule()); - } - add( - $current, - "greetings", - lv_greetings_0_0, - "com.avaloq.tools.ddk.check.TestLanguage.Greeting"); - afterParserOrEnumRuleCall(); - } - -) -)* +ruleModel returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + { + newCompositeNode(grammarAccess.getModelAccess().getGreetingsGreetingParserRuleCall_0()); + } + lv_greetings_0_0=ruleGreeting + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getModelRule()); + } + add( + $current, + "greetings", + lv_greetings_0_0, + "com.avaloq.tools.ddk.check.TestLanguage.Greeting"); + afterParserOrEnumRuleCall(); + } + ) + )* ; - - - - // Entry rule entryRuleGreeting -entryRuleGreeting returns [EObject current=null] - : +entryRuleGreeting returns [EObject current=null]: { newCompositeNode(grammarAccess.getGreetingRule()); } - iv_ruleGreeting=ruleGreeting - { $current=$iv_ruleGreeting.current; } - EOF -; + iv_ruleGreeting=ruleGreeting + { $current=$iv_ruleGreeting.current; } + EOF; // Rule Greeting -ruleGreeting returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='Hello' - { - newLeafNode(otherlv_0, grammarAccess.getGreetingAccess().getHelloKeyword_0()); - } -( -( - lv_name_1_0=RULE_ID +ruleGreeting returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='Hello' { - newLeafNode(lv_name_1_0, grammarAccess.getGreetingAccess().getNameIDTerminalRuleCall_1_0()); + newLeafNode(otherlv_0, grammarAccess.getGreetingAccess().getHelloKeyword_0()); } + ( + ( + lv_name_1_0=RULE_ID + { + newLeafNode(lv_name_1_0, grammarAccess.getGreetingAccess().getNameIDTerminalRuleCall_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getGreetingRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_1_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) + otherlv_2='!' { - if ($current==null) { - $current = createModelElement(grammarAccess.getGreetingRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_1_0, - "org.eclipse.xtext.common.Terminals.ID"); - } - -) -) otherlv_2='!' - { - newLeafNode(otherlv_2, grammarAccess.getGreetingAccess().getExclamationMarkKeyword_2()); - } -) + newLeafNode(otherlv_2, grammarAccess.getGreetingAccess().getExclamationMarkKeyword_2()); + } + ) ; - - - - RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; RULE_INT : ('0'..'9')+; @@ -162,5 +154,3 @@ RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; RULE_WS : (' '|'\t'|'\r'|'\n')+; RULE_ANY_OTHER : .; - - diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguageLexer.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguageLexer.java index 93d02b06e2..1b5dd7afac 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguageLexer.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguageLexer.java @@ -82,10 +82,10 @@ public final void mRULE_ID() throws RecognitionException { try { int _type = RULE_ID; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:152:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // InternalTestLanguage.g:152:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalTestLanguage.g:144:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + // InternalTestLanguage.g:144:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* { - // InternalTestLanguage.g:152:11: ( '^' )? + // InternalTestLanguage.g:144:11: ( '^' )? int alt1=2; int LA1_0 = input.LA(1); @@ -94,7 +94,7 @@ public final void mRULE_ID() throws RecognitionException { } switch (alt1) { case 1 : - // InternalTestLanguage.g:152:11: '^' + // InternalTestLanguage.g:144:11: '^' { match('^'); @@ -112,7 +112,7 @@ public final void mRULE_ID() throws RecognitionException { recover(mse); throw mse;} - // InternalTestLanguage.g:152:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalTestLanguage.g:144:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* loop2: do { int alt2=2; @@ -161,10 +161,10 @@ public final void mRULE_INT() throws RecognitionException { try { int _type = RULE_INT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:154:10: ( ( '0' .. '9' )+ ) - // InternalTestLanguage.g:154:12: ( '0' .. '9' )+ + // InternalTestLanguage.g:146:10: ( ( '0' .. '9' )+ ) + // InternalTestLanguage.g:146:12: ( '0' .. '9' )+ { - // InternalTestLanguage.g:154:12: ( '0' .. '9' )+ + // InternalTestLanguage.g:146:12: ( '0' .. '9' )+ int cnt3=0; loop3: do { @@ -178,7 +178,7 @@ public final void mRULE_INT() throws RecognitionException { switch (alt3) { case 1 : - // InternalTestLanguage.g:154:13: '0' .. '9' + // InternalTestLanguage.g:146:13: '0' .. '9' { matchRange('0','9'); @@ -210,10 +210,10 @@ public final void mRULE_STRING() throws RecognitionException { try { int _type = RULE_STRING; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:156:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // InternalTestLanguage.g:156:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalTestLanguage.g:148:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) + // InternalTestLanguage.g:148:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) { - // InternalTestLanguage.g:156:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalTestLanguage.g:148:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) int alt6=2; int LA6_0 = input.LA(1); @@ -231,10 +231,10 @@ else if ( (LA6_0=='\'') ) { } switch (alt6) { case 1 : - // InternalTestLanguage.g:156:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' + // InternalTestLanguage.g:148:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' { match('\"'); - // InternalTestLanguage.g:156:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* + // InternalTestLanguage.g:148:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* loop4: do { int alt4=3; @@ -250,7 +250,7 @@ else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>= switch (alt4) { case 1 : - // InternalTestLanguage.g:156:21: '\\\\' . + // InternalTestLanguage.g:148:21: '\\\\' . { match('\\'); matchAny(); @@ -258,7 +258,7 @@ else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>= } break; case 2 : - // InternalTestLanguage.g:156:28: ~ ( ( '\\\\' | '\"' ) ) + // InternalTestLanguage.g:148:28: ~ ( ( '\\\\' | '\"' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -283,10 +283,10 @@ else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>= } break; case 2 : - // InternalTestLanguage.g:156:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' + // InternalTestLanguage.g:148:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' { match('\''); - // InternalTestLanguage.g:156:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* + // InternalTestLanguage.g:148:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* loop5: do { int alt5=3; @@ -302,7 +302,7 @@ else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>= switch (alt5) { case 1 : - // InternalTestLanguage.g:156:54: '\\\\' . + // InternalTestLanguage.g:148:54: '\\\\' . { match('\\'); matchAny(); @@ -310,7 +310,7 @@ else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>= } break; case 2 : - // InternalTestLanguage.g:156:61: ~ ( ( '\\\\' | '\\'' ) ) + // InternalTestLanguage.g:148:61: ~ ( ( '\\\\' | '\\'' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -353,12 +353,12 @@ public final void mRULE_ML_COMMENT() throws RecognitionException { try { int _type = RULE_ML_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:158:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // InternalTestLanguage.g:158:19: '/*' ( options {greedy=false; } : . )* '*/' + // InternalTestLanguage.g:150:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) + // InternalTestLanguage.g:150:19: '/*' ( options {greedy=false; } : . )* '*/' { match("/*"); - // InternalTestLanguage.g:158:24: ( options {greedy=false; } : . )* + // InternalTestLanguage.g:150:24: ( options {greedy=false; } : . )* loop7: do { int alt7=2; @@ -383,7 +383,7 @@ else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) { switch (alt7) { case 1 : - // InternalTestLanguage.g:158:52: . + // InternalTestLanguage.g:150:52: . { matchAny(); @@ -413,12 +413,12 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { try { int _type = RULE_SL_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:160:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // InternalTestLanguage.g:160:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? + // InternalTestLanguage.g:152:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) + // InternalTestLanguage.g:152:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? { match("//"); - // InternalTestLanguage.g:160:24: (~ ( ( '\\n' | '\\r' ) ) )* + // InternalTestLanguage.g:152:24: (~ ( ( '\\n' | '\\r' ) ) )* loop8: do { int alt8=2; @@ -431,7 +431,7 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { switch (alt8) { case 1 : - // InternalTestLanguage.g:160:24: ~ ( ( '\\n' | '\\r' ) ) + // InternalTestLanguage.g:152:24: ~ ( ( '\\n' | '\\r' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -451,7 +451,7 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { } } while (true); - // InternalTestLanguage.g:160:40: ( ( '\\r' )? '\\n' )? + // InternalTestLanguage.g:152:40: ( ( '\\r' )? '\\n' )? int alt10=2; int LA10_0 = input.LA(1); @@ -460,9 +460,9 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { } switch (alt10) { case 1 : - // InternalTestLanguage.g:160:41: ( '\\r' )? '\\n' + // InternalTestLanguage.g:152:41: ( '\\r' )? '\\n' { - // InternalTestLanguage.g:160:41: ( '\\r' )? + // InternalTestLanguage.g:152:41: ( '\\r' )? int alt9=2; int LA9_0 = input.LA(1); @@ -471,7 +471,7 @@ public final void mRULE_SL_COMMENT() throws RecognitionException { } switch (alt9) { case 1 : - // InternalTestLanguage.g:160:41: '\\r' + // InternalTestLanguage.g:152:41: '\\r' { match('\r'); @@ -503,10 +503,10 @@ public final void mRULE_WS() throws RecognitionException { try { int _type = RULE_WS; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:162:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // InternalTestLanguage.g:162:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalTestLanguage.g:154:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) + // InternalTestLanguage.g:154:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ { - // InternalTestLanguage.g:162:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalTestLanguage.g:154:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ int cnt11=0; loop11: do { @@ -560,8 +560,8 @@ public final void mRULE_ANY_OTHER() throws RecognitionException { try { int _type = RULE_ANY_OTHER; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalTestLanguage.g:164:16: ( . ) - // InternalTestLanguage.g:164:18: . + // InternalTestLanguage.g:156:16: ( . ) + // InternalTestLanguage.g:156:18: . { matchAny(); diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguageParser.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguageParser.java index 0d4d5629a2..dc4ce267ec 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguageParser.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/parser/antlr/internal/InternalTestLanguageParser.java @@ -1,4 +1,4 @@ -package com.avaloq.tools.ddk.check.parser.antlr.internal; +package com.avaloq.tools.ddk.check.parser.antlr.internal; import org.eclipse.xtext.*; import org.eclipse.xtext.parser.*; @@ -53,18 +53,18 @@ public InternalTestLanguageParser(TokenStream input, RecognizerSharedState state private TestLanguageGrammarAccess grammarAccess; - + public InternalTestLanguageParser(TokenStream input, TestLanguageGrammarAccess grammarAccess) { this(input); this.grammarAccess = grammarAccess; registerRules(grammarAccess.getGrammar()); } - + @Override protected String getFirstRuleName() { - return "Model"; + return "Model"; } - + @Override protected TestLanguageGrammarAccess getGrammarAccess() { return grammarAccess; @@ -72,8 +72,9 @@ protected TestLanguageGrammarAccess getGrammarAccess() { + // $ANTLR start "entryRuleModel" - // InternalTestLanguage.g:67:1: entryRuleModel returns [EObject current=null] : iv_ruleModel= ruleModel EOF ; + // InternalTestLanguage.g:64:1: entryRuleModel returns [EObject current=null] : iv_ruleModel= ruleModel EOF ; public final EObject entryRuleModel() throws RecognitionException { EObject current = null; @@ -81,8 +82,8 @@ public final EObject entryRuleModel() throws RecognitionException { try { - // InternalTestLanguage.g:68:2: (iv_ruleModel= ruleModel EOF ) - // InternalTestLanguage.g:69:2: iv_ruleModel= ruleModel EOF + // InternalTestLanguage.g:64:46: (iv_ruleModel= ruleModel EOF ) + // InternalTestLanguage.g:65:2: iv_ruleModel= ruleModel EOF { newCompositeNode(grammarAccess.getModelRule()); pushFollow(FOLLOW_1); @@ -96,11 +97,11 @@ public final EObject entryRuleModel() throws RecognitionException { } } - - catch (RecognitionException re) { - recover(input,re); + + catch (RecognitionException re) { + recover(input,re); appendSkippedTokens(); - } + } finally { } return current; @@ -109,20 +110,21 @@ public final EObject entryRuleModel() throws RecognitionException { // $ANTLR start "ruleModel" - // InternalTestLanguage.g:76:1: ruleModel returns [EObject current=null] : ( (lv_greetings_0_0= ruleGreeting ) )* ; + // InternalTestLanguage.g:71:1: ruleModel returns [EObject current=null] : ( (lv_greetings_0_0= ruleGreeting ) )* ; public final EObject ruleModel() throws RecognitionException { EObject current = null; EObject lv_greetings_0_0 = null; - enterRule(); - + + enterRule(); + try { - // InternalTestLanguage.g:79:28: ( ( (lv_greetings_0_0= ruleGreeting ) )* ) - // InternalTestLanguage.g:80:1: ( (lv_greetings_0_0= ruleGreeting ) )* + // InternalTestLanguage.g:77:2: ( ( (lv_greetings_0_0= ruleGreeting ) )* ) + // InternalTestLanguage.g:78:2: ( (lv_greetings_0_0= ruleGreeting ) )* { - // InternalTestLanguage.g:80:1: ( (lv_greetings_0_0= ruleGreeting ) )* + // InternalTestLanguage.g:78:2: ( (lv_greetings_0_0= ruleGreeting ) )* loop1: do { int alt1=2; @@ -135,30 +137,30 @@ public final EObject ruleModel() throws RecognitionException { switch (alt1) { case 1 : - // InternalTestLanguage.g:81:1: (lv_greetings_0_0= ruleGreeting ) + // InternalTestLanguage.g:79:3: (lv_greetings_0_0= ruleGreeting ) { - // InternalTestLanguage.g:81:1: (lv_greetings_0_0= ruleGreeting ) - // InternalTestLanguage.g:82:3: lv_greetings_0_0= ruleGreeting + // InternalTestLanguage.g:79:3: (lv_greetings_0_0= ruleGreeting ) + // InternalTestLanguage.g:80:4: lv_greetings_0_0= ruleGreeting { - - newCompositeNode(grammarAccess.getModelAccess().getGreetingsGreetingParserRuleCall_0()); - + + newCompositeNode(grammarAccess.getModelAccess().getGreetingsGreetingParserRuleCall_0()); + pushFollow(FOLLOW_3); lv_greetings_0_0=ruleGreeting(); state._fsp--; - if (current==null) { - current = createModelElementForParent(grammarAccess.getModelRule()); - } - add( - current, - "greetings", - lv_greetings_0_0, - "com.avaloq.tools.ddk.check.TestLanguage.Greeting"); - afterParserOrEnumRuleCall(); - + if (current==null) { + current = createModelElementForParent(grammarAccess.getModelRule()); + } + add( + current, + "greetings", + lv_greetings_0_0, + "com.avaloq.tools.ddk.check.TestLanguage.Greeting"); + afterParserOrEnumRuleCall(); + } @@ -174,13 +176,15 @@ public final EObject ruleModel() throws RecognitionException { } - leaveRule(); + + leaveRule(); + } - - catch (RecognitionException re) { - recover(input,re); + + catch (RecognitionException re) { + recover(input,re); appendSkippedTokens(); - } + } finally { } return current; @@ -189,7 +193,7 @@ public final EObject ruleModel() throws RecognitionException { // $ANTLR start "entryRuleGreeting" - // InternalTestLanguage.g:106:1: entryRuleGreeting returns [EObject current=null] : iv_ruleGreeting= ruleGreeting EOF ; + // InternalTestLanguage.g:100:1: entryRuleGreeting returns [EObject current=null] : iv_ruleGreeting= ruleGreeting EOF ; public final EObject entryRuleGreeting() throws RecognitionException { EObject current = null; @@ -197,8 +201,8 @@ public final EObject entryRuleGreeting() throws RecognitionException { try { - // InternalTestLanguage.g:107:2: (iv_ruleGreeting= ruleGreeting EOF ) - // InternalTestLanguage.g:108:2: iv_ruleGreeting= ruleGreeting EOF + // InternalTestLanguage.g:100:49: (iv_ruleGreeting= ruleGreeting EOF ) + // InternalTestLanguage.g:101:2: iv_ruleGreeting= ruleGreeting EOF { newCompositeNode(grammarAccess.getGreetingRule()); pushFollow(FOLLOW_1); @@ -212,11 +216,11 @@ public final EObject entryRuleGreeting() throws RecognitionException { } } - - catch (RecognitionException re) { - recover(input,re); + + catch (RecognitionException re) { + recover(input,re); appendSkippedTokens(); - } + } finally { } return current; @@ -225,7 +229,7 @@ public final EObject entryRuleGreeting() throws RecognitionException { // $ANTLR start "ruleGreeting" - // InternalTestLanguage.g:115:1: ruleGreeting returns [EObject current=null] : (otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' ) ; + // InternalTestLanguage.g:107:1: ruleGreeting returns [EObject current=null] : (otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' ) ; public final EObject ruleGreeting() throws RecognitionException { EObject current = null; @@ -233,39 +237,40 @@ public final EObject ruleGreeting() throws RecognitionException { Token lv_name_1_0=null; Token otherlv_2=null; - enterRule(); - + + enterRule(); + try { - // InternalTestLanguage.g:118:28: ( (otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' ) ) - // InternalTestLanguage.g:119:1: (otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' ) + // InternalTestLanguage.g:113:2: ( (otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' ) ) + // InternalTestLanguage.g:114:2: (otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' ) { - // InternalTestLanguage.g:119:1: (otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' ) - // InternalTestLanguage.g:119:3: otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' + // InternalTestLanguage.g:114:2: (otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' ) + // InternalTestLanguage.g:115:3: otherlv_0= 'Hello' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '!' { otherlv_0=(Token)match(input,11,FOLLOW_4); - newLeafNode(otherlv_0, grammarAccess.getGreetingAccess().getHelloKeyword_0()); - - // InternalTestLanguage.g:123:1: ( (lv_name_1_0= RULE_ID ) ) - // InternalTestLanguage.g:124:1: (lv_name_1_0= RULE_ID ) + newLeafNode(otherlv_0, grammarAccess.getGreetingAccess().getHelloKeyword_0()); + + // InternalTestLanguage.g:119:3: ( (lv_name_1_0= RULE_ID ) ) + // InternalTestLanguage.g:120:4: (lv_name_1_0= RULE_ID ) { - // InternalTestLanguage.g:124:1: (lv_name_1_0= RULE_ID ) - // InternalTestLanguage.g:125:3: lv_name_1_0= RULE_ID + // InternalTestLanguage.g:120:4: (lv_name_1_0= RULE_ID ) + // InternalTestLanguage.g:121:5: lv_name_1_0= RULE_ID { lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_5); - newLeafNode(lv_name_1_0, grammarAccess.getGreetingAccess().getNameIDTerminalRuleCall_1_0()); - + newLeafNode(lv_name_1_0, grammarAccess.getGreetingAccess().getNameIDTerminalRuleCall_1_0()); + - if (current==null) { - current = createModelElement(grammarAccess.getGreetingRule()); - } - setWithLastConsumed( - current, - "name", - lv_name_1_0, - "org.eclipse.xtext.common.Terminals.ID"); - + if (current==null) { + current = createModelElement(grammarAccess.getGreetingRule()); + } + setWithLastConsumed( + current, + "name", + lv_name_1_0, + "org.eclipse.xtext.common.Terminals.ID"); + } @@ -274,21 +279,23 @@ public final EObject ruleGreeting() throws RecognitionException { otherlv_2=(Token)match(input,12,FOLLOW_2); - newLeafNode(otherlv_2, grammarAccess.getGreetingAccess().getExclamationMarkKeyword_2()); - + newLeafNode(otherlv_2, grammarAccess.getGreetingAccess().getExclamationMarkKeyword_2()); + } } - leaveRule(); + + leaveRule(); + } - - catch (RecognitionException re) { - recover(input,re); + + catch (RecognitionException re) { + recover(input,re); appendSkippedTokens(); - } + } finally { } return current; diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/scoping/AbstractTestLanguageScopeProvider.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/scoping/AbstractTestLanguageScopeProvider.java new file mode 100644 index 0000000000..fc2a64fb11 --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/scoping/AbstractTestLanguageScopeProvider.java @@ -0,0 +1,9 @@ +/* + * generated by Xtext + */ +package com.avaloq.tools.ddk.check.scoping; + +import org.eclipse.xtext.scoping.impl.DelegatingScopeProvider; + +public abstract class AbstractTestLanguageScopeProvider extends DelegatingScopeProvider { +} diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/serializer/AbstractTestLanguageSemanticSequencer.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/serializer/AbstractTestLanguageSemanticSequencer.java index b72dd7b8cb..c8afb6982c 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/serializer/AbstractTestLanguageSemanticSequencer.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/serializer/AbstractTestLanguageSemanticSequencer.java @@ -45,11 +45,13 @@ public void sequence(ISerializationContext context, EObject semanticObject) { } /** + *
 	 * Contexts:
 	 *     Greeting returns Greeting
 	 *
 	 * Constraint:
 	 *     name=ID
+	 * 
*/ protected void sequence_Greeting(ISerializationContext context, Greeting semanticObject) { if (errorAcceptor != null) { @@ -63,11 +65,13 @@ protected void sequence_Greeting(ISerializationContext context, Greeting semanti /** + *
 	 * Contexts:
 	 *     Model returns Model
 	 *
 	 * Constraint:
 	 *     greetings+=Greeting+
+	 * 
*/ protected void sequence_Model(ISerializationContext context, Model semanticObject) { genericSequencer.createSequence(context, semanticObject); diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/services/TestLanguageGrammarAccess.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/services/TestLanguageGrammarAccess.java index e688001588..b78010d1a3 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/services/TestLanguageGrammarAccess.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/services/TestLanguageGrammarAccess.java @@ -3,20 +3,23 @@ */ package com.avaloq.tools.ddk.check.services; -import com.google.inject.Singleton; import com.google.inject.Inject; - +import com.google.inject.Singleton; import java.util.List; - -import org.eclipse.xtext.*; -import org.eclipse.xtext.service.GrammarProvider; -import org.eclipse.xtext.service.AbstractElementFinder.*; - +import org.eclipse.xtext.Assignment; +import org.eclipse.xtext.Grammar; +import org.eclipse.xtext.GrammarUtil; +import org.eclipse.xtext.Group; +import org.eclipse.xtext.Keyword; +import org.eclipse.xtext.ParserRule; +import org.eclipse.xtext.RuleCall; +import org.eclipse.xtext.TerminalRule; import org.eclipse.xtext.common.services.TerminalsGrammarAccess; +import org.eclipse.xtext.service.AbstractElementFinder; +import org.eclipse.xtext.service.GrammarProvider; @Singleton -public class TestLanguageGrammarAccess extends AbstractGrammarElementFinder { - +public class TestLanguageGrammarAccess extends AbstractElementFinder.AbstractGrammarElementFinder { public class ModelElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "com.avaloq.tools.ddk.check.TestLanguage.Model"); @@ -24,16 +27,15 @@ public class ModelElements extends AbstractParserRuleElementFinder { private final RuleCall cGreetingsGreetingParserRuleCall_0 = (RuleCall)cGreetingsAssignment.eContents().get(0); //Model: - // greetings+=Greeting*; + // greetings+=Greeting*; @Override public ParserRule getRule() { return rule; } - + //greetings+=Greeting* public Assignment getGreetingsAssignment() { return cGreetingsAssignment; } - + //Greeting public RuleCall getGreetingsGreetingParserRuleCall_0() { return cGreetingsGreetingParserRuleCall_0; } } - public class GreetingElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "com.avaloq.tools.ddk.check.TestLanguage.Greeting"); private final Group cGroup = (Group)rule.eContents().get(1); @@ -43,21 +45,21 @@ public class GreetingElements extends AbstractParserRuleElementFinder { private final Keyword cExclamationMarkKeyword_2 = (Keyword)cGroup.eContents().get(2); //Greeting: - // 'Hello' name=ID '!'; + // 'Hello' name=ID '!'; @Override public ParserRule getRule() { return rule; } - + //'Hello' name=ID '!' public Group getGroup() { return cGroup; } - + //'Hello' public Keyword getHelloKeyword_0() { return cHelloKeyword_0; } - + //name=ID public Assignment getNameAssignment_1() { return cNameAssignment_1; } - + //ID public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } - + //'!' public Keyword getExclamationMarkKeyword_2() { return cExclamationMarkKeyword_2; } } @@ -67,12 +69,12 @@ public class GreetingElements extends AbstractParserRuleElementFinder { private final GreetingElements pGreeting; private final Grammar grammar; - + private final TerminalsGrammarAccess gaTerminals; @Inject public TestLanguageGrammarAccess(GrammarProvider grammarProvider, - TerminalsGrammarAccess gaTerminals) { + TerminalsGrammarAccess gaTerminals) { this.grammar = internalFindGrammar(grammarProvider); this.gaTerminals = gaTerminals; this.pModel = new ModelElements(); @@ -100,14 +102,14 @@ public Grammar getGrammar() { return grammar; } - + public TerminalsGrammarAccess getTerminalsGrammarAccess() { return gaTerminals; } //Model: - // greetings+=Greeting*; + // greetings+=Greeting*; public ModelElements getModelAccess() { return pModel; } @@ -115,9 +117,9 @@ public ModelElements getModelAccess() { public ParserRule getModelRule() { return getModelAccess().getRule(); } - + //Greeting: - // 'Hello' name=ID '!'; + // 'Hello' name=ID '!'; public GreetingElements getGreetingAccess() { return pGreeting; } @@ -125,46 +127,42 @@ public GreetingElements getGreetingAccess() { public ParserRule getGreetingRule() { return getGreetingAccess().getRule(); } - - //terminal ID: - // '^'? ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | '0'..'9')*; + + //terminal ID: '^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; public TerminalRule getIDRule() { return gaTerminals.getIDRule(); - } - - //terminal INT returns ecore::EInt: - // '0'..'9'+; + } + + //terminal INT returns ecore::EInt: ('0'..'9')+; public TerminalRule getINTRule() { return gaTerminals.getINTRule(); - } - + } + //terminal STRING: - // '"' ('\\' . | !('\\' | '"'))* '"' | "'" ('\\' . | !('\\' | "'"))* "'"; + // '"' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|'"') )* '"' | + // "'" ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|"'") )* "'" + // ; public TerminalRule getSTRINGRule() { return gaTerminals.getSTRINGRule(); - } - - //terminal ML_COMMENT: - // '/*'->'*/'; + } + + //terminal ML_COMMENT : '/*' -> '*/'; public TerminalRule getML_COMMENTRule() { return gaTerminals.getML_COMMENTRule(); - } - - //terminal SL_COMMENT: - // '//' !('\n' | '\r')* ('\r'? '\n')?; + } + + //terminal SL_COMMENT : '//' !('\n'|'\r')* ('\r'? '\n')?; public TerminalRule getSL_COMMENTRule() { return gaTerminals.getSL_COMMENTRule(); - } - - //terminal WS: - // ' ' | '\t' | '\r' | '\n'+; + } + + //terminal WS : (' '|'\t'|'\r'|'\n')+; public TerminalRule getWSRule() { return gaTerminals.getWSRule(); - } - - //terminal ANY_OTHER: - // .; + } + + //terminal ANY_OTHER: .; public TerminalRule getANY_OTHERRule() { return gaTerminals.getANY_OTHERRule(); - } + } } diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/Greeting.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/Greeting.java index b942b6d664..07b13fae4d 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/Greeting.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/Greeting.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage; @@ -25,10 +26,6 @@ public interface Greeting extends EObject /** * Returns the value of the 'Name' attribute. * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

* * @return the value of the 'Name' attribute. * @see #setName(String) diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/Model.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/Model.java index ebde8ebe76..b04f7883d6 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/Model.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/Model.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage; @@ -28,10 +29,6 @@ public interface Model extends EObject * Returns the value of the 'Greetings' containment reference list. * The list contents are of type {@link com.avaloq.tools.ddk.check.testLanguage.Greeting}. * - *

- * If the meaning of the 'Greetings' containment reference list isn't clear, - * there really should be more of a description here... - *

* * @return the value of the 'Greetings' containment reference list. * @see com.avaloq.tools.ddk.check.testLanguage.TestLanguagePackage#getModel_Greetings() diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/TestLanguageFactory.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/TestLanguageFactory.java index 97c84bea79..9e4888f305 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/TestLanguageFactory.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/TestLanguageFactory.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage; diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/TestLanguagePackage.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/TestLanguagePackage.java index 145f6090d1..9f0050df1c 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/TestLanguagePackage.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/TestLanguagePackage.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage; diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/GreetingImpl.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/GreetingImpl.java index 54322ac244..8b8f2e02d6 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/GreetingImpl.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/GreetingImpl.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage.impl; @@ -73,6 +74,7 @@ protected EClass eStaticClass() * * @generated */ + @Override public String getName() { return name; @@ -83,6 +85,7 @@ public String getName() * * @generated */ + @Override public void setName(String newName) { String oldName = name; @@ -167,7 +170,7 @@ public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/ModelImpl.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/ModelImpl.java index ad619ae46b..9935c2fea3 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/ModelImpl.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/ModelImpl.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage.impl; @@ -71,6 +72,7 @@ protected EClass eStaticClass() * * @generated */ + @Override public EList getGreetings() { if (greetings == null) diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/TestLanguageFactoryImpl.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/TestLanguageFactoryImpl.java index 1a4451ddad..34d31921c4 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/TestLanguageFactoryImpl.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/TestLanguageFactoryImpl.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage.impl; @@ -76,6 +77,7 @@ public EObject create(EClass eClass) * * @generated */ + @Override public Model createModel() { ModelImpl model = new ModelImpl(); @@ -87,6 +89,7 @@ public Model createModel() * * @generated */ + @Override public Greeting createGreeting() { GreetingImpl greeting = new GreetingImpl(); @@ -98,6 +101,7 @@ public Greeting createGreeting() * * @generated */ + @Override public TestLanguagePackage getTestLanguagePackage() { return (TestLanguagePackage)getEPackage(); diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/TestLanguagePackageImpl.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/TestLanguagePackageImpl.java index b0e7b6fee6..8ea9107999 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/TestLanguagePackageImpl.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/impl/TestLanguagePackageImpl.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage.impl; @@ -55,7 +56,6 @@ private TestLanguagePackageImpl() { super(eNS_URI, TestLanguageFactory.eINSTANCE); } - /** * * @@ -65,7 +65,7 @@ private TestLanguagePackageImpl() /** * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * + * *

This method is used to initialize {@link TestLanguagePackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * @@ -80,7 +80,8 @@ public static TestLanguagePackage init() if (isInited) return (TestLanguagePackage)EPackage.Registry.INSTANCE.getEPackage(TestLanguagePackage.eNS_URI); // Obtain or create and register package - TestLanguagePackageImpl theTestLanguagePackage = (TestLanguagePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof TestLanguagePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new TestLanguagePackageImpl()); + Object registeredTestLanguagePackage = EPackage.Registry.INSTANCE.get(eNS_URI); + TestLanguagePackageImpl theTestLanguagePackage = registeredTestLanguagePackage instanceof TestLanguagePackageImpl ? (TestLanguagePackageImpl)registeredTestLanguagePackage : new TestLanguagePackageImpl(); isInited = true; @@ -93,7 +94,6 @@ public static TestLanguagePackage init() // Mark meta-data to indicate it can't be changed theTestLanguagePackage.freeze(); - // Update the registry and return the package EPackage.Registry.INSTANCE.put(TestLanguagePackage.eNS_URI, theTestLanguagePackage); return theTestLanguagePackage; @@ -104,6 +104,7 @@ public static TestLanguagePackage init() * * @generated */ + @Override public EClass getModel() { return modelEClass; @@ -114,6 +115,7 @@ public EClass getModel() * * @generated */ + @Override public EReference getModel_Greetings() { return (EReference)modelEClass.getEStructuralFeatures().get(0); @@ -124,6 +126,7 @@ public EReference getModel_Greetings() * * @generated */ + @Override public EClass getGreeting() { return greetingEClass; @@ -134,6 +137,7 @@ public EClass getGreeting() * * @generated */ + @Override public EAttribute getGreeting_Name() { return (EAttribute)greetingEClass.getEStructuralFeatures().get(0); @@ -144,6 +148,7 @@ public EAttribute getGreeting_Name() * * @generated */ + @Override public TestLanguageFactory getTestLanguageFactory() { return (TestLanguageFactory)getEFactoryInstance(); diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/util/TestLanguageAdapterFactory.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/util/TestLanguageAdapterFactory.java index 390ca36878..6a90c2ce05 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/util/TestLanguageAdapterFactory.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/util/TestLanguageAdapterFactory.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage.util; diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/util/TestLanguageSwitch.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/util/TestLanguageSwitch.java index 9d73c16ba8..023e0c99d6 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/util/TestLanguageSwitch.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/testLanguage/util/TestLanguageSwitch.java @@ -1,4 +1,5 @@ /** + * generated by Xtext */ package com.avaloq.tools.ddk.check.testLanguage.util; diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/validation/AbstractTestLanguageJavaValidator.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/validation/AbstractTestLanguageJavaValidator.java deleted file mode 100644 index 9c5472d699..0000000000 --- a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/validation/AbstractTestLanguageJavaValidator.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * generated by Xtext - */ -package com.avaloq.tools.ddk.check.validation; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.xtext.validation.ComposedChecks; - -@ComposedChecks(validators= {org.eclipse.xtext.validation.ImportUriValidator.class, org.eclipse.xtext.validation.NamesAreUniqueValidator.class}) -public class AbstractTestLanguageJavaValidator extends org.eclipse.xtext.validation.AbstractDeclarativeValidator { - - @Override - protected List getEPackages() { - List result = new ArrayList(); - result.add(com.avaloq.tools.ddk.check.testLanguage.TestLanguagePackage.eINSTANCE); - return result; - } - -} diff --git a/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/validation/AbstractTestLanguageValidator.java b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/validation/AbstractTestLanguageValidator.java new file mode 100644 index 0000000000..e3a4db0b25 --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime/src-gen/com/avaloq/tools/ddk/check/validation/AbstractTestLanguageValidator.java @@ -0,0 +1,23 @@ +/* + * generated by Xtext + */ +package com.avaloq.tools.ddk.check.validation; + +import java.util.ArrayList; +import java.util.List; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.xtext.validation.AbstractDeclarativeValidator; +import org.eclipse.xtext.validation.ComposedChecks; +import org.eclipse.xtext.validation.ImportUriValidator; +import org.eclipse.xtext.validation.NamesAreUniqueValidator; + +@ComposedChecks(validators = {ImportUriValidator.class, NamesAreUniqueValidator.class}) +public abstract class AbstractTestLanguageValidator extends AbstractDeclarativeValidator { + + @Override + protected List getEPackages() { + List result = new ArrayList(); + result.add(com.avaloq.tools.ddk.check.testLanguage.TestLanguagePackage.eINSTANCE); + return result; + } +} diff --git a/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/GenerateTestLanguage.mwe2 b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/GenerateTestLanguage.mwe2 index 0d8207ae51..2e95630bd7 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/GenerateTestLanguage.mwe2 +++ b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/GenerateTestLanguage.mwe2 @@ -9,6 +9,7 @@ import com.avaloq.tools.ddk.xtext.generator.* import com.avaloq.tools.ddk.xtext.generator.resourceFactory.* import com.avaloq.tools.ddk.xtext.generator.ecore.* import com.avaloq.tools.ddk.xtext.generator.model.project.* +import com.avaloq.tools.ddk.check.generator.* var grammarURI = "classpath:/com/avaloq/tools/ddk/check/TestLanguage.xtext" var file.extensions = "checktest" @@ -26,17 +27,27 @@ Workflow { directory = "${runtimeProject}/src-gen" } + component = DirectoryCleaner { + directory = "${runtimeProject}.ide/src-gen" + } + component = DirectoryCleaner { directory = "${runtimeProject}.ui/src-gen" } component = XtextGenerator { - configuration = GeneratorModule { + configuration = TestLanguageGeneratorModule { project = ProjectConfig { baseName = projectName rootPath = rootPath runtimeSuffix = "" - forceDisableIdeProject = true + forceDisableIdeProject = false + runtime = { + ecoreModel = "${runtimeProject}/src-gen/com/avaloq/tools/ddk/check" + } + genericIde = { + enabled = true + } runtimeTest = { enabled = false } @@ -52,6 +63,7 @@ Workflow { encoding = "UTF-8" lineDelimiter = "\n" fileHeader = "/*\n * generated by Xtext\n */" + preferXtendStubs = false } } @@ -73,11 +85,17 @@ Workflow { // the serialization component fragment = serializer.SerializerFragment2 {} - // The antlr parser generator fragment. + // The antlr parser generator fragment, including the content assist parser of the IDE project. fragment = parser.antlr.XtextAntlrGeneratorFragment2 { options = auto-inject {} } + // validation API + fragment = validation.ValidatorFragment2 { + composedCheck = "org.eclipse.xtext.validation.ImportUriValidator" + composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" + } + // scoping and exporting API fragment = scoping.ImportNamespacesScopingFragment2 {} fragment = exporting.QualifiedNamesFragment2 {} @@ -102,15 +120,15 @@ Workflow { // content assist API fragment = contentAssist.ContentAssistFragment2 {} + // code templates and their preference page + fragment = templates.CodetemplatesGeneratorFragment2 {} + // provides the necessary bindings for java types integration fragment = types.TypesGeneratorFragment2 {} // generates the required bindings only if the grammar inherits from Xbase fragment = xbase.XbaseGeneratorFragment2 {} - // provides a preference page for template proposals - fragment = templates.CodetemplatesGeneratorFragment2 {} - // rename refactoring fragment = refactoring.RefactorElementNameFragment2 {} @@ -118,8 +136,12 @@ Workflow { fragment = compare.CompareFragment2 {} // formatter API - fragment = org.eclipse.xtext.xtext.generator.formatting.Formatter2Fragment2 { - generateStub = false + fragment = com.avaloq.tools.ddk.xtext.generator.formatting.FormatterFragment2 {} + + // Strip bundle-version introduced e.g. by SerializerFragment2 + fragment = BundleVersionStripperFragment { + bundle = "org.eclipse.xtext.xbase.lib" + bundle = "org.antlr.runtime" } } } diff --git a/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGenerator.java b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGenerator.java index 129fdefbbf..ff132f5b4d 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGenerator.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGenerator.java @@ -11,14 +11,18 @@ package com.avaloq.tools.ddk.check.generator; import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.xtext.generator.IFileSystemAccess; -import org.eclipse.xtext.generator.IGenerator; +import org.eclipse.xtext.generator.AbstractGenerator; +import org.eclipse.xtext.generator.IFileSystemAccess2; +import org.eclipse.xtext.generator.IGeneratorContext; -public class TestLanguageGenerator implements IGenerator { +/** + * Code generator of the test language, which generates nothing. + */ +public class TestLanguageGenerator extends AbstractGenerator { @Override - public void doGenerate(final Resource resource, final IFileSystemAccess fsa) { - // TODO implement me + public void doGenerate(final Resource input, final IFileSystemAccess2 fsa, final IGeneratorContext context) { + // nothing to generate } } diff --git a/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGeneratorModule.java b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGeneratorModule.java new file mode 100644 index 0000000000..e25f79827c --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGeneratorModule.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2026 Avaloq Group AG and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Avaloq Group AG - initial API and implementation + *******************************************************************************/ +package com.avaloq.tools.ddk.check.generator; + +import org.eclipse.xtext.xtext.generator.XtextGeneratorNaming; + +import com.avaloq.tools.ddk.xtext.generator.GeneratorModule; + + +/** + * Generator module of GenerateTestLanguage.mwe2. + */ +public class TestLanguageGeneratorModule extends GeneratorModule { + + @Override + public Class bindXtextGeneratorNaming() { + return TestLanguageGeneratorNaming.class; + } +} diff --git a/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGeneratorNaming.java b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGeneratorNaming.java new file mode 100644 index 0000000000..7d6b0ce2c3 --- /dev/null +++ b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/generator/TestLanguageGeneratorNaming.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2026 Avaloq Group AG and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Avaloq Group AG - initial API and implementation + *******************************************************************************/ +package com.avaloq.tools.ddk.check.generator; + +import org.eclipse.xtext.xtext.generator.model.TypeReference; + +import com.avaloq.tools.ddk.xtext.generator.GeneratorNaming; + + +/** + * Naming of the test language's generated classes, keeping the activator name that the UI manifest and the tests refer to. + */ +public class TestLanguageGeneratorNaming extends GeneratorNaming { + + @Override + public TypeReference getEclipsePluginActivator() { + return new TypeReference("com.avaloq.tools.ddk.check.ui.internal", "TestLanguageActivator"); //$NON-NLS-1$ //$NON-NLS-2$ + } +} diff --git a/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/validation/TestLanguageJavaValidator.java b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/validation/TestLanguageValidator.java similarity index 90% rename from com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/validation/TestLanguageJavaValidator.java rename to com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/validation/TestLanguageValidator.java index 0a41c663ea..597cd23ee4 100644 --- a/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/validation/TestLanguageJavaValidator.java +++ b/com.avaloq.tools.ddk.check.test.runtime/src/com/avaloq/tools/ddk/check/validation/TestLanguageValidator.java @@ -19,10 +19,10 @@ /** - * The Class TestLanguageJavaValidator. + * Custom validation rules of the test language. */ @SuppressWarnings("nls") -public class TestLanguageJavaValidator extends AbstractTestLanguageJavaValidator { +public class TestLanguageValidator extends AbstractTestLanguageValidator { @Check public void checkGreetingStartsWithCapital(final Greeting greeting) { diff --git a/ddk-parent/pom.xml b/ddk-parent/pom.xml index 4c8506ada1..ff72c619c1 100644 --- a/ddk-parent/pom.xml +++ b/ddk-parent/pom.xml @@ -122,6 +122,7 @@ ../com.avaloq.tools.ddk.check.runtime.core.test ../com.avaloq.tools.ddk.check.ui.test ../com.avaloq.tools.ddk.check.test.runtime + ../com.avaloq.tools.ddk.check.test.runtime.ide ../com.avaloq.tools.ddk.check.test.runtime.tests ../com.avaloq.tools.ddk.check.test.runtime.ui ../com.avaloq.tools.ddk.checkcfg.core