/**
 * openHAB, the open Home Automation Bus.
 * Copyright (C) 2011, openHAB.org <admin@openhab.org>
 *
 * See the contributors.txt file in the distribution for a
 * full listing of individual contributors.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses>.
 *
 * Additional permission under GNU GPL version 3 section 7
 *
 * If you modify this Program, or any covered work, by linking or
 * combining it with Eclipse (or a modified version of that library),
 * containing parts covered by the terms of the Eclipse Public License
 * (EPL), the licensors of this Program grant you additional permission
 * to convey the resulting work.
 */

/*
* generated by Xtext
*/
package org.openhab.model.parseTreeConstruction;

import org.eclipse.emf.ecore.*;
import org.eclipse.xtext.*;
import org.eclipse.xtext.parsetree.reconstr.IEObjectConsumer;
import org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor;

import org.openhab.model.services.ItemsGrammarAccess;

import com.google.inject.Inject;

@SuppressWarnings("all")
public class ItemsParsetreeConstructor extends AbstractParseTreeConstructor {
		
	@Inject
	private ItemsGrammarAccess grammarAccess;
	
	@Override
	protected AbstractToken getRootToken(IEObjectConsumer inst) {
		return new ThisRootNode(inst);	
	}
	
protected class ThisRootNode extends RootToken {
	public ThisRootNode(IEObjectConsumer inst) {
		super(inst);
	}
	
	@Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ItemModel_ItemsAssignment(this, this, 0, inst);
			case 1: return new ModelItem_Group(this, this, 1, inst);
			case 2: return new ModelGroupItem_Group(this, this, 2, inst);
			case 3: return new ModelNormalItem_TypeAssignment(this, this, 3, inst);
			case 4: return new ModelBinding_Group(this, this, 4, inst);
			default: return null;
		}	
	}	
}
	

/************ begin Rule ItemModel ****************
 *
 * ItemModel:
 * 	items+=ModelItem*;
 *
 **/

// items+=ModelItem*
protected class ItemModel_ItemsAssignment extends AssignmentToken  {
	
	public ItemModel_ItemsAssignment(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getItemModelAccess().getItemsAssignment();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_Group(this, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("items",false)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("items");
		if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
			IEObjectConsumer param = createEObjectConsumer((EObject)value);
			if(param.isInstanceOf(grammarAccess.getModelItemRule().getType().getClassifier())) {
				type = AssignmentType.PARSER_RULE_CALL;
				element = grammarAccess.getItemModelAccess().getItemsModelItemParserRuleCall_0(); 
				consumed = obj;
				return param;
			}
		}
		return null;
	}

    @Override
	public AbstractToken createFollowerAfterReturn(AbstractToken next,	int actIndex, int index, IEObjectConsumer inst) {
		if(value == inst.getEObject() && !inst.isConsumed()) return null;
		switch(index) {
			case 0: return new ItemModel_ItemsAssignment(lastRuleCallOrigin, next, actIndex, consumed);
			default: return lastRuleCallOrigin.createFollowerAfterReturn(next, actIndex , index - 1, consumed);
		}	
	}	
}

/************ end Rule ItemModel ****************/


/************ begin Rule ModelItem ****************
 *
 * ModelItem:
 * 	(ModelNormalItem | ModelGroupItem) name=ID label=STRING? ("<" icon=(ID | STRING) ">")? ("(" groups+=[ModelGroupItem]
 * 	("," groups+=[ModelGroupItem])* ")")? ("{" bindings+=ModelBinding ("," bindings+=ModelBinding)* "}")*;
 *
 **/

// (ModelNormalItem | ModelGroupItem) name=ID label=STRING? ("<" icon=(ID | STRING) ">")? ("(" groups+=[ModelGroupItem]
// ("," groups+=[ModelGroupItem])* ")")? ("{" bindings+=ModelBinding ("," bindings+=ModelBinding)* "}")*
protected class ModelItem_Group extends GroupToken {
	
	public ModelItem_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelItemAccess().getGroup();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_Group_5(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelItem_Group_4(lastRuleCallOrigin, this, 1, inst);
			case 2: return new ModelItem_Group_3(lastRuleCallOrigin, this, 2, inst);
			case 3: return new ModelItem_LabelAssignment_2(lastRuleCallOrigin, this, 3, inst);
			case 4: return new ModelItem_NameAssignment_1(lastRuleCallOrigin, this, 4, inst);
			default: return null;
		}	
	}

    @Override
	public IEObjectConsumer tryConsume() {
		if(getEObject().eClass() != grammarAccess.getModelGroupItemAccess().getModelGroupItemAction_1().getType().getClassifier() && 
		   getEObject().eClass() != grammarAccess.getModelNormalItemRule().getType().getClassifier())
			return null;
		return eObjectConsumer;
	}

}

// ModelNormalItem | ModelGroupItem
protected class ModelItem_Alternatives_0 extends AlternativesToken {

	public ModelItem_Alternatives_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Alternatives getGrammarElement() {
		return grammarAccess.getModelItemAccess().getAlternatives_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_ModelNormalItemParserRuleCall_0_0(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelItem_ModelGroupItemParserRuleCall_0_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}

// ModelNormalItem
protected class ModelItem_ModelNormalItemParserRuleCall_0_0 extends RuleCallToken {
	
	public ModelItem_ModelNormalItemParserRuleCall_0_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public RuleCall getGrammarElement() {
		return grammarAccess.getModelItemAccess().getModelNormalItemParserRuleCall_0_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelNormalItem_TypeAssignment(this, this, 0, inst);
			default: return null;
		}	
	}

    @Override
	public IEObjectConsumer tryConsume() {
		if(getEObject().eClass() != grammarAccess.getModelNormalItemRule().getType().getClassifier())
			return null;
		if(checkForRecursion(ModelNormalItem_TypeAssignment.class, eObjectConsumer)) return null;
		return eObjectConsumer;
	}
	
    @Override
	public AbstractToken createFollowerAfterReturn(AbstractToken next,	int actIndex, int index, IEObjectConsumer inst) {
		switch(index) {
			default: return lastRuleCallOrigin.createFollowerAfterReturn(next, actIndex , index, inst);
		}	
	}	
}

// ModelGroupItem
protected class ModelItem_ModelGroupItemParserRuleCall_0_1 extends RuleCallToken {
	
	public ModelItem_ModelGroupItemParserRuleCall_0_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public RuleCall getGrammarElement() {
		return grammarAccess.getModelItemAccess().getModelGroupItemParserRuleCall_0_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_Group(this, this, 0, inst);
			default: return null;
		}	
	}

    @Override
	public IEObjectConsumer tryConsume() {
		if(getEObject().eClass() != grammarAccess.getModelGroupItemAccess().getModelGroupItemAction_1().getType().getClassifier())
			return null;
		if(checkForRecursion(ModelGroupItem_Group.class, eObjectConsumer)) return null;
		return eObjectConsumer;
	}
	
    @Override
	public AbstractToken createFollowerAfterReturn(AbstractToken next,	int actIndex, int index, IEObjectConsumer inst) {
		switch(index) {
			default: return lastRuleCallOrigin.createFollowerAfterReturn(next, actIndex , index, inst);
		}	
	}	
}


// name=ID
protected class ModelItem_NameAssignment_1 extends AssignmentToken  {
	
	public ModelItem_NameAssignment_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelItemAccess().getNameAssignment_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_Alternatives_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("name",true)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("name");
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelItemAccess().getNameIDTerminalRuleCall_1_0(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelItemAccess().getNameIDTerminalRuleCall_1_0();
			return obj;
		}
		return null;
	}

}

// label=STRING?
protected class ModelItem_LabelAssignment_2 extends AssignmentToken  {
	
	public ModelItem_LabelAssignment_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelItemAccess().getLabelAssignment_2();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_NameAssignment_1(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("label",false)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("label");
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelItemAccess().getLabelSTRINGTerminalRuleCall_2_0(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelItemAccess().getLabelSTRINGTerminalRuleCall_2_0();
			return obj;
		}
		return null;
	}

}

// ("<" icon=(ID | STRING) ">")?
protected class ModelItem_Group_3 extends GroupToken {
	
	public ModelItem_Group_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelItemAccess().getGroup_3();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_GreaterThanSignKeyword_3_2(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// "<"
protected class ModelItem_LessThanSignKeyword_3_0 extends KeywordToken  {
	
	public ModelItem_LessThanSignKeyword_3_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelItemAccess().getLessThanSignKeyword_3_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_LabelAssignment_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelItem_NameAssignment_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}

// icon=(ID | STRING)
protected class ModelItem_IconAssignment_3_1 extends AssignmentToken  {
	
	public ModelItem_IconAssignment_3_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelItemAccess().getIconAssignment_3_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_LessThanSignKeyword_3_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("icon",false)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("icon");
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelItemAccess().getIconIDTerminalRuleCall_3_1_0_0(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelItemAccess().getIconIDTerminalRuleCall_3_1_0_0();
			return obj;
		}
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelItemAccess().getIconSTRINGTerminalRuleCall_3_1_0_1(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelItemAccess().getIconSTRINGTerminalRuleCall_3_1_0_1();
			return obj;
		}
		return null;
	}

}

// ">"
protected class ModelItem_GreaterThanSignKeyword_3_2 extends KeywordToken  {
	
	public ModelItem_GreaterThanSignKeyword_3_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelItemAccess().getGreaterThanSignKeyword_3_2();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_IconAssignment_3_1(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}


// ("(" groups+=[ModelGroupItem] ("," groups+=[ModelGroupItem])* ")")?
protected class ModelItem_Group_4 extends GroupToken {
	
	public ModelItem_Group_4(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelItemAccess().getGroup_4();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_RightParenthesisKeyword_4_3(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// "("
protected class ModelItem_LeftParenthesisKeyword_4_0 extends KeywordToken  {
	
	public ModelItem_LeftParenthesisKeyword_4_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelItemAccess().getLeftParenthesisKeyword_4_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_Group_3(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelItem_LabelAssignment_2(lastRuleCallOrigin, this, 1, inst);
			case 2: return new ModelItem_NameAssignment_1(lastRuleCallOrigin, this, 2, inst);
			default: return null;
		}	
	}

}

// groups+=[ModelGroupItem]
protected class ModelItem_GroupsAssignment_4_1 extends AssignmentToken  {
	
	public ModelItem_GroupsAssignment_4_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelItemAccess().getGroupsAssignment_4_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_LeftParenthesisKeyword_4_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("groups",true)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("groups");
		if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
			IEObjectConsumer param = createEObjectConsumer((EObject)value);
			if(param.isInstanceOf(grammarAccess.getModelItemAccess().getGroupsModelGroupItemCrossReference_4_1_0().getType().getClassifier())) {
				type = AssignmentType.CROSS_REFERENCE;
				element = grammarAccess.getModelItemAccess().getGroupsModelGroupItemCrossReference_4_1_0(); 
				return obj;
			}
		}
		return null;
	}

}

// ("," groups+=[ModelGroupItem])*
protected class ModelItem_Group_4_2 extends GroupToken {
	
	public ModelItem_Group_4_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelItemAccess().getGroup_4_2();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_GroupsAssignment_4_2_1(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// ","
protected class ModelItem_CommaKeyword_4_2_0 extends KeywordToken  {
	
	public ModelItem_CommaKeyword_4_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelItemAccess().getCommaKeyword_4_2_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_Group_4_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelItem_GroupsAssignment_4_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}

// groups+=[ModelGroupItem]
protected class ModelItem_GroupsAssignment_4_2_1 extends AssignmentToken  {
	
	public ModelItem_GroupsAssignment_4_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelItemAccess().getGroupsAssignment_4_2_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_CommaKeyword_4_2_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("groups",false)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("groups");
		if(value instanceof EObject) { // org::eclipse::xtext::impl::CrossReferenceImpl
			IEObjectConsumer param = createEObjectConsumer((EObject)value);
			if(param.isInstanceOf(grammarAccess.getModelItemAccess().getGroupsModelGroupItemCrossReference_4_2_1_0().getType().getClassifier())) {
				type = AssignmentType.CROSS_REFERENCE;
				element = grammarAccess.getModelItemAccess().getGroupsModelGroupItemCrossReference_4_2_1_0(); 
				return obj;
			}
		}
		return null;
	}

}


// ")"
protected class ModelItem_RightParenthesisKeyword_4_3 extends KeywordToken  {
	
	public ModelItem_RightParenthesisKeyword_4_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelItemAccess().getRightParenthesisKeyword_4_3();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_Group_4_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelItem_GroupsAssignment_4_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}


// ("{" bindings+=ModelBinding ("," bindings+=ModelBinding)* "}")*
protected class ModelItem_Group_5 extends GroupToken {
	
	public ModelItem_Group_5(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelItemAccess().getGroup_5();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_RightCurlyBracketKeyword_5_3(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// "{"
protected class ModelItem_LeftCurlyBracketKeyword_5_0 extends KeywordToken  {
	
	public ModelItem_LeftCurlyBracketKeyword_5_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelItemAccess().getLeftCurlyBracketKeyword_5_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_Group_5(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelItem_Group_4(lastRuleCallOrigin, this, 1, inst);
			case 2: return new ModelItem_Group_3(lastRuleCallOrigin, this, 2, inst);
			case 3: return new ModelItem_LabelAssignment_2(lastRuleCallOrigin, this, 3, inst);
			case 4: return new ModelItem_NameAssignment_1(lastRuleCallOrigin, this, 4, inst);
			default: return null;
		}	
	}

}

// bindings+=ModelBinding
protected class ModelItem_BindingsAssignment_5_1 extends AssignmentToken  {
	
	public ModelItem_BindingsAssignment_5_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelItemAccess().getBindingsAssignment_5_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelBinding_Group(this, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("bindings",true)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("bindings");
		if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
			IEObjectConsumer param = createEObjectConsumer((EObject)value);
			if(param.isInstanceOf(grammarAccess.getModelBindingRule().getType().getClassifier())) {
				type = AssignmentType.PARSER_RULE_CALL;
				element = grammarAccess.getModelItemAccess().getBindingsModelBindingParserRuleCall_5_1_0(); 
				consumed = obj;
				return param;
			}
		}
		return null;
	}

    @Override
	public AbstractToken createFollowerAfterReturn(AbstractToken next,	int actIndex, int index, IEObjectConsumer inst) {
		if(value == inst.getEObject() && !inst.isConsumed()) return null;
		switch(index) {
			case 0: return new ModelItem_LeftCurlyBracketKeyword_5_0(lastRuleCallOrigin, next, actIndex, consumed);
			default: return null;
		}	
	}	
}

// ("," bindings+=ModelBinding)*
protected class ModelItem_Group_5_2 extends GroupToken {
	
	public ModelItem_Group_5_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelItemAccess().getGroup_5_2();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_BindingsAssignment_5_2_1(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// ","
protected class ModelItem_CommaKeyword_5_2_0 extends KeywordToken  {
	
	public ModelItem_CommaKeyword_5_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelItemAccess().getCommaKeyword_5_2_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_Group_5_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelItem_BindingsAssignment_5_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}

// bindings+=ModelBinding
protected class ModelItem_BindingsAssignment_5_2_1 extends AssignmentToken  {
	
	public ModelItem_BindingsAssignment_5_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelItemAccess().getBindingsAssignment_5_2_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelBinding_Group(this, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("bindings",false)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("bindings");
		if(value instanceof EObject) { // org::eclipse::xtext::impl::RuleCallImpl
			IEObjectConsumer param = createEObjectConsumer((EObject)value);
			if(param.isInstanceOf(grammarAccess.getModelBindingRule().getType().getClassifier())) {
				type = AssignmentType.PARSER_RULE_CALL;
				element = grammarAccess.getModelItemAccess().getBindingsModelBindingParserRuleCall_5_2_1_0(); 
				consumed = obj;
				return param;
			}
		}
		return null;
	}

    @Override
	public AbstractToken createFollowerAfterReturn(AbstractToken next,	int actIndex, int index, IEObjectConsumer inst) {
		if(value == inst.getEObject() && !inst.isConsumed()) return null;
		switch(index) {
			case 0: return new ModelItem_CommaKeyword_5_2_0(lastRuleCallOrigin, next, actIndex, consumed);
			default: return null;
		}	
	}	
}


// "}"
protected class ModelItem_RightCurlyBracketKeyword_5_3 extends KeywordToken  {
	
	public ModelItem_RightCurlyBracketKeyword_5_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelItemAccess().getRightCurlyBracketKeyword_5_3();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelItem_Group_5_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelItem_BindingsAssignment_5_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}



/************ end Rule ModelItem ****************/


/************ begin Rule ModelGroupItem ****************
 *
 * ModelGroupItem:
 * 	"Group" {ModelGroupItem} (":" type=ModelItemType (":" function=ModelGroupFunction ("(" args+=(ID | STRING) (","
 * 	args+=(ID | STRING))* ")")?)?)?;
 *
 **/

// "Group" {ModelGroupItem} (":" type=ModelItemType (":" function=ModelGroupFunction ("(" args+=(ID | STRING) (","
// args+=(ID | STRING))* ")")?)?)?
protected class ModelGroupItem_Group extends GroupToken {
	
	public ModelGroupItem_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getGroup();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_Group_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelGroupItem_ModelGroupItemAction_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

    @Override
	public IEObjectConsumer tryConsume() {
		if(getEObject().eClass() != grammarAccess.getModelGroupItemAccess().getModelGroupItemAction_1().getType().getClassifier())
			return null;
		return eObjectConsumer;
	}

}

// "Group"
protected class ModelGroupItem_GroupKeyword_0 extends KeywordToken  {
	
	public ModelGroupItem_GroupKeyword_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getGroupKeyword_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
		}	
	}

}

// {ModelGroupItem}
protected class ModelGroupItem_ModelGroupItemAction_1 extends ActionToken  {

	public ModelGroupItem_ModelGroupItemAction_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Action getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getModelGroupItemAction_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_GroupKeyword_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override
	public IEObjectConsumer tryConsume() {
		if(!eObjectConsumer.isConsumed()) return null;
		return eObjectConsumer;
	}
}

// (":" type=ModelItemType (":" function=ModelGroupFunction ("(" args+=(ID | STRING) ("," args+=(ID | STRING))* ")")?)?)?
protected class ModelGroupItem_Group_2 extends GroupToken {
	
	public ModelGroupItem_Group_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getGroup_2();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_Group_2_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelGroupItem_TypeAssignment_2_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}

// ":"
protected class ModelGroupItem_ColonKeyword_2_0 extends KeywordToken  {
	
	public ModelGroupItem_ColonKeyword_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getColonKeyword_2_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_ModelGroupItemAction_1(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// type=ModelItemType
protected class ModelGroupItem_TypeAssignment_2_1 extends AssignmentToken  {
	
	public ModelGroupItem_TypeAssignment_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getTypeAssignment_2_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_ColonKeyword_2_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("type",true)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("type");
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelGroupItemAccess().getTypeModelItemTypeParserRuleCall_2_1_0(), value, null)) {
			type = AssignmentType.DATATYPE_RULE_CALL;
			element = grammarAccess.getModelGroupItemAccess().getTypeModelItemTypeParserRuleCall_2_1_0();
			return obj;
		}
		return null;
	}

}

// (":" function=ModelGroupFunction ("(" args+=(ID | STRING) ("," args+=(ID | STRING))* ")")?)?
protected class ModelGroupItem_Group_2_2 extends GroupToken {
	
	public ModelGroupItem_Group_2_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getGroup_2_2();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_Group_2_2_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelGroupItem_FunctionAssignment_2_2_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}

// ":"
protected class ModelGroupItem_ColonKeyword_2_2_0 extends KeywordToken  {
	
	public ModelGroupItem_ColonKeyword_2_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getColonKeyword_2_2_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_TypeAssignment_2_1(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// function=ModelGroupFunction
protected class ModelGroupItem_FunctionAssignment_2_2_1 extends AssignmentToken  {
	
	public ModelGroupItem_FunctionAssignment_2_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getFunctionAssignment_2_2_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_ColonKeyword_2_2_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("function",true)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("function");
		if(enumLitSerializer.isValid(obj.getEObject(), grammarAccess.getModelGroupItemAccess().getFunctionModelGroupFunctionEnumRuleCall_2_2_1_0(), value, null)) { 
			type = AssignmentType.ENUM_RULE_CALL;
			element = grammarAccess.getModelGroupItemAccess().getFunctionModelGroupFunctionEnumRuleCall_2_2_1_0();
			return obj;
		}
		return null;
	}

}

// ("(" args+=(ID | STRING) ("," args+=(ID | STRING))* ")")?
protected class ModelGroupItem_Group_2_2_2 extends GroupToken {
	
	public ModelGroupItem_Group_2_2_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getGroup_2_2_2();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_RightParenthesisKeyword_2_2_2_3(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// "("
protected class ModelGroupItem_LeftParenthesisKeyword_2_2_2_0 extends KeywordToken  {
	
	public ModelGroupItem_LeftParenthesisKeyword_2_2_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getLeftParenthesisKeyword_2_2_2_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_FunctionAssignment_2_2_1(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// args+=(ID | STRING)
protected class ModelGroupItem_ArgsAssignment_2_2_2_1 extends AssignmentToken  {
	
	public ModelGroupItem_ArgsAssignment_2_2_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getArgsAssignment_2_2_2_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_LeftParenthesisKeyword_2_2_2_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("args",true)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("args");
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelGroupItemAccess().getArgsIDTerminalRuleCall_2_2_2_1_0_0(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelGroupItemAccess().getArgsIDTerminalRuleCall_2_2_2_1_0_0();
			return obj;
		}
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelGroupItemAccess().getArgsSTRINGTerminalRuleCall_2_2_2_1_0_1(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelGroupItemAccess().getArgsSTRINGTerminalRuleCall_2_2_2_1_0_1();
			return obj;
		}
		return null;
	}

}

// ("," args+=(ID | STRING))*
protected class ModelGroupItem_Group_2_2_2_2 extends GroupToken {
	
	public ModelGroupItem_Group_2_2_2_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getGroup_2_2_2_2();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_ArgsAssignment_2_2_2_2_1(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// ","
protected class ModelGroupItem_CommaKeyword_2_2_2_2_0 extends KeywordToken  {
	
	public ModelGroupItem_CommaKeyword_2_2_2_2_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getCommaKeyword_2_2_2_2_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_Group_2_2_2_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelGroupItem_ArgsAssignment_2_2_2_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}

// args+=(ID | STRING)
protected class ModelGroupItem_ArgsAssignment_2_2_2_2_1 extends AssignmentToken  {
	
	public ModelGroupItem_ArgsAssignment_2_2_2_2_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getArgsAssignment_2_2_2_2_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_CommaKeyword_2_2_2_2_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("args",false)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("args");
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelGroupItemAccess().getArgsIDTerminalRuleCall_2_2_2_2_1_0_0(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelGroupItemAccess().getArgsIDTerminalRuleCall_2_2_2_2_1_0_0();
			return obj;
		}
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelGroupItemAccess().getArgsSTRINGTerminalRuleCall_2_2_2_2_1_0_1(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelGroupItemAccess().getArgsSTRINGTerminalRuleCall_2_2_2_2_1_0_1();
			return obj;
		}
		return null;
	}

}


// ")"
protected class ModelGroupItem_RightParenthesisKeyword_2_2_2_3 extends KeywordToken  {
	
	public ModelGroupItem_RightParenthesisKeyword_2_2_2_3(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelGroupItemAccess().getRightParenthesisKeyword_2_2_2_3();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelGroupItem_Group_2_2_2_2(lastRuleCallOrigin, this, 0, inst);
			case 1: return new ModelGroupItem_ArgsAssignment_2_2_2_1(lastRuleCallOrigin, this, 1, inst);
			default: return null;
		}	
	}

}





/************ end Rule ModelGroupItem ****************/


/************ begin Rule ModelNormalItem ****************
 *
 * ModelNormalItem:
 * 	type=ModelItemType;
 *
 **/

// type=ModelItemType
protected class ModelNormalItem_TypeAssignment extends AssignmentToken  {
	
	public ModelNormalItem_TypeAssignment(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelNormalItemAccess().getTypeAssignment();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if(getEObject().eClass() != grammarAccess.getModelNormalItemRule().getType().getClassifier())
			return null;
		if((value = eObjectConsumer.getConsumable("type",true)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("type");
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelNormalItemAccess().getTypeModelItemTypeParserRuleCall_0(), value, null)) {
			type = AssignmentType.DATATYPE_RULE_CALL;
			element = grammarAccess.getModelNormalItemAccess().getTypeModelItemTypeParserRuleCall_0();
			return obj;
		}
		return null;
	}

}

/************ end Rule ModelNormalItem ****************/



/************ begin Rule ModelBinding ****************
 *
 * ModelBinding:
 * 	type=ID "=" configuration=STRING;
 *
 **/

// type=ID "=" configuration=STRING
protected class ModelBinding_Group extends GroupToken {
	
	public ModelBinding_Group(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Group getGrammarElement() {
		return grammarAccess.getModelBindingAccess().getGroup();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelBinding_ConfigurationAssignment_2(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override
	public IEObjectConsumer tryConsume() {
		if(getEObject().eClass() != grammarAccess.getModelBindingRule().getType().getClassifier())
			return null;
		return eObjectConsumer;
	}

}

// type=ID
protected class ModelBinding_TypeAssignment_0 extends AssignmentToken  {
	
	public ModelBinding_TypeAssignment_0(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelBindingAccess().getTypeAssignment_0();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			default: return lastRuleCallOrigin.createFollowerAfterReturn(this, index, index, inst);
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("type",true)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("type");
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelBindingAccess().getTypeIDTerminalRuleCall_0_0(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelBindingAccess().getTypeIDTerminalRuleCall_0_0();
			return obj;
		}
		return null;
	}

}

// "="
protected class ModelBinding_EqualsSignKeyword_1 extends KeywordToken  {
	
	public ModelBinding_EqualsSignKeyword_1(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Keyword getGrammarElement() {
		return grammarAccess.getModelBindingAccess().getEqualsSignKeyword_1();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelBinding_TypeAssignment_0(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

}

// configuration=STRING
protected class ModelBinding_ConfigurationAssignment_2 extends AssignmentToken  {
	
	public ModelBinding_ConfigurationAssignment_2(AbstractToken lastRuleCallOrigin, AbstractToken next, int transitionIndex, IEObjectConsumer eObjectConsumer) {
		super(lastRuleCallOrigin, next, transitionIndex, eObjectConsumer);
	}
	
	@Override
	public Assignment getGrammarElement() {
		return grammarAccess.getModelBindingAccess().getConfigurationAssignment_2();
	}

    @Override
	public AbstractToken createFollower(int index, IEObjectConsumer inst) {
		switch(index) {
			case 0: return new ModelBinding_EqualsSignKeyword_1(lastRuleCallOrigin, this, 0, inst);
			default: return null;
		}	
	}

    @Override	
	public IEObjectConsumer tryConsume() {
		if((value = eObjectConsumer.getConsumable("configuration",true)) == null) return null;
		IEObjectConsumer obj = eObjectConsumer.cloneAndConsume("configuration");
		if(valueSerializer.isValid(obj.getEObject(), grammarAccess.getModelBindingAccess().getConfigurationSTRINGTerminalRuleCall_2_0(), value, null)) {
			type = AssignmentType.TERMINAL_RULE_CALL;
			element = grammarAccess.getModelBindingAccess().getConfigurationSTRINGTerminalRuleCall_2_0();
			return obj;
		}
		return null;
	}

}


/************ end Rule ModelBinding ****************/

}
