/*
* generated by Xtext
*/
package org.applause.lang.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.applause.lang.services.ApplauseDslGrammarAccess;

public class ApplauseDslParser extends AbstractContentAssistParser {
	
	@Inject
	private ApplauseDslGrammarAccess grammarAccess;
	
	private Map<AbstractElement, String> nameMappings;
	
	@Override
	protected org.applause.lang.ui.contentassist.antlr.internal.InternalApplauseDslParser createParser() {
		org.applause.lang.ui.contentassist.antlr.internal.InternalApplauseDslParser result = new org.applause.lang.ui.contentassist.antlr.internal.InternalApplauseDslParser(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.getModelElementAccess().getAlternatives(), "rule__ModelElement__Alternatives");
					put(grammarAccess.getVariableDeclarationAccess().getAlternatives(), "rule__VariableDeclaration__Alternatives");
					put(grammarAccess.getExpressionAccess().getAlternatives(), "rule__Expression__Alternatives");
					put(grammarAccess.getScalarExpressionAccess().getAlternatives(), "rule__ScalarExpression__Alternatives");
					put(grammarAccess.getCollectionExpressionAccess().getAlternatives(), "rule__CollectionExpression__Alternatives");
					put(grammarAccess.getStringFunctionAccess().getAlternatives(), "rule__StringFunction__Alternatives");
					put(grammarAccess.getTabBarApplicationAccess().getAlternatives_0(), "rule__TabBarApplication__Alternatives_0");
					put(grammarAccess.getTypeAccess().getAlternatives(), "rule__Type__Alternatives");
					put(grammarAccess.getContentProviderAccess().getAlternatives_3(), "rule__ContentProvider__Alternatives_3");
					put(grammarAccess.getProviderConstructionAccess().getAlternatives(), "rule__ProviderConstruction__Alternatives");
					put(grammarAccess.getViewAccess().getAlternatives(), "rule__View__Alternatives");
					put(grammarAccess.getSectionedViewAccess().getAlternatives(), "rule__SectionedView__Alternatives");
					put(grammarAccess.getViewActionAccess().getAlternatives(), "rule__ViewAction__Alternatives");
					put(grammarAccess.getCellTypeAccess().getAlternatives(), "rule__CellType__Alternatives");
					put(grammarAccess.getModelAccess().getGroup(), "rule__Model__Group__0");
					put(grammarAccess.getTypeDescriptionAccess().getGroup(), "rule__TypeDescription__Group__0");
					put(grammarAccess.getParameterAccess().getGroup(), "rule__Parameter__Group__0");
					put(grammarAccess.getObjectReferenceAccess().getGroup(), "rule__ObjectReference__Group__0");
					put(grammarAccess.getNestedObjectReferenceAccess().getGroup(), "rule__NestedObjectReference__Group__0");
					put(grammarAccess.getStringFunctionAccess().getGroup_0(), "rule__StringFunction__Group_0__0");
					put(grammarAccess.getStringFunctionAccess().getGroup_1(), "rule__StringFunction__Group_1__0");
					put(grammarAccess.getStringFunctionAccess().getGroup_2(), "rule__StringFunction__Group_2__0");
					put(grammarAccess.getCollectionLiteralAccess().getGroup(), "rule__CollectionLiteral__Group__0");
					put(grammarAccess.getCollectionLiteralAccess().getGroup_2(), "rule__CollectionLiteral__Group_2__0");
					put(grammarAccess.getCollectionFunctionAccess().getGroup(), "rule__CollectionFunction__Group__0");
					put(grammarAccess.getTabBarApplicationAccess().getGroup(), "rule__TabBarApplication__Group__0");
					put(grammarAccess.getTabBarApplicationAccess().getGroup_3(), "rule__TabBarApplication__Group_3__0");
					put(grammarAccess.getTabbarButtonAccess().getGroup(), "rule__TabbarButton__Group__0");
					put(grammarAccess.getConstantAccess().getGroup(), "rule__Constant__Group__0");
					put(grammarAccess.getSimpleTypeAccess().getGroup(), "rule__SimpleType__Group__0");
					put(grammarAccess.getEntityAccess().getGroup(), "rule__Entity__Group__0");
					put(grammarAccess.getEntityAccess().getGroup_2(), "rule__Entity__Group_2__0");
					put(grammarAccess.getPropertyAccess().getGroup(), "rule__Property__Group__0");
					put(grammarAccess.getContentProviderAccess().getGroup(), "rule__ContentProvider__Group__0");
					put(grammarAccess.getContentProviderAccess().getGroup_2(), "rule__ContentProvider__Group_2__0");
					put(grammarAccess.getProviderConstructionAccess().getGroup_0(), "rule__ProviderConstruction__Group_0__0");
					put(grammarAccess.getProviderConstructionAccess().getGroup_1(), "rule__ProviderConstruction__Group_1__0");
					put(grammarAccess.getTableViewAccess().getGroup(), "rule__TableView__Group__0");
					put(grammarAccess.getTableViewAccess().getGroup_2(), "rule__TableView__Group_2__0");
					put(grammarAccess.getDetailsViewAccess().getGroup(), "rule__DetailsView__Group__0");
					put(grammarAccess.getDetailsViewAccess().getGroup_2(), "rule__DetailsView__Group_2__0");
					put(grammarAccess.getCustomViewAccess().getGroup(), "rule__CustomView__Group__0");
					put(grammarAccess.getCustomViewAccess().getGroup_2(), "rule__CustomView__Group_2__0");
					put(grammarAccess.getViewHeaderAccess().getGroup(), "rule__ViewHeader__Group__0");
					put(grammarAccess.getViewHeaderAccess().getGroup_3(), "rule__ViewHeader__Group_3__0");
					put(grammarAccess.getViewHeaderAccess().getGroup_4(), "rule__ViewHeader__Group_4__0");
					put(grammarAccess.getViewHeaderAccess().getGroup_5(), "rule__ViewHeader__Group_5__0");
					put(grammarAccess.getViewHeaderAccess().getGroup_6(), "rule__ViewHeader__Group_6__0");
					put(grammarAccess.getViewSectionAccess().getGroup(), "rule__ViewSection__Group__0");
					put(grammarAccess.getViewSectionAccess().getGroup_2(), "rule__ViewSection__Group_2__0");
					put(grammarAccess.getSectionCellAccess().getGroup(), "rule__SectionCell__Group__0");
					put(grammarAccess.getSectionCellAccess().getGroup_2(), "rule__SectionCell__Group_2__0");
					put(grammarAccess.getSectionCellAccess().getGroup_4(), "rule__SectionCell__Group_4__0");
					put(grammarAccess.getSectionCellAccess().getGroup_5(), "rule__SectionCell__Group_5__0");
					put(grammarAccess.getSectionCellAccess().getGroup_6(), "rule__SectionCell__Group_6__0");
					put(grammarAccess.getSectionCellAccess().getGroup_7(), "rule__SectionCell__Group_7__0");
					put(grammarAccess.getSectionCellAccess().getGroup_8(), "rule__SectionCell__Group_8__0");
					put(grammarAccess.getCollectionIteratorAccess().getGroup(), "rule__CollectionIterator__Group__0");
					put(grammarAccess.getViewCallAccess().getGroup(), "rule__ViewCall__Group__0");
					put(grammarAccess.getModelAccess().getApplicationAssignment_0(), "rule__Model__ApplicationAssignment_0");
					put(grammarAccess.getModelAccess().getElementsAssignment_1(), "rule__Model__ElementsAssignment_1");
					put(grammarAccess.getTypeDescriptionAccess().getTypeAssignment_0(), "rule__TypeDescription__TypeAssignment_0");
					put(grammarAccess.getTypeDescriptionAccess().getManyAssignment_1(), "rule__TypeDescription__ManyAssignment_1");
					put(grammarAccess.getParameterAccess().getDescriptionAssignment_0(), "rule__Parameter__DescriptionAssignment_0");
					put(grammarAccess.getParameterAccess().getNameAssignment_1(), "rule__Parameter__NameAssignment_1");
					put(grammarAccess.getObjectReferenceAccess().getObjectAssignment_0(), "rule__ObjectReference__ObjectAssignment_0");
					put(grammarAccess.getObjectReferenceAccess().getTailAssignment_1(), "rule__ObjectReference__TailAssignment_1");
					put(grammarAccess.getNestedObjectReferenceAccess().getObjectAssignment_1(), "rule__NestedObjectReference__ObjectAssignment_1");
					put(grammarAccess.getNestedObjectReferenceAccess().getTailAssignment_2(), "rule__NestedObjectReference__TailAssignment_2");
					put(grammarAccess.getStringLiteralAccess().getValueAssignment(), "rule__StringLiteral__ValueAssignment");
					put(grammarAccess.getStringFunctionAccess().getValuesAssignment_0_2(), "rule__StringFunction__ValuesAssignment_0_2");
					put(grammarAccess.getStringFunctionAccess().getValueAssignment_1_2(), "rule__StringFunction__ValueAssignment_1_2");
					put(grammarAccess.getStringFunctionAccess().getMatchAssignment_1_4(), "rule__StringFunction__MatchAssignment_1_4");
					put(grammarAccess.getStringFunctionAccess().getReplacementAssignment_1_6(), "rule__StringFunction__ReplacementAssignment_1_6");
					put(grammarAccess.getStringFunctionAccess().getValueAssignment_2_2(), "rule__StringFunction__ValueAssignment_2_2");
					put(grammarAccess.getCollectionLiteralAccess().getItemsAssignment_1(), "rule__CollectionLiteral__ItemsAssignment_1");
					put(grammarAccess.getCollectionLiteralAccess().getItemsAssignment_2_1(), "rule__CollectionLiteral__ItemsAssignment_2_1");
					put(grammarAccess.getCollectionFunctionAccess().getValueAssignment_2(), "rule__CollectionFunction__ValueAssignment_2");
					put(grammarAccess.getCollectionFunctionAccess().getDelimiterAssignment_4(), "rule__CollectionFunction__DelimiterAssignment_4");
					put(grammarAccess.getTabBarApplicationAccess().getNameAssignment_1(), "rule__TabBarApplication__NameAssignment_1");
					put(grammarAccess.getTabBarApplicationAccess().getSplashAssignment_3_1(), "rule__TabBarApplication__SplashAssignment_3_1");
					put(grammarAccess.getTabBarApplicationAccess().getButtonsAssignment_4(), "rule__TabBarApplication__ButtonsAssignment_4");
					put(grammarAccess.getTabbarButtonAccess().getTitleAssignment_3(), "rule__TabbarButton__TitleAssignment_3");
					put(grammarAccess.getTabbarButtonAccess().getIconAssignment_5(), "rule__TabbarButton__IconAssignment_5");
					put(grammarAccess.getTabbarButtonAccess().getViewAssignment_7(), "rule__TabbarButton__ViewAssignment_7");
					put(grammarAccess.getConstantAccess().getNameAssignment_2(), "rule__Constant__NameAssignment_2");
					put(grammarAccess.getConstantAccess().getValueAssignment_3(), "rule__Constant__ValueAssignment_3");
					put(grammarAccess.getSimpleTypeAccess().getNameAssignment_1(), "rule__SimpleType__NameAssignment_1");
					put(grammarAccess.getSimpleTypeAccess().getPlatformTypeAssignment_3(), "rule__SimpleType__PlatformTypeAssignment_3");
					put(grammarAccess.getEntityAccess().getNameAssignment_1(), "rule__Entity__NameAssignment_1");
					put(grammarAccess.getEntityAccess().getExtendsAssignment_2_1(), "rule__Entity__ExtendsAssignment_2_1");
					put(grammarAccess.getEntityAccess().getPropertiesAssignment_4(), "rule__Entity__PropertiesAssignment_4");
					put(grammarAccess.getPropertyAccess().getDerivedAssignment_0(), "rule__Property__DerivedAssignment_0");
					put(grammarAccess.getPropertyAccess().getDescriptionAssignment_1(), "rule__Property__DescriptionAssignment_1");
					put(grammarAccess.getPropertyAccess().getNameAssignment_2(), "rule__Property__NameAssignment_2");
					put(grammarAccess.getContentProviderAccess().getNameAssignment_1(), "rule__ContentProvider__NameAssignment_1");
					put(grammarAccess.getContentProviderAccess().getParameterAssignment_2_1(), "rule__ContentProvider__ParameterAssignment_2_1");
					put(grammarAccess.getContentProviderAccess().getResolverAssignment_3_1(), "rule__ContentProvider__ResolverAssignment_3_1");
					put(grammarAccess.getContentProviderAccess().getTypeAssignment_4(), "rule__ContentProvider__TypeAssignment_4");
					put(grammarAccess.getContentProviderAccess().getManyAssignment_5(), "rule__ContentProvider__ManyAssignment_5");
					put(grammarAccess.getContentProviderAccess().getUrlAssignment_9(), "rule__ContentProvider__UrlAssignment_9");
					put(grammarAccess.getContentProviderAccess().getSelectionAssignment_11(), "rule__ContentProvider__SelectionAssignment_11");
					put(grammarAccess.getProviderConstructionAccess().getProviderAssignment_0_1(), "rule__ProviderConstruction__ProviderAssignment_0_1");
					put(grammarAccess.getProviderConstructionAccess().getArgumentAssignment_0_3(), "rule__ProviderConstruction__ArgumentAssignment_0_3");
					put(grammarAccess.getProviderConstructionAccess().getExpressionAssignment_1_1(), "rule__ProviderConstruction__ExpressionAssignment_1_1");
					put(grammarAccess.getTableViewAccess().getNameAssignment_1(), "rule__TableView__NameAssignment_1");
					put(grammarAccess.getTableViewAccess().getContentAssignment_2_1(), "rule__TableView__ContentAssignment_2_1");
					put(grammarAccess.getTableViewAccess().getTitleAssignment_5(), "rule__TableView__TitleAssignment_5");
					put(grammarAccess.getTableViewAccess().getSectionsAssignment_6(), "rule__TableView__SectionsAssignment_6");
					put(grammarAccess.getDetailsViewAccess().getNameAssignment_1(), "rule__DetailsView__NameAssignment_1");
					put(grammarAccess.getDetailsViewAccess().getContentAssignment_2_1(), "rule__DetailsView__ContentAssignment_2_1");
					put(grammarAccess.getDetailsViewAccess().getTitleAssignment_5(), "rule__DetailsView__TitleAssignment_5");
					put(grammarAccess.getDetailsViewAccess().getHeaderAssignment_6(), "rule__DetailsView__HeaderAssignment_6");
					put(grammarAccess.getDetailsViewAccess().getSectionsAssignment_7(), "rule__DetailsView__SectionsAssignment_7");
					put(grammarAccess.getCustomViewAccess().getNameAssignment_1(), "rule__CustomView__NameAssignment_1");
					put(grammarAccess.getCustomViewAccess().getContentAssignment_2_1(), "rule__CustomView__ContentAssignment_2_1");
					put(grammarAccess.getCustomViewAccess().getObjclassAssignment_4(), "rule__CustomView__ObjclassAssignment_4");
					put(grammarAccess.getViewHeaderAccess().getTitleAssignment_3_1(), "rule__ViewHeader__TitleAssignment_3_1");
					put(grammarAccess.getViewHeaderAccess().getSubtitleAssignment_4_1(), "rule__ViewHeader__SubtitleAssignment_4_1");
					put(grammarAccess.getViewHeaderAccess().getDetailsAssignment_5_1(), "rule__ViewHeader__DetailsAssignment_5_1");
					put(grammarAccess.getViewHeaderAccess().getImageAssignment_6_1(), "rule__ViewHeader__ImageAssignment_6_1");
					put(grammarAccess.getViewSectionAccess().getTitleAssignment_2_1(), "rule__ViewSection__TitleAssignment_2_1");
					put(grammarAccess.getViewSectionAccess().getCellsAssignment_3(), "rule__ViewSection__CellsAssignment_3");
					put(grammarAccess.getSectionCellAccess().getTypeAssignment_1(), "rule__SectionCell__TypeAssignment_1");
					put(grammarAccess.getSectionCellAccess().getIteratorAssignment_2_1(), "rule__SectionCell__IteratorAssignment_2_1");
					put(grammarAccess.getSectionCellAccess().getTextAssignment_4_1(), "rule__SectionCell__TextAssignment_4_1");
					put(grammarAccess.getSectionCellAccess().getDetailsAssignment_5_1(), "rule__SectionCell__DetailsAssignment_5_1");
					put(grammarAccess.getSectionCellAccess().getImageAssignment_6_1(), "rule__SectionCell__ImageAssignment_6_1");
					put(grammarAccess.getSectionCellAccess().getQueryAssignment_7_1(), "rule__SectionCell__QueryAssignment_7_1");
					put(grammarAccess.getSectionCellAccess().getActionAssignment_8_1(), "rule__SectionCell__ActionAssignment_8_1");
					put(grammarAccess.getCollectionIteratorAccess().getCollectionAssignment_0(), "rule__CollectionIterator__CollectionAssignment_0");
					put(grammarAccess.getCollectionIteratorAccess().getNameAssignment_2(), "rule__CollectionIterator__NameAssignment_2");
					put(grammarAccess.getExternalOpenAccess().getUrlAssignment(), "rule__ExternalOpen__UrlAssignment");
					put(grammarAccess.getViewCallAccess().getViewAssignment_0(), "rule__ViewCall__ViewAssignment_0");
					put(grammarAccess.getViewCallAccess().getProviderAssignment_2(), "rule__ViewCall__ProviderAssignment_2");
				}
			};
		}
		return nameMappings.get(element);
	}
	
	@Override
	protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
		try {
			org.applause.lang.ui.contentassist.antlr.internal.InternalApplauseDslParser typedParser = (org.applause.lang.ui.contentassist.antlr.internal.InternalApplauseDslParser) parser;
			typedParser.entryRuleModel();
			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 ApplauseDslGrammarAccess getGrammarAccess() {
		return this.grammarAccess;
	}
	
	public void setGrammarAccess(ApplauseDslGrammarAccess grammarAccess) {
		this.grammarAccess = grammarAccess;
	}
}
