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

public class MyDslParser extends AbstractContentAssistParser {
	
	@Inject
	private MyDslGrammarAccess grammarAccess;
	
	private Map<AbstractElement, String> nameMappings;
	
	@Override
	protected org.xtext.example.mydsl.ui.contentassist.antlr.internal.InternalMyDslParser createParser() {
		org.xtext.example.mydsl.ui.contentassist.antlr.internal.InternalMyDslParser result = new org.xtext.example.mydsl.ui.contentassist.antlr.internal.InternalMyDslParser(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.getContentUnitAccess().getAlternatives(), "rule__ContentUnit__Alternatives");
					put(grammarAccess.getContentModelAccess().getGroup(), "rule__ContentModel__Group__0");
					put(grammarAccess.getContentModelAccess().getGroup_6(), "rule__ContentModel__Group_6__0");
					put(grammarAccess.getWebAccess().getGroup(), "rule__Web__Group__0");
					put(grammarAccess.getWebAccess().getGroup_9(), "rule__Web__Group_9__0");
					put(grammarAccess.getWebAccess().getGroup_10(), "rule__Web__Group_10__0");
					put(grammarAccess.getWebAccess().getGroup_11(), "rule__Web__Group_11__0");
					put(grammarAccess.getQualifiedNameAccess().getGroup(), "rule__QualifiedName__Group__0");
					put(grammarAccess.getQualifiedNameAccess().getGroup_1(), "rule__QualifiedName__Group_1__0");
					put(grammarAccess.getContentModelAccess().getNameAssignment_1(), "rule__ContentModel__NameAssignment_1");
					put(grammarAccess.getContentModelAccess().getDisplayNameAssignment_5(), "rule__ContentModel__DisplayNameAssignment_5");
					put(grammarAccess.getContentModelAccess().getDescriptionAssignment_6_2(), "rule__ContentModel__DescriptionAssignment_6_2");
					put(grammarAccess.getContentModelAccess().getOwnedWebAssignment_7(), "rule__ContentModel__OwnedWebAssignment_7");
					put(grammarAccess.getWebAccess().getNameAssignment_1(), "rule__Web__NameAssignment_1");
					put(grammarAccess.getWebAccess().getGuIDAssignment_5(), "rule__Web__GuIDAssignment_5");
					put(grammarAccess.getWebAccess().getDisplayNameAssignment_8(), "rule__Web__DisplayNameAssignment_8");
					put(grammarAccess.getWebAccess().getDescriptionAssignment_9_2(), "rule__Web__DescriptionAssignment_9_2");
					put(grammarAccess.getWebAccess().getSitePermissionAssignment_10_2(), "rule__Web__SitePermissionAssignment_10_2");
					put(grammarAccess.getWebAccess().getOwnedWebAssignment_11_2(), "rule__Web__OwnedWebAssignment_11_2");
					put(grammarAccess.getWebAccess().getOwnedWebAssignment_11_3(), "rule__Web__OwnedWebAssignment_11_3");
				}
			};
		}
		return nameMappings.get(element);
	}
	
	@Override
	protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
		try {
			org.xtext.example.mydsl.ui.contentassist.antlr.internal.InternalMyDslParser typedParser = (org.xtext.example.mydsl.ui.contentassist.antlr.internal.InternalMyDslParser) parser;
			typedParser.entryRuleContentModel();
			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 MyDslGrammarAccess getGrammarAccess() {
		return this.grammarAccess;
	}
	
	public void setGrammarAccess(MyDslGrammarAccess grammarAccess) {
		this.grammarAccess = grammarAccess;
	}
}
