/* * generated by Xtext */ package de.gebit.integrity.serializer; import com.google.inject.Inject; import de.gebit.integrity.services.DSLGrammarAccess; 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.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 abstract class AbstractDSLSyntacticSequencer extends AbstractSyntacticSequencer { protected DSLGrammarAccess grammarAccess; protected AbstractElementAlias match_ParameterTableHeader_VerticalLineKeyword_2_q; protected AbstractElementAlias match_ParameterTableValue_VerticalLineKeyword_2_q; protected AbstractElementAlias match_ResultTableHeader_VerticalLineKeyword_3_q; protected AbstractElementAlias match_SuiteDefinition___ConcludedbyKeyword_8_0_NLParserRuleCall_8_1__q; protected AbstractElementAlias match_SuiteDefinition___RequiresKeyword_7_0_NLParserRuleCall_7_1__q; @Inject protected void init(IGrammarAccess access) { grammarAccess = (DSLGrammarAccess) access; match_ParameterTableHeader_VerticalLineKeyword_2_q = new TokenAlias(false, true, grammarAccess.getParameterTableHeaderAccess().getVerticalLineKeyword_2()); match_ParameterTableValue_VerticalLineKeyword_2_q = new TokenAlias(false, true, grammarAccess.getParameterTableValueAccess().getVerticalLineKeyword_2()); match_ResultTableHeader_VerticalLineKeyword_3_q = new TokenAlias(false, true, grammarAccess.getResultTableHeaderAccess().getVerticalLineKeyword_3()); match_SuiteDefinition___ConcludedbyKeyword_8_0_NLParserRuleCall_8_1__q = new GroupAlias(false, true, new TokenAlias(false, false, grammarAccess.getSuiteDefinitionAccess().getConcludedbyKeyword_8_0()), new TokenAlias(false, false, grammarAccess.getSuiteDefinitionAccess().getNLParserRuleCall_8_1())); match_SuiteDefinition___RequiresKeyword_7_0_NLParserRuleCall_7_1__q = new GroupAlias(false, true, new TokenAlias(false, false, grammarAccess.getSuiteDefinitionAccess().getRequiresKeyword_7_0()), new TokenAlias(false, false, grammarAccess.getSuiteDefinitionAccess().getNLParserRuleCall_7_1())); } @Override protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) { if (ruleCall.getRule() == grammarAccess.getNLRule()) return getNLToken(semanticObject, ruleCall, node); else if (ruleCall.getRule() == grammarAccess.getNLFORCEDRule()) return getNLFORCEDToken(semanticObject, ruleCall, node); return ""; } /** * NL: * (NEWLINE WS?)*; */ protected String getNLToken(EObject semanticObject, RuleCall ruleCall, INode node) { if (node != null) return getTokenText(node); return ""; } /** * NLFORCED: * NEWLINE WS? NL; */ protected String getNLFORCEDToken(EObject semanticObject, RuleCall ruleCall, INode node) { if (node != null) return getTokenText(node); return "\r"; } @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_ParameterTableHeader_VerticalLineKeyword_2_q.equals(syntax)) emit_ParameterTableHeader_VerticalLineKeyword_2_q(semanticObject, getLastNavigableState(), syntaxNodes); else if (match_ParameterTableValue_VerticalLineKeyword_2_q.equals(syntax)) emit_ParameterTableValue_VerticalLineKeyword_2_q(semanticObject, getLastNavigableState(), syntaxNodes); else if (match_ResultTableHeader_VerticalLineKeyword_3_q.equals(syntax)) emit_ResultTableHeader_VerticalLineKeyword_3_q(semanticObject, getLastNavigableState(), syntaxNodes); else if (match_SuiteDefinition___ConcludedbyKeyword_8_0_NLParserRuleCall_8_1__q.equals(syntax)) emit_SuiteDefinition___ConcludedbyKeyword_8_0_NLParserRuleCall_8_1__q(semanticObject, getLastNavigableState(), syntaxNodes); else if (match_SuiteDefinition___RequiresKeyword_7_0_NLParserRuleCall_7_1__q.equals(syntax)) emit_SuiteDefinition___RequiresKeyword_7_0_NLParserRuleCall_7_1__q(semanticObject, getLastNavigableState(), syntaxNodes); else acceptNodes(getLastNavigableState(), syntaxNodes); } } /** * Ambiguous syntax: * '|'? * * This ambiguous syntax occurs at: * name=ParameterName (ambiguity) (rule end) */ protected void emit_ParameterTableHeader_VerticalLineKeyword_2_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); } /** * Ambiguous syntax: * '|'? * * This ambiguous syntax occurs at: * value=ValueOrEnumValueOrOperationCollection (ambiguity) (rule end) */ protected void emit_ParameterTableValue_VerticalLineKeyword_2_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); } /** * Ambiguous syntax: * '|'? * * This ambiguous syntax occurs at: * name=ResultName '=' (ambiguity) (rule end) */ protected void emit_ResultTableHeader_VerticalLineKeyword_3_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); } /** * Ambiguous syntax: * ('concludedby' NL)? * * This ambiguous syntax occurs at: * dependencies+=[SuiteDefinition|QualifiedName] NL (ambiguity) 'with' NL 'suiteend' NL (rule end) * dependencies+=[SuiteDefinition|QualifiedName] NL (ambiguity) 'with' NL statements+=SuiteStatement * name=QualifiedName NL ('requires' NL)? (ambiguity) 'with' NL 'suiteend' NL (rule end) * name=QualifiedName NL ('requires' NL)? (ambiguity) 'with' NL statements+=SuiteStatement * parameters+=SuiteParameterDefinition NL ('requires' NL)? (ambiguity) 'with' NL 'suiteend' NL (rule end) * parameters+=SuiteParameterDefinition NL ('requires' NL)? (ambiguity) 'with' NL statements+=SuiteStatement * return+=SuiteReturnDefinition NL ('requires' NL)? (ambiguity) 'with' NL 'suiteend' NL (rule end) * return+=SuiteReturnDefinition NL ('requires' NL)? (ambiguity) 'with' NL statements+=SuiteStatement */ protected void emit_SuiteDefinition___ConcludedbyKeyword_8_0_NLParserRuleCall_8_1__q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); } /** * Ambiguous syntax: * ('requires' NL)? * * This ambiguous syntax occurs at: * name=QualifiedName NL (ambiguity) 'concludedby' NL finalizers+=[SuiteDefinition|QualifiedName] * name=QualifiedName NL (ambiguity) ('concludedby' NL)? 'with' NL 'suiteend' NL (rule end) * name=QualifiedName NL (ambiguity) ('concludedby' NL)? 'with' NL statements+=SuiteStatement * parameters+=SuiteParameterDefinition NL (ambiguity) 'concludedby' NL finalizers+=[SuiteDefinition|QualifiedName] * parameters+=SuiteParameterDefinition NL (ambiguity) ('concludedby' NL)? 'with' NL 'suiteend' NL (rule end) * parameters+=SuiteParameterDefinition NL (ambiguity) ('concludedby' NL)? 'with' NL statements+=SuiteStatement * return+=SuiteReturnDefinition NL (ambiguity) 'concludedby' NL finalizers+=[SuiteDefinition|QualifiedName] * return+=SuiteReturnDefinition NL (ambiguity) ('concludedby' NL)? 'with' NL 'suiteend' NL (rule end) * return+=SuiteReturnDefinition NL (ambiguity) ('concludedby' NL)? 'with' NL statements+=SuiteStatement */ protected void emit_SuiteDefinition___RequiresKeyword_7_0_NLParserRuleCall_7_1__q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); } }