/*
 * 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.InternalPatternParser;
import com.irtsaintexupery.xtext.pseim.services.PatternGrammarAccess;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser;

public class PatternParser extends AbstractContentAssistParser {

	@Inject
	private PatternGrammarAccess grammarAccess;

	private Map<AbstractElement, String> nameMappings;

	@Override
	protected InternalPatternParser createParser() {
		InternalPatternParser result = new InternalPatternParser(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.getPatternAccess().getAlternatives_5_1(), "rule__Pattern__Alternatives_5_1");
					put(grammarAccess.getPatternComponentAccess().getAlternatives_2_1(), "rule__PatternComponent__Alternatives_2_1");
					put(grammarAccess.getPatternComponentAccess().getAlternatives_6_1(), "rule__PatternComponent__Alternatives_6_1");
					put(grammarAccess.getPatternPortAccess().getAlternatives_2_1(), "rule__PatternPort__Alternatives_2_1");
					put(grammarAccess.getPatternPortDirectionAccess().getAlternatives(), "rule__PatternPortDirection__Alternatives");
					put(grammarAccess.getLinkTypeAccess().getAlternatives(), "rule__LinkType__Alternatives");
					put(grammarAccess.getPortDirectionAccess().getAlternatives(), "rule__PortDirection__Alternatives");
					put(grammarAccess.getPatternAccess().getGroup(), "rule__Pattern__Group__0");
					put(grammarAccess.getPatternAccess().getGroup_3(), "rule__Pattern__Group_3__0");
					put(grammarAccess.getPatternAccess().getGroup_3_1(), "rule__Pattern__Group_3_1__0");
					put(grammarAccess.getPatternAccess().getGroup_5(), "rule__Pattern__Group_5__0");
					put(grammarAccess.getPatternComponentAccess().getGroup(), "rule__PatternComponent__Group__0");
					put(grammarAccess.getPatternComponentAccess().getGroup_2(), "rule__PatternComponent__Group_2__0");
					put(grammarAccess.getPatternComponentAccess().getGroup_4(), "rule__PatternComponent__Group_4__0");
					put(grammarAccess.getPatternComponentAccess().getGroup_4_1(), "rule__PatternComponent__Group_4_1__0");
					put(grammarAccess.getPatternComponentAccess().getGroup_6(), "rule__PatternComponent__Group_6__0");
					put(grammarAccess.getPatternPortAccess().getGroup(), "rule__PatternPort__Group__0");
					put(grammarAccess.getPatternPortAccess().getGroup_2(), "rule__PatternPort__Group_2__0");
					put(grammarAccess.getPatternLinkAccess().getGroup(), "rule__PatternLink__Group__0");
					put(grammarAccess.getQualifiedIDAccess().getGroup(), "rule__QualifiedID__Group__0");
					put(grammarAccess.getQualifiedIDAccess().getGroup_1(), "rule__QualifiedID__Group_1__0");
					put(grammarAccess.getPatternAccess().getNameAssignment_1(), "rule__Pattern__NameAssignment_1");
					put(grammarAccess.getPatternAccess().getCardinalityElementsAssignment_3_0(), "rule__Pattern__CardinalityElementsAssignment_3_0");
					put(grammarAccess.getPatternAccess().getCardinalityElementsAssignment_3_1_1(), "rule__Pattern__CardinalityElementsAssignment_3_1_1");
					put(grammarAccess.getPatternAccess().getModelElementsAssignment_5_1_0(), "rule__Pattern__ModelElementsAssignment_5_1_0");
					put(grammarAccess.getPatternAccess().getModelElementsAssignment_5_1_1(), "rule__Pattern__ModelElementsAssignment_5_1_1");
					put(grammarAccess.getPatternComponentAccess().getNameAssignment_1(), "rule__PatternComponent__NameAssignment_1");
					put(grammarAccess.getPatternComponentAccess().getMultiplicityValueAssignment_2_1_0(), "rule__PatternComponent__MultiplicityValueAssignment_2_1_0");
					put(grammarAccess.getPatternComponentAccess().getCardinalityElementAssignment_2_1_1(), "rule__PatternComponent__CardinalityElementAssignment_2_1_1");
					put(grammarAccess.getPatternComponentAccess().getContentAssignment_4_0(), "rule__PatternComponent__ContentAssignment_4_0");
					put(grammarAccess.getPatternComponentAccess().getContentAssignment_4_1_1(), "rule__PatternComponent__ContentAssignment_4_1_1");
					put(grammarAccess.getPatternComponentAccess().getContentAssignment_6_1_0(), "rule__PatternComponent__ContentAssignment_6_1_0");
					put(grammarAccess.getPatternComponentAccess().getContentAssignment_6_1_1(), "rule__PatternComponent__ContentAssignment_6_1_1");
					put(grammarAccess.getPatternPortAccess().getDirAssignment_0(), "rule__PatternPort__DirAssignment_0");
					put(grammarAccess.getPatternPortAccess().getNameAssignment_1(), "rule__PatternPort__NameAssignment_1");
					put(grammarAccess.getPatternPortAccess().getMultiplicityValueAssignment_2_1_0(), "rule__PatternPort__MultiplicityValueAssignment_2_1_0");
					put(grammarAccess.getPatternPortAccess().getCardinalityElementAssignment_2_1_1(), "rule__PatternPort__CardinalityElementAssignment_2_1_1");
					put(grammarAccess.getCardinalityElementAccess().getNameAssignment(), "rule__CardinalityElement__NameAssignment");
					put(grammarAccess.getPatternLinkAccess().getSrcAssignment_0(), "rule__PatternLink__SrcAssignment_0");
					put(grammarAccess.getPatternLinkAccess().getLinkTypeAssignment_2(), "rule__PatternLink__LinkTypeAssignment_2");
					put(grammarAccess.getPatternLinkAccess().getDstAssignment_4(), "rule__PatternLink__DstAssignment_4");
				}
			};
		}
		return nameMappings.get(element);
	}
			
	@Override
	protected String[] getInitialHiddenTokens() {
		return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
	}

	public PatternGrammarAccess getGrammarAccess() {
		return this.grammarAccess;
	}

	public void setGrammarAccess(PatternGrammarAccess grammarAccess) {
		this.grammarAccess = grammarAccess;
	}
}
