mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00
[eclipse/xtext#1679] ported xtend to java
Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
This commit is contained in:
parent
da7c786347
commit
c64394f33c
4 changed files with 51 additions and 90 deletions
|
@ -6,12 +6,6 @@
|
||||||
<attribute name="gradle_used_by_scope" value="mwe2"/>
|
<attribute name="gradle_used_by_scope" value="mwe2"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" output="bin/mwe2" path="xtend-gen">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="gradle_scope" value="mwe2"/>
|
|
||||||
<attribute name="gradle_used_by_scope" value="mwe2"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||||
<classpathentry kind="output" path="bin/default"/>
|
<classpathentry kind="output" path="bin/default"/>
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2016, 2020 itemis AG (http://www.itemis.eu) and others.
|
||||||
|
* This program and the accompanying materials are made available under the
|
||||||
|
* terms of the Eclipse Public License 2.0 which is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-2.0.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: EPL-2.0
|
||||||
|
*/
|
||||||
|
package org.eclipse.xtext.xtext.bootstrap;
|
||||||
|
|
||||||
|
import org.eclipse.xtext.Grammar;
|
||||||
|
import org.eclipse.xtext.xtext.generator.DefaultGeneratorModule;
|
||||||
|
import org.eclipse.xtext.xtext.generator.XtextGeneratorNaming;
|
||||||
|
import org.eclipse.xtext.xtext.generator.model.TypeReference;
|
||||||
|
|
||||||
|
public class XtextLangGeneratorModule extends DefaultGeneratorModule {
|
||||||
|
|
||||||
|
public Class<? extends XtextGeneratorNaming> bindNaming() {
|
||||||
|
return XtextLangGeneratorNaming.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class XtextLangGeneratorNaming extends XtextGeneratorNaming {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGenericIdeBasePackage(Grammar grammar) {
|
||||||
|
if (isXtext(grammar)) {
|
||||||
|
return "org.eclipse.xtext.xtext.ide";
|
||||||
|
} else {
|
||||||
|
return super.getGenericIdeBasePackage(grammar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getEclipsePluginBasePackage(Grammar grammar) {
|
||||||
|
if (isXtext(grammar)) {
|
||||||
|
return "org.eclipse.xtext.xtext.ui";
|
||||||
|
} else {
|
||||||
|
return super.getEclipsePluginBasePackage(grammar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TypeReference getEclipsePluginActivator() {
|
||||||
|
return new TypeReference("org.eclipse.xtext.xtext.ui.internal", "Activator");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isXtext(Grammar grammar) {
|
||||||
|
return grammar.getName().equals("org.eclipse.xtext.Xtext");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,40 +0,0 @@
|
||||||
package org.eclipse.xtext.xtext.bootstrap
|
|
||||||
|
|
||||||
import org.eclipse.xtext.Grammar
|
|
||||||
import org.eclipse.xtext.xtext.generator.DefaultGeneratorModule
|
|
||||||
import org.eclipse.xtext.xtext.generator.XtextGeneratorNaming
|
|
||||||
import org.eclipse.xtext.xtext.generator.model.TypeReference
|
|
||||||
|
|
||||||
class XtextLangGeneratorModule extends DefaultGeneratorModule {
|
|
||||||
|
|
||||||
def Class<? extends XtextGeneratorNaming> bindNaming() {
|
|
||||||
return XtextLangGeneratorNaming
|
|
||||||
}
|
|
||||||
|
|
||||||
static class XtextLangGeneratorNaming extends XtextGeneratorNaming {
|
|
||||||
|
|
||||||
override getGenericIdeBasePackage(Grammar grammar) {
|
|
||||||
if (isXtext(grammar)) {
|
|
||||||
return "org.eclipse.xtext.xtext.ide";
|
|
||||||
} else {
|
|
||||||
return super.getGenericIdeBasePackage(grammar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override getEclipsePluginBasePackage(Grammar grammar) {
|
|
||||||
if (isXtext(grammar)) {
|
|
||||||
return "org.eclipse.xtext.xtext.ui";
|
|
||||||
} else {
|
|
||||||
return super.getEclipsePluginBasePackage(grammar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override getEclipsePluginActivator() {
|
|
||||||
return new TypeReference("org.eclipse.xtext.xtext.ui.internal", "Activator");
|
|
||||||
}
|
|
||||||
|
|
||||||
def boolean isXtext(Grammar grammar) {
|
|
||||||
return grammar.getName().equals("org.eclipse.xtext.Xtext");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
package org.eclipse.xtext.xtext.bootstrap;
|
|
||||||
|
|
||||||
import org.eclipse.xtext.Grammar;
|
|
||||||
import org.eclipse.xtext.xtext.generator.DefaultGeneratorModule;
|
|
||||||
import org.eclipse.xtext.xtext.generator.XtextGeneratorNaming;
|
|
||||||
import org.eclipse.xtext.xtext.generator.model.TypeReference;
|
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class XtextLangGeneratorModule extends DefaultGeneratorModule {
|
|
||||||
public static class XtextLangGeneratorNaming extends XtextGeneratorNaming {
|
|
||||||
@Override
|
|
||||||
public String getGenericIdeBasePackage(final Grammar grammar) {
|
|
||||||
boolean _isXtext = this.isXtext(grammar);
|
|
||||||
if (_isXtext) {
|
|
||||||
return "org.eclipse.xtext.xtext.ide";
|
|
||||||
} else {
|
|
||||||
return super.getGenericIdeBasePackage(grammar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getEclipsePluginBasePackage(final Grammar grammar) {
|
|
||||||
boolean _isXtext = this.isXtext(grammar);
|
|
||||||
if (_isXtext) {
|
|
||||||
return "org.eclipse.xtext.xtext.ui";
|
|
||||||
} else {
|
|
||||||
return super.getEclipsePluginBasePackage(grammar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TypeReference getEclipsePluginActivator() {
|
|
||||||
return new TypeReference("org.eclipse.xtext.xtext.ui.internal", "Activator");
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isXtext(final Grammar grammar) {
|
|
||||||
return grammar.getName().equals("org.eclipse.xtext.Xtext");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class<? extends XtextGeneratorNaming> bindNaming() {
|
|
||||||
return XtextLangGeneratorModule.XtextLangGeneratorNaming.class;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue