/*
* generated by Xtext
*/
package jp.ac.jaist.kslab.e4.dsl.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 jp.ac.jaist.kslab.e4.dsl.services.E4DslGrammarAccess;

public class E4DslParser extends AbstractContentAssistParser {
	
	@Inject
	private E4DslGrammarAccess grammarAccess;
	
	private Map<AbstractElement, String> nameMappings;
	
	@Override
	protected jp.ac.jaist.kslab.e4.dsl.ui.contentassist.antlr.internal.InternalE4DslParser createParser() {
		jp.ac.jaist.kslab.e4.dsl.ui.contentassist.antlr.internal.InternalE4DslParser result = new jp.ac.jaist.kslab.e4.dsl.ui.contentassist.antlr.internal.InternalE4DslParser(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.getAbsWindowAccess().getAlternatives(), "rule__AbsWindow__Alternatives");
					put(grammarAccess.getAbsPartAccess().getAlternatives(), "rule__AbsPart__Alternatives");
					put(grammarAccess.getLayoutAccess().getLayoutAlternatives_1_0(), "rule__Layout__LayoutAlternatives_1_0");
					put(grammarAccess.getControlsAccess().getAlternatives(), "rule__Controls__Alternatives");
					put(grammarAccess.getAbsMenuAccess().getAlternatives(), "rule__AbsMenu__Alternatives");
					put(grammarAccess.getToolItemAccess().getEnableAlternatives_6_0(), "rule__ToolItem__EnableAlternatives_6_0");
					put(grammarAccess.getApplicationAccess().getGroup(), "rule__Application__Group__0");
					put(grammarAccess.getApplicationAccess().getGroup_4(), "rule__Application__Group_4__0");
					put(grammarAccess.getApplicationAccess().getGroup_5(), "rule__Application__Group_5__0");
					put(grammarAccess.getWindowAccess().getGroup(), "rule__Window__Group__0");
					put(grammarAccess.getTrimmedWindowAccess().getGroup(), "rule__TrimmedWindow__Group__0");
					put(grammarAccess.getTrimmedWindowAccess().getGroup_4(), "rule__TrimmedWindow__Group_4__0");
					put(grammarAccess.getTrimmedWindowAccess().getGroup_5(), "rule__TrimmedWindow__Group_5__0");
					put(grammarAccess.getPartAccess().getGroup(), "rule__Part__Group__0");
					put(grammarAccess.getXWTPartAccess().getGroup(), "rule__XWTPart__Group__0");
					put(grammarAccess.getLayoutAccess().getGroup(), "rule__Layout__Group__0");
					put(grammarAccess.getBrowserAccess().getGroup(), "rule__Browser__Group__0");
					put(grammarAccess.getButtonAccess().getGroup(), "rule__Button__Group__0");
					put(grammarAccess.getButtonAccess().getGroup_6(), "rule__Button__Group_6__0");
					put(grammarAccess.getCComboAccess().getGroup(), "rule__CCombo__Group__0");
					put(grammarAccess.getCLabelAccess().getGroup(), "rule__CLabel__Group__0");
					put(grammarAccess.getComboAccess().getGroup(), "rule__Combo__Group__0");
					put(grammarAccess.getDateTimeAccess().getGroup(), "rule__DateTime__Group__0");
					put(grammarAccess.getLabelAccess().getGroup(), "rule__Label__Group__0");
					put(grammarAccess.getLinkAccess().getGroup(), "rule__Link__Group__0");
					put(grammarAccess.getListAccess().getGroup(), "rule__List__Group__0");
					put(grammarAccess.getProgressBarAccess().getGroup(), "rule__ProgressBar__Group__0");
					put(grammarAccess.getSashAccess().getGroup(), "rule__Sash__Group__0");
					put(grammarAccess.getScaleAccess().getGroup(), "rule__Scale__Group__0");
					put(grammarAccess.getSliderAccess().getGroup(), "rule__Slider__Group__0");
					put(grammarAccess.getSpinnerAccess().getGroup(), "rule__Spinner__Group__0");
					put(grammarAccess.getSeparatorAccess().getGroup(), "rule__Separator__Group__0");
					put(grammarAccess.getStyledTextAccess().getGroup(), "rule__StyledText__Group__0");
					put(grammarAccess.getTextAccess().getGroup(), "rule__Text__Group__0");
					put(grammarAccess.getTextAccess().getGroup_6(), "rule__Text__Group_6__0");
					put(grammarAccess.getSizeAccess().getGroup(), "rule__Size__Group__0");
					put(grammarAccess.getCommandAccess().getGroup(), "rule__Command__Group__0");
					put(grammarAccess.getBindingAccess().getGroup(), "rule__Binding__Group__0");
					put(grammarAccess.getMenuAccess().getGroup(), "rule__Menu__Group__0");
					put(grammarAccess.getHandledMenuItemAccess().getGroup(), "rule__HandledMenuItem__Group__0");
					put(grammarAccess.getDirectMenuItemAccess().getGroup(), "rule__DirectMenuItem__Group__0");
					put(grammarAccess.getToolBarAccess().getGroup(), "rule__ToolBar__Group__0");
					put(grammarAccess.getToolItemAccess().getGroup(), "rule__ToolItem__Group__0");
					put(grammarAccess.getApplicationAccess().getNameAssignment_1(), "rule__Application__NameAssignment_1");
					put(grammarAccess.getApplicationAccess().getWindowsAssignment_3(), "rule__Application__WindowsAssignment_3");
					put(grammarAccess.getApplicationAccess().getCommandsAssignment_4_2(), "rule__Application__CommandsAssignment_4_2");
					put(grammarAccess.getApplicationAccess().getBindingsAssignment_5_2(), "rule__Application__BindingsAssignment_5_2");
					put(grammarAccess.getWindowAccess().getNameAssignment_1(), "rule__Window__NameAssignment_1");
					put(grammarAccess.getWindowAccess().getPartsAssignment_3(), "rule__Window__PartsAssignment_3");
					put(grammarAccess.getTrimmedWindowAccess().getNameAssignment_1(), "rule__TrimmedWindow__NameAssignment_1");
					put(grammarAccess.getTrimmedWindowAccess().getPartsAssignment_3(), "rule__TrimmedWindow__PartsAssignment_3");
					put(grammarAccess.getTrimmedWindowAccess().getMenuAssignment_4_2(), "rule__TrimmedWindow__MenuAssignment_4_2");
					put(grammarAccess.getTrimmedWindowAccess().getToolbarsAssignment_5_2(), "rule__TrimmedWindow__ToolbarsAssignment_5_2");
					put(grammarAccess.getPartAccess().getNameAssignment_1(), "rule__Part__NameAssignment_1");
					put(grammarAccess.getPartAccess().getLayoutAssignment_3(), "rule__Part__LayoutAssignment_3");
					put(grammarAccess.getPartAccess().getControlsAssignment_4(), "rule__Part__ControlsAssignment_4");
					put(grammarAccess.getXWTPartAccess().getNameAssignment_1(), "rule__XWTPart__NameAssignment_1");
					put(grammarAccess.getXWTPartAccess().getLayoutAssignment_3(), "rule__XWTPart__LayoutAssignment_3");
					put(grammarAccess.getXWTPartAccess().getControlsAssignment_4(), "rule__XWTPart__ControlsAssignment_4");
					put(grammarAccess.getLayoutAccess().getLayoutAssignment_1(), "rule__Layout__LayoutAssignment_1");
					put(grammarAccess.getBrowserAccess().getNameAssignment_2(), "rule__Browser__NameAssignment_2");
					put(grammarAccess.getBrowserAccess().getTextAssignment_5(), "rule__Browser__TextAssignment_5");
					put(grammarAccess.getButtonAccess().getNameAssignment_2(), "rule__Button__NameAssignment_2");
					put(grammarAccess.getButtonAccess().getTextAssignment_5(), "rule__Button__TextAssignment_5");
					put(grammarAccess.getButtonAccess().getSizeAssignment_6_1(), "rule__Button__SizeAssignment_6_1");
					put(grammarAccess.getCComboAccess().getNameAssignment_2(), "rule__CCombo__NameAssignment_2");
					put(grammarAccess.getCLabelAccess().getNameAssignment_2(), "rule__CLabel__NameAssignment_2");
					put(grammarAccess.getCLabelAccess().getTextAssignment_5(), "rule__CLabel__TextAssignment_5");
					put(grammarAccess.getComboAccess().getNameAssignment_2(), "rule__Combo__NameAssignment_2");
					put(grammarAccess.getDateTimeAccess().getNameAssignment_2(), "rule__DateTime__NameAssignment_2");
					put(grammarAccess.getLabelAccess().getNameAssignment_2(), "rule__Label__NameAssignment_2");
					put(grammarAccess.getLabelAccess().getTextAssignment_5(), "rule__Label__TextAssignment_5");
					put(grammarAccess.getLinkAccess().getNameAssignment_2(), "rule__Link__NameAssignment_2");
					put(grammarAccess.getListAccess().getNameAssignment_2(), "rule__List__NameAssignment_2");
					put(grammarAccess.getProgressBarAccess().getNameAssignment_2(), "rule__ProgressBar__NameAssignment_2");
					put(grammarAccess.getSashAccess().getNameAssignment_2(), "rule__Sash__NameAssignment_2");
					put(grammarAccess.getScaleAccess().getNameAssignment_2(), "rule__Scale__NameAssignment_2");
					put(grammarAccess.getSliderAccess().getNameAssignment_2(), "rule__Slider__NameAssignment_2");
					put(grammarAccess.getSpinnerAccess().getNameAssignment_2(), "rule__Spinner__NameAssignment_2");
					put(grammarAccess.getSeparatorAccess().getNameAssignment_2(), "rule__Separator__NameAssignment_2");
					put(grammarAccess.getStyledTextAccess().getNameAssignment_2(), "rule__StyledText__NameAssignment_2");
					put(grammarAccess.getStyledTextAccess().getTextAssignment_5(), "rule__StyledText__TextAssignment_5");
					put(grammarAccess.getTextAccess().getNameAssignment_2(), "rule__Text__NameAssignment_2");
					put(grammarAccess.getTextAccess().getTextAssignment_5(), "rule__Text__TextAssignment_5");
					put(grammarAccess.getTextAccess().getSizeAssignment_6_1(), "rule__Text__SizeAssignment_6_1");
					put(grammarAccess.getSizeAccess().getXAssignment_0(), "rule__Size__XAssignment_0");
					put(grammarAccess.getSizeAccess().getYAssignment_2(), "rule__Size__YAssignment_2");
					put(grammarAccess.getCommandAccess().getNameAssignment_1(), "rule__Command__NameAssignment_1");
					put(grammarAccess.getBindingAccess().getCommandAssignment_1(), "rule__Binding__CommandAssignment_1");
					put(grammarAccess.getBindingAccess().getKeyAssignment_3(), "rule__Binding__KeyAssignment_3");
					put(grammarAccess.getMenuAccess().getNameAssignment_1(), "rule__Menu__NameAssignment_1");
					put(grammarAccess.getMenuAccess().getItemsAssignment_3(), "rule__Menu__ItemsAssignment_3");
					put(grammarAccess.getHandledMenuItemAccess().getNameAssignment_1(), "rule__HandledMenuItem__NameAssignment_1");
					put(grammarAccess.getHandledMenuItemAccess().getCommandAssignment_3(), "rule__HandledMenuItem__CommandAssignment_3");
					put(grammarAccess.getHandledMenuItemAccess().getIconAssignment_5(), "rule__HandledMenuItem__IconAssignment_5");
					put(grammarAccess.getDirectMenuItemAccess().getNameAssignment_1(), "rule__DirectMenuItem__NameAssignment_1");
					put(grammarAccess.getDirectMenuItemAccess().getClassAssignment_3(), "rule__DirectMenuItem__ClassAssignment_3");
					put(grammarAccess.getDirectMenuItemAccess().getIconAssignment_5(), "rule__DirectMenuItem__IconAssignment_5");
					put(grammarAccess.getToolBarAccess().getNameAssignment_1(), "rule__ToolBar__NameAssignment_1");
					put(grammarAccess.getToolBarAccess().getItemAssignment_3(), "rule__ToolBar__ItemAssignment_3");
					put(grammarAccess.getToolItemAccess().getNameAssignment_1(), "rule__ToolItem__NameAssignment_1");
					put(grammarAccess.getToolItemAccess().getCommandAssignment_3(), "rule__ToolItem__CommandAssignment_3");
					put(grammarAccess.getToolItemAccess().getIconAssignment_5(), "rule__ToolItem__IconAssignment_5");
					put(grammarAccess.getToolItemAccess().getEnableAssignment_6(), "rule__ToolItem__EnableAssignment_6");
				}
			};
		}
		return nameMappings.get(element);
	}
	
	@Override
	protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
		try {
			jp.ac.jaist.kslab.e4.dsl.ui.contentassist.antlr.internal.InternalE4DslParser typedParser = (jp.ac.jaist.kslab.e4.dsl.ui.contentassist.antlr.internal.InternalE4DslParser) parser;
			typedParser.entryRuleApplication();
			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 E4DslGrammarAccess getGrammarAccess() {
		return this.grammarAccess;
	}
	
	public void setGrammarAccess(E4DslGrammarAccess grammarAccess) {
		this.grammarAccess = grammarAccess;
	}
}
