blob: 312ed608d5dff80b62b99e3f3294ef25ca4c4554 [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2017 CEA LIST.
*
*
* 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:
*
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
*
*****************************************************************************/
/*
* generated by Xtext 2.11.0
*/
package org.eclipse.papyrus.requirements.sysml14.serializer;
import com.google.inject.Inject;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.requirements.sysml14.services.BoilerplateTextGrammarAccess;
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.GrammarAlias.GroupAlias;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias;
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable;
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
@SuppressWarnings("all")
public class BoilerplateTextSyntacticSequencer extends AbstractSyntacticSequencer {
protected BoilerplateTextGrammarAccess grammarAccess;
protected AbstractElementAlias match_ShallNot___BeKeyword_2_0_AbleKeyword_2_1_ToKeyword_2_2__q;
protected AbstractElementAlias match_Shall___BeKeyword_1_0_0_AbleKeyword_1_0_1_ToKeyword_1_0_2__q;
@Inject
protected void init(IGrammarAccess access) {
grammarAccess = (BoilerplateTextGrammarAccess) access;
match_ShallNot___BeKeyword_2_0_AbleKeyword_2_1_ToKeyword_2_2__q = new GroupAlias(false, true, new TokenAlias(false, false, grammarAccess.getShallNotAccess().getBeKeyword_2_0()), new TokenAlias(false, false, grammarAccess.getShallNotAccess().getAbleKeyword_2_1()), new TokenAlias(false, false, grammarAccess.getShallNotAccess().getToKeyword_2_2()));
match_Shall___BeKeyword_1_0_0_AbleKeyword_1_0_1_ToKeyword_1_0_2__q = new GroupAlias(false, true, new TokenAlias(false, false, grammarAccess.getShallAccess().getBeKeyword_1_0_0()), new TokenAlias(false, false, grammarAccess.getShallAccess().getAbleKeyword_1_0_1()), new TokenAlias(false, false, grammarAccess.getShallAccess().getToKeyword_1_0_2()));
}
@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);
if (match_ShallNot___BeKeyword_2_0_AbleKeyword_2_1_ToKeyword_2_2__q.equals(syntax))
emit_ShallNot___BeKeyword_2_0_AbleKeyword_2_1_ToKeyword_2_2__q(semanticObject, getLastNavigableState(), syntaxNodes);
else if (match_Shall___BeKeyword_1_0_0_AbleKeyword_1_0_1_ToKeyword_1_0_2__q.equals(syntax))
emit_Shall___BeKeyword_1_0_0_AbleKeyword_1_0_1_ToKeyword_1_0_2__q(semanticObject, getLastNavigableState(), syntaxNodes);
else acceptNodes(getLastNavigableState(), syntaxNodes);
}
}
/**
* Ambiguous syntax:
* ('be' 'able' 'to')?
*
* This ambiguous syntax occurs at:
* (rule start) 'shall' 'not' (ambiguity) action=STRING
*/
protected void emit_ShallNot___BeKeyword_2_0_AbleKeyword_2_1_ToKeyword_2_2__q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
acceptNodes(transition, nodes);
}
/**
* Ambiguous syntax:
* ('be' 'able' 'to')?
*
* This ambiguous syntax occurs at:
* (rule start) 'shall' (ambiguity) action=STRING
*/
protected void emit_Shall___BeKeyword_1_0_0_AbleKeyword_1_0_1_ToKeyword_1_0_2__q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
acceptNodes(transition, nodes);
}
}