/*
* generated by Xtext
*/
grammar InternalMyDsl;

options {
	superClass=AbstractInternalAntlrParser;
	
}

@lexer::header {
package org.xtext.example.mydsl3.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.xtext.example.mydsl3.parser.antlr.internal; 

import java.io.InputStream;
import org.eclipse.xtext.*;
import org.eclipse.xtext.parser.*;
import org.eclipse.xtext.parser.impl.*;
import org.eclipse.xtext.parsetree.*;
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.eclipse.xtext.conversion.ValueConverterException;
import org.xtext.example.mydsl3.services.MyDslGrammarAccess;

}

@parser::members {

 	private MyDslGrammarAccess grammarAccess;
 	
    public InternalMyDslParser(TokenStream input, IAstFactory factory, MyDslGrammarAccess grammarAccess) {
        this(input);
        this.factory = factory;
        registerRules(grammarAccess.getGrammar());
        this.grammarAccess = grammarAccess;
    }
    
    @Override
    protected InputStream getTokenFile() {
    	ClassLoader classLoader = getClass().getClassLoader();
    	return classLoader.getResourceAsStream("org/xtext/example/mydsl3/parser/antlr/internal/InternalMyDsl.tokens");
    }
    
    @Override
    protected String getFirstRuleName() {
    	return "AgentInternalViewpoint";	
   	}
   	
   	@Override
   	protected MyDslGrammarAccess getGrammarAccess() {
   		return grammarAccess;
   	}
}

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




// Entry rule entryRuleAgentInternalViewpoint
entryRuleAgentInternalViewpoint returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getAgentInternalViewpointRule(), currentNode); }
	 iv_ruleAgentInternalViewpoint=ruleAgentInternalViewpoint 
	 { $current=$iv_ruleAgentInternalViewpoint.current; } 
	 EOF 
;

// Rule AgentInternalViewpoint
ruleAgentInternalViewpoint returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
(	'AgentInternalViewPoint' 
    {
        createLeafNode(grammarAccess.getAgentInternalViewpointAccess().getAgentInternalViewPointKeyword_0(), null); 
    }
	'{' 
    {
        createLeafNode(grammarAccess.getAgentInternalViewpointAccess().getLeftCurlyBracketKeyword_1(), null); 
    }
(((
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getSemanticwebagentSemanticWebAgentParserRuleCall_2_0_0_0(), currentNode); 
	    }
		lv_semanticwebagent_2_0=ruleSemanticWebAgent		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"semanticwebagent",
	        		lv_semanticwebagent_2_0, 
	        		"SemanticWebAgent", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getCapabilitiesCapabilitiesParserRuleCall_2_0_1_0(), currentNode); 
	    }
		lv_capabilities_3_0=ruleCapabilities		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"capabilities",
	        		lv_capabilities_3_0, 
	        		"Capabilities", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
))
    |((
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getCapabilitiesCapabilitiesParserRuleCall_2_1_0_0(), currentNode); 
	    }
		lv_capabilities_4_0=ruleCapabilities		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"capabilities",
	        		lv_capabilities_4_0, 
	        		"Capabilities", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getSemanticwebagentSemanticWebAgentParserRuleCall_2_1_1_0(), currentNode); 
	    }
		lv_semanticwebagent_5_0=ruleSemanticWebAgent		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"semanticwebagent",
	        		lv_semanticwebagent_5_0, 
	        		"SemanticWebAgent", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)))((
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getBeliefBeliefParserRuleCall_3_0_0(), currentNode); 
	    }
		lv_belief_6_0=ruleBelief		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"belief",
	        		lv_belief_6_0, 
	        		"Belief", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)
    |(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getGoalGoalParserRuleCall_3_1_0(), currentNode); 
	    }
		lv_goal_7_0=ruleGoal		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"goal",
	        		lv_goal_7_0, 
	        		"Goal", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)
    |(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getCapabilitiesCapabilitiesParserRuleCall_3_2_0(), currentNode); 
	    }
		lv_capabilities_8_0=ruleCapabilities		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"capabilities",
	        		lv_capabilities_8_0, 
	        		"Capabilities", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)
    |(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getAgentstateAgentStateParserRuleCall_3_3_0(), currentNode); 
	    }
		lv_agentstate_9_0=ruleAgentState		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"agentstate",
	        		lv_agentstate_9_0, 
	        		"AgentState", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)
    |(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getSemanticwebagentSemanticWebAgentParserRuleCall_3_4_0(), currentNode); 
	    }
		lv_semanticwebagent_10_0=ruleSemanticWebAgent		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"semanticwebagent",
	        		lv_semanticwebagent_10_0, 
	        		"SemanticWebAgent", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)
    |(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getRoleRoleParserRuleCall_3_5_0(), currentNode); 
	    }
		lv_role_11_0=ruleRole		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"role",
	        		lv_role_11_0, 
	        		"Role", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)
    |(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getPlanPlanParserRuleCall_3_6_0(), currentNode); 
	    }
		lv_plan_12_0=rulePlan		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"plan",
	        		lv_plan_12_0, 
	        		"Plan", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)
    |(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getAgenttypeAgentTypeParserRuleCall_3_7_0(), currentNode); 
	    }
		lv_agenttype_13_0=ruleAgentType		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"agenttype",
	        		lv_agenttype_13_0, 
	        		"AgentType", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
)
    |(
(
		{ 
	        currentNode=createCompositeNode(grammarAccess.getAgentInternalViewpointAccess().getBehaviourBehaviourParserRuleCall_3_8_0(), currentNode); 
	    }
		lv_behaviour_14_0=ruleBehaviour		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentInternalViewpointRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode.getParent(), $current);
	        }
	        try {
	       		add(
	       			$current, 
	       			"behaviour",
	        		lv_behaviour_14_0, 
	        		"Behaviour", 
	        		currentNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	        currentNode = currentNode.getParent();
	    }

)
))*	'}' 
    {
        createLeafNode(grammarAccess.getAgentInternalViewpointAccess().getRGhtCurlyBracketKeyword_4(), null); 
    }
)
;





// Entry rule entryRuleBelief
entryRuleBelief returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getBeliefRule(), currentNode); }
	 iv_ruleBelief=ruleBelief 
	 { $current=$iv_ruleBelief.current; } 
	 EOF 
;

// Rule Belief
ruleBelief returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
(	'Belief' 
    {
        createLeafNode(grammarAccess.getBeliefAccess().getBeliefKeyword_0(), null); 
    }
(
(
		lv_name_1_0=RULE_ID
		{
			createLeafNode(grammarAccess.getBeliefAccess().getNameIDTerminalRuleCall_1_0(), "name"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getBeliefRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"name",
	        		lv_name_1_0, 
	        		"ID", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_description_2_0=RULE_STRING
		{
			createLeafNode(grammarAccess.getBeliefAccess().getDescriptionSTRINGTerminalRuleCall_2_0(), "description"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getBeliefRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"description",
	        		lv_description_2_0, 
	        		"STRING", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_dynamic_3_0=RULE_INT
		{
			createLeafNode(grammarAccess.getBeliefAccess().getDynamicINTTerminalRuleCall_3_0(), "dynamic"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getBeliefRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"dynamic",
	        		lv_dynamic_3_0, 
	        		"INT", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)	';' 
    {
        createLeafNode(grammarAccess.getBeliefAccess().getSemColonKeyword_4(), null); 
    }
)
;





// Entry rule entryRuleGoal
entryRuleGoal returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getGoalRule(), currentNode); }
	 iv_ruleGoal=ruleGoal 
	 { $current=$iv_ruleGoal.current; } 
	 EOF 
;

// Rule Goal
ruleGoal returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
(	'Goal' 
    {
        createLeafNode(grammarAccess.getGoalAccess().getGoalKeyword_0(), null); 
    }
(
(
		lv_name_1_0=RULE_ID
		{
			createLeafNode(grammarAccess.getGoalAccess().getNameIDTerminalRuleCall_1_0(), "name"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getGoalRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"name",
	        		lv_name_1_0, 
	        		"ID", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_description_2_0=RULE_STRING
		{
			createLeafNode(grammarAccess.getGoalAccess().getDescriptionSTRINGTerminalRuleCall_2_0(), "description"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getGoalRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"description",
	        		lv_description_2_0, 
	        		"STRING", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_recur_3_0=RULE_INT
		{
			createLeafNode(grammarAccess.getGoalAccess().getRecurINTTerminalRuleCall_3_0(), "recur"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getGoalRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"recur",
	        		lv_recur_3_0, 
	        		"INT", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)	';' 
    {
        createLeafNode(grammarAccess.getGoalAccess().getSemColonKeyword_4(), null); 
    }
)
;





// Entry rule entryRuleCapabilities
entryRuleCapabilities returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getCapabilitiesRule(), currentNode); }
	 iv_ruleCapabilities=ruleCapabilities 
	 { $current=$iv_ruleCapabilities.current; } 
	 EOF 
;

// Rule Capabilities
ruleCapabilities returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
((	'Capabilities' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getCapabilitiesKeyword_0_0(), null); 
    }
(
(
		lv_name_1_0=RULE_ID
		{
			createLeafNode(grammarAccess.getCapabilitiesAccess().getNameIDTerminalRuleCall_0_1_0(), "name"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getCapabilitiesRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"name",
	        		lv_name_1_0, 
	        		"ID", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_description_2_0=RULE_STRING
		{
			createLeafNode(grammarAccess.getCapabilitiesAccess().getDescriptionSTRINGTerminalRuleCall_0_2_0(), "description"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getCapabilitiesRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"description",
	        		lv_description_2_0, 
	        		"STRING", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)	';' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getSemColonKeyword_0_3(), null); 
    }
)
    |((
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getCapabilitiesRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getCapabilitiesAccess().getCapCapabilitiesCrossReference_1_0_0(), "cap"); 
	}

)
)	'{' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getLeftCurlyBracketKeyword_1_1(), null); 
    }
((	'includes' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getIncludesKeyword_1_2_0_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getCapabilitiesRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getCapabilitiesAccess().getBeliefBeliefCrossReference_1_2_0_1_0(), "belief"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getSemColonKeyword_1_2_0_2(), null); 
    }
)
    |(	'uses' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getUsesKeyword_1_2_1_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getCapabilitiesRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getCapabilitiesAccess().getGoalGoalCrossReference_1_2_1_1_0(), "goal"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getSemColonKeyword_1_2_1_2(), null); 
    }
)
    |(	'applies' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getAppliesKeyword_1_2_2_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getCapabilitiesRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getCapabilitiesAccess().getPlanPlanCrossReference_1_2_2_1_0(), "plan"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getSemColonKeyword_1_2_2_2(), null); 
    }
))*	'}' 
    {
        createLeafNode(grammarAccess.getCapabilitiesAccess().getRGhtCurlyBracketKeyword_1_3(), null); 
    }
))
;





// Entry rule entryRuleAgentState
entryRuleAgentState returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getAgentStateRule(), currentNode); }
	 iv_ruleAgentState=ruleAgentState 
	 { $current=$iv_ruleAgentState.current; } 
	 EOF 
;

// Rule AgentState
ruleAgentState returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
(	'AgentState' 
    {
        createLeafNode(grammarAccess.getAgentStateAccess().getAgentStateKeyword_0(), null); 
    }
(
(
		lv_name_1_0=RULE_ID
		{
			createLeafNode(grammarAccess.getAgentStateAccess().getNameIDTerminalRuleCall_1_0(), "name"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentStateRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"name",
	        		lv_name_1_0, 
	        		"ID", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)	';' 
    {
        createLeafNode(grammarAccess.getAgentStateAccess().getSemColonKeyword_2(), null); 
    }
)
;





// Entry rule entryRuleSemanticWebAgent
entryRuleSemanticWebAgent returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getSemanticWebAgentRule(), currentNode); }
	 iv_ruleSemanticWebAgent=ruleSemanticWebAgent 
	 { $current=$iv_ruleSemanticWebAgent.current; } 
	 EOF 
;

// Rule SemanticWebAgent
ruleSemanticWebAgent returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
((	'SemanticWebAgent' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getSemanticWebAgentKeyword_0_0(), null); 
    }
(
(
		lv_name_1_0=RULE_ID
		{
			createLeafNode(grammarAccess.getSemanticWebAgentAccess().getNameIDTerminalRuleCall_0_1_0(), "name"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"name",
	        		lv_name_1_0, 
	        		"ID", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_description_2_0=RULE_STRING
		{
			createLeafNode(grammarAccess.getSemanticWebAgentAccess().getDescriptionSTRINGTerminalRuleCall_0_2_0(), "description"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"description",
	        		lv_description_2_0, 
	        		"STRING", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_properties_3_0=RULE_STRING
		{
			createLeafNode(grammarAccess.getSemanticWebAgentAccess().getPropertiesSTRINGTerminalRuleCall_0_3_0(), "properties"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"properties",
	        		lv_properties_3_0, 
	        		"STRING", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)	';' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getSemColonKeyword_0_4(), null); 
    }
)
    |((
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getSemanticWebAgentAccess().getSemanticwebagentSemanticWebAgentCrossReference_1_0_0(), "semanticwebagent"); 
	}

)
)(	'{' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getLeftCurlyBracketKeyword_1_1_0(), null); 
    }
	'contains' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getContainsKeyword_1_1_1(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getSemanticWebAgentAccess().getAgentstateAgentStateCrossReference_1_1_2_0(), "agentstate"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getSemColonKeyword_1_1_3(), null); 
    }
(	'includes' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getIncludesKeyword_1_1_4_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getSemanticWebAgentAccess().getCapCapabilitiesCrossReference_1_1_4_1_0(), "cap"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getSemColonKeyword_1_1_4_2(), null); 
    }
)*	'includes' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getIncludesKeyword_1_1_5(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getSemanticWebAgentAccess().getCapCapabilitiesCrossReference_1_1_6_0(), "cap"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getSemColonKeyword_1_1_7(), null); 
    }
(	'has' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getHasKeyword_1_1_8_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getSemanticWebAgentAccess().getAgenttypeAgentTypeCrossReference_1_1_8_1_0(), "agenttype"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getSemColonKeyword_1_1_8_2(), null); 
    }
)?	'plays' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getPlaysKeyword_1_1_9(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getSemanticWebAgentAccess().getRoleRoleCrossReference_1_1_10_0(), "role"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getSemColonKeyword_1_1_11(), null); 
    }
(	'plays' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getPlaysKeyword_1_1_12_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getSemanticWebAgentRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getSemanticWebAgentAccess().getRoleRoleCrossReference_1_1_12_1_0(), "role"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getSemColonKeyword_1_1_12_2(), null); 
    }
)*)	'}' 
    {
        createLeafNode(grammarAccess.getSemanticWebAgentAccess().getRGhtCurlyBracketKeyword_1_2(), null); 
    }
))
;





// Entry rule entryRuleRole
entryRuleRole returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getRoleRule(), currentNode); }
	 iv_ruleRole=ruleRole 
	 { $current=$iv_ruleRole.current; } 
	 EOF 
;

// Rule Role
ruleRole returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
((	'Role' 
    {
        createLeafNode(grammarAccess.getRoleAccess().getRoleKeyword_0_0(), null); 
    }
(
(
		lv_name_1_0=RULE_ID
		{
			createLeafNode(grammarAccess.getRoleAccess().getNameIDTerminalRuleCall_0_1_0(), "name"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getRoleRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"name",
	        		lv_name_1_0, 
	        		"ID", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)	';' 
    {
        createLeafNode(grammarAccess.getRoleAccess().getSemColonKeyword_0_2(), null); 
    }
)
    |((
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getRoleRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getRoleAccess().getRoleRoleCrossReference_1_0_0(), "role"); 
	}

)
)	'{' 
    {
        createLeafNode(grammarAccess.getRoleAccess().getLeftCurlyBracketKeyword_1_1(), null); 
    }
	'has' 
    {
        createLeafNode(grammarAccess.getRoleAccess().getHasKeyword_1_2(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getRoleRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getRoleAccess().getBehBehaviourCrossReference_1_3_0(), "beh"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getRoleAccess().getSemColonKeyword_1_4(), null); 
    }
(	'has' 
    {
        createLeafNode(grammarAccess.getRoleAccess().getHasKeyword_1_5_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getRoleRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getRoleAccess().getBehBehaviourCrossReference_1_5_1_0(), "beh"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getRoleAccess().getSemColonKeyword_1_5_2(), null); 
    }
)*	'}' 
    {
        createLeafNode(grammarAccess.getRoleAccess().getRGhtCurlyBracketKeyword_1_6(), null); 
    }
))
;





// Entry rule entryRulePlan
entryRulePlan returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getPlanRule(), currentNode); }
	 iv_rulePlan=rulePlan 
	 { $current=$iv_rulePlan.current; } 
	 EOF 
;

// Rule Plan
rulePlan returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
((	'Plan' 
    {
        createLeafNode(grammarAccess.getPlanAccess().getPlanKeyword_0_0(), null); 
    }
(
(
		lv_name_1_0=RULE_ID
		{
			createLeafNode(grammarAccess.getPlanAccess().getNameIDTerminalRuleCall_0_1_0(), "name"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getPlanRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"name",
	        		lv_name_1_0, 
	        		"ID", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_type_2_0=RULE_STRING
		{
			createLeafNode(grammarAccess.getPlanAccess().getTypeSTRINGTerminalRuleCall_0_2_0(), "type"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getPlanRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"type",
	        		lv_type_2_0, 
	        		"STRING", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_description_3_0=RULE_STRING
		{
			createLeafNode(grammarAccess.getPlanAccess().getDescriptionSTRINGTerminalRuleCall_0_3_0(), "description"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getPlanRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"description",
	        		lv_description_3_0, 
	        		"STRING", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_priority_4_0=RULE_INT
		{
			createLeafNode(grammarAccess.getPlanAccess().getPriorityINTTerminalRuleCall_0_4_0(), "priority"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getPlanRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"priority",
	        		lv_priority_4_0, 
	        		"INT", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)	';' 
    {
        createLeafNode(grammarAccess.getPlanAccess().getSemColonKeyword_0_5(), null); 
    }
)
    |((
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getPlanRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getPlanAccess().getPlanPlanCrossReference_1_0_0(), "plan"); 
	}

)
)	'{' 
    {
        createLeafNode(grammarAccess.getPlanAccess().getLeftCurlyBracketKeyword_1_1(), null); 
    }
(	'dispatches' 
    {
        createLeafNode(grammarAccess.getPlanAccess().getDispatchesKeyword_1_2_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getPlanRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getPlanAccess().getGoalGoalCrossReference_1_2_1_0(), "goal"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getPlanAccess().getSemColonKeyword_1_2_2(), null); 
    }
)*	'}' 
    {
        createLeafNode(grammarAccess.getPlanAccess().getRGhtCurlyBracketKeyword_1_3(), null); 
    }
))
;





// Entry rule entryRuleAgentType
entryRuleAgentType returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getAgentTypeRule(), currentNode); }
	 iv_ruleAgentType=ruleAgentType 
	 { $current=$iv_ruleAgentType.current; } 
	 EOF 
;

// Rule AgentType
ruleAgentType returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
(	'AgentType' 
    {
        createLeafNode(grammarAccess.getAgentTypeAccess().getAgentTypeKeyword_0(), null); 
    }
(
(
		lv_name_1_0=RULE_ID
		{
			createLeafNode(grammarAccess.getAgentTypeAccess().getNameIDTerminalRuleCall_1_0(), "name"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getAgentTypeRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"name",
	        		lv_name_1_0, 
	        		"ID", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)	';' 
    {
        createLeafNode(grammarAccess.getAgentTypeAccess().getSemColonKeyword_2(), null); 
    }
)
;





// Entry rule entryRuleBehaviour
entryRuleBehaviour returns [EObject current=null] 
	:
	{ currentNode = createCompositeNode(grammarAccess.getBehaviourRule(), currentNode); }
	 iv_ruleBehaviour=ruleBehaviour 
	 { $current=$iv_ruleBehaviour.current; } 
	 EOF 
;

// Rule Behaviour
ruleBehaviour returns [EObject current=null] 
    @init { EObject temp=null; setCurrentLookahead(); resetLookahead(); 
    }
    @after { resetLookahead(); 
    	lastConsumedNode = currentNode;
    }:
((	'Behaviour' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getBehaviourKeyword_0_0(), null); 
    }
(
(
		lv_name_1_0=RULE_ID
		{
			createLeafNode(grammarAccess.getBehaviourAccess().getNameIDTerminalRuleCall_0_1_0(), "name"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getBehaviourRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"name",
	        		lv_name_1_0, 
	        		"ID", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)(
(
		lv_resident_2_0=RULE_INT
		{
			createLeafNode(grammarAccess.getBehaviourAccess().getResidentINTTerminalRuleCall_0_2_0(), "resident"); 
		}
		{
	        if ($current==null) {
	            $current = factory.create(grammarAccess.getBehaviourRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
	        try {
	       		set(
	       			$current, 
	       			"resident",
	        		lv_resident_2_0, 
	        		"INT", 
	        		lastConsumedNode);
	        } catch (ValueConverterException vce) {
				handleValueConverterException(vce);
	        }
	    }

)
)	';' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getSemColonKeyword_0_3(), null); 
    }
)
    |((
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getBehaviourRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getBehaviourAccess().getBehBehaviourCrossReference_1_0_0(), "beh"); 
	}

)
)	'{' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getLeftCurlyBracketKeyword_1_1(), null); 
    }
(	'executes' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getExecutesKeyword_1_2_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getBehaviourRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getBehaviourAccess().getPlanPlanCrossReference_1_2_1_0(), "plan"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getSemColonKeyword_1_2_2(), null); 
    }
)*	'composed_of' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getComposed_ofKeyword_1_3(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getBehaviourRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getBehaviourAccess().getBehBehaviourCrossReference_1_4_0(), "beh"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getSemColonKeyword_1_5(), null); 
    }
(	'composed_of' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getComposed_ofKeyword_1_6_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getBehaviourRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getBehaviourAccess().getBehBehaviourCrossReference_1_6_1_0(), "beh"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getSemColonKeyword_1_6_2(), null); 
    }
)*(	'executes' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getExecutesKeyword_1_7_0(), null); 
    }
(
(
		{
			if ($current==null) {
	            $current = factory.create(grammarAccess.getBehaviourRule().getType().getClassifier());
	            associateNodeWithAstElement(currentNode, $current);
	        }
        }
	RULE_ID
	{
		createLeafNode(grammarAccess.getBehaviourAccess().getPlanPlanCrossReference_1_7_1_0(), "plan"); 
	}

)
)	';' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getSemColonKeyword_1_7_2(), null); 
    }
)*	'}' 
    {
        createLeafNode(grammarAccess.getBehaviourAccess().getRGhtCurlyBracketKeyword_1_8(), null); 
    }
))
;





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

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

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

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

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

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

RULE_ANY_OTHER : .;


