Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
regenerated web examples
harmonized dates in the header to the lesser evil changeset

Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
  • Loading branch information
cdietrich committed Mar 8, 2019
1 parent 0648cad commit 90c0165
Show file tree
Hide file tree
Showing 16 changed files with 500 additions and 455 deletions.
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -3,7 +3,7 @@
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="******************************************************************************&#xA;Copyright (c) 2015 itemis AG (http://www.itemis.eu) and others.&#xA;All rights reserved. This program and the accompanying materials&#xA;are made available under the terms of the Eclipse Public License v1.0&#xA;which accompanies this distribution, and is available at&#xA;http://www.eclipse.org/legal/epl-v10.html&#xA; ******************************************************************************"
modelDirectory="/org.eclipse.xtext.web.example.entities/src-gen" modelPluginID="org.eclipse.xtext.web.example.entities"
forceOverwrite="true" modelName="Entities" updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.11" usedGenPackages="platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel#//types platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel#//xbase platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel#//xtype">
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.12" usedGenPackages="platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel#//types platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel#//xbase platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel#//xtype">
<genPackages prefix="Domainmodel" basePackage="org.eclipse.xtext.web.example.entities"
disposableProviderFactory="true" fileExtensions="entities" ecorePackage="Entities.ecore#/">
<genClasses ecoreClass="Entities.ecore#//Entities">
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
Expand Down
Binary file not shown.
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
Expand Down Expand Up @@ -1104,6 +1104,7 @@ public ParserRule getXCatchClauseRule() {
return getXCatchClauseAccess().getRule();
}

//@Override
//QualifiedName:
// ValidID (=> '.' ValidID)*;
public XbaseGrammarAccess.QualifiedNameElements getQualifiedNameAccess() {
Expand All @@ -1125,7 +1126,7 @@ public ParserRule getNumberRule() {
}

///**
// * Dummy rule, for "better" downwards compatibility, since GrammarAccess generates non-static inner classes,
// * Dummy rule, for "better" downwards compatibility, since GrammarAccess generates non-static inner classes,
// * which makes downstream grammars break on classloading, when a rule is removed.
// */ StaticQualifier:
// (ValidID '::')+;
Expand Down
Expand Up @@ -26,5 +26,4 @@ protected List<EPackage> getEPackages() {
result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/xtext/xbase/Xtype"));
return result;
}

}
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
Expand Down
@@ -1,14 +1,15 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
*******************************************************************************/
package org.eclipse.xtext.web.example.statemachine.ide.contentassist.antlr;

import com.google.common.collect.ImmutableMap;
import com.google.inject.Inject;
import java.util.HashMap;
import com.google.inject.Singleton;
import java.util.Map;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser;
Expand All @@ -17,10 +18,59 @@

public class StatemachineParser extends AbstractContentAssistParser {

@Singleton
public static final class NameMappings {

private final Map<AbstractElement, String> mappings;

@Inject
public NameMappings(StatemachineGrammarAccess grammarAccess) {
ImmutableMap.Builder<AbstractElement, String> 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<AbstractElement, String> builder, StatemachineGrammarAccess grammarAccess) {
builder.put(grammarAccess.getSignalAccess().getAlternatives_0(), "rule__Signal__Alternatives_0");
builder.put(grammarAccess.getStatemachineAccess().getGroup(), "rule__Statemachine__Group__0");
builder.put(grammarAccess.getSignalAccess().getGroup(), "rule__Signal__Group__0");
builder.put(grammarAccess.getInputSignalAccess().getGroup(), "rule__InputSignal__Group__0");
builder.put(grammarAccess.getOutputSignalAccess().getGroup(), "rule__OutputSignal__Group__0");
builder.put(grammarAccess.getStateAccess().getGroup(), "rule__State__Group__0");
builder.put(grammarAccess.getTransitionAccess().getGroup(), "rule__Transition__Group__0");
builder.put(grammarAccess.getConditionAccess().getGroup(), "rule__Condition__Group__0");
builder.put(grammarAccess.getConditionAccess().getGroup_1(), "rule__Condition__Group_1__0");
builder.put(grammarAccess.getEventAccess().getGroup(), "rule__Event__Group__0");
builder.put(grammarAccess.getCommandAccess().getGroup(), "rule__Command__Group__0");
builder.put(grammarAccess.getQualifiedNameAccess().getGroup(), "rule__QualifiedName__Group__0");
builder.put(grammarAccess.getQualifiedNameAccess().getGroup_1(), "rule__QualifiedName__Group_1__0");
builder.put(grammarAccess.getStatemachineAccess().getSignalsAssignment_1(), "rule__Statemachine__SignalsAssignment_1");
builder.put(grammarAccess.getStatemachineAccess().getStatesAssignment_2(), "rule__Statemachine__StatesAssignment_2");
builder.put(grammarAccess.getSignalAccess().getNameAssignment_2(), "rule__Signal__NameAssignment_2");
builder.put(grammarAccess.getStateAccess().getNameAssignment_1(), "rule__State__NameAssignment_1");
builder.put(grammarAccess.getStateAccess().getCommandsAssignment_2(), "rule__State__CommandsAssignment_2");
builder.put(grammarAccess.getStateAccess().getTransitionsAssignment_3(), "rule__State__TransitionsAssignment_3");
builder.put(grammarAccess.getStateAccess().getNestedStatesAssignment_4(), "rule__State__NestedStatesAssignment_4");
builder.put(grammarAccess.getTransitionAccess().getConditionAssignment_1(), "rule__Transition__ConditionAssignment_1");
builder.put(grammarAccess.getTransitionAccess().getStateAssignment_3(), "rule__Transition__StateAssignment_3");
builder.put(grammarAccess.getConditionAccess().getEventsAssignment_0(), "rule__Condition__EventsAssignment_0");
builder.put(grammarAccess.getConditionAccess().getEventsAssignment_1_1(), "rule__Condition__EventsAssignment_1_1");
builder.put(grammarAccess.getEventAccess().getSignalAssignment_0(), "rule__Event__SignalAssignment_0");
builder.put(grammarAccess.getEventAccess().getValueAssignment_2(), "rule__Event__ValueAssignment_2");
builder.put(grammarAccess.getCommandAccess().getSignalAssignment_1(), "rule__Command__SignalAssignment_1");
builder.put(grammarAccess.getCommandAccess().getNewValueAssignment_3(), "rule__Command__NewValueAssignment_3");
}
}

@Inject
private StatemachineGrammarAccess grammarAccess;
private NameMappings nameMappings;

private Map<AbstractElement, String> nameMappings;
@Inject
private StatemachineGrammarAccess grammarAccess;

@Override
protected InternalStatemachineParser createParser() {
Expand All @@ -31,44 +81,9 @@ protected InternalStatemachineParser createParser() {

@Override
protected String getRuleName(AbstractElement element) {
if (nameMappings == null) {
nameMappings = new HashMap<AbstractElement, String>() {
private static final long serialVersionUID = 1L;
{
put(grammarAccess.getSignalAccess().getAlternatives_0(), "rule__Signal__Alternatives_0");
put(grammarAccess.getStatemachineAccess().getGroup(), "rule__Statemachine__Group__0");
put(grammarAccess.getSignalAccess().getGroup(), "rule__Signal__Group__0");
put(grammarAccess.getInputSignalAccess().getGroup(), "rule__InputSignal__Group__0");
put(grammarAccess.getOutputSignalAccess().getGroup(), "rule__OutputSignal__Group__0");
put(grammarAccess.getStateAccess().getGroup(), "rule__State__Group__0");
put(grammarAccess.getTransitionAccess().getGroup(), "rule__Transition__Group__0");
put(grammarAccess.getConditionAccess().getGroup(), "rule__Condition__Group__0");
put(grammarAccess.getConditionAccess().getGroup_1(), "rule__Condition__Group_1__0");
put(grammarAccess.getEventAccess().getGroup(), "rule__Event__Group__0");
put(grammarAccess.getCommandAccess().getGroup(), "rule__Command__Group__0");
put(grammarAccess.getQualifiedNameAccess().getGroup(), "rule__QualifiedName__Group__0");
put(grammarAccess.getQualifiedNameAccess().getGroup_1(), "rule__QualifiedName__Group_1__0");
put(grammarAccess.getStatemachineAccess().getSignalsAssignment_1(), "rule__Statemachine__SignalsAssignment_1");
put(grammarAccess.getStatemachineAccess().getStatesAssignment_2(), "rule__Statemachine__StatesAssignment_2");
put(grammarAccess.getSignalAccess().getNameAssignment_2(), "rule__Signal__NameAssignment_2");
put(grammarAccess.getStateAccess().getNameAssignment_1(), "rule__State__NameAssignment_1");
put(grammarAccess.getStateAccess().getCommandsAssignment_2(), "rule__State__CommandsAssignment_2");
put(grammarAccess.getStateAccess().getTransitionsAssignment_3(), "rule__State__TransitionsAssignment_3");
put(grammarAccess.getStateAccess().getNestedStatesAssignment_4(), "rule__State__NestedStatesAssignment_4");
put(grammarAccess.getTransitionAccess().getConditionAssignment_1(), "rule__Transition__ConditionAssignment_1");
put(grammarAccess.getTransitionAccess().getStateAssignment_3(), "rule__Transition__StateAssignment_3");
put(grammarAccess.getConditionAccess().getEventsAssignment_0(), "rule__Condition__EventsAssignment_0");
put(grammarAccess.getConditionAccess().getEventsAssignment_1_1(), "rule__Condition__EventsAssignment_1_1");
put(grammarAccess.getEventAccess().getSignalAssignment_0(), "rule__Event__SignalAssignment_0");
put(grammarAccess.getEventAccess().getValueAssignment_2(), "rule__Event__ValueAssignment_2");
put(grammarAccess.getCommandAccess().getSignalAssignment_1(), "rule__Command__SignalAssignment_1");
put(grammarAccess.getCommandAccess().getNewValueAssignment_3(), "rule__Command__NewValueAssignment_3");
}
};
}
return nameMappings.get(element);
return nameMappings.getRuleName(element);
}

@Override
protected String[] getInitialHiddenTokens() {
return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
Expand All @@ -81,4 +96,12 @@ public StatemachineGrammarAccess getGrammarAccess() {
public void setGrammarAccess(StatemachineGrammarAccess grammarAccess) {
this.grammarAccess = grammarAccess;
}

public NameMappings getNameMappings() {
return nameMappings;
}

public void setNameMappings(NameMappings nameMappings) {
this.nameMappings = nameMappings;
}
}
Expand Up @@ -3,7 +3,7 @@
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="******************************************************************************&#xA;Copyright (c) 2015 itemis AG (http://www.itemis.eu) and others.&#xA;All rights reserved. This program and the accompanying materials&#xA;are made available under the terms of the Eclipse Public License v1.0&#xA;which accompanies this distribution, and is available at&#xA;http://www.eclipse.org/legal/epl-v10.html&#xA; ******************************************************************************"
modelDirectory="/org.eclipse.xtext.web.example.statemachine/src-gen" modelPluginID="org.eclipse.xtext.web.example.statemachine"
forceOverwrite="true" modelName="Statemachine" updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.11">
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.12">
<genPackages prefix="Statemachine" basePackage="org.eclipse.xtext.web.example.statemachine"
disposableProviderFactory="true" fileExtensions="statemachine" ecorePackage="Statemachine.ecore#/">
<genClasses ecoreClass="Statemachine.ecore#//Statemachine">
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2016 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) 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
Expand Down
Expand Up @@ -23,5 +23,4 @@ protected List<EPackage> getEPackages() {
result.add(org.eclipse.xtext.web.example.statemachine.statemachine.StatemachinePackage.eINSTANCE);
return result;
}

}

0 comments on commit 90c0165

Please sign in to comment.