package org.xtext.example.mydsl.parser.antlr.internal;

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



import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings("all")
public class InternalMyDslParser extends AbstractInternalAntlrParser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'Model'", "'{'", "'classAs'", "','", "'}'", "'ClassA'", "'classb'", "'ClassB'", "'target'"
    };
    public static final int RULE_STRING=6;
    public static final int RULE_SL_COMMENT=8;
    public static final int T__19=19;
    public static final int T__15=15;
    public static final int T__16=16;
    public static final int T__17=17;
    public static final int T__18=18;
    public static final int T__11=11;
    public static final int T__12=12;
    public static final int T__13=13;
    public static final int T__14=14;
    public static final int EOF=-1;
    public static final int RULE_ID=4;
    public static final int RULE_WS=9;
    public static final int RULE_ANY_OTHER=10;
    public static final int RULE_INT=5;
    public static final int RULE_ML_COMMENT=7;

    // delegates
    // delegators


        public InternalMyDslParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public InternalMyDslParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        

    public String[] getTokenNames() { return InternalMyDslParser.tokenNames; }
    public String getGrammarFileName() { return "InternalMyDsl.g"; }



     	private MyDslGrammarAccess grammarAccess;

        public InternalMyDslParser(TokenStream input, MyDslGrammarAccess grammarAccess) {
            this(input);
            this.grammarAccess = grammarAccess;
            registerRules(grammarAccess.getGrammar());
        }

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

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




    // $ANTLR start "entryRuleModel"
    // InternalMyDsl.g:64:1: entryRuleModel returns [EObject current=null] : iv_ruleModel= ruleModel EOF ;
    public final EObject entryRuleModel() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleModel = null;


        try {
            // InternalMyDsl.g:64:46: (iv_ruleModel= ruleModel EOF )
            // InternalMyDsl.g:65:2: iv_ruleModel= ruleModel EOF
            {
             newCompositeNode(grammarAccess.getModelRule()); 
            pushFollow(FOLLOW_1);
            iv_ruleModel=ruleModel();

            state._fsp--;

             current =iv_ruleModel; 
            match(input,EOF,FOLLOW_2); 

            }

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleModel"


    // $ANTLR start "ruleModel"
    // InternalMyDsl.g:71:1: ruleModel returns [EObject current=null] : ( () otherlv_1= 'Model' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classAs' otherlv_5= '{' ( (lv_classAs_6_0= ruleClassA ) ) (otherlv_7= ',' ( (lv_classAs_8_0= ruleClassA ) ) )* otherlv_9= '}' )? otherlv_10= '}' ) ;
    public final EObject ruleModel() throws RecognitionException {
        EObject current = null;

        Token otherlv_1=null;
        Token lv_name_2_0=null;
        Token otherlv_3=null;
        Token otherlv_4=null;
        Token otherlv_5=null;
        Token otherlv_7=null;
        Token otherlv_9=null;
        Token otherlv_10=null;
        EObject lv_classAs_6_0 = null;

        EObject lv_classAs_8_0 = null;



        	enterRule();

        try {
            // InternalMyDsl.g:77:2: ( ( () otherlv_1= 'Model' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classAs' otherlv_5= '{' ( (lv_classAs_6_0= ruleClassA ) ) (otherlv_7= ',' ( (lv_classAs_8_0= ruleClassA ) ) )* otherlv_9= '}' )? otherlv_10= '}' ) )
            // InternalMyDsl.g:78:2: ( () otherlv_1= 'Model' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classAs' otherlv_5= '{' ( (lv_classAs_6_0= ruleClassA ) ) (otherlv_7= ',' ( (lv_classAs_8_0= ruleClassA ) ) )* otherlv_9= '}' )? otherlv_10= '}' )
            {
            // InternalMyDsl.g:78:2: ( () otherlv_1= 'Model' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classAs' otherlv_5= '{' ( (lv_classAs_6_0= ruleClassA ) ) (otherlv_7= ',' ( (lv_classAs_8_0= ruleClassA ) ) )* otherlv_9= '}' )? otherlv_10= '}' )
            // InternalMyDsl.g:79:3: () otherlv_1= 'Model' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classAs' otherlv_5= '{' ( (lv_classAs_6_0= ruleClassA ) ) (otherlv_7= ',' ( (lv_classAs_8_0= ruleClassA ) ) )* otherlv_9= '}' )? otherlv_10= '}'
            {
            // InternalMyDsl.g:79:3: ()
            // InternalMyDsl.g:80:4: 
            {

            				current = forceCreateModelElement(
            					grammarAccess.getModelAccess().getModelAction_0(),
            					current);
            			

            }

            otherlv_1=(Token)match(input,11,FOLLOW_3); 

            			newLeafNode(otherlv_1, grammarAccess.getModelAccess().getModelKeyword_1());
            		
            // InternalMyDsl.g:90:3: ( (lv_name_2_0= RULE_ID ) )
            // InternalMyDsl.g:91:4: (lv_name_2_0= RULE_ID )
            {
            // InternalMyDsl.g:91:4: (lv_name_2_0= RULE_ID )
            // InternalMyDsl.g:92:5: lv_name_2_0= RULE_ID
            {
            lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_4); 

            					newLeafNode(lv_name_2_0, grammarAccess.getModelAccess().getNameIDTerminalRuleCall_2_0());
            				

            					if (current==null) {
            						current = createModelElement(grammarAccess.getModelRule());
            					}
            					setWithLastConsumed(
            						current,
            						"name",
            						lv_name_2_0,
            						"org.eclipse.xtext.common.Terminals.ID");
            				

            }


            }

            otherlv_3=(Token)match(input,12,FOLLOW_5); 

            			newLeafNode(otherlv_3, grammarAccess.getModelAccess().getLeftCurlyBracketKeyword_3());
            		
            // InternalMyDsl.g:112:3: (otherlv_4= 'classAs' otherlv_5= '{' ( (lv_classAs_6_0= ruleClassA ) ) (otherlv_7= ',' ( (lv_classAs_8_0= ruleClassA ) ) )* otherlv_9= '}' )?
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==13) ) {
                alt2=1;
            }
            switch (alt2) {
                case 1 :
                    // InternalMyDsl.g:113:4: otherlv_4= 'classAs' otherlv_5= '{' ( (lv_classAs_6_0= ruleClassA ) ) (otherlv_7= ',' ( (lv_classAs_8_0= ruleClassA ) ) )* otherlv_9= '}'
                    {
                    otherlv_4=(Token)match(input,13,FOLLOW_4); 

                    				newLeafNode(otherlv_4, grammarAccess.getModelAccess().getClassAsKeyword_4_0());
                    			
                    otherlv_5=(Token)match(input,12,FOLLOW_6); 

                    				newLeafNode(otherlv_5, grammarAccess.getModelAccess().getLeftCurlyBracketKeyword_4_1());
                    			
                    // InternalMyDsl.g:121:4: ( (lv_classAs_6_0= ruleClassA ) )
                    // InternalMyDsl.g:122:5: (lv_classAs_6_0= ruleClassA )
                    {
                    // InternalMyDsl.g:122:5: (lv_classAs_6_0= ruleClassA )
                    // InternalMyDsl.g:123:6: lv_classAs_6_0= ruleClassA
                    {

                    						newCompositeNode(grammarAccess.getModelAccess().getClassAsClassAParserRuleCall_4_2_0());
                    					
                    pushFollow(FOLLOW_7);
                    lv_classAs_6_0=ruleClassA();

                    state._fsp--;


                    						if (current==null) {
                    							current = createModelElementForParent(grammarAccess.getModelRule());
                    						}
                    						add(
                    							current,
                    							"classAs",
                    							lv_classAs_6_0,
                    							"org.xtext.example.mydsl.MyDsl.ClassA");
                    						afterParserOrEnumRuleCall();
                    					

                    }


                    }

                    // InternalMyDsl.g:140:4: (otherlv_7= ',' ( (lv_classAs_8_0= ruleClassA ) ) )*
                    loop1:
                    do {
                        int alt1=2;
                        int LA1_0 = input.LA(1);

                        if ( (LA1_0==14) ) {
                            alt1=1;
                        }


                        switch (alt1) {
                    	case 1 :
                    	    // InternalMyDsl.g:141:5: otherlv_7= ',' ( (lv_classAs_8_0= ruleClassA ) )
                    	    {
                    	    otherlv_7=(Token)match(input,14,FOLLOW_6); 

                    	    					newLeafNode(otherlv_7, grammarAccess.getModelAccess().getCommaKeyword_4_3_0());
                    	    				
                    	    // InternalMyDsl.g:145:5: ( (lv_classAs_8_0= ruleClassA ) )
                    	    // InternalMyDsl.g:146:6: (lv_classAs_8_0= ruleClassA )
                    	    {
                    	    // InternalMyDsl.g:146:6: (lv_classAs_8_0= ruleClassA )
                    	    // InternalMyDsl.g:147:7: lv_classAs_8_0= ruleClassA
                    	    {

                    	    							newCompositeNode(grammarAccess.getModelAccess().getClassAsClassAParserRuleCall_4_3_1_0());
                    	    						
                    	    pushFollow(FOLLOW_7);
                    	    lv_classAs_8_0=ruleClassA();

                    	    state._fsp--;


                    	    							if (current==null) {
                    	    								current = createModelElementForParent(grammarAccess.getModelRule());
                    	    							}
                    	    							add(
                    	    								current,
                    	    								"classAs",
                    	    								lv_classAs_8_0,
                    	    								"org.xtext.example.mydsl.MyDsl.ClassA");
                    	    							afterParserOrEnumRuleCall();
                    	    						

                    	    }


                    	    }


                    	    }
                    	    break;

                    	default :
                    	    break loop1;
                        }
                    } while (true);

                    otherlv_9=(Token)match(input,15,FOLLOW_8); 

                    				newLeafNode(otherlv_9, grammarAccess.getModelAccess().getRightCurlyBracketKeyword_4_4());
                    			

                    }
                    break;

            }

            otherlv_10=(Token)match(input,15,FOLLOW_2); 

            			newLeafNode(otherlv_10, grammarAccess.getModelAccess().getRightCurlyBracketKeyword_5());
            		

            }


            }


            	leaveRule();

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleModel"


    // $ANTLR start "entryRuleClassA"
    // InternalMyDsl.g:178:1: entryRuleClassA returns [EObject current=null] : iv_ruleClassA= ruleClassA EOF ;
    public final EObject entryRuleClassA() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleClassA = null;


        try {
            // InternalMyDsl.g:178:47: (iv_ruleClassA= ruleClassA EOF )
            // InternalMyDsl.g:179:2: iv_ruleClassA= ruleClassA EOF
            {
             newCompositeNode(grammarAccess.getClassARule()); 
            pushFollow(FOLLOW_1);
            iv_ruleClassA=ruleClassA();

            state._fsp--;

             current =iv_ruleClassA; 
            match(input,EOF,FOLLOW_2); 

            }

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleClassA"


    // $ANTLR start "ruleClassA"
    // InternalMyDsl.g:185:1: ruleClassA returns [EObject current=null] : ( () otherlv_1= 'ClassA' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classb' otherlv_5= '{' ( (lv_classb_6_0= ruleClassB ) ) (otherlv_7= ',' ( (lv_classb_8_0= ruleClassB ) ) )* otherlv_9= '}' )? otherlv_10= '}' ) ;
    public final EObject ruleClassA() throws RecognitionException {
        EObject current = null;

        Token otherlv_1=null;
        Token lv_name_2_0=null;
        Token otherlv_3=null;
        Token otherlv_4=null;
        Token otherlv_5=null;
        Token otherlv_7=null;
        Token otherlv_9=null;
        Token otherlv_10=null;
        EObject lv_classb_6_0 = null;

        EObject lv_classb_8_0 = null;



        	enterRule();

        try {
            // InternalMyDsl.g:191:2: ( ( () otherlv_1= 'ClassA' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classb' otherlv_5= '{' ( (lv_classb_6_0= ruleClassB ) ) (otherlv_7= ',' ( (lv_classb_8_0= ruleClassB ) ) )* otherlv_9= '}' )? otherlv_10= '}' ) )
            // InternalMyDsl.g:192:2: ( () otherlv_1= 'ClassA' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classb' otherlv_5= '{' ( (lv_classb_6_0= ruleClassB ) ) (otherlv_7= ',' ( (lv_classb_8_0= ruleClassB ) ) )* otherlv_9= '}' )? otherlv_10= '}' )
            {
            // InternalMyDsl.g:192:2: ( () otherlv_1= 'ClassA' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classb' otherlv_5= '{' ( (lv_classb_6_0= ruleClassB ) ) (otherlv_7= ',' ( (lv_classb_8_0= ruleClassB ) ) )* otherlv_9= '}' )? otherlv_10= '}' )
            // InternalMyDsl.g:193:3: () otherlv_1= 'ClassA' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= '{' (otherlv_4= 'classb' otherlv_5= '{' ( (lv_classb_6_0= ruleClassB ) ) (otherlv_7= ',' ( (lv_classb_8_0= ruleClassB ) ) )* otherlv_9= '}' )? otherlv_10= '}'
            {
            // InternalMyDsl.g:193:3: ()
            // InternalMyDsl.g:194:4: 
            {

            				current = forceCreateModelElement(
            					grammarAccess.getClassAAccess().getClassAAction_0(),
            					current);
            			

            }

            otherlv_1=(Token)match(input,16,FOLLOW_3); 

            			newLeafNode(otherlv_1, grammarAccess.getClassAAccess().getClassAKeyword_1());
            		
            // InternalMyDsl.g:204:3: ( (lv_name_2_0= RULE_ID ) )
            // InternalMyDsl.g:205:4: (lv_name_2_0= RULE_ID )
            {
            // InternalMyDsl.g:205:4: (lv_name_2_0= RULE_ID )
            // InternalMyDsl.g:206:5: lv_name_2_0= RULE_ID
            {
            lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_4); 

            					newLeafNode(lv_name_2_0, grammarAccess.getClassAAccess().getNameIDTerminalRuleCall_2_0());
            				

            					if (current==null) {
            						current = createModelElement(grammarAccess.getClassARule());
            					}
            					setWithLastConsumed(
            						current,
            						"name",
            						lv_name_2_0,
            						"org.eclipse.xtext.common.Terminals.ID");
            				

            }


            }

            otherlv_3=(Token)match(input,12,FOLLOW_9); 

            			newLeafNode(otherlv_3, grammarAccess.getClassAAccess().getLeftCurlyBracketKeyword_3());
            		
            // InternalMyDsl.g:226:3: (otherlv_4= 'classb' otherlv_5= '{' ( (lv_classb_6_0= ruleClassB ) ) (otherlv_7= ',' ( (lv_classb_8_0= ruleClassB ) ) )* otherlv_9= '}' )?
            int alt4=2;
            int LA4_0 = input.LA(1);

            if ( (LA4_0==17) ) {
                alt4=1;
            }
            switch (alt4) {
                case 1 :
                    // InternalMyDsl.g:227:4: otherlv_4= 'classb' otherlv_5= '{' ( (lv_classb_6_0= ruleClassB ) ) (otherlv_7= ',' ( (lv_classb_8_0= ruleClassB ) ) )* otherlv_9= '}'
                    {
                    otherlv_4=(Token)match(input,17,FOLLOW_4); 

                    				newLeafNode(otherlv_4, grammarAccess.getClassAAccess().getClassbKeyword_4_0());
                    			
                    otherlv_5=(Token)match(input,12,FOLLOW_10); 

                    				newLeafNode(otherlv_5, grammarAccess.getClassAAccess().getLeftCurlyBracketKeyword_4_1());
                    			
                    // InternalMyDsl.g:235:4: ( (lv_classb_6_0= ruleClassB ) )
                    // InternalMyDsl.g:236:5: (lv_classb_6_0= ruleClassB )
                    {
                    // InternalMyDsl.g:236:5: (lv_classb_6_0= ruleClassB )
                    // InternalMyDsl.g:237:6: lv_classb_6_0= ruleClassB
                    {

                    						newCompositeNode(grammarAccess.getClassAAccess().getClassbClassBParserRuleCall_4_2_0());
                    					
                    pushFollow(FOLLOW_7);
                    lv_classb_6_0=ruleClassB();

                    state._fsp--;


                    						if (current==null) {
                    							current = createModelElementForParent(grammarAccess.getClassARule());
                    						}
                    						add(
                    							current,
                    							"classb",
                    							lv_classb_6_0,
                    							"org.xtext.example.mydsl.MyDsl.ClassB");
                    						afterParserOrEnumRuleCall();
                    					

                    }


                    }

                    // InternalMyDsl.g:254:4: (otherlv_7= ',' ( (lv_classb_8_0= ruleClassB ) ) )*
                    loop3:
                    do {
                        int alt3=2;
                        int LA3_0 = input.LA(1);

                        if ( (LA3_0==14) ) {
                            alt3=1;
                        }


                        switch (alt3) {
                    	case 1 :
                    	    // InternalMyDsl.g:255:5: otherlv_7= ',' ( (lv_classb_8_0= ruleClassB ) )
                    	    {
                    	    otherlv_7=(Token)match(input,14,FOLLOW_10); 

                    	    					newLeafNode(otherlv_7, grammarAccess.getClassAAccess().getCommaKeyword_4_3_0());
                    	    				
                    	    // InternalMyDsl.g:259:5: ( (lv_classb_8_0= ruleClassB ) )
                    	    // InternalMyDsl.g:260:6: (lv_classb_8_0= ruleClassB )
                    	    {
                    	    // InternalMyDsl.g:260:6: (lv_classb_8_0= ruleClassB )
                    	    // InternalMyDsl.g:261:7: lv_classb_8_0= ruleClassB
                    	    {

                    	    							newCompositeNode(grammarAccess.getClassAAccess().getClassbClassBParserRuleCall_4_3_1_0());
                    	    						
                    	    pushFollow(FOLLOW_7);
                    	    lv_classb_8_0=ruleClassB();

                    	    state._fsp--;


                    	    							if (current==null) {
                    	    								current = createModelElementForParent(grammarAccess.getClassARule());
                    	    							}
                    	    							add(
                    	    								current,
                    	    								"classb",
                    	    								lv_classb_8_0,
                    	    								"org.xtext.example.mydsl.MyDsl.ClassB");
                    	    							afterParserOrEnumRuleCall();
                    	    						

                    	    }


                    	    }


                    	    }
                    	    break;

                    	default :
                    	    break loop3;
                        }
                    } while (true);

                    otherlv_9=(Token)match(input,15,FOLLOW_8); 

                    				newLeafNode(otherlv_9, grammarAccess.getClassAAccess().getRightCurlyBracketKeyword_4_4());
                    			

                    }
                    break;

            }

            otherlv_10=(Token)match(input,15,FOLLOW_2); 

            			newLeafNode(otherlv_10, grammarAccess.getClassAAccess().getRightCurlyBracketKeyword_5());
            		

            }


            }


            	leaveRule();

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleClassA"


    // $ANTLR start "entryRuleClassB"
    // InternalMyDsl.g:292:1: entryRuleClassB returns [EObject current=null] : iv_ruleClassB= ruleClassB EOF ;
    public final EObject entryRuleClassB() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleClassB = null;


        try {
            // InternalMyDsl.g:292:47: (iv_ruleClassB= ruleClassB EOF )
            // InternalMyDsl.g:293:2: iv_ruleClassB= ruleClassB EOF
            {
             newCompositeNode(grammarAccess.getClassBRule()); 
            pushFollow(FOLLOW_1);
            iv_ruleClassB=ruleClassB();

            state._fsp--;

             current =iv_ruleClassB; 
            match(input,EOF,FOLLOW_2); 

            }

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleClassB"


    // $ANTLR start "ruleClassB"
    // InternalMyDsl.g:299:1: ruleClassB returns [EObject current=null] : (otherlv_0= 'ClassB' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' otherlv_3= 'target' ( (otherlv_4= RULE_ID ) ) otherlv_5= '}' ) ;
    public final EObject ruleClassB() throws RecognitionException {
        EObject current = null;

        Token otherlv_0=null;
        Token lv_name_1_0=null;
        Token otherlv_2=null;
        Token otherlv_3=null;
        Token otherlv_4=null;
        Token otherlv_5=null;


        	enterRule();

        try {
            // InternalMyDsl.g:305:2: ( (otherlv_0= 'ClassB' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' otherlv_3= 'target' ( (otherlv_4= RULE_ID ) ) otherlv_5= '}' ) )
            // InternalMyDsl.g:306:2: (otherlv_0= 'ClassB' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' otherlv_3= 'target' ( (otherlv_4= RULE_ID ) ) otherlv_5= '}' )
            {
            // InternalMyDsl.g:306:2: (otherlv_0= 'ClassB' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' otherlv_3= 'target' ( (otherlv_4= RULE_ID ) ) otherlv_5= '}' )
            // InternalMyDsl.g:307:3: otherlv_0= 'ClassB' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' otherlv_3= 'target' ( (otherlv_4= RULE_ID ) ) otherlv_5= '}'
            {
            otherlv_0=(Token)match(input,18,FOLLOW_3); 

            			newLeafNode(otherlv_0, grammarAccess.getClassBAccess().getClassBKeyword_0());
            		
            // InternalMyDsl.g:311:3: ( (lv_name_1_0= RULE_ID ) )
            // InternalMyDsl.g:312:4: (lv_name_1_0= RULE_ID )
            {
            // InternalMyDsl.g:312:4: (lv_name_1_0= RULE_ID )
            // InternalMyDsl.g:313:5: lv_name_1_0= RULE_ID
            {
            lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_4); 

            					newLeafNode(lv_name_1_0, grammarAccess.getClassBAccess().getNameIDTerminalRuleCall_1_0());
            				

            					if (current==null) {
            						current = createModelElement(grammarAccess.getClassBRule());
            					}
            					setWithLastConsumed(
            						current,
            						"name",
            						lv_name_1_0,
            						"org.eclipse.xtext.common.Terminals.ID");
            				

            }


            }

            otherlv_2=(Token)match(input,12,FOLLOW_11); 

            			newLeafNode(otherlv_2, grammarAccess.getClassBAccess().getLeftCurlyBracketKeyword_2());
            		
            otherlv_3=(Token)match(input,19,FOLLOW_3); 

            			newLeafNode(otherlv_3, grammarAccess.getClassBAccess().getTargetKeyword_3());
            		
            // InternalMyDsl.g:337:3: ( (otherlv_4= RULE_ID ) )
            // InternalMyDsl.g:338:4: (otherlv_4= RULE_ID )
            {
            // InternalMyDsl.g:338:4: (otherlv_4= RULE_ID )
            // InternalMyDsl.g:339:5: otherlv_4= RULE_ID
            {

            					if (current==null) {
            						current = createModelElement(grammarAccess.getClassBRule());
            					}
            				
            otherlv_4=(Token)match(input,RULE_ID,FOLLOW_8); 

            					newLeafNode(otherlv_4, grammarAccess.getClassBAccess().getTargetClassACrossReference_4_0());
            				

            }


            }

            otherlv_5=(Token)match(input,15,FOLLOW_2); 

            			newLeafNode(otherlv_5, grammarAccess.getClassBAccess().getRightCurlyBracketKeyword_5());
            		

            }


            }


            	leaveRule();

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleClassB"

    // Delegated rules


 

    public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x000000000000A000L});
    public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x000000000000C000L});
    public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x0000000000028000L});
    public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x0000000000080000L});

}