/*
 * generated by Xtext 2.18.0.M3
 */
package co.edu.uniandes.accordant_rq.ide.contentassist.antlr;

import co.edu.uniandes.accordant_rq.ide.contentassist.antlr.internal.InternalAinlParser;
import co.edu.uniandes.accordant_rq.services.AinlGrammarAccess;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.Map;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser;

public class AinlParser extends AbstractContentAssistParser {

	@Singleton
	public static final class NameMappings {
		
		private final Map<AbstractElement, String> mappings;
		
		@Inject
		public NameMappings(AinlGrammarAccess 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, AinlGrammarAccess grammarAccess) {
			builder.put(grammarAccess.getEStringAccess().getAlternatives(), "rule__EString__Alternatives");
			builder.put(grammarAccess.getEFloatAccess().getAlternatives_4_0(), "rule__EFloat__Alternatives_4_0");
			builder.put(grammarAccess.getEBooleanAccess().getAlternatives(), "rule__EBoolean__Alternatives");
			builder.put(grammarAccess.getQAMetricAccess().getAlternatives(), "rule__QAMetric__Alternatives");
			builder.put(grammarAccess.getMetricUnitAccess().getAlternatives(), "rule__MetricUnit__Alternatives");
			builder.put(grammarAccess.getQAttributeAccess().getAlternatives(), "rule__QAttribute__Alternatives");
			builder.put(grammarAccess.getConstraintTypeAccess().getAlternatives(), "rule__ConstraintType__Alternatives");
			builder.put(grammarAccess.getProjectAccess().getGroup(), "rule__Project__Group__0");
			builder.put(grammarAccess.getProjectAccess().getGroup_7(), "rule__Project__Group_7__0");
			builder.put(grammarAccess.getProjectAccess().getGroup_9(), "rule__Project__Group_9__0");
			builder.put(grammarAccess.getProjectAccess().getGroup_9_3(), "rule__Project__Group_9_3__0");
			builder.put(grammarAccess.getProjectAccess().getGroup_10(), "rule__Project__Group_10__0");
			builder.put(grammarAccess.getProjectAccess().getGroup_10_3(), "rule__Project__Group_10_3__0");
			builder.put(grammarAccess.getProjectAccess().getGroup_14(), "rule__Project__Group_14__0");
			builder.put(grammarAccess.getQScenarioAccess().getGroup(), "rule__QScenario__Group__0");
			builder.put(grammarAccess.getEFloatAccess().getGroup(), "rule__EFloat__Group__0");
			builder.put(grammarAccess.getEFloatAccess().getGroup_4(), "rule__EFloat__Group_4__0");
			builder.put(grammarAccess.getAnalyzedQSAccess().getGroup(), "rule__AnalyzedQS__Group__0");
			builder.put(grammarAccess.getAnalyzedQSAccess().getGroup_5(), "rule__AnalyzedQS__Group_5__0");
			builder.put(grammarAccess.getAnalyzedQSAccess().getGroup_6(), "rule__AnalyzedQS__Group_6__0");
			builder.put(grammarAccess.getArchDecisionAccess().getGroup(), "rule__ArchDecision__Group__0");
			builder.put(grammarAccess.getArchDecisionAccess().getGroup_5(), "rule__ArchDecision__Group_5__0");
			builder.put(grammarAccess.getArchDecisionAccess().getGroup_6(), "rule__ArchDecision__Group_6__0");
			builder.put(grammarAccess.getArchDecisionAccess().getGroup_10(), "rule__ArchDecision__Group_10__0");
			builder.put(grammarAccess.getConstraintAccess().getGroup(), "rule__Constraint__Group__0");
			builder.put(grammarAccess.getConstraintAccess().getGroup_3(), "rule__Constraint__Group_3__0");
			builder.put(grammarAccess.getTacticAccess().getGroup(), "rule__Tactic__Group__0");
			builder.put(grammarAccess.getTacticAccess().getGroup_4(), "rule__Tactic__Group_4__0");
			builder.put(grammarAccess.getTacticAccess().getGroup_5(), "rule__Tactic__Group_5__0");
			builder.put(grammarAccess.getTacticAccess().getGroup_6(), "rule__Tactic__Group_6__0");
			builder.put(grammarAccess.getTacticAccess().getGroup_7(), "rule__Tactic__Group_7__0");
			builder.put(grammarAccess.getTacticAccess().getGroup_8(), "rule__Tactic__Group_8__0");
			builder.put(grammarAccess.getProjectAccess().getNameAssignment_2(), "rule__Project__NameAssignment_2");
			builder.put(grammarAccess.getProjectAccess().getScenariosAssignment_6(), "rule__Project__ScenariosAssignment_6");
			builder.put(grammarAccess.getProjectAccess().getScenariosAssignment_7_1(), "rule__Project__ScenariosAssignment_7_1");
			builder.put(grammarAccess.getProjectAccess().getAnalyzedQsAssignment_9_2(), "rule__Project__AnalyzedQsAssignment_9_2");
			builder.put(grammarAccess.getProjectAccess().getAnalyzedQsAssignment_9_3_1(), "rule__Project__AnalyzedQsAssignment_9_3_1");
			builder.put(grammarAccess.getProjectAccess().getConstraintsAssignment_10_2(), "rule__Project__ConstraintsAssignment_10_2");
			builder.put(grammarAccess.getProjectAccess().getConstraintsAssignment_10_3_1(), "rule__Project__ConstraintsAssignment_10_3_1");
			builder.put(grammarAccess.getProjectAccess().getTacticsAssignment_13(), "rule__Project__TacticsAssignment_13");
			builder.put(grammarAccess.getProjectAccess().getTacticsAssignment_14_1(), "rule__Project__TacticsAssignment_14_1");
			builder.put(grammarAccess.getQScenarioAccess().getNameAssignment_1(), "rule__QScenario__NameAssignment_1");
			builder.put(grammarAccess.getQScenarioAccess().getQAttributeAssignment_5(), "rule__QScenario__QAttributeAssignment_5");
			builder.put(grammarAccess.getQScenarioAccess().getStimulusAssignment_8(), "rule__QScenario__StimulusAssignment_8");
			builder.put(grammarAccess.getQScenarioAccess().getEnvironmentAssignment_11(), "rule__QScenario__EnvironmentAssignment_11");
			builder.put(grammarAccess.getQScenarioAccess().getResponseAssignment_14(), "rule__QScenario__ResponseAssignment_14");
			builder.put(grammarAccess.getQScenarioAccess().getMeasureAssignment_17(), "rule__QScenario__MeasureAssignment_17");
			builder.put(grammarAccess.getQScenarioAccess().getMinValueAssignment_19(), "rule__QScenario__MinValueAssignment_19");
			builder.put(grammarAccess.getQScenarioAccess().getMaxValueAssignment_21(), "rule__QScenario__MaxValueAssignment_21");
			builder.put(grammarAccess.getQScenarioAccess().getUnitAssignment_23(), "rule__QScenario__UnitAssignment_23");
			builder.put(grammarAccess.getAnalyzedQSAccess().getNameAssignment_1(), "rule__AnalyzedQS__NameAssignment_1");
			builder.put(grammarAccess.getAnalyzedQSAccess().getQsAssignment_3(), "rule__AnalyzedQS__QsAssignment_3");
			builder.put(grammarAccess.getAnalyzedQSAccess().getReasoningAssignment_5_2(), "rule__AnalyzedQS__ReasoningAssignment_5_2");
			builder.put(grammarAccess.getAnalyzedQSAccess().getDecisionsAssignment_6_2(), "rule__AnalyzedQS__DecisionsAssignment_6_2");
			builder.put(grammarAccess.getArchDecisionAccess().getNameAssignment_1(), "rule__ArchDecision__NameAssignment_1");
			builder.put(grammarAccess.getArchDecisionAccess().getIsRiskAssignment_3(), "rule__ArchDecision__IsRiskAssignment_3");
			builder.put(grammarAccess.getArchDecisionAccess().getIsSensitivityPointAssignment_4(), "rule__ArchDecision__IsSensitivityPointAssignment_4");
			builder.put(grammarAccess.getArchDecisionAccess().getRationaleAssignment_5_2(), "rule__ArchDecision__RationaleAssignment_5_2");
			builder.put(grammarAccess.getArchDecisionAccess().getCodeAssignment_6_2(), "rule__ArchDecision__CodeAssignment_6_2");
			builder.put(grammarAccess.getArchDecisionAccess().getAppliedTacticsAssignment_9(), "rule__ArchDecision__AppliedTacticsAssignment_9");
			builder.put(grammarAccess.getArchDecisionAccess().getAppliedTacticsAssignment_10_1(), "rule__ArchDecision__AppliedTacticsAssignment_10_1");
			builder.put(grammarAccess.getConstraintAccess().getCodeAssignment_1(), "rule__Constraint__CodeAssignment_1");
			builder.put(grammarAccess.getConstraintAccess().getTypeAssignment_3_2(), "rule__Constraint__TypeAssignment_3_2");
			builder.put(grammarAccess.getConstraintAccess().getValueAssignment_3_4(), "rule__Constraint__ValueAssignment_3_4");
			builder.put(grammarAccess.getTacticAccess().getNameAssignment_2(), "rule__Tactic__NameAssignment_2");
			builder.put(grammarAccess.getTacticAccess().getQAttributeAssignment_4_2(), "rule__Tactic__QAttributeAssignment_4_2");
			builder.put(grammarAccess.getTacticAccess().getRationaleAssignment_5_2(), "rule__Tactic__RationaleAssignment_5_2");
			builder.put(grammarAccess.getTacticAccess().getStimulusAssignment_6_2(), "rule__Tactic__StimulusAssignment_6_2");
			builder.put(grammarAccess.getTacticAccess().getResponseAssignment_7_2(), "rule__Tactic__ResponseAssignment_7_2");
			builder.put(grammarAccess.getTacticAccess().getViewpointAssignment_8_2(), "rule__Tactic__ViewpointAssignment_8_2");
		}
	}
	
	@Inject
	private NameMappings nameMappings;

	@Inject
	private AinlGrammarAccess grammarAccess;

	@Override
	protected InternalAinlParser createParser() {
		InternalAinlParser result = new InternalAinlParser(null);
		result.setGrammarAccess(grammarAccess);
		return result;
	}

	@Override
	protected String getRuleName(AbstractElement element) {
		return nameMappings.getRuleName(element);
	}

	@Override
	protected String[] getInitialHiddenTokens() {
		return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
	}

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

	public void setGrammarAccess(AinlGrammarAccess grammarAccess) {
		this.grammarAccess = grammarAccess;
	}
	
	public NameMappings getNameMappings() {
		return nameMappings;
	}
	
	public void setNameMappings(NameMappings nameMappings) {
		this.nameMappings = nameMappings;
	}
}
