/*
 * generated by Xtext 2.9.2
 */
parser grammar InternalEinDslParser;

options {
	tokenVocab=InternalEinDslLexer;
	superClass=AbstractInternalAntlrParser;
}

@header {
package org.xtext.example.mydsl.parser.antlr.internal;

import org.eclipse.xtext.*;
import org.eclipse.xtext.parser.*;
import org.eclipse.xtext.parser.impl.*;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
import org.xtext.example.mydsl.services.EinDslGrammarAccess;

}

@members {

 	private EinDslGrammarAccess grammarAccess;

    public InternalEinDslParser(TokenStream input, EinDslGrammarAccess grammarAccess) {
        this(input);
        this.grammarAccess = grammarAccess;
        registerRules(grammarAccess.getGrammar());
    }

    @Override
    protected String getFirstRuleName() {
    	return "Model";
   	}

   	@Override
   	protected EinDslGrammarAccess getGrammarAccess() {
   		return grammarAccess;
   	}

}

@rulecatch {
    catch (RecognitionException re) {
        recover(input,re);
        appendSkippedTokens();
    }
}

// Entry rule entryRuleModel
entryRuleModel returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getModelRule()); }
	iv_ruleModel=ruleModel
	{ $current=$iv_ruleModel.current; }
	EOF;

// Rule Model
ruleModel returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			{
				newCompositeNode(grammarAccess.getModelAccess().getGreetingsQueryParserRuleCall_0());
			}
			lv_greetings_0_0=ruleQuery
			{
				if ($current==null) {
					$current = createModelElementForParent(grammarAccess.getModelRule());
				}
				set(
					$current,
					"greetings",
					lv_greetings_0_0,
					"org.xtext.example.mydsl.EinDsl.Query");
				afterParserOrEnumRuleCall();
			}
		)
	)
;

// Entry rule entryRuleQuery
entryRuleQuery returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getQueryRule()); }
	iv_ruleQuery=ruleQuery
	{ $current=$iv_ruleQuery.current; }
	EOF;

// Rule Query
ruleQuery returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				{
					newCompositeNode(grammarAccess.getQueryAccess().getKeyQTypekeyWordParserRuleCall_0_0());
				}
				lv_key_0_0=ruleQTypekeyWord
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getQueryRule());
					}
					set(
						$current,
						"key",
						lv_key_0_0,
						"org.xtext.example.mydsl.EinDsl.QTypekeyWord");
					afterParserOrEnumRuleCall();
				}
			)
		)?
		(
			(
				{
					newCompositeNode(grammarAccess.getQueryAccess().getAggregationAggregationParserRuleCall_1_0());
				}
				lv_aggregation_1_0=ruleAggregation
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getQueryRule());
					}
					set(
						$current,
						"aggregation",
						lv_aggregation_1_0,
						"org.xtext.example.mydsl.EinDsl.Aggregation");
					afterParserOrEnumRuleCall();
				}
			)
		)?
		(
			(
				{
					newCompositeNode(grammarAccess.getQueryAccess().getMeasureMeasureListParserRuleCall_2_0());
				}
				lv_measure_2_0=ruleMeasureList
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getQueryRule());
					}
					set(
						$current,
						"measure",
						lv_measure_2_0,
						"org.xtext.example.mydsl.EinDsl.MeasureList");
					afterParserOrEnumRuleCall();
				}
			)
		)
		(
			(
				{ 
				  getUnorderedGroupHelper().enter(grammarAccess.getQueryAccess().getUnorderedGroup_3());
				}
				(
					(
			(
				{getUnorderedGroupHelper().canSelect(grammarAccess.getQueryAccess().getUnorderedGroup_3(), 0)}?=>(
					{
						getUnorderedGroupHelper().select(grammarAccess.getQueryAccess().getUnorderedGroup_3(), 0);
					}
								({true}?=>((
									{
										newCompositeNode(grammarAccess.getQueryAccess().getGroupByGroupParserRuleCall_3_0_0());
									}
									lv_groupBy_4_0=ruleGroup
									{
										if ($current==null) {
											$current = createModelElementForParent(grammarAccess.getQueryRule());
										}
										add(
											$current,
											"groupBy",
											lv_groupBy_4_0,
											"org.xtext.example.mydsl.EinDsl.Group");
										afterParserOrEnumRuleCall();
									}
								)
								))
					{ 
						getUnorderedGroupHelper().returnFromSelection(grammarAccess.getQueryAccess().getUnorderedGroup_3());
					}
				)
			)|
			(
				{getUnorderedGroupHelper().canSelect(grammarAccess.getQueryAccess().getUnorderedGroup_3(), 1)}?=>(
					{
						getUnorderedGroupHelper().select(grammarAccess.getQueryAccess().getUnorderedGroup_3(), 1);
					}
								({true}?=>((
									{
										newCompositeNode(grammarAccess.getQueryAccess().getConditionCondtitionParserRuleCall_3_1_0());
									}
									lv_condition_5_0=ruleCondtition
									{
										if ($current==null) {
											$current = createModelElementForParent(grammarAccess.getQueryRule());
										}
										set(
											$current,
											"condition",
											lv_condition_5_0,
											"org.xtext.example.mydsl.EinDsl.Condtition");
										afterParserOrEnumRuleCall();
									}
								)
								))+
					{ 
						getUnorderedGroupHelper().returnFromSelection(grammarAccess.getQueryAccess().getUnorderedGroup_3());
					}
				)
			)|
			(
				{getUnorderedGroupHelper().canSelect(grammarAccess.getQueryAccess().getUnorderedGroup_3(), 2)}?=>(
					{
						getUnorderedGroupHelper().select(grammarAccess.getQueryAccess().getUnorderedGroup_3(), 2);
					}
								({true}?=>((
									{
										newCompositeNode(grammarAccess.getQueryAccess().getRangeTransitionParserRuleCall_3_2_0());
									}
									lv_range_6_0=ruleTransition
									{
										if ($current==null) {
											$current = createModelElementForParent(grammarAccess.getQueryRule());
										}
										set(
											$current,
											"range",
											lv_range_6_0,
											"org.xtext.example.mydsl.EinDsl.Transition");
										afterParserOrEnumRuleCall();
									}
								)
								))
					{ 
						getUnorderedGroupHelper().returnFromSelection(grammarAccess.getQueryAccess().getUnorderedGroup_3());
					}
				)
			)
					)*
				)
			)
				{ 
				  getUnorderedGroupHelper().leave(grammarAccess.getQueryAccess().getUnorderedGroup_3());
				}
		)
		(
			(
				{
					newCompositeNode(grammarAccess.getQueryAccess().getChartTypeChartTypeParserRuleCall_4_0());
				}
				lv_chartType_7_0=ruleChartType
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getQueryRule());
					}
					set(
						$current,
						"chartType",
						lv_chartType_7_0,
						"org.xtext.example.mydsl.EinDsl.ChartType");
					afterParserOrEnumRuleCall();
				}
			)
		)?
	)
;

// Entry rule entryRuleQTypekeyWord
entryRuleQTypekeyWord returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getQTypekeyWordRule()); }
	iv_ruleQTypekeyWord=ruleQTypekeyWord
	{ $current=$iv_ruleQTypekeyWord.current; }
	EOF;

// Rule QTypekeyWord
ruleQTypekeyWord returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			lv_qKeyword_0_0=Plot
			{
				newLeafNode(lv_qKeyword_0_0, grammarAccess.getQTypekeyWordAccess().getQKeywordPlotKeyword_0());
			}
			{
				if ($current==null) {
					$current = createModelElement(grammarAccess.getQTypekeyWordRule());
				}
				setWithLastConsumed($current, "qKeyword", lv_qKeyword_0_0, "plot");
			}
		)
	)
;

// Entry rule entryRuleAggregation
entryRuleAggregation returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getAggregationRule()); }
	iv_ruleAggregation=ruleAggregation
	{ $current=$iv_ruleAggregation.current; }
	EOF;

// Rule Aggregation
ruleAggregation returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				lv_agg_0_1=Average
				{
					newLeafNode(lv_agg_0_1, grammarAccess.getAggregationAccess().getAggAverageKeyword_0_0());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getAggregationRule());
					}
					setWithLastConsumed($current, "agg", lv_agg_0_1, null);
				}
				    |
				lv_agg_0_2=NumberOf
				{
					newLeafNode(lv_agg_0_2, grammarAccess.getAggregationAccess().getAggNumberOfKeyword_0_1());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getAggregationRule());
					}
					setWithLastConsumed($current, "agg", lv_agg_0_2, null);
				}
				    |
				lv_agg_0_3=Total
				{
					newLeafNode(lv_agg_0_3, grammarAccess.getAggregationAccess().getAggTotalKeyword_0_2());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getAggregationRule());
					}
					setWithLastConsumed($current, "agg", lv_agg_0_3, null);
				}
			)
		)
	)
;

// Entry rule entryRuleCondtition
entryRuleCondtition returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getCondtitionRule()); }
	iv_ruleCondtition=ruleCondtition
	{ $current=$iv_ruleCondtition.current; }
	EOF;

// Rule Condtition
ruleCondtition returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				(
					lv_con_0_0=For
					{
						newLeafNode(lv_con_0_0, grammarAccess.getCondtitionAccess().getConForKeyword_0_0_0());
					}
					{
						if ($current==null) {
							$current = createModelElement(grammarAccess.getCondtitionRule());
						}
						addWithLastConsumed($current, "con", lv_con_0_0, "for");
					}
				)
			)
			(
				(
					(
						{
							newCompositeNode(grammarAccess.getCondtitionAccess().getDimValueDimensionValueParserRuleCall_0_1_0_0());
						}
						lv_dimValue_1_0=ruleDimensionValue
						{
							if ($current==null) {
								$current = createModelElementForParent(grammarAccess.getCondtitionRule());
							}
							set(
								$current,
								"dimValue",
								lv_dimValue_1_0,
								"org.xtext.example.mydsl.EinDsl.DimensionValue");
							afterParserOrEnumRuleCall();
						}
					)
				)
				otherlv_2=As
				{
					newLeafNode(otherlv_2, grammarAccess.getCondtitionAccess().getAsKeyword_0_1_1());
				}
				(
					(
						{
							newCompositeNode(grammarAccess.getCondtitionAccess().getDimenDimensionParserRuleCall_0_1_2_0());
						}
						lv_dimen_3_0=ruleDimension
						{
							if ($current==null) {
								$current = createModelElementForParent(grammarAccess.getCondtitionRule());
							}
							set(
								$current,
								"dimen",
								lv_dimen_3_0,
								"org.xtext.example.mydsl.EinDsl.Dimension");
							afterParserOrEnumRuleCall();
						}
					)
				)
			)
		)
		    |
		(
			(
				(
					lv_conTimeCurrent_4_0=For
					{
						newLeafNode(lv_conTimeCurrent_4_0, grammarAccess.getCondtitionAccess().getConTimeCurrentForKeyword_1_0_0());
					}
					{
						if ($current==null) {
							$current = createModelElement(grammarAccess.getCondtitionRule());
						}
						setWithLastConsumed($current, "conTimeCurrent", lv_conTimeCurrent_4_0, "for");
					}
				)
			)
			(
				(
					{
						newCompositeNode(grammarAccess.getCondtitionAccess().getThisTimeGroupThisTimeGroupParserRuleCall_1_1_0());
					}
					lv_thisTimeGroup_5_0=ruleThisTimeGroup
					{
						if ($current==null) {
							$current = createModelElementForParent(grammarAccess.getCondtitionRule());
						}
						set(
							$current,
							"thisTimeGroup",
							lv_thisTimeGroup_5_0,
							"org.xtext.example.mydsl.EinDsl.ThisTimeGroup");
						afterParserOrEnumRuleCall();
					}
				)
			)
		)
		    |
		(
			(
				(
					lv_conlastTimePast_6_0=For
					{
						newLeafNode(lv_conlastTimePast_6_0, grammarAccess.getCondtitionAccess().getConlastTimePastForKeyword_2_0_0());
					}
					{
						if ($current==null) {
							$current = createModelElement(grammarAccess.getCondtitionRule());
						}
						setWithLastConsumed($current, "conlastTimePast", lv_conlastTimePast_6_0, "for");
					}
				)
			)
			(
				(
					{
						newCompositeNode(grammarAccess.getCondtitionAccess().getLastTimeGroupLastTimeGroupParserRuleCall_2_1_0());
					}
					lv_lastTimeGroup_7_0=ruleLastTimeGroup
					{
						if ($current==null) {
							$current = createModelElementForParent(grammarAccess.getCondtitionRule());
						}
						set(
							$current,
							"lastTimeGroup",
							lv_lastTimeGroup_7_0,
							"org.xtext.example.mydsl.EinDsl.LastTimeGroup");
						afterParserOrEnumRuleCall();
					}
				)
			)
		)
		    |
		(
			(
				(
					lv_conlastNTimePast_8_0=For
					{
						newLeafNode(lv_conlastNTimePast_8_0, grammarAccess.getCondtitionAccess().getConlastNTimePastForKeyword_3_0_0());
					}
					{
						if ($current==null) {
							$current = createModelElement(grammarAccess.getCondtitionRule());
						}
						setWithLastConsumed($current, "conlastNTimePast", lv_conlastNTimePast_8_0, "for");
					}
				)
			)
			(
				(
					{
						newCompositeNode(grammarAccess.getCondtitionAccess().getLastNTimeGroupLastNTimeGroupParserRuleCall_3_1_0());
					}
					lv_lastNTimeGroup_9_0=ruleLastNTimeGroup
					{
						if ($current==null) {
							$current = createModelElementForParent(grammarAccess.getCondtitionRule());
						}
						set(
							$current,
							"lastNTimeGroup",
							lv_lastNTimeGroup_9_0,
							"org.xtext.example.mydsl.EinDsl.LastNTimeGroup");
						afterParserOrEnumRuleCall();
					}
				)
			)
		)
		    |
		(
			(
				(
					lv_conDayTimeGroup_10_0=For
					{
						newLeafNode(lv_conDayTimeGroup_10_0, grammarAccess.getCondtitionAccess().getConDayTimeGroupForKeyword_4_0_0());
					}
					{
						if ($current==null) {
							$current = createModelElement(grammarAccess.getCondtitionRule());
						}
						setWithLastConsumed($current, "conDayTimeGroup", lv_conDayTimeGroup_10_0, "for");
					}
				)
			)
			(
				(
					{
						newCompositeNode(grammarAccess.getCondtitionAccess().getDayTimeGroupDayTimeGroupParserRuleCall_4_1_0());
					}
					lv_dayTimeGroup_11_0=ruleDayTimeGroup
					{
						if ($current==null) {
							$current = createModelElementForParent(grammarAccess.getCondtitionRule());
						}
						set(
							$current,
							"dayTimeGroup",
							lv_dayTimeGroup_11_0,
							"org.xtext.example.mydsl.EinDsl.DayTimeGroup");
						afterParserOrEnumRuleCall();
					}
				)
			)
		)
	)
;

// Entry rule entryRuleMeasureList
entryRuleMeasureList returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getMeasureListRule()); }
	iv_ruleMeasureList=ruleMeasureList
	{ $current=$iv_ruleMeasureList.current; }
	EOF;

// Rule MeasureList
ruleMeasureList returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				{
					newCompositeNode(grammarAccess.getMeasureListAccess().getNamesMeasureParserRuleCall_0_0());
				}
				lv_names_0_0=ruleMeasure
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getMeasureListRule());
					}
					add(
						$current,
						"names",
						lv_names_0_0,
						"org.xtext.example.mydsl.EinDsl.Measure");
					afterParserOrEnumRuleCall();
				}
			)
		)
		(
			otherlv_1=And
			{
				newLeafNode(otherlv_1, grammarAccess.getMeasureListAccess().getAndKeyword_1_0());
			}
			(
				(
					{
						newCompositeNode(grammarAccess.getMeasureListAccess().getNamesMeasureParserRuleCall_1_1_0());
					}
					lv_names_2_0=ruleMeasure
					{
						if ($current==null) {
							$current = createModelElementForParent(grammarAccess.getMeasureListRule());
						}
						add(
							$current,
							"names",
							lv_names_2_0,
							"org.xtext.example.mydsl.EinDsl.Measure");
						afterParserOrEnumRuleCall();
					}
				)
			)
		)*
	)
;

// Entry rule entryRuleEinString
entryRuleEinString returns [String current=null]:
	{ newCompositeNode(grammarAccess.getEinStringRule()); }
	iv_ruleEinString=ruleEinString
	{ $current=$iv_ruleEinString.current.getText(); }
	EOF;

// Rule EinString
ruleEinString returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		this_ID_0=RULE_ID
		{
			$current.merge(this_ID_0);
		}
		{
			newLeafNode(this_ID_0, grammarAccess.getEinStringAccess().getIDTerminalRuleCall_0());
		}
		    |
		{
			newCompositeNode(grammarAccess.getEinStringAccess().getSPECIALParserRuleCall_1());
		}
		this_SPECIAL_1=ruleSPECIAL
		{
			$current.merge(this_SPECIAL_1);
		}
		{
			afterParserOrEnumRuleCall();
		}
	)
;

// Entry rule entryRuleSPECIAL
entryRuleSPECIAL returns [String current=null]:
	{ newCompositeNode(grammarAccess.getSPECIALRule()); }
	iv_ruleSPECIAL=ruleSPECIAL
	{ $current=$iv_ruleSPECIAL.current.getText(); }
	EOF;

// Rule SPECIAL
ruleSPECIAL returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		kw=Solidus
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getSolidusKeyword_0());
		}
		    |
		kw=Semicolon
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getSemicolonKeyword_1());
		}
		    |
		kw=Comma
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getCommaKeyword_2());
		}
		    |
		kw=ExclamationMark
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getExclamationMarkKeyword_3());
		}
		    |
		kw=SectionSign
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getSectionSignKeyword_4());
		}
		    |
		kw=PercentSign
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getPercentSignKeyword_5());
		}
		    |
		kw=Ampersand
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getAmpersandKeyword_6());
		}
		    |
		kw=LeftParenthesis
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getLeftParenthesisKeyword_7());
		}
		    |
		kw=RightParenthesis
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getRightParenthesisKeyword_8());
		}
		    |
		kw=QuestionMark
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getQuestionMarkKeyword_9());
		}
		    |
		kw=Asterisk
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getAsteriskKeyword_10());
		}
		    |
		kw=PlusSign
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getPlusSignKeyword_11());
		}
		    |
		kw=FullStop
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getFullStopKeyword_12());
		}
		    |
		kw=HyphenMinus
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getHyphenMinusKeyword_13());
		}
		    |
		kw=VerticalLine
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getVerticalLineKeyword_14());
		}
		    |
		kw=LeftSquareBracket
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getLeftSquareBracketKeyword_15());
		}
		    |
		kw=RightSquareBracket
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getRightSquareBracketKeyword_16());
		}
		    |
		kw=NumberSign
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getNumberSignKeyword_17());
		}
		    |
		kw=CommercialAt
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getCommercialAtKeyword_18());
		}
		    |
		kw=LeftCurlyBracket
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getLeftCurlyBracketKeyword_19());
		}
		    |
		kw=RightCurlyBracket
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getRightCurlyBracketKeyword_20());
		}
		    |
		kw=DollarSign
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getDollarSignKeyword_21());
		}
		    |
		kw=CircumflexAccent
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getCircumflexAccentKeyword_22());
		}
		    |
		kw=Tilde
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getTildeKeyword_23());
		}
		    |
		this_INT_24=RULE_INT
		{
			$current.merge(this_INT_24);
		}
		{
			newLeafNode(this_INT_24, grammarAccess.getSPECIALAccess().getINTTerminalRuleCall_24());
		}
		    |
		kw=Colon
		{
			$current.merge(kw);
			newLeafNode(kw, grammarAccess.getSPECIALAccess().getColonKeyword_25());
		}
	)
;

// Entry rule entryRuleMeasure
entryRuleMeasure returns [String current=null]:
	{ newCompositeNode(grammarAccess.getMeasureRule()); }
	iv_ruleMeasure=ruleMeasure
	{ $current=$iv_ruleMeasure.current.getText(); }
	EOF;

// Rule Measure
ruleMeasure returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		{
			newCompositeNode(grammarAccess.getMeasureAccess().getEinStringParserRuleCall());
		}
		this_EinString_0=ruleEinString
		{
			$current.merge(this_EinString_0);
		}
		{
			afterParserOrEnumRuleCall();
		}
	)+
;

// Entry rule entryRuleDimension
entryRuleDimension returns [String current=null]:
	{ newCompositeNode(grammarAccess.getDimensionRule()); }
	iv_ruleDimension=ruleDimension
	{ $current=$iv_ruleDimension.current.getText(); }
	EOF;

// Rule Dimension
ruleDimension returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		{
			newCompositeNode(grammarAccess.getDimensionAccess().getEinStringParserRuleCall());
		}
		this_EinString_0=ruleEinString
		{
			$current.merge(this_EinString_0);
		}
		{
			afterParserOrEnumRuleCall();
		}
	)+
;

// Entry rule entryRuleDimensionValue
entryRuleDimensionValue returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getDimensionValueRule()); }
	iv_ruleDimensionValue=ruleDimensionValue
	{ $current=$iv_ruleDimensionValue.current; }
	EOF;

// Rule DimensionValue
ruleDimensionValue returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			{
				newCompositeNode(grammarAccess.getDimensionValueAccess().getValueEinStringParserRuleCall_0());
			}
			lv_value_0_0=ruleEinString
			{
				if ($current==null) {
					$current = createModelElementForParent(grammarAccess.getDimensionValueRule());
				}
				set(
					$current,
					"value",
					lv_value_0_0,
					"org.xtext.example.mydsl.EinDsl.EinString");
				afterParserOrEnumRuleCall();
			}
		)
	)+
;

// Entry rule entryRuleGroup
entryRuleGroup returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getGroupRule()); }
	iv_ruleGroup=ruleGroup
	{ $current=$iv_ruleGroup.current; }
	EOF;

// Rule Group
ruleGroup returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		otherlv_0=By
		{
			newLeafNode(otherlv_0, grammarAccess.getGroupAccess().getByKeyword_0());
		}
		(
			(
				(
					(
						{
							newCompositeNode(grammarAccess.getGroupAccess().getDimGroupDimensionParserRuleCall_1_0_0_0());
						}
						lv_dimGroup_1_0=ruleDimension
						{
							if ($current==null) {
								$current = createModelElementForParent(grammarAccess.getGroupRule());
							}
							set(
								$current,
								"dimGroup",
								lv_dimGroup_1_0,
								"org.xtext.example.mydsl.EinDsl.Dimension");
							afterParserOrEnumRuleCall();
						}
					)
				)
				(
					otherlv_2=By
					{
						newLeafNode(otherlv_2, grammarAccess.getGroupAccess().getByKeyword_1_0_1_0());
					}
					(
						(
							{
								newCompositeNode(grammarAccess.getGroupAccess().getTimeGroupTimeGroupParserRuleCall_1_0_1_1_0());
							}
							lv_timeGroup_3_0=ruleTimeGroup
							{
								if ($current==null) {
									$current = createModelElementForParent(grammarAccess.getGroupRule());
								}
								add(
									$current,
									"timeGroup",
									lv_timeGroup_3_0,
									"org.xtext.example.mydsl.EinDsl.TimeGroup");
								afterParserOrEnumRuleCall();
							}
						)
					)
				)?
			)
			    |
			(
				(
					{
						newCompositeNode(grammarAccess.getGroupAccess().getTimeGroupTimeGroupParserRuleCall_1_1_0());
					}
					lv_timeGroup_4_0=ruleTimeGroup
					{
						if ($current==null) {
							$current = createModelElementForParent(grammarAccess.getGroupRule());
						}
						add(
							$current,
							"timeGroup",
							lv_timeGroup_4_0,
							"org.xtext.example.mydsl.EinDsl.TimeGroup");
						afterParserOrEnumRuleCall();
					}
				)
			)
		)
	)
;

// Entry rule entryRuleTransition
entryRuleTransition returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getTransitionRule()); }
	iv_ruleTransition=ruleTransition
	{ $current=$iv_ruleTransition.current; }
	EOF;

// Rule Transition
ruleTransition returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		otherlv_0=From
		{
			newLeafNode(otherlv_0, grammarAccess.getTransitionAccess().getFromKeyword_0());
		}
		(
			(
				{
					newCompositeNode(grammarAccess.getTransitionAccess().getDateStartDateParserRuleCall_1_0());
				}
				lv_dateStart_1_0=ruleDate
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getTransitionRule());
					}
					set(
						$current,
						"dateStart",
						lv_dateStart_1_0,
						"org.xtext.example.mydsl.EinDsl.Date");
					afterParserOrEnumRuleCall();
				}
			)
		)
		otherlv_2=To
		{
			newLeafNode(otherlv_2, grammarAccess.getTransitionAccess().getToKeyword_2());
		}
		(
			(
				{
					newCompositeNode(grammarAccess.getTransitionAccess().getDateEndDateParserRuleCall_3_0());
				}
				lv_dateEnd_3_0=ruleDate
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getTransitionRule());
					}
					set(
						$current,
						"dateEnd",
						lv_dateEnd_3_0,
						"org.xtext.example.mydsl.EinDsl.Date");
					afterParserOrEnumRuleCall();
				}
			)
		)
	)
;

// Entry rule entryRuleTimeGroup
entryRuleTimeGroup returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getTimeGroupRule()); }
	iv_ruleTimeGroup=ruleTimeGroup
	{ $current=$iv_ruleTimeGroup.current; }
	EOF;

// Rule TimeGroup
ruleTimeGroup returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				lv_timeGroup_0_1=Day
				{
					newLeafNode(lv_timeGroup_0_1, grammarAccess.getTimeGroupAccess().getTimeGroupDayKeyword_0_0());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getTimeGroupRule());
					}
					setWithLastConsumed($current, "timeGroup", lv_timeGroup_0_1, null);
				}
				    |
				lv_timeGroup_0_2=Week
				{
					newLeafNode(lv_timeGroup_0_2, grammarAccess.getTimeGroupAccess().getTimeGroupWeekKeyword_0_1());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getTimeGroupRule());
					}
					setWithLastConsumed($current, "timeGroup", lv_timeGroup_0_2, null);
				}
				    |
				lv_timeGroup_0_3=Month
				{
					newLeafNode(lv_timeGroup_0_3, grammarAccess.getTimeGroupAccess().getTimeGroupMonthKeyword_0_2());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getTimeGroupRule());
					}
					setWithLastConsumed($current, "timeGroup", lv_timeGroup_0_3, null);
				}
				    |
				lv_timeGroup_0_4=Quarter
				{
					newLeafNode(lv_timeGroup_0_4, grammarAccess.getTimeGroupAccess().getTimeGroupQuarterKeyword_0_3());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getTimeGroupRule());
					}
					setWithLastConsumed($current, "timeGroup", lv_timeGroup_0_4, null);
				}
				    |
				lv_timeGroup_0_5=Year
				{
					newLeafNode(lv_timeGroup_0_5, grammarAccess.getTimeGroupAccess().getTimeGroupYearKeyword_0_4());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getTimeGroupRule());
					}
					setWithLastConsumed($current, "timeGroup", lv_timeGroup_0_5, null);
				}
			)
		)
	)
;

// Entry rule entryRuleThisTimeGroup
entryRuleThisTimeGroup returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getThisTimeGroupRule()); }
	iv_ruleThisTimeGroup=ruleThisTimeGroup
	{ $current=$iv_ruleThisTimeGroup.current; }
	EOF;

// Rule ThisTimeGroup
ruleThisTimeGroup returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				(
					lv_thisTimeGroup_0_0=This
					{
						newLeafNode(lv_thisTimeGroup_0_0, grammarAccess.getThisTimeGroupAccess().getThisTimeGroupThisKeyword_0_0_0());
					}
					{
						if ($current==null) {
							$current = createModelElement(grammarAccess.getThisTimeGroupRule());
						}
						setWithLastConsumed($current, "thisTimeGroup", lv_thisTimeGroup_0_0, "this");
					}
				)
			)
			(
				otherlv_1=Year
				{
					newLeafNode(otherlv_1, grammarAccess.getThisTimeGroupAccess().getYearKeyword_0_1_0());
				}
				    |
				otherlv_2=Month
				{
					newLeafNode(otherlv_2, grammarAccess.getThisTimeGroupAccess().getMonthKeyword_0_1_1());
				}
				    |
				otherlv_3=Week
				{
					newLeafNode(otherlv_3, grammarAccess.getThisTimeGroupAccess().getWeekKeyword_0_1_2());
				}
			)
		)
		    |
		otherlv_4=Ytd
		{
			newLeafNode(otherlv_4, grammarAccess.getThisTimeGroupAccess().getYtdKeyword_1());
		}
		    |
		otherlv_5=Mtd
		{
			newLeafNode(otherlv_5, grammarAccess.getThisTimeGroupAccess().getMtdKeyword_2());
		}
	)
;

// Entry rule entryRuleLastTimeGroup
entryRuleLastTimeGroup returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getLastTimeGroupRule()); }
	iv_ruleLastTimeGroup=ruleLastTimeGroup
	{ $current=$iv_ruleLastTimeGroup.current; }
	EOF;

// Rule LastTimeGroup
ruleLastTimeGroup returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				lv_lastTimeGroup_0_0=Last
				{
					newLeafNode(lv_lastTimeGroup_0_0, grammarAccess.getLastTimeGroupAccess().getLastTimeGroupLastKeyword_0_0());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getLastTimeGroupRule());
					}
					setWithLastConsumed($current, "lastTimeGroup", lv_lastTimeGroup_0_0, "last");
				}
			)
		)
		(
			otherlv_1=Year
			{
				newLeafNode(otherlv_1, grammarAccess.getLastTimeGroupAccess().getYearKeyword_1_0());
			}
			    |
			otherlv_2=Quarter
			{
				newLeafNode(otherlv_2, grammarAccess.getLastTimeGroupAccess().getQuarterKeyword_1_1());
			}
			    |
			otherlv_3=Month
			{
				newLeafNode(otherlv_3, grammarAccess.getLastTimeGroupAccess().getMonthKeyword_1_2());
			}
			    |
			otherlv_4=Week
			{
				newLeafNode(otherlv_4, grammarAccess.getLastTimeGroupAccess().getWeekKeyword_1_3());
			}
		)
	)
;

// Entry rule entryRuleLastNTimeGroup
entryRuleLastNTimeGroup returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getLastNTimeGroupRule()); }
	iv_ruleLastNTimeGroup=ruleLastNTimeGroup
	{ $current=$iv_ruleLastNTimeGroup.current; }
	EOF;

// Rule LastNTimeGroup
ruleLastNTimeGroup returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				lv_lastTimeGroup_0_0=Last
				{
					newLeafNode(lv_lastTimeGroup_0_0, grammarAccess.getLastNTimeGroupAccess().getLastTimeGroupLastKeyword_0_0());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getLastNTimeGroupRule());
					}
					setWithLastConsumed($current, "lastTimeGroup", lv_lastTimeGroup_0_0, "last");
				}
			)
		)
		this_INT_1=RULE_INT
		{
			newLeafNode(this_INT_1, grammarAccess.getLastNTimeGroupAccess().getINTTerminalRuleCall_1());
		}
		(
			otherlv_2=Days
			{
				newLeafNode(otherlv_2, grammarAccess.getLastNTimeGroupAccess().getDaysKeyword_2_0());
			}
			    |
			otherlv_3=Weeks
			{
				newLeafNode(otherlv_3, grammarAccess.getLastNTimeGroupAccess().getWeeksKeyword_2_1());
			}
			    |
			otherlv_4=Months
			{
				newLeafNode(otherlv_4, grammarAccess.getLastNTimeGroupAccess().getMonthsKeyword_2_2());
			}
		)
	)
;

// Entry rule entryRuleDayTimeGroup
entryRuleDayTimeGroup returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getDayTimeGroupRule()); }
	iv_ruleDayTimeGroup=ruleDayTimeGroup
	{ $current=$iv_ruleDayTimeGroup.current; }
	EOF;

// Rule DayTimeGroup
ruleDayTimeGroup returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				lv_dayTimeGroup_0_1=Today
				{
					newLeafNode(lv_dayTimeGroup_0_1, grammarAccess.getDayTimeGroupAccess().getDayTimeGroupTodayKeyword_0_0());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getDayTimeGroupRule());
					}
					setWithLastConsumed($current, "dayTimeGroup", lv_dayTimeGroup_0_1, null);
				}
				    |
				lv_dayTimeGroup_0_2=Yesterday
				{
					newLeafNode(lv_dayTimeGroup_0_2, grammarAccess.getDayTimeGroupAccess().getDayTimeGroupYesterdayKeyword_0_1());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getDayTimeGroupRule());
					}
					setWithLastConsumed($current, "dayTimeGroup", lv_dayTimeGroup_0_2, null);
				}
			)
		)
	)
;

// Entry rule entryRuleChartType
entryRuleChartType returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getChartTypeRule()); }
	iv_ruleChartType=ruleChartType
	{ $current=$iv_ruleChartType.current; }
	EOF;

// Rule ChartType
ruleChartType returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				lv_chartType_0_0=As
				{
					newLeafNode(lv_chartType_0_0, grammarAccess.getChartTypeAccess().getChartTypeAsKeyword_0_0());
				}
				{
					if ($current==null) {
						$current = createModelElement(grammarAccess.getChartTypeRule());
					}
					setWithLastConsumed($current, "chartType", lv_chartType_0_0, "as");
				}
			)
		)
		(
			otherlv_1=Pie
			{
				newLeafNode(otherlv_1, grammarAccess.getChartTypeAccess().getPieKeyword_1_0());
			}
			    |
			otherlv_2=Column
			{
				newLeafNode(otherlv_2, grammarAccess.getChartTypeAccess().getColumnKeyword_1_1());
			}
			    |
			otherlv_3=Bar
			{
				newLeafNode(otherlv_3, grammarAccess.getChartTypeAccess().getBarKeyword_1_2());
			}
			    |
			otherlv_4=Line
			{
				newLeafNode(otherlv_4, grammarAccess.getChartTypeAccess().getLineKeyword_1_3());
			}
		)
		otherlv_5=Chart
		{
			newLeafNode(otherlv_5, grammarAccess.getChartTypeAccess().getChartKeyword_2());
		}
	)
;

// Entry rule entryRuleDate
entryRuleDate returns [EObject current=null]:
	{ newCompositeNode(grammarAccess.getDateRule()); }
	iv_ruleDate=ruleDate
	{ $current=$iv_ruleDate.current; }
	EOF;

// Rule Date
ruleDate returns [EObject current=null]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	(
		(
			(
				{
					newCompositeNode(grammarAccess.getDateAccess().getDDayParserRuleCall_0_0());
				}
				lv_d_0_0=ruleDay
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getDateRule());
					}
					set(
						$current,
						"d",
						lv_d_0_0,
						"org.xtext.example.mydsl.EinDsl.Day");
					afterParserOrEnumRuleCall();
				}
			)
		)
		(
			(
				{
					newCompositeNode(grammarAccess.getDateAccess().getMMonthParserRuleCall_1_0());
				}
				lv_m_1_0=ruleMonth
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getDateRule());
					}
					set(
						$current,
						"m",
						lv_m_1_0,
						"org.xtext.example.mydsl.EinDsl.Month");
					afterParserOrEnumRuleCall();
				}
			)
		)
		(
			(
				{
					newCompositeNode(grammarAccess.getDateAccess().getYYearParserRuleCall_2_0());
				}
				lv_y_2_0=ruleYear
				{
					if ($current==null) {
						$current = createModelElementForParent(grammarAccess.getDateRule());
					}
					set(
						$current,
						"y",
						lv_y_2_0,
						"org.xtext.example.mydsl.EinDsl.Year");
					afterParserOrEnumRuleCall();
				}
			)
		)
	)
;

// Entry rule entryRuleDay
entryRuleDay returns [String current=null]:
	{ newCompositeNode(grammarAccess.getDayRule()); }
	iv_ruleDay=ruleDay
	{ $current=$iv_ruleDay.current.getText(); }
	EOF;

// Rule Day
ruleDay returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	this_ID_0=RULE_ID
	{
		$current.merge(this_ID_0);
	}
	{
		newLeafNode(this_ID_0, grammarAccess.getDayAccess().getIDTerminalRuleCall());
	}
;

// Entry rule entryRuleMonth
entryRuleMonth returns [String current=null]:
	{ newCompositeNode(grammarAccess.getMonthRule()); }
	iv_ruleMonth=ruleMonth
	{ $current=$iv_ruleMonth.current.getText(); }
	EOF;

// Rule Month
ruleMonth returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	this_ID_0=RULE_ID
	{
		$current.merge(this_ID_0);
	}
	{
		newLeafNode(this_ID_0, grammarAccess.getMonthAccess().getIDTerminalRuleCall());
	}
;

// Entry rule entryRuleYear
entryRuleYear returns [String current=null]:
	{ newCompositeNode(grammarAccess.getYearRule()); }
	iv_ruleYear=ruleYear
	{ $current=$iv_ruleYear.current.getText(); }
	EOF;

// Rule Year
ruleYear returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()]
@init {
	enterRule();
}
@after {
	leaveRule();
}:
	this_INT_0=RULE_INT
	{
		$current.merge(this_INT_0);
	}
	{
		newLeafNode(this_INT_0, grammarAccess.getYearAccess().getINTTerminalRuleCall());
	}
;
