/*
* generated by Xtext
*/
grammar InternalSGen;

options {
	superClass=AbstractInternalAntlrParser;
	
}

@lexer::header {
package org.yakindu.sct.generator.genmodel.parser.antlr.internal;

// Hack: Use our own Lexer superclass by means of import. 
// Currently there is no other way to specify the superclass for the lexer.
import org.eclipse.xtext.parser.antlr.Lexer;
}

@parser::header {
package org.yakindu.sct.generator.genmodel.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.yakindu.sct.generator.genmodel.services.SGenGrammarAccess;

}

@parser::members {

 	private SGenGrammarAccess grammarAccess;
 	
    public InternalSGenParser(TokenStream input, SGenGrammarAccess grammarAccess) {
        this(input);
        this.grammarAccess = grammarAccess;
        registerRules(grammarAccess.getGrammar());
    }
    
    @Override
    protected String getFirstRuleName() {
    	return "GeneratorModel";	
   	}
   	
   	@Override
   	protected SGenGrammarAccess getGrammarAccess() {
   		return grammarAccess;
   	}
}

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




// Entry rule entryRuleGeneratorModel
entryRuleGeneratorModel returns [EObject current=null] 
	:
	{ newCompositeNode(grammarAccess.getGeneratorModelRule()); }
	 iv_ruleGeneratorModel=ruleGeneratorModel 
	 { $current=$iv_ruleGeneratorModel.current; } 
	 EOF 
;

// Rule GeneratorModel
ruleGeneratorModel returns [EObject current=null] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
(	otherlv_0='GeneratorModel' 
    {
    	newLeafNode(otherlv_0, grammarAccess.getGeneratorModelAccess().getGeneratorModelKeyword_0());
    }
	otherlv_1='for' 
    {
    	newLeafNode(otherlv_1, grammarAccess.getGeneratorModelAccess().getForKeyword_1());
    }
(
(
		{ 
	        newCompositeNode(grammarAccess.getGeneratorModelAccess().getGeneratorIdQIDParserRuleCall_2_0()); 
	    }
		lv_generatorId_2_0=ruleQID		{
	        if ($current==null) {
	            $current = createModelElementForParent(grammarAccess.getGeneratorModelRule());
	        }
       		set(
       			$current, 
       			"generatorId",
        		lv_generatorId_2_0, 
        		"QID");
	        afterParserOrEnumRuleCall();
	    }

)
)	otherlv_3='{' 
    {
    	newLeafNode(otherlv_3, grammarAccess.getGeneratorModelAccess().getLeftCurlyBracketKeyword_3());
    }
(
(
		{ 
	        newCompositeNode(grammarAccess.getGeneratorModelAccess().getEntriesGeneratorEntryParserRuleCall_4_0()); 
	    }
		lv_entries_4_0=ruleGeneratorEntry		{
	        if ($current==null) {
	            $current = createModelElementForParent(grammarAccess.getGeneratorModelRule());
	        }
       		add(
       			$current, 
       			"entries",
        		lv_entries_4_0, 
        		"GeneratorEntry");
	        afterParserOrEnumRuleCall();
	    }

)
)*	otherlv_5='}' 
    {
    	newLeafNode(otherlv_5, grammarAccess.getGeneratorModelAccess().getRightCurlyBracketKeyword_5());
    }
)
;





// Entry rule entryRuleGeneratorEntry
entryRuleGeneratorEntry returns [EObject current=null] 
	:
	{ newCompositeNode(grammarAccess.getGeneratorEntryRule()); }
	 iv_ruleGeneratorEntry=ruleGeneratorEntry 
	 { $current=$iv_ruleGeneratorEntry.current; } 
	 EOF 
;

// Rule GeneratorEntry
ruleGeneratorEntry returns [EObject current=null] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
((
(
		lv_contentType_0_0=RULE_ID
		{
			newLeafNode(lv_contentType_0_0, grammarAccess.getGeneratorEntryAccess().getContentTypeIDTerminalRuleCall_0_0()); 
		}
		{
	        if ($current==null) {
	            $current = createModelElement(grammarAccess.getGeneratorEntryRule());
	        }
       		setWithLastConsumed(
       			$current, 
       			"contentType",
        		lv_contentType_0_0, 
        		"ID");
	    }

)
)(
(
		{
			if ($current==null) {
	            $current = createModelElement(grammarAccess.getGeneratorEntryRule());
	        }
        }
		{ 
	        newCompositeNode(grammarAccess.getGeneratorEntryAccess().getElementRefEObjectCrossReference_1_0()); 
	    }
		ruleQID		{ 
	        afterParserOrEnumRuleCall();
	    }

)
)	otherlv_2='{' 
    {
    	newLeafNode(otherlv_2, grammarAccess.getGeneratorEntryAccess().getLeftCurlyBracketKeyword_2());
    }
(
(
		{ 
	        newCompositeNode(grammarAccess.getGeneratorEntryAccess().getFeaturesFeatureConfigurationParserRuleCall_3_0()); 
	    }
		lv_features_3_0=ruleFeatureConfiguration		{
	        if ($current==null) {
	            $current = createModelElementForParent(grammarAccess.getGeneratorEntryRule());
	        }
       		add(
       			$current, 
       			"features",
        		lv_features_3_0, 
        		"FeatureConfiguration");
	        afterParserOrEnumRuleCall();
	    }

)
)*	otherlv_4='}' 
    {
    	newLeafNode(otherlv_4, grammarAccess.getGeneratorEntryAccess().getRightCurlyBracketKeyword_4());
    }
)
;





// Entry rule entryRuleFeatureConfiguration
entryRuleFeatureConfiguration returns [EObject current=null] 
	:
	{ newCompositeNode(grammarAccess.getFeatureConfigurationRule()); }
	 iv_ruleFeatureConfiguration=ruleFeatureConfiguration 
	 { $current=$iv_ruleFeatureConfiguration.current; } 
	 EOF 
;

// Rule FeatureConfiguration
ruleFeatureConfiguration returns [EObject current=null] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
((
    {
        $current = forceCreateModelElement(
            grammarAccess.getFeatureConfigurationAccess().getFeatureConfigurationAction_0(),
            $current);
    }
)	otherlv_1='feature' 
    {
    	newLeafNode(otherlv_1, grammarAccess.getFeatureConfigurationAccess().getFeatureKeyword_1());
    }
(
(
		{
			if ($current==null) {
	            $current = createModelElement(grammarAccess.getFeatureConfigurationRule());
	        }
        }
	otherlv_2=RULE_ID
	{
		newLeafNode(otherlv_2, grammarAccess.getFeatureConfigurationAccess().getTypeFeatureTypeCrossReference_2_0()); 
	}

)
)	otherlv_3='{' 
    {
    	newLeafNode(otherlv_3, grammarAccess.getFeatureConfigurationAccess().getLeftCurlyBracketKeyword_3());
    }
(
(
		{ 
	        newCompositeNode(grammarAccess.getFeatureConfigurationAccess().getParameterValuesFeatureParameterValueParserRuleCall_4_0()); 
	    }
		lv_parameterValues_4_0=ruleFeatureParameterValue		{
	        if ($current==null) {
	            $current = createModelElementForParent(grammarAccess.getFeatureConfigurationRule());
	        }
       		add(
       			$current, 
       			"parameterValues",
        		lv_parameterValues_4_0, 
        		"FeatureParameterValue");
	        afterParserOrEnumRuleCall();
	    }

)
)*	otherlv_5='}' 
    {
    	newLeafNode(otherlv_5, grammarAccess.getFeatureConfigurationAccess().getRightCurlyBracketKeyword_5());
    }
)
;





// Entry rule entryRuleFeatureParameterValue
entryRuleFeatureParameterValue returns [EObject current=null] 
	:
	{ newCompositeNode(grammarAccess.getFeatureParameterValueRule()); }
	 iv_ruleFeatureParameterValue=ruleFeatureParameterValue 
	 { $current=$iv_ruleFeatureParameterValue.current; } 
	 EOF 
;

// Rule FeatureParameterValue
ruleFeatureParameterValue returns [EObject current=null] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
((
    {
        $current = forceCreateModelElement(
            grammarAccess.getFeatureParameterValueAccess().getFeatureParameterValueAction_0(),
            $current);
    }
)(
(
		{
			if ($current==null) {
	            $current = createModelElement(grammarAccess.getFeatureParameterValueRule());
	        }
        }
	otherlv_1=RULE_ID
	{
		newLeafNode(otherlv_1, grammarAccess.getFeatureParameterValueAccess().getParameterFeatureParameterCrossReference_1_0()); 
	}

)
)	otherlv_2='=' 
    {
    	newLeafNode(otherlv_2, grammarAccess.getFeatureParameterValueAccess().getEqualsSignKeyword_2());
    }
(
(
		{ 
	        newCompositeNode(grammarAccess.getFeatureParameterValueAccess().getExpressionLiteralParserRuleCall_3_0()); 
	    }
		lv_expression_3_0=ruleLiteral		{
	        if ($current==null) {
	            $current = createModelElementForParent(grammarAccess.getFeatureParameterValueRule());
	        }
       		set(
       			$current, 
       			"expression",
        		lv_expression_3_0, 
        		"Literal");
	        afterParserOrEnumRuleCall();
	    }

)
))
;





// Entry rule entryRuleLiteral
entryRuleLiteral returns [EObject current=null] 
	:
	{ newCompositeNode(grammarAccess.getLiteralRule()); }
	 iv_ruleLiteral=ruleLiteral 
	 { $current=$iv_ruleLiteral.current; } 
	 EOF 
;

// Rule Literal
ruleLiteral returns [EObject current=null] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
(
    { 
        newCompositeNode(grammarAccess.getLiteralAccess().getBoolLiteralParserRuleCall_0()); 
    }
    this_BoolLiteral_0=ruleBoolLiteral
    { 
        $current = $this_BoolLiteral_0.current; 
        afterParserOrEnumRuleCall();
    }

    |
    { 
        newCompositeNode(grammarAccess.getLiteralAccess().getIntLiteralParserRuleCall_1()); 
    }
    this_IntLiteral_1=ruleIntLiteral
    { 
        $current = $this_IntLiteral_1.current; 
        afterParserOrEnumRuleCall();
    }

    |
    { 
        newCompositeNode(grammarAccess.getLiteralAccess().getRealLiteralParserRuleCall_2()); 
    }
    this_RealLiteral_2=ruleRealLiteral
    { 
        $current = $this_RealLiteral_2.current; 
        afterParserOrEnumRuleCall();
    }

    |
    { 
        newCompositeNode(grammarAccess.getLiteralAccess().getStringLiteralParserRuleCall_3()); 
    }
    this_StringLiteral_3=ruleStringLiteral
    { 
        $current = $this_StringLiteral_3.current; 
        afterParserOrEnumRuleCall();
    }
)
;





// Entry rule entryRuleBoolLiteral
entryRuleBoolLiteral returns [EObject current=null] 
	:
	{ newCompositeNode(grammarAccess.getBoolLiteralRule()); }
	 iv_ruleBoolLiteral=ruleBoolLiteral 
	 { $current=$iv_ruleBoolLiteral.current; } 
	 EOF 
;

// Rule BoolLiteral
ruleBoolLiteral returns [EObject current=null] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
((
    {
        $current = forceCreateModelElement(
            grammarAccess.getBoolLiteralAccess().getBoolLiteralAction_0(),
            $current);
    }
)(
(
		lv_value_1_0=RULE_BOOL
		{
			newLeafNode(lv_value_1_0, grammarAccess.getBoolLiteralAccess().getValueBOOLTerminalRuleCall_1_0()); 
		}
		{
	        if ($current==null) {
	            $current = createModelElement(grammarAccess.getBoolLiteralRule());
	        }
       		setWithLastConsumed(
       			$current, 
       			"value",
        		lv_value_1_0, 
        		"BOOL");
	    }

)
))
;





// Entry rule entryRuleIntLiteral
entryRuleIntLiteral returns [EObject current=null] 
	:
	{ newCompositeNode(grammarAccess.getIntLiteralRule()); }
	 iv_ruleIntLiteral=ruleIntLiteral 
	 { $current=$iv_ruleIntLiteral.current; } 
	 EOF 
;

// Rule IntLiteral
ruleIntLiteral returns [EObject current=null] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
((
    {
        $current = forceCreateModelElement(
            grammarAccess.getIntLiteralAccess().getIntLiteralAction_0(),
            $current);
    }
)(
(
		lv_value_1_0=RULE_INT
		{
			newLeafNode(lv_value_1_0, grammarAccess.getIntLiteralAccess().getValueINTTerminalRuleCall_1_0()); 
		}
		{
	        if ($current==null) {
	            $current = createModelElement(grammarAccess.getIntLiteralRule());
	        }
       		setWithLastConsumed(
       			$current, 
       			"value",
        		lv_value_1_0, 
        		"INT");
	    }

)
))
;





// Entry rule entryRuleRealLiteral
entryRuleRealLiteral returns [EObject current=null] 
	:
	{ newCompositeNode(grammarAccess.getRealLiteralRule()); }
	 iv_ruleRealLiteral=ruleRealLiteral 
	 { $current=$iv_ruleRealLiteral.current; } 
	 EOF 
;

// Rule RealLiteral
ruleRealLiteral returns [EObject current=null] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
((
    {
        $current = forceCreateModelElement(
            grammarAccess.getRealLiteralAccess().getRealLiteralAction_0(),
            $current);
    }
)(
(
		lv_value_1_0=RULE_FLOAT
		{
			newLeafNode(lv_value_1_0, grammarAccess.getRealLiteralAccess().getValueFLOATTerminalRuleCall_1_0()); 
		}
		{
	        if ($current==null) {
	            $current = createModelElement(grammarAccess.getRealLiteralRule());
	        }
       		setWithLastConsumed(
       			$current, 
       			"value",
        		lv_value_1_0, 
        		"FLOAT");
	    }

)
))
;





// Entry rule entryRuleStringLiteral
entryRuleStringLiteral returns [EObject current=null] 
	:
	{ newCompositeNode(grammarAccess.getStringLiteralRule()); }
	 iv_ruleStringLiteral=ruleStringLiteral 
	 { $current=$iv_ruleStringLiteral.current; } 
	 EOF 
;

// Rule StringLiteral
ruleStringLiteral returns [EObject current=null] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
((
    {
        $current = forceCreateModelElement(
            grammarAccess.getStringLiteralAccess().getStringLiteralAction_0(),
            $current);
    }
)(
(
		lv_value_1_0=RULE_STRING
		{
			newLeafNode(lv_value_1_0, grammarAccess.getStringLiteralAccess().getValueSTRINGTerminalRuleCall_1_0()); 
		}
		{
	        if ($current==null) {
	            $current = createModelElement(grammarAccess.getStringLiteralRule());
	        }
       		setWithLastConsumed(
       			$current, 
       			"value",
        		lv_value_1_0, 
        		"STRING");
	    }

)
))
;





// Entry rule entryRuleQID
entryRuleQID returns [String current=null] 
	:
	{ newCompositeNode(grammarAccess.getQIDRule()); } 
	 iv_ruleQID=ruleQID 
	 { $current=$iv_ruleQID.current.getText(); }  
	 EOF 
;

// Rule QID
ruleQID returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] 
    @init { enterRule(); 
    }
    @after { leaveRule(); }:
(    this_ID_0=RULE_ID    {
		$current.merge(this_ID_0);
    }

    { 
    newLeafNode(this_ID_0, grammarAccess.getQIDAccess().getIDTerminalRuleCall_0()); 
    }
((
	kw='::' 
    {
        $current.merge(kw);
        newLeafNode(kw, grammarAccess.getQIDAccess().getColonColonKeyword_1_0_0()); 
    }

    |
	kw='.' 
    {
        $current.merge(kw);
        newLeafNode(kw, grammarAccess.getQIDAccess().getFullStopKeyword_1_0_1()); 
    }
)    this_ID_3=RULE_ID    {
		$current.merge(this_ID_3);
    }

    { 
    newLeafNode(this_ID_3, grammarAccess.getQIDAccess().getIDTerminalRuleCall_1_1()); 
    }
)*)
    ;





RULE_BOOL : ('true'|'false'|'yes'|'no');

RULE_FLOAT : RULE_INT '.' RULE_INT ('e' ('-'|'+') RULE_INT)? ('f'|'F'|'d'|'D')?;

RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;

RULE_INT : ('0'..'9')+;

RULE_STRING : ('"' ('\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|'\''|'\\')|~(('\\'|'"')))* '"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|'\''|'\\')|~(('\\'|'\'')))* '\'');

RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';

RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;

RULE_WS : (' '|'\t'|'\r'|'\n')+;

RULE_ANY_OTHER : .;


