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

public class MyDsl6Parser extends AbstractContentAssistParser {
	
	@Inject
	private MyDsl6GrammarAccess grammarAccess;
	
	private Map<AbstractElement, String> nameMappings;
	
	@Override
	protected org.xtext.example.mydsl6.ui.contentassist.antlr.internal.InternalMyDsl6Parser createParser() {
		org.xtext.example.mydsl6.ui.contentassist.antlr.internal.InternalMyDsl6Parser result = new org.xtext.example.mydsl6.ui.contentassist.antlr.internal.InternalMyDsl6Parser(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.getContextUnitAccess().getAlternatives(), "rule__ContextUnit__Alternatives");
					put(grammarAccess.getFieldAccess().getAlternatives(), "rule__Field__Alternatives");
					put(grammarAccess.getContextAccess().getGroup(), "rule__Context__Group__0");
					put(grammarAccess.getApplicationAccess().getGroup(), "rule__Application__Group__0");
					put(grammarAccess.getCollectionAccess().getGroup(), "rule__Collection__Group__0");
					put(grammarAccess.getMethodAccess().getGroup(), "rule__Method__Group__0");
					put(grammarAccess.getMethodAccess().getGroup_3(), "rule__Method__Group_3__0");
					put(grammarAccess.getMethodAccess().getGroup_4(), "rule__Method__Group_4__0");
					put(grammarAccess.getFunctionAccess().getGroup(), "rule__Function__Group__0");
					put(grammarAccess.getFunctionAccess().getGroup_3(), "rule__Function__Group_3__0");
					put(grammarAccess.getTypeAccess().getGroup(), "rule__Type__Group__0");
					put(grammarAccess.getTypeAccess().getGroup_3(), "rule__Type__Group_3__0");
					put(grammarAccess.getTypeAccess().getGroup_6(), "rule__Type__Group_6__0");
					put(grammarAccess.getLookUpAccess().getGroup(), "rule__LookUp__Group__0");
					put(grammarAccess.getLookUpAccess().getGroup_3(), "rule__LookUp__Group_3__0");
					put(grammarAccess.getLookUpAccess().getGroup_4(), "rule__LookUp__Group_4__0");
					put(grammarAccess.getTextFieldAccess().getGroup(), "rule__TextField__Group__0");
					put(grammarAccess.getQualifiedNameAccess().getGroup(), "rule__QualifiedName__Group__0");
					put(grammarAccess.getQualifiedNameAccess().getGroup_1(), "rule__QualifiedName__Group_1__0");
					put(grammarAccess.getContextAccess().getNameAssignment_1(), "rule__Context__NameAssignment_1");
					put(grammarAccess.getContextAccess().getAppAssignment_3(), "rule__Context__AppAssignment_3");
					put(grammarAccess.getApplicationAccess().getNameAssignment_1(), "rule__Application__NameAssignment_1");
					put(grammarAccess.getApplicationAccess().getCollectionAssignment_3(), "rule__Application__CollectionAssignment_3");
					put(grammarAccess.getApplicationAccess().getCollectionAssignment_4(), "rule__Application__CollectionAssignment_4");
					put(grammarAccess.getCollectionAccess().getNameAssignment_1(), "rule__Collection__NameAssignment_1");
					put(grammarAccess.getCollectionAccess().getOwnmethodAssignment_3(), "rule__Collection__OwnmethodAssignment_3");
					put(grammarAccess.getMethodAccess().getNameAssignment_1(), "rule__Method__NameAssignment_1");
					put(grammarAccess.getMethodAccess().getListAssignment_3_0(), "rule__Method__ListAssignment_3_0");
					put(grammarAccess.getMethodAccess().getListAssignment_3_1(), "rule__Method__ListAssignment_3_1");
					put(grammarAccess.getMethodAccess().getOwnmethodAssignment_4_0(), "rule__Method__OwnmethodAssignment_4_0");
					put(grammarAccess.getMethodAccess().getOwnmethodAssignment_4_1(), "rule__Method__OwnmethodAssignment_4_1");
					put(grammarAccess.getFunctionAccess().getNameAssignment_1(), "rule__Function__NameAssignment_1");
					put(grammarAccess.getFunctionAccess().getTypeAssignment_3_0(), "rule__Function__TypeAssignment_3_0");
					put(grammarAccess.getFunctionAccess().getTypeAssignment_3_1(), "rule__Function__TypeAssignment_3_1");
					put(grammarAccess.getTypeAccess().getNameAssignment_1(), "rule__Type__NameAssignment_1");
					put(grammarAccess.getTypeAccess().getParentTypeAssignment_3_2(), "rule__Type__ParentTypeAssignment_3_2");
					put(grammarAccess.getTypeAccess().getOwnedFieldAssignment_6_0(), "rule__Type__OwnedFieldAssignment_6_0");
					put(grammarAccess.getTypeAccess().getOwnedFieldAssignment_6_1(), "rule__Type__OwnedFieldAssignment_6_1");
					put(grammarAccess.getLookUpAccess().getNameAssignment_1(), "rule__LookUp__NameAssignment_1");
					put(grammarAccess.getLookUpAccess().getTypeAssignment_3_2(), "rule__LookUp__TypeAssignment_3_2");
					put(grammarAccess.getLookUpAccess().getShowFieldAssignment_4_2(), "rule__LookUp__ShowFieldAssignment_4_2");
					put(grammarAccess.getTextFieldAccess().getNameAssignment_1(), "rule__TextField__NameAssignment_1");
					put(grammarAccess.getTextFieldAccess().getDisplayNameAssignment_5(), "rule__TextField__DisplayNameAssignment_5");
					put(grammarAccess.getTextFieldAccess().getPropertyAssignment_8(), "rule__TextField__PropertyAssignment_8");
				}
			};
		}
		return nameMappings.get(element);
	}
	
	@Override
	protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
		try {
			org.xtext.example.mydsl6.ui.contentassist.antlr.internal.InternalMyDsl6Parser typedParser = (org.xtext.example.mydsl6.ui.contentassist.antlr.internal.InternalMyDsl6Parser) parser;
			typedParser.entryRuleContext();
			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 MyDsl6GrammarAccess getGrammarAccess() {
		return this.grammarAccess;
	}
	
	public void setGrammarAccess(MyDsl6GrammarAccess grammarAccess) {
		this.grammarAccess = grammarAccess;
	}
}
