Commit 650ef7b5 authored by Arnaud Dieumegard's avatar Arnaud Dieumegard

Added mapping xtext editor

parent a85ade0b
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="xtend-gen"/>
<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.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.irtsaintexupery.xtext.pseim.mapping.ide</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com.irtsaintexupery.xtext.pseim.mapping.ide
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: com.irtsaintexupery.xtext.pseim.mapping.ide; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: com.irtsaintexupery.xtext.pseim.mapping,
com.irtsaintexupery.pseim,
org.eclipse.xtext.ide,
org.eclipse.xtext.xbase.ide,
org.antlr.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: com.irtsaintexupery.xtext.pseim.ide.contentassist.antlr.internal,
com.irtsaintexupery.xtext.pseim.ide.contentassist.antlr
source.. = src/,\
src-gen/,\
xtend-gen/
bin.includes = .,\
META-INF/
bin.excludes = **/*.xtend
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ide;
import com.google.inject.Binder;
import com.google.inject.name.Names;
import com.irtsaintexupery.xtext.pseim.ide.contentassist.antlr.MappingParser;
import com.irtsaintexupery.xtext.pseim.ide.contentassist.antlr.internal.InternalMappingLexer;
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;
/**
* Manual modifications go to {@link MappingIdeModule}.
*/
@SuppressWarnings("all")
public abstract class AbstractMappingIdeModule 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(InternalMappingLexer.class);
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends IContentAssistParser> bindIContentAssistParser() {
return MappingParser.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends IProposalConflictHelper> bindIProposalConflictHelper() {
return AntlrProposalConflictHelper.class;
}
// contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2
public Class<? extends IPrefixMatcher> bindIPrefixMatcher() {
return FQNPrefixMatcher.class;
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ide.contentassist.antlr;
import com.google.inject.Inject;
import com.irtsaintexupery.xtext.pseim.ide.contentassist.antlr.internal.InternalMappingParser;
import com.irtsaintexupery.xtext.pseim.services.MappingGrammarAccess;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser;
public class MappingParser extends AbstractContentAssistParser {
@Inject
private MappingGrammarAccess grammarAccess;
private Map<AbstractElement, String> nameMappings;
@Override
protected InternalMappingParser createParser() {
InternalMappingParser result = new InternalMappingParser(null);
result.setGrammarAccess(grammarAccess);
return result;
}
@Override
protected String getRuleName(AbstractElement element) {
if (nameMappings == null) {
nameMappings = new HashMap<AbstractElement, String>() {
private static final long serialVersionUID = 1L;
{
put(grammarAccess.getPatternApplicationAccess().getGroup(), "rule__PatternApplication__Group__0");
put(grammarAccess.getPatternApplicationAccess().getGroup_5(), "rule__PatternApplication__Group_5__0");
put(grammarAccess.getPatternApplicationAccess().getGroup_6(), "rule__PatternApplication__Group_6__0");
put(grammarAccess.getPatternApplicationAccess().getGroup_7(), "rule__PatternApplication__Group_7__0");
put(grammarAccess.getCardinalityValueAccess().getGroup(), "rule__CardinalityValue__Group__0");
put(grammarAccess.getPortMappingAccess().getGroup(), "rule__PortMapping__Group__0");
put(grammarAccess.getPortMappingAccess().getGroup_1(), "rule__PortMapping__Group_1__0");
put(grammarAccess.getGraphElementMappingAccess().getGroup(), "rule__GraphElementMapping__Group__0");
put(grammarAccess.getGraphElementMappingAccess().getGroup_1(), "rule__GraphElementMapping__Group_1__0");
put(grammarAccess.getEIntAccess().getGroup(), "rule__EInt__Group__0");
put(grammarAccess.getQualifiedIDAccess().getGroup(), "rule__QualifiedID__Group__0");
put(grammarAccess.getQualifiedIDAccess().getGroup_1(), "rule__QualifiedID__Group_1__0");
put(grammarAccess.getPatternApplicationAccess().getModelAssignment_1(), "rule__PatternApplication__ModelAssignment_1");
put(grammarAccess.getPatternApplicationAccess().getPatternAssignment_3(), "rule__PatternApplication__PatternAssignment_3");
put(grammarAccess.getPatternApplicationAccess().getCardinalityValuesAssignment_5_1(), "rule__PatternApplication__CardinalityValuesAssignment_5_1");
put(grammarAccess.getPatternApplicationAccess().getCardinalityValuesAssignment_5_2(), "rule__PatternApplication__CardinalityValuesAssignment_5_2");
put(grammarAccess.getPatternApplicationAccess().getModelElementAssignment_6_1(), "rule__PatternApplication__ModelElementAssignment_6_1");
put(grammarAccess.getPatternApplicationAccess().getModelElementAssignment_6_2(), "rule__PatternApplication__ModelElementAssignment_6_2");
put(grammarAccess.getPatternApplicationAccess().getPortMappingAssignment_7_1(), "rule__PatternApplication__PortMappingAssignment_7_1");
put(grammarAccess.getPatternApplicationAccess().getPortMappingAssignment_7_2(), "rule__PatternApplication__PortMappingAssignment_7_2");
put(grammarAccess.getCardinalityValueAccess().getCardinalityElementAssignment_0(), "rule__CardinalityValue__CardinalityElementAssignment_0");
put(grammarAccess.getCardinalityValueAccess().getValueAssignment_2(), "rule__CardinalityValue__ValueAssignment_2");
put(grammarAccess.getPortMappingAccess().getModelPortAssignment_0(), "rule__PortMapping__ModelPortAssignment_0");
put(grammarAccess.getPortMappingAccess().getModelPortAssignment_1_1(), "rule__PortMapping__ModelPortAssignment_1_1");
put(grammarAccess.getPortMappingAccess().getPatternPortAssignment_3(), "rule__PortMapping__PatternPortAssignment_3");
put(grammarAccess.getGraphElementMappingAccess().getModelGraphElementAssignment_0(), "rule__GraphElementMapping__ModelGraphElementAssignment_0");
put(grammarAccess.getGraphElementMappingAccess().getModelGraphElementAssignment_1_1(), "rule__GraphElementMapping__ModelGraphElementAssignment_1_1");
put(grammarAccess.getGraphElementMappingAccess().getPatternGraphElementAssignment_3(), "rule__GraphElementMapping__PatternGraphElementAssignment_3");
}
};
}
return nameMappings.get(element);
}
@Override
protected String[] getInitialHiddenTokens() {
return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
}
public MappingGrammarAccess getGrammarAccess() {
return this.grammarAccess;
}
public void setGrammarAccess(MappingGrammarAccess grammarAccess) {
this.grammarAccess = grammarAccess;
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ide.contentassist.antlr;
import java.util.Collection;
import java.util.Collections;
import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.ide.editor.contentassist.antlr.FollowElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
import org.eclipse.xtext.ide.editor.partialEditing.IPartialEditingContentAssistParser;
import org.eclipse.xtext.util.PolymorphicDispatcher;
public class PartialMappingContentAssistParser extends MappingParser implements IPartialEditingContentAssistParser {
private AbstractRule rule;
@Override
public void initializeFor(AbstractRule rule) {
this.rule = rule;
}
@Override
protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
if (rule == null || rule.eIsProxy())
return Collections.emptyList();
String methodName = "entryRule" + rule.getName();
PolymorphicDispatcher<Collection<FollowElement>> dispatcher =
new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser));
dispatcher.invoke();
return parser.getFollowElements();
}
}
','=19
'-'=20
'->'=18
'.'=21
'components'=16
'multiplicity'=15
'ports'=17
'transform'=11
'using'=12
'{'=13
'}'=14
RULE_ANY_OTHER=10
RULE_ID=5
RULE_INT=4
RULE_ML_COMMENT=7
RULE_SL_COMMENT=8
RULE_STRING=6
RULE_WS=9
T__11=11
T__12=12
T__13=13
T__14=14
T__15=15
T__16=16
T__17=17
T__18=18
T__19=19
T__20=20
T__21=21
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ide
/**
* Use this class to register ide components.
*/
class MappingIdeModule extends AbstractMappingIdeModule {
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ide
import com.google.inject.Guice
import com.irtsaintexupery.xtext.pseim.MappingRuntimeModule
import com.irtsaintexupery.xtext.pseim.MappingStandaloneSetup
import org.eclipse.xtext.util.Modules2
/**
* Initialization support for running Xtext languages as language servers.
*/
class MappingIdeSetup extends MappingStandaloneSetup {
override createInjector() {
Guice.createInjector(Modules2.mixin(new MappingRuntimeModule, new MappingIdeModule))
}
}
/.MappingIdeModule.java._trace
/.MappingIdeSetup.java._trace
/.MappingIdeModule.xtendbin
/.MappingIdeSetup.xtendbin
/MappingIdeModule.java
/MappingIdeSetup.java
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="xtend-gen"/>
<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.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.irtsaintexupery.xtext.pseim.mapping.ui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com.irtsaintexupery.xtext.pseim.mapping.ui
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: com.irtsaintexupery.xtext.pseim.mapping.ui; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: com.irtsaintexupery.xtext.pseim.mapping,
com.irtsaintexupery.xtext.pseim.mapping.ide,
com.irtsaintexupery.pseim,
org.eclipse.xtext.ui,
org.eclipse.xtext.ui.shared,
org.eclipse.xtext.ui.codetemplates.ui,
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.ui.ide;bundle-version="3.5.0",
org.eclipse.ui,
org.eclipse.compare,
org.eclipse.xtext.builder,
org.eclipse.xtend.lib;resolution:=optional,
org.eclipse.xtext.xbase.lib
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: com.irtsaintexupery.xtext.pseim.ui.contentassist,
com.irtsaintexupery.xtext.pseim.mapping.ui.internal,
com.irtsaintexupery.xtext.pseim.ui.quickfix
Bundle-Activator: com.irtsaintexupery.xtext.pseim.mapping.ui.internal.MappingActivator
source.. = src/,\
src-gen/,\
xtend-gen/
bin.includes = .,\
META-INF/,\
plugin.xml
bin.excludes = **/*.xtend
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.mapping.ui.internal;
import com.google.common.collect.Maps;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.irtsaintexupery.xtext.pseim.MappingRuntimeModule;
import com.irtsaintexupery.xtext.pseim.ui.MappingUiModule;
import java.util.Collections;
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;
/**
* This class was generated. Customizations should only happen in a newly
* introduced subclass.
*/
public class MappingActivator extends AbstractUIPlugin {
public static final String COM_IRTSAINTEXUPERY_XTEXT_PSEIM_MAPPING = "com.irtsaintexupery.xtext.pseim.Mapping";
private static final Logger logger = Logger.getLogger(MappingActivator.class);
private static MappingActivator INSTANCE;
private Map<String, Injector> injectors = Collections.synchronizedMap(Maps.<String, Injector> newHashMapWithExpectedSize(1));
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
INSTANCE = this;
}
@Override
public void stop(BundleContext context) throws Exception {
injectors.clear();
INSTANCE = null;
super.stop(context);
}
public static MappingActivator getInstance() {
return INSTANCE;
}
public Injector getInjector(String language) {
synchronized (injectors) {
Injector injector = injectors.get(language);
if (injector == null) {
injectors.put(language, injector = createInjector(language));
}
return injector;
}
}
protected Injector createInjector(String language) {
try {
Module runtimeModule = getRuntimeModule(language);
Module sharedStateModule = getSharedStateModule();
Module uiModule = getUiModule(language);
Module mergedModule = Modules2.mixin(runtimeModule, sharedStateModule, uiModule);
return Guice.createInjector(mergedModule);
} catch (Exception e) {
logger.error("Failed to create injector for " + language);
logger.error(e.getMessage(), e);
throw new RuntimeException("Failed to create injector for " + language, e);
}
}
protected Module getRuntimeModule(String grammar) {
if (COM_IRTSAINTEXUPERY_XTEXT_PSEIM_MAPPING.equals(grammar)) {
return new MappingRuntimeModule();
}
throw new IllegalArgumentException(grammar);
}
protected Module getUiModule(String grammar) {
if (COM_IRTSAINTEXUPERY_XTEXT_PSEIM_MAPPING.equals(grammar)) {
return new MappingUiModule(this);
}
throw new IllegalArgumentException(grammar);
}
protected Module getSharedStateModule() {
return new SharedStateModule();
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ui;
import com.google.inject.Injector;
import com.irtsaintexupery.xtext.pseim.mapping.ui.internal.MappingActivator;
import org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory;
import org.osgi.framework.Bundle;
/**
* This class was generated. Customizations should only happen in a newly
* introduced subclass.
*/
public class MappingExecutableExtensionFactory extends AbstractGuiceAwareExecutableExtensionFactory {
@Override
protected Bundle getBundle() {
return MappingActivator.getInstance().getBundle();
}
@Override
protected Injector getInjector() {
return MappingActivator.getInstance().getInjector(MappingActivator.COM_IRTSAINTEXUPERY_XTEXT_PSEIM_MAPPING);
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ui.contentassist;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.Assignment;
import org.eclipse.xtext.CrossReference;
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 TerminalsProposalProvider}.
* Methods are dynamically dispatched on the first parameter, i.e., you can override them
* with a more concrete subtype.
*/
public abstract class AbstractMappingProposalProvider extends TerminalsProposalProvider {
public void completePatternApplication_Model(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
}
public void completePatternApplication_Pattern(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
}
public void completePatternApplication_CardinalityValues(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completePatternApplication_ModelElement(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completePatternApplication_PortMapping(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completeCardinalityValue_CardinalityElement(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
}
public void completeCardinalityValue_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
}
public void completePortMapping_ModelPort(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
}
public void completePortMapping_PatternPort(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
}
public void completeGraphElementMapping_ModelGraphElement(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
}
public void completeGraphElementMapping_PatternGraphElement(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
}
public void complete_PatternApplication(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_CardinalityValue(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_PortMapping(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_GraphElementMapping(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_EInt(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
public void complete_QualifiedID(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
// subclasses may override
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ui
import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor
/**
* Use this class to register components to be used within the Eclipse IDE.
*/
@FinalFieldsConstructor
class MappingUiModule extends AbstractMappingUiModule {
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ui.contentassist
/**
* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#content-assist
* on how to customize the content assistant.
*/
class MappingProposalProvider extends AbstractMappingProposalProvider {
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ui.labeling
import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider
/**
* Provides labels for IEObjectDescriptions and IResourceDescriptions.
*
* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider
*/
class MappingDescriptionLabelProvider extends DefaultDescriptionLabelProvider {
// Labels and icons can be computed like this:
// override text(IEObjectDescription ele) {
// ele.name.toString
// }
//
// override image(IEObjectDescription ele) {
// ele.EClass.name + '.gif'
// }
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ui.labeling
import com.google.inject.Inject
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider
/**
* Provides labels for EObjects.
*
* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider
*/
class MappingLabelProvider extends DefaultEObjectLabelProvider {
@Inject
new(AdapterFactoryLabelProvider delegate) {
super(delegate);
}
// Labels and icons can be computed like this:
// def text(Greeting ele) {
// 'A greeting to ' + ele.name
// }
//
// def image(Greeting ele) {
// 'Greeting.gif'
// }
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ui.outline
import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider
/**
* Customization of the default outline structure.
*
* See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline
*/
class MappingOutlineTreeProvider extends DefaultOutlineTreeProvider {
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.ui.quickfix
import org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider
/**
* Custom quickfixes.
*
* See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#quick-fixes
*/
class MappingQuickfixProvider extends DefaultQuickfixProvider {
// @Fix(MappingValidator.INVALID_NAME)
// def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) {
// acceptor.accept(issue, 'Capitalize name', 'Capitalize the name.', 'upcase.png') [
// context |
// val xtextDocument = context.xtextDocument
// val firstLetter = xtextDocument.get(issue.offset, 1)
// xtextDocument.replace(issue.offset, 1, firstLetter.toUpperCase)
// ]
// }
}
/.MappingUiModule.java._trace
/.MappingUiModule.xtendbin
/MappingUiModule.java
/.MappingProposalProvider.java._trace
/.MappingProposalProvider.xtendbin
/MappingProposalProvider.java
/.MappingDescriptionLabelProvider.java._trace
/.MappingLabelProvider.java._trace
/.MappingDescriptionLabelProvider.xtendbin
/.MappingLabelProvider.xtendbin
/MappingDescriptionLabelProvider.java
/MappingLabelProvider.java
/.MappingOutlineTreeProvider.java._trace
/.MappingOutlineTreeProvider.xtendbin
/MappingOutlineTreeProvider.java
/.MappingQuickfixProvider.java._trace
/.MappingQuickfixProvider.xtendbin
/MappingQuickfixProvider.java
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="xtend-gen"/>
<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.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.emf.mwe2.launch.Mwe2LaunchConfigurationType">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.irtsaintexupery.xtext.pseim.mapping"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/com.irtsaintexupery.xtext.pseim.mapping&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/com.irtsaintexupery.xtext.pseim.mapping.ide&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/com.irtsaintexupery.xtext.pseim.mapping.ui&quot; type=&quot;4&quot;/&gt;&#10;;&lt;/resources&gt;}"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="com.irtsaintexupery.xtext.pseim.GenerateMapping"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.irtsaintexupery.xtext.pseim.mapping"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
<booleanAttribute key="append.args" value="true"/>
<booleanAttribute key="askclear" value="true"/>
<booleanAttribute key="automaticAdd" value="true"/>
<booleanAttribute key="automaticValidate" value="false"/>
<stringAttribute key="bad_container_name" value="/com.irtsaintexupery.xtext.pseim.mapping/.launch/"/>
<stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="false"/>
<booleanAttribute key="clearws" value="false"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Launch Runtime Eclipse"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../runtime-EclipseXtext"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
<booleanAttribute key="useProduct" value="true"/>
<booleanAttribute key="usefeatures" value="false"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.irtsaintexupery.xtext.pseim.mapping</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com.irtsaintexupery.xtext.pseim.mapping
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: com.irtsaintexupery.xtext.pseim.mapping; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: com.irtsaintexupery.pseim,
org.eclipse.xtext,
org.eclipse.xtext.xbase,
org.eclipse.equinox.common;bundle-version="3.5.0",
org.eclipse.xtext.xbase.lib,
org.eclipse.xtext.util,
org.eclipse.xtend.lib,
org.antlr.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: com.irtsaintexupery.xtext.pseim.serializer,
com.irtsaintexupery.xtext.pseim.scoping,
com.irtsaintexupery.xtext.pseim.formatting2,
com.irtsaintexupery.xtext.pseim.services,
com.irtsaintexupery.xtext.pseim,
com.irtsaintexupery.xtext.pseim.generator,
com.irtsaintexupery.xtext.pseim.validation,
com.irtsaintexupery.xtext.pseim.parser.antlr,
com.irtsaintexupery.xtext.pseim.parser.antlr.internal
Import-Package: org.apache.log4j
source.. = src/,\
src-gen/,\
xtend-gen/
bin.includes = .,\
META-INF/
bin.excludes = **/*.mwe2,\
**/*.xtend
additional.bundles = org.eclipse.xtext.xbase,\
org.eclipse.xtext.common.types,\
org.eclipse.xtext.xtext.generator,\
org.eclipse.emf.codegen.ecore,\
org.eclipse.emf.mwe.utils,\
org.eclipse.emf.mwe2.launch,\
org.eclipse.emf.mwe2.lib,\
org.objectweb.asm,\
org.apache.commons.logging,\
org.apache.log4j,\
com.ibm.icu,\
org.eclipse.xtext.generator
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim;
import com.google.inject.Binder;
import com.google.inject.Provider;
import com.google.inject.name.Names;
import com.irtsaintexupery.xtext.pseim.formatting2.MappingFormatter;
import com.irtsaintexupery.xtext.pseim.generator.MappingGenerator;
import com.irtsaintexupery.xtext.pseim.parser.antlr.MappingAntlrTokenFileProvider;
import com.irtsaintexupery.xtext.pseim.parser.antlr.MappingParser;
import com.irtsaintexupery.xtext.pseim.parser.antlr.internal.InternalMappingLexer;
import com.irtsaintexupery.xtext.pseim.scoping.MappingScopeProvider;
import com.irtsaintexupery.xtext.pseim.serializer.MappingSemanticSequencer;
import com.irtsaintexupery.xtext.pseim.serializer.MappingSyntacticSequencer;
import com.irtsaintexupery.xtext.pseim.services.MappingGrammarAccess;
import com.irtsaintexupery.xtext.pseim.validation.MappingValidator;
import java.util.Properties;
import org.eclipse.xtext.Constants;
import org.eclipse.xtext.IGrammarAccess;
import org.eclipse.xtext.common.services.Ecore2XtextTerminalConverters;
import org.eclipse.xtext.conversion.IValueConverterService;
import org.eclipse.xtext.formatting2.FormatterPreferenceValuesProvider;
import org.eclipse.xtext.formatting2.FormatterPreferences;
import org.eclipse.xtext.formatting2.IFormatter2;
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.preferences.IPreferenceValuesProvider;
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.DefaultGlobalScopeProvider;
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.DefaultRuntimeModule;
import org.eclipse.xtext.service.SingletonBinding;
/**
* Manual modifications go to {@link MappingRuntimeModule}.
*/
@SuppressWarnings("all")
public abstract class AbstractMappingRuntimeModule extends DefaultRuntimeModule {
protected Properties properties = null;
@Override
public void configure(Binder binder) {
properties = tryBindProperties(binder, "com/irtsaintexupery/xtext/pseim/Mapping.properties");
super.configure(binder);
}
public void configureLanguageName(Binder binder) {
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("com.irtsaintexupery.xtext.pseim.Mapping");
}
public void configureFileExtensions(Binder binder) {
if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("mapping");
}
// contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
public ClassLoader bindClassLoaderToInstance() {
return getClass().getClassLoader();
}
// contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
public Class<? extends IGrammarAccess> bindIGrammarAccess() {
return MappingGrammarAccess.class;
}
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
return MappingSemanticSequencer.class;
}
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
return MappingSyntacticSequencer.class;
}
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
public Class<? extends ISerializer> bindISerializer() {
return Serializer.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends IParser> bindIParser() {
return MappingParser.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends ITokenToStringConverter> bindITokenToStringConverter() {
return AntlrTokenToStringConverter.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
return MappingAntlrTokenFileProvider.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends Lexer> bindLexer() {
return InternalMappingLexer.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
return AntlrTokenDefProvider.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Provider<? extends InternalMappingLexer> provideInternalMappingLexer() {
return LexerProvider.create(InternalMappingLexer.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(InternalMappingLexer.class);
}
// contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2
@SingletonBinding(eager=true)
public Class<? extends MappingValidator> bindMappingValidator() {
return MappingValidator.class;
}
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
public Class<? extends IScopeProvider> bindIScopeProvider() {
return MappingScopeProvider.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.xtext.generator.scoping.ImportNamespacesScopingFragment2
public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
return DefaultGlobalScopeProvider.class;
}
// 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.xtext.generator.exporting.QualifiedNamesFragment2
public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
return DefaultDeclarativeQualifiedNameProvider.class;
}
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
public Class<? extends IContainer.Manager> bindIContainer$Manager() {
return StateBasedContainerManager.class;
}
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
public Class<? extends IAllContainersState.Provider> bindIAllContainersState$Provider() {
return ResourceSetBasedAllContainersStateProvider.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.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.xtext.generator.generator.GeneratorFragment2
public Class<? extends IGenerator2> bindIGenerator2() {
return MappingGenerator.class;
}
// contributed by org.eclipse.xtext.xtext.generator.formatting.Formatter2Fragment2
public Class<? extends IFormatter2> bindIFormatter2() {
return MappingFormatter.class;
}
// contributed by org.eclipse.xtext.xtext.generator.formatting.Formatter2Fragment2
public void configureFormatterPreferences(Binder binder) {
binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
// contributed by org.eclipse.xtext.xtext.generator.ecore2xtext.Ecore2XtextValueConverterServiceFragment2
public Class<? extends IValueConverterService> bindIValueConverterService() {
return Ecore2XtextTerminalConverters.class;
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim;
import com.google.inject.Guice;
import com.google.inject.Injector;
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;
@SuppressWarnings("all")
public class MappingStandaloneSetupGenerated implements ISetup {
@Override
public Injector createInjectorAndDoEMFRegistration() {
TerminalsStandaloneSetup.doSetup();
Injector injector = createInjector();
register(injector);
return injector;
}
public Injector createInjector() {
return Guice.createInjector(new MappingRuntimeModule());
}
public void register(Injector injector) {
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("mapping", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("mapping", serviceProvider);
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.parser.antlr;
import java.io.InputStream;
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
public class MappingAntlrTokenFileProvider implements IAntlrTokenFileProvider {
@Override
public InputStream getAntlrTokenFile() {
ClassLoader classLoader = getClass().getClassLoader();
return classLoader.getResourceAsStream("com/irtsaintexupery/xtext/pseim/parser/antlr/internal/InternalMapping.tokens");
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.parser.antlr;
import com.google.inject.Inject;
import com.irtsaintexupery.xtext.pseim.parser.antlr.internal.InternalMappingParser;
import com.irtsaintexupery.xtext.pseim.services.MappingGrammarAccess;
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser;
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
public class MappingParser extends AbstractAntlrParser {
@Inject
private MappingGrammarAccess grammarAccess;
@Override
protected void setInitialHiddenTokens(XtextTokenStream tokenStream) {
tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
}
@Override
protected InternalMappingParser createParser(XtextTokenStream stream) {
return new InternalMappingParser(stream, getGrammarAccess());
}
@Override
protected String getDefaultRuleName() {
return "PatternApplication";
}
public MappingGrammarAccess getGrammarAccess() {
return this.grammarAccess;
}
public void setGrammarAccess(MappingGrammarAccess grammarAccess) {
this.grammarAccess = grammarAccess;
}
}
','=19
'-'=20
'->'=18
'.'=21
'components'=15
'multiplicity'=14
'ports'=16
'transform'=11
'using'=12
'{'=13
'}'=17
RULE_ANY_OTHER=10
RULE_ID=4
RULE_INT=5
RULE_ML_COMMENT=7
RULE_SL_COMMENT=8
RULE_STRING=6
RULE_WS=9
T__11=11
T__12=12
T__13=13
T__14=14
T__15=15
T__16=16
T__17=17
T__18=18
T__19=19
T__20=20
T__21=21
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.scoping;
import org.eclipse.xtext.scoping.impl.DelegatingScopeProvider;
public abstract class AbstractMappingScopeProvider extends DelegatingScopeProvider {
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.serializer;
import com.google.inject.Inject;
import com.irtsaintexupery.pseim.mapping.CardinalityValue;
import com.irtsaintexupery.pseim.mapping.GraphElementMapping;
import com.irtsaintexupery.pseim.mapping.MappingPackage;
import com.irtsaintexupery.pseim.mapping.PatternApplication;
import com.irtsaintexupery.pseim.mapping.PortMapping;
import com.irtsaintexupery.xtext.pseim.services.MappingGrammarAccess;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.xtext.Action;
import org.eclipse.xtext.Parameter;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.serializer.ISerializationContext;
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
@SuppressWarnings("all")
public class MappingSemanticSequencer extends AbstractDelegatingSemanticSequencer {
@Inject
private MappingGrammarAccess grammarAccess;
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == MappingPackage.eINSTANCE)
switch (semanticObject.eClass().getClassifierID()) {
case MappingPackage.CARDINALITY_VALUE:
sequence_CardinalityValue(context, (CardinalityValue) semanticObject);
return;
case MappingPackage.GRAPH_ELEMENT_MAPPING:
sequence_GraphElementMapping(context, (GraphElementMapping) semanticObject);
return;
case MappingPackage.PATTERN_APPLICATION:
sequence_PatternApplication(context, (PatternApplication) semanticObject);
return;
case MappingPackage.PORT_MAPPING:
sequence_PortMapping(context, (PortMapping) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
/**
* Contexts:
* CardinalityValue returns CardinalityValue
*
* Constraint:
* (cardinalityElement=[CardinalityElement|QualifiedID] value=EInt)
*/
protected void sequence_CardinalityValue(ISerializationContext context, CardinalityValue semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, MappingPackage.Literals.CARDINALITY_VALUE__CARDINALITY_ELEMENT) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, MappingPackage.Literals.CARDINALITY_VALUE__CARDINALITY_ELEMENT));
if (transientValues.isValueTransient(semanticObject, MappingPackage.Literals.CARDINALITY_VALUE__VALUE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, MappingPackage.Literals.CARDINALITY_VALUE__VALUE));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getCardinalityValueAccess().getCardinalityElementCardinalityElementQualifiedIDParserRuleCall_0_0_1(), semanticObject.eGet(MappingPackage.Literals.CARDINALITY_VALUE__CARDINALITY_ELEMENT, false));
feeder.accept(grammarAccess.getCardinalityValueAccess().getValueEIntParserRuleCall_2_0(), semanticObject.getValue());
feeder.finish();
}
/**
* Contexts:
* GraphElementMapping returns GraphElementMapping
*
* Constraint:
* (modelGraphElement+=[GraphElement|QualifiedID] modelGraphElement+=[GraphElement|QualifiedID]* patternGraphElement=[GraphElement|QualifiedID])
*/
protected void sequence_GraphElementMapping(ISerializationContext context, GraphElementMapping semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* PatternApplication returns PatternApplication
*
* Constraint:
* (
* model=[Model|ID]
* pattern=[Pattern|ID]
* (cardinalityValues+=CardinalityValue cardinalityValues+=CardinalityValue*)?
* (modelElement+=GraphElementMapping modelElement+=GraphElementMapping*)?
* (portMapping+=PortMapping portMapping+=PortMapping*)?
* )
*/
protected void sequence_PatternApplication(ISerializationContext context, PatternApplication semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* PortMapping returns PortMapping
*
* Constraint:
* (modelPort+=[BorderElement|QualifiedID] modelPort+=[BorderElement|QualifiedID]* patternPort=[BorderElement|QualifiedID])
*/
protected void sequence_PortMapping(ISerializationContext context, PortMapping semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.serializer;
import com.google.inject.Inject;
import com.irtsaintexupery.xtext.pseim.services.MappingGrammarAccess;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.IGrammarAccess;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
@SuppressWarnings("all")
public class MappingSyntacticSequencer extends AbstractSyntacticSequencer {
protected MappingGrammarAccess grammarAccess;
@Inject
protected void init(IGrammarAccess access) {
grammarAccess = (MappingGrammarAccess) access;
}
@Override
protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
return "";
}
@Override
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
if (transition.getAmbiguousSyntaxes().isEmpty()) return;
List<INode> transitionNodes = collectNodes(fromNode, toNode);
for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
acceptNodes(getLastNavigableState(), syntaxNodes);
}
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.validation;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.xtext.validation.AbstractDeclarativeValidator;
public abstract class AbstractMappingValidator extends AbstractDeclarativeValidator {
@Override
protected List<EPackage> getEPackages() {
List<EPackage> result = new ArrayList<EPackage>();
result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.irit.fr/patterns/mapping/0.1"));
return result;
}
}
module com.irtsaintexupery.xtext.pseim.GenerateMapping
import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*
var rootPath = ".."
Workflow {
component = XtextGenerator {
configuration = {
project = StandardProjectConfig {
baseName = "com.irtsaintexupery.xtext.pseim.mapping"
rootPath = rootPath
eclipsePlugin = {
enabled = true
}
createEclipseMetaData = true
}
code = {
encoding = "UTF-8"
lineDelimiter = "\n"
fileHeader = "/*\n * generated by Xtext \${version}\n */"
}
}
language = StandardLanguage {
name = "com.irtsaintexupery.xtext.pseim.Mapping"
fileExtensions = "mapping"
referencedResource = "platform:/resource/com.irtsaintexupery.pseim/model/seim.genmodel"
referencedResource = "platform:/resource/com.irtsaintexupery.pseim/model/mapping.genmodel"
referencedResource = "platform:/resource/com.irtsaintexupery.pseim/model/pseim.genmodel"
fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment2 auto-inject {}
formatter = {
generateStub = true
}
serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
}
}
}
// automatically generated by Xtext
grammar com.irtsaintexupery.xtext.pseim.Mapping with org.eclipse.xtext.common.Terminals
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.irit.fr/patterns/mapping/0.1" as mapping
import "http://www.irt-saintexupery.com/pseim/0.1" as pseim
import "http://www.irt-saintexupery.com/seim/0.1" as seim
PatternApplication returns mapping::PatternApplication:
'transform' model=[seim::Model|ID] 'using' pattern=[pseim::Pattern|ID] '{'
('multiplicity' cardinalityValues+=CardinalityValue (cardinalityValues+=CardinalityValue)* )?
('components' modelElement+=GraphElementMapping (modelElement+=GraphElementMapping)*)?
('ports' portMapping+=PortMapping (portMapping+=PortMapping)*)?
'}';
CardinalityValue returns mapping::CardinalityValue:
cardinalityElement=[pseim::CardinalityElement|QualifiedID] '->' value=EInt;
PortMapping returns mapping::PortMapping:
modelPort+=[seim::BorderElement|QualifiedID] (',' modelPort+=[seim::BorderElement|QualifiedID])*
'->'
patternPort=[seim::BorderElement|QualifiedID];
GraphElementMapping returns mapping::GraphElementMapping:
modelGraphElement+=[seim::GraphElement|QualifiedID] (',' modelGraphElement+=[seim::GraphElement|QualifiedID])*
'->'
patternGraphElement=[seim::GraphElement|QualifiedID];
EInt returns ecore::EInt:
'-'? INT;
QualifiedID:
ID('.'ID)*
;
\ No newline at end of file
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim
/**
* Use this class to register components to be used at runtime / without the Equinox extension registry.
*/
class MappingRuntimeModule extends AbstractMappingRuntimeModule {
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim
/**
* Initialization support for running Xtext languages without Equinox extension registry.
*/
class MappingStandaloneSetup extends MappingStandaloneSetupGenerated {
def static void doSetup() {
new MappingStandaloneSetup().createInjectorAndDoEMFRegistration()
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.formatting2
import com.google.inject.Inject
import com.irtsaintexupery.pseim.mapping.CardinalityValue
import com.irtsaintexupery.pseim.mapping.GraphElementMapping
import com.irtsaintexupery.pseim.mapping.PatternApplication
import com.irtsaintexupery.pseim.mapping.PortMapping
import com.irtsaintexupery.xtext.pseim.services.MappingGrammarAccess
import org.eclipse.xtext.formatting2.AbstractFormatter2
import org.eclipse.xtext.formatting2.IFormattableDocument
class MappingFormatter extends AbstractFormatter2 {
@Inject extension MappingGrammarAccess
def dispatch void format(PatternApplication patternApplication, extension IFormattableDocument document) {
// TODO: format HiddenRegions around keywords, attributes, cross references, etc.
for (CardinalityValue cardinalityValue : patternApplication.getCardinalityValues()) {
cardinalityValue.format;
}
for (PortMapping portMapping : patternApplication.getPortMapping()) {
portMapping.format;
}
for (GraphElementMapping graphElementMapping : patternApplication.getModelElement()) {
graphElementMapping.format;
}
}
// TODO: implement for
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.generator
import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.xtext.generator.AbstractGenerator
import org.eclipse.xtext.generator.IFileSystemAccess2
import org.eclipse.xtext.generator.IGeneratorContext
/**
* Generates code from your model files on save.
*
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
*/
class MappingGenerator extends AbstractGenerator {
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
// fsa.generateFile('greetings.txt', 'People to greet: ' +
// resource.allContents
// .filter(Greeting)
// .map[name]
// .join(', '))
}
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.scoping
/**
* This class contains custom scoping description.
*
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
* on how and when to use it.
*/
class MappingScopeProvider extends AbstractMappingScopeProvider {
}
/*
* generated by Xtext 2.12.0
*/
package com.irtsaintexupery.xtext.pseim.validation
/**
* This class contains custom validation rules.
*
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation
*/
class MappingValidator extends AbstractMappingValidator {
// public static val INVALID_NAME = 'invalidName'
//
// @Check
// def checkGreetingStartsWithCapital(Greeting greeting) {
// if (!Character.isUpperCase(greeting.name.charAt(0))) {
// warning('Name should start with a capital',
// MappingPackage.Literals.GREETING__NAME,
// INVALID_NAME)
// }
// }
}
/.MappingRuntimeModule.java._trace
/.MappingStandaloneSetup.java._trace
/.MappingRuntimeModule.xtendbin
/.MappingStandaloneSetup.xtendbin
/MappingRuntimeModule.java
/MappingStandaloneSetup.java
/.MappingGenerator.java._trace
/.MappingGenerator.xtendbin
/MappingGenerator.java
/.MappingScopeProvider.java._trace
/.MappingScopeProvider.xtendbin
/MappingScopeProvider.java
/.MappingValidator.java._trace
/.MappingValidator.xtendbin
/MappingValidator.java
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment