/*
* generated by Xtext
*/
package org.yakindu.sct.generator.genmodel.ui.contentassist.antlr;

import java.util.Collection;
import java.util.Map;
import java.util.HashMap;

import org.antlr.runtime.RecognitionException;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser;
import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement;
import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;

import com.google.inject.Inject;

import org.yakindu.sct.generator.genmodel.services.SGenGrammarAccess;

public class SGenParser extends AbstractContentAssistParser {
	
	@Inject
	private SGenGrammarAccess grammarAccess;
	
	private Map<AbstractElement, String> nameMappings;
	
	@Override
	protected org.yakindu.sct.generator.genmodel.ui.contentassist.antlr.internal.InternalSGenParser createParser() {
		org.yakindu.sct.generator.genmodel.ui.contentassist.antlr.internal.InternalSGenParser result = new org.yakindu.sct.generator.genmodel.ui.contentassist.antlr.internal.InternalSGenParser(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.getLiteralAccess().getAlternatives(), "rule__Literal__Alternatives");
					put(grammarAccess.getQIDAccess().getAlternatives_1_0(), "rule__QID__Alternatives_1_0");
					put(grammarAccess.getGeneratorModelAccess().getGroup(), "rule__GeneratorModel__Group__0");
					put(grammarAccess.getGeneratorEntryAccess().getGroup(), "rule__GeneratorEntry__Group__0");
					put(grammarAccess.getFeatureConfigurationAccess().getGroup(), "rule__FeatureConfiguration__Group__0");
					put(grammarAccess.getFeatureParameterValueAccess().getGroup(), "rule__FeatureParameterValue__Group__0");
					put(grammarAccess.getBoolLiteralAccess().getGroup(), "rule__BoolLiteral__Group__0");
					put(grammarAccess.getIntLiteralAccess().getGroup(), "rule__IntLiteral__Group__0");
					put(grammarAccess.getRealLiteralAccess().getGroup(), "rule__RealLiteral__Group__0");
					put(grammarAccess.getStringLiteralAccess().getGroup(), "rule__StringLiteral__Group__0");
					put(grammarAccess.getQIDAccess().getGroup(), "rule__QID__Group__0");
					put(grammarAccess.getQIDAccess().getGroup_1(), "rule__QID__Group_1__0");
					put(grammarAccess.getGeneratorModelAccess().getGeneratorIdAssignment_2(), "rule__GeneratorModel__GeneratorIdAssignment_2");
					put(grammarAccess.getGeneratorModelAccess().getEntriesAssignment_4(), "rule__GeneratorModel__EntriesAssignment_4");
					put(grammarAccess.getGeneratorEntryAccess().getContentTypeAssignment_0(), "rule__GeneratorEntry__ContentTypeAssignment_0");
					put(grammarAccess.getGeneratorEntryAccess().getElementRefAssignment_1(), "rule__GeneratorEntry__ElementRefAssignment_1");
					put(grammarAccess.getGeneratorEntryAccess().getFeaturesAssignment_3(), "rule__GeneratorEntry__FeaturesAssignment_3");
					put(grammarAccess.getFeatureConfigurationAccess().getTypeAssignment_2(), "rule__FeatureConfiguration__TypeAssignment_2");
					put(grammarAccess.getFeatureConfigurationAccess().getParameterValuesAssignment_4(), "rule__FeatureConfiguration__ParameterValuesAssignment_4");
					put(grammarAccess.getFeatureParameterValueAccess().getParameterAssignment_1(), "rule__FeatureParameterValue__ParameterAssignment_1");
					put(grammarAccess.getFeatureParameterValueAccess().getExpressionAssignment_3(), "rule__FeatureParameterValue__ExpressionAssignment_3");
					put(grammarAccess.getBoolLiteralAccess().getValueAssignment_1(), "rule__BoolLiteral__ValueAssignment_1");
					put(grammarAccess.getIntLiteralAccess().getValueAssignment_1(), "rule__IntLiteral__ValueAssignment_1");
					put(grammarAccess.getRealLiteralAccess().getValueAssignment_1(), "rule__RealLiteral__ValueAssignment_1");
					put(grammarAccess.getStringLiteralAccess().getValueAssignment_1(), "rule__StringLiteral__ValueAssignment_1");
				}
			};
		}
		return nameMappings.get(element);
	}
	
	@Override
	protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
		try {
			org.yakindu.sct.generator.genmodel.ui.contentassist.antlr.internal.InternalSGenParser typedParser = (org.yakindu.sct.generator.genmodel.ui.contentassist.antlr.internal.InternalSGenParser) parser;
			typedParser.entryRuleGeneratorModel();
			return typedParser.getFollowElements();
		} catch(RecognitionException ex) {
			throw new RuntimeException(ex);
		}		
	}
	
	@Override
	protected String[] getInitialHiddenTokens() {
		return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
	}
	
	public SGenGrammarAccess getGrammarAccess() {
		return this.grammarAccess;
	}
	
	public void setGrammarAccess(SGenGrammarAccess grammarAccess) {
		this.grammarAccess = grammarAccess;
	}
}
