/*
* generated by Xtext
*/
package org.xtext.example.domij.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.xtext.example.domij.services.ErDslGrammarAccess;

public class ErDslParser extends AbstractContentAssistParser {
	
	@Inject
	private ErDslGrammarAccess grammarAccess;
	
	private Map<AbstractElement, String> nameMappings;
	
	@Override
	protected org.xtext.example.domij.ui.contentassist.antlr.internal.InternalErDslParser createParser() {
		org.xtext.example.domij.ui.contentassist.antlr.internal.InternalErDslParser result = new org.xtext.example.domij.ui.contentassist.antlr.internal.InternalErDslParser(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.getRelationshipConceptAccess().getAlternatives(), "rule__RelationshipConcept__Alternatives");
					put(grammarAccess.getEntityConceptAccess().getAlternatives(), "rule__EntityConcept__Alternatives");
					put(grammarAccess.getEStringAccess().getAlternatives(), "rule__EString__Alternatives");
					put(grammarAccess.getMinCardinalityAccess().getAlternatives(), "rule__MinCardinality__Alternatives");
					put(grammarAccess.getMaxCardinalityAccess().getAlternatives(), "rule__MaxCardinality__Alternatives");
					put(grammarAccess.getPrimitiveDomainAccess().getAlternatives(), "rule__PrimitiveDomain__Alternatives");
					put(grammarAccess.getEBooleanAccess().getAlternatives(), "rule__EBoolean__Alternatives");
					put(grammarAccess.getERModelAccess().getGroup(), "rule__ERModel__Group__0");
					put(grammarAccess.getERModelAccess().getGroup_2(), "rule__ERModel__Group_2__0");
					put(grammarAccess.getERModelAccess().getGroup_2_3(), "rule__ERModel__Group_2_3__0");
					put(grammarAccess.getERModelAccess().getGroup_3(), "rule__ERModel__Group_3__0");
					put(grammarAccess.getERModelAccess().getGroup_3_3(), "rule__ERModel__Group_3_3__0");
					put(grammarAccess.getERModelAccess().getGroup_4(), "rule__ERModel__Group_4__0");
					put(grammarAccess.getERModelAccess().getGroup_4_3(), "rule__ERModel__Group_4_3__0");
					put(grammarAccess.getERModelAccess().getGroup_5(), "rule__ERModel__Group_5__0");
					put(grammarAccess.getERModelAccess().getGroup_5_3(), "rule__ERModel__Group_5_3__0");
					put(grammarAccess.getEntityAccess().getGroup(), "rule__Entity__Group__0");
					put(grammarAccess.getEntityAccess().getGroup_2(), "rule__Entity__Group_2__0");
					put(grammarAccess.getEntityAccess().getGroup_2_3(), "rule__Entity__Group_2_3__0");
					put(grammarAccess.getEntityAccess().getGroup_3(), "rule__Entity__Group_3__0");
					put(grammarAccess.getEntityAccess().getGroup_3_3(), "rule__Entity__Group_3_3__0");
					put(grammarAccess.getEntityAccess().getGroup_4(), "rule__Entity__Group_4__0");
					put(grammarAccess.getAttributeAccess().getGroup(), "rule__Attribute__Group__0");
					put(grammarAccess.getAttributeDomainAccess().getGroup(), "rule__AttributeDomain__Group__0");
					put(grammarAccess.getAttributeDomainAccess().getGroup_1(), "rule__AttributeDomain__Group_1__0");
					put(grammarAccess.getAttributeDomainAccess().getGroup_2(), "rule__AttributeDomain__Group_2__0");
					put(grammarAccess.getKeyAccess().getGroup(), "rule__Key__Group__0");
					put(grammarAccess.getKeyAccess().getGroup_3(), "rule__Key__Group_3__0");
					put(grammarAccess.getDomainAccess().getGroup(), "rule__Domain__Group__0");
					put(grammarAccess.getRelationshipAccess().getGroup(), "rule__Relationship__Group__0");
					put(grammarAccess.getRelationshipAccess().getGroup_5(), "rule__Relationship__Group_5__0");
					put(grammarAccess.getRelationshipAccess().getGroup_7(), "rule__Relationship__Group_7__0");
					put(grammarAccess.getRelationshipAccess().getGroup_7_3(), "rule__Relationship__Group_7_3__0");
					put(grammarAccess.getISAAccess().getGroup(), "rule__ISA__Group__0");
					put(grammarAccess.getISAAccess().getGroup_8(), "rule__ISA__Group_8__0");
					put(grammarAccess.getCategorisationAccess().getGroup(), "rule__Categorisation__Group__0");
					put(grammarAccess.getIdentificationDependencyAccess().getGroup(), "rule__IdentificationDependency__Group__0");
					put(grammarAccess.getRegularEntityAccess().getGroup(), "rule__RegularEntity__Group__0");
					put(grammarAccess.getCategoriesAccess().getGroup(), "rule__Categories__Group__0");
					put(grammarAccess.getCategoriesAccess().getGroup_2(), "rule__Categories__Group_2__0");
					put(grammarAccess.getEIntAccess().getGroup(), "rule__EInt__Group__0");
					put(grammarAccess.getERModelAccess().getNameAssignment_0(), "rule__ERModel__NameAssignment_0");
					put(grammarAccess.getERModelAccess().getDomainsAssignment_2_2(), "rule__ERModel__DomainsAssignment_2_2");
					put(grammarAccess.getERModelAccess().getDomainsAssignment_2_3_1(), "rule__ERModel__DomainsAssignment_2_3_1");
					put(grammarAccess.getERModelAccess().getEntitiesAssignment_3_2(), "rule__ERModel__EntitiesAssignment_3_2");
					put(grammarAccess.getERModelAccess().getEntitiesAssignment_3_3_1(), "rule__ERModel__EntitiesAssignment_3_3_1");
					put(grammarAccess.getERModelAccess().getGerundsAssignment_4_2(), "rule__ERModel__GerundsAssignment_4_2");
					put(grammarAccess.getERModelAccess().getGerundsAssignment_4_3_1(), "rule__ERModel__GerundsAssignment_4_3_1");
					put(grammarAccess.getERModelAccess().getRelationshipsAssignment_5_2(), "rule__ERModel__RelationshipsAssignment_5_2");
					put(grammarAccess.getERModelAccess().getRelationshipsAssignment_5_3_1(), "rule__ERModel__RelationshipsAssignment_5_3_1");
					put(grammarAccess.getEntityAccess().getNameAssignment_0(), "rule__Entity__NameAssignment_0");
					put(grammarAccess.getEntityAccess().getEntityAttributesAssignment_2_2(), "rule__Entity__EntityAttributesAssignment_2_2");
					put(grammarAccess.getEntityAccess().getEntityAttributesAssignment_2_3_1(), "rule__Entity__EntityAttributesAssignment_2_3_1");
					put(grammarAccess.getEntityAccess().getKeySetAssignment_3_2(), "rule__Entity__KeySetAssignment_3_2");
					put(grammarAccess.getEntityAccess().getKeySetAssignment_3_3_1(), "rule__Entity__KeySetAssignment_3_3_1");
					put(grammarAccess.getEntityAccess().getPrimaryKeyAssignment_4_1(), "rule__Entity__PrimaryKeyAssignment_4_1");
					put(grammarAccess.getGerundAccess().getRelationshipAssignment(), "rule__Gerund__RelationshipAssignment");
					put(grammarAccess.getAttributeAccess().getNameAssignment_1(), "rule__Attribute__NameAssignment_1");
					put(grammarAccess.getAttributeAccess().getAttributeDomainAssignment_2(), "rule__Attribute__AttributeDomainAssignment_2");
					put(grammarAccess.getAttributeDomainAccess().getDomainAssignment_0(), "rule__AttributeDomain__DomainAssignment_0");
					put(grammarAccess.getAttributeDomainAccess().getLengthAssignment_1_1(), "rule__AttributeDomain__LengthAssignment_1_1");
					put(grammarAccess.getAttributeDomainAccess().getDefaultAssignment_2_1(), "rule__AttributeDomain__DefaultAssignment_2_1");
					put(grammarAccess.getKeyAccess().getNameAssignment_0(), "rule__Key__NameAssignment_0");
					put(grammarAccess.getKeyAccess().getKeyAttributesAssignment_2(), "rule__Key__KeyAttributesAssignment_2");
					put(grammarAccess.getKeyAccess().getKeyAttributesAssignment_3_1(), "rule__Key__KeyAttributesAssignment_3_1");
					put(grammarAccess.getDomainAccess().getNameAssignment_1(), "rule__Domain__NameAssignment_1");
					put(grammarAccess.getDomainAccess().getPrimitiveDomainAssignment_3(), "rule__Domain__PrimitiveDomainAssignment_3");
					put(grammarAccess.getRelationshipAccess().getNameAssignment_0(), "rule__Relationship__NameAssignment_0");
					put(grammarAccess.getRelationshipAccess().getEntitiesAssignment_4(), "rule__Relationship__EntitiesAssignment_4");
					put(grammarAccess.getRelationshipAccess().getEntitiesAssignment_5_1(), "rule__Relationship__EntitiesAssignment_5_1");
					put(grammarAccess.getRelationshipAccess().getRelationshipAttributesAssignment_7_2(), "rule__Relationship__RelationshipAttributesAssignment_7_2");
					put(grammarAccess.getRelationshipAccess().getRelationshipAttributesAssignment_7_3_1(), "rule__Relationship__RelationshipAttributesAssignment_7_3_1");
					put(grammarAccess.getISAAccess().getNameAssignment_1(), "rule__ISA__NameAssignment_1");
					put(grammarAccess.getISAAccess().getSupertypeAssignment_4(), "rule__ISA__SupertypeAssignment_4");
					put(grammarAccess.getISAAccess().getSubtypesAssignment_7(), "rule__ISA__SubtypesAssignment_7");
					put(grammarAccess.getISAAccess().getSubtypesAssignment_8_1(), "rule__ISA__SubtypesAssignment_8_1");
					put(grammarAccess.getISAAccess().getClassificationAttributeAssignment_11(), "rule__ISA__ClassificationAttributeAssignment_11");
					put(grammarAccess.getCategorisationAccess().getNameAssignment_1(), "rule__Categorisation__NameAssignment_1");
					put(grammarAccess.getCategorisationAccess().getCategorisedEntityAssignment_4(), "rule__Categorisation__CategorisedEntityAssignment_4");
					put(grammarAccess.getCategorisationAccess().getCategorisationEntitiesAssignment_6(), "rule__Categorisation__CategorisationEntitiesAssignment_6");
					put(grammarAccess.getCategorisationAccess().getIsPartialAssignment_8(), "rule__Categorisation__IsPartialAssignment_8");
					put(grammarAccess.getIdentificationDependencyAccess().getNameAssignment_1(), "rule__IdentificationDependency__NameAssignment_1");
					put(grammarAccess.getIdentificationDependencyAccess().getWeakEntityAssignment_4(), "rule__IdentificationDependency__WeakEntityAssignment_4");
					put(grammarAccess.getIdentificationDependencyAccess().getRegularEntityAssignment_6(), "rule__IdentificationDependency__RegularEntityAssignment_6");
					put(grammarAccess.getRegularEntityAccess().getEntityAssignment_0(), "rule__RegularEntity__EntityAssignment_0");
					put(grammarAccess.getRegularEntityAccess().getMinAssignment_2(), "rule__RegularEntity__MinAssignment_2");
					put(grammarAccess.getRegularEntityAccess().getMaxAssignment_4(), "rule__RegularEntity__MaxAssignment_4");
					put(grammarAccess.getRegularEntityAccess().getRoleAssignment_6(), "rule__RegularEntity__RoleAssignment_6");
					put(grammarAccess.getCategoriesAccess().getEntitiesAssignment_1(), "rule__Categories__EntitiesAssignment_1");
					put(grammarAccess.getCategoriesAccess().getEntitiesAssignment_2_1(), "rule__Categories__EntitiesAssignment_2_1");
					put(grammarAccess.getCategoriesAccess().getMinAssignment_5(), "rule__Categories__MinAssignment_5");
					put(grammarAccess.getCategoriesAccess().getMaxAssignment_7(), "rule__Categories__MaxAssignment_7");
				}
			};
		}
		return nameMappings.get(element);
	}
	
	@Override
	protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
		try {
			org.xtext.example.domij.ui.contentassist.antlr.internal.InternalErDslParser typedParser = (org.xtext.example.domij.ui.contentassist.antlr.internal.InternalErDslParser) parser;
			typedParser.entryRuleERModel();
			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 ErDslGrammarAccess getGrammarAccess() {
		return this.grammarAccess;
	}
	
	public void setGrammarAccess(ErDslGrammarAccess grammarAccess) {
		this.grammarAccess = grammarAccess;
	}
}
