Search in sources :

Example 6 with Enumerator

use of org.eclipse.emf.common.util.Enumerator in project mechanoid by robotoworks.

the class InternalOpServiceModelParser method ruleOperationArg.

// $ANTLR end "entryRuleOperationArg"
// $ANTLR start "ruleOperationArg"
// ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:316:1: ruleOperationArg returns [EObject current=null] : ( ( (lv_type_0_0= ruleOpArgType ) ) ( (lv_name_1_0= RULE_ID ) ) ) ;
public final EObject ruleOperationArg() throws RecognitionException {
    EObject current = null;
    Token lv_name_1_0 = null;
    Enumerator lv_type_0_0 = null;
    enterRule();
    try {
        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:319:28: ( ( ( (lv_type_0_0= ruleOpArgType ) ) ( (lv_name_1_0= RULE_ID ) ) ) )
        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:320:1: ( ( (lv_type_0_0= ruleOpArgType ) ) ( (lv_name_1_0= RULE_ID ) ) )
        {
            // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:320:1: ( ( (lv_type_0_0= ruleOpArgType ) ) ( (lv_name_1_0= RULE_ID ) ) )
            // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:320:2: ( (lv_type_0_0= ruleOpArgType ) ) ( (lv_name_1_0= RULE_ID ) )
            {
                // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:320:2: ( (lv_type_0_0= ruleOpArgType ) )
                // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:321:1: (lv_type_0_0= ruleOpArgType )
                {
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:321:1: (lv_type_0_0= ruleOpArgType )
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:322:3: lv_type_0_0= ruleOpArgType
                    {
                        newCompositeNode(grammarAccess.getOperationArgAccess().getTypeOpArgTypeEnumRuleCall_0_0());
                        pushFollow(FOLLOW_ruleOpArgType_in_ruleOperationArg618);
                        lv_type_0_0 = ruleOpArgType();
                        state._fsp--;
                        if (current == null) {
                            current = createModelElementForParent(grammarAccess.getOperationArgRule());
                        }
                        set(current, "type", lv_type_0_0, "OpArgType");
                        afterParserOrEnumRuleCall();
                    }
                }
                // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:338:2: ( (lv_name_1_0= RULE_ID ) )
                // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:339:1: (lv_name_1_0= RULE_ID )
                {
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:339:1: (lv_name_1_0= RULE_ID )
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:340:3: lv_name_1_0= RULE_ID
                    {
                        lv_name_1_0 = (Token) match(input, RULE_ID, FOLLOW_RULE_ID_in_ruleOperationArg635);
                        newLeafNode(lv_name_1_0, grammarAccess.getOperationArgAccess().getNameIDTerminalRuleCall_1_0());
                        if (current == null) {
                            current = createModelElement(grammarAccess.getOperationArgRule());
                        }
                        setWithLastConsumed(current, "name", lv_name_1_0, "ID");
                    }
                }
            }
        }
        leaveRule();
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : Enumerator(org.eclipse.emf.common.util.Enumerator) EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 7 with Enumerator

use of org.eclipse.emf.common.util.Enumerator in project mechanoid by robotoworks.

the class InternalOpServiceModelParser method ruleOpArgType.

// $ANTLR end "ruleQualifiedName"
// $ANTLR start "ruleOpArgType"
// ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:489:1: ruleOpArgType returns [Enumerator current=null] : ( (enumLiteral_0= 'boolean' ) | (enumLiteral_1= 'String' ) | (enumLiteral_2= 'int' ) | (enumLiteral_3= 'float' ) | (enumLiteral_4= 'double' ) | (enumLiteral_5= 'long' ) | (enumLiteral_6= 'Parcelable' ) ) ;
public final Enumerator ruleOpArgType() throws RecognitionException {
    Enumerator current = null;
    Token enumLiteral_0 = null;
    Token enumLiteral_1 = null;
    Token enumLiteral_2 = null;
    Token enumLiteral_3 = null;
    Token enumLiteral_4 = null;
    Token enumLiteral_5 = null;
    Token enumLiteral_6 = null;
    enterRule();
    try {
        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:491:28: ( ( (enumLiteral_0= 'boolean' ) | (enumLiteral_1= 'String' ) | (enumLiteral_2= 'int' ) | (enumLiteral_3= 'float' ) | (enumLiteral_4= 'double' ) | (enumLiteral_5= 'long' ) | (enumLiteral_6= 'Parcelable' ) ) )
        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:492:1: ( (enumLiteral_0= 'boolean' ) | (enumLiteral_1= 'String' ) | (enumLiteral_2= 'int' ) | (enumLiteral_3= 'float' ) | (enumLiteral_4= 'double' ) | (enumLiteral_5= 'long' ) | (enumLiteral_6= 'Parcelable' ) )
        {
            // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:492:1: ( (enumLiteral_0= 'boolean' ) | (enumLiteral_1= 'String' ) | (enumLiteral_2= 'int' ) | (enumLiteral_3= 'float' ) | (enumLiteral_4= 'double' ) | (enumLiteral_5= 'long' ) | (enumLiteral_6= 'Parcelable' ) )
            int alt8 = 7;
            switch(input.LA(1)) {
                case 22:
                    {
                        alt8 = 1;
                    }
                    break;
                case 23:
                    {
                        alt8 = 2;
                    }
                    break;
                case 24:
                    {
                        alt8 = 3;
                    }
                    break;
                case 25:
                    {
                        alt8 = 4;
                    }
                    break;
                case 26:
                    {
                        alt8 = 5;
                    }
                    break;
                case 27:
                    {
                        alt8 = 6;
                    }
                    break;
                case 28:
                    {
                        alt8 = 7;
                    }
                    break;
                default:
                    NoViableAltException nvae = new NoViableAltException("", 8, 0, input);
                    throw nvae;
            }
            switch(alt8) {
                case 1:
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:492:2: (enumLiteral_0= 'boolean' )
                    {
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:492:2: (enumLiteral_0= 'boolean' )
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:492:4: enumLiteral_0= 'boolean'
                        {
                            enumLiteral_0 = (Token) match(input, 22, FOLLOW_22_in_ruleOpArgType1037);
                            current = grammarAccess.getOpArgTypeAccess().getBooleanEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
                            newLeafNode(enumLiteral_0, grammarAccess.getOpArgTypeAccess().getBooleanEnumLiteralDeclaration_0());
                        }
                    }
                    break;
                case 2:
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:498:6: (enumLiteral_1= 'String' )
                    {
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:498:6: (enumLiteral_1= 'String' )
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:498:8: enumLiteral_1= 'String'
                        {
                            enumLiteral_1 = (Token) match(input, 23, FOLLOW_23_in_ruleOpArgType1054);
                            current = grammarAccess.getOpArgTypeAccess().getStringEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
                            newLeafNode(enumLiteral_1, grammarAccess.getOpArgTypeAccess().getStringEnumLiteralDeclaration_1());
                        }
                    }
                    break;
                case 3:
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:504:6: (enumLiteral_2= 'int' )
                    {
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:504:6: (enumLiteral_2= 'int' )
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:504:8: enumLiteral_2= 'int'
                        {
                            enumLiteral_2 = (Token) match(input, 24, FOLLOW_24_in_ruleOpArgType1071);
                            current = grammarAccess.getOpArgTypeAccess().getIntegerEnumLiteralDeclaration_2().getEnumLiteral().getInstance();
                            newLeafNode(enumLiteral_2, grammarAccess.getOpArgTypeAccess().getIntegerEnumLiteralDeclaration_2());
                        }
                    }
                    break;
                case 4:
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:510:6: (enumLiteral_3= 'float' )
                    {
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:510:6: (enumLiteral_3= 'float' )
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:510:8: enumLiteral_3= 'float'
                        {
                            enumLiteral_3 = (Token) match(input, 25, FOLLOW_25_in_ruleOpArgType1088);
                            current = grammarAccess.getOpArgTypeAccess().getFloatEnumLiteralDeclaration_3().getEnumLiteral().getInstance();
                            newLeafNode(enumLiteral_3, grammarAccess.getOpArgTypeAccess().getFloatEnumLiteralDeclaration_3());
                        }
                    }
                    break;
                case 5:
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:516:6: (enumLiteral_4= 'double' )
                    {
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:516:6: (enumLiteral_4= 'double' )
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:516:8: enumLiteral_4= 'double'
                        {
                            enumLiteral_4 = (Token) match(input, 26, FOLLOW_26_in_ruleOpArgType1105);
                            current = grammarAccess.getOpArgTypeAccess().getDoubleEnumLiteralDeclaration_4().getEnumLiteral().getInstance();
                            newLeafNode(enumLiteral_4, grammarAccess.getOpArgTypeAccess().getDoubleEnumLiteralDeclaration_4());
                        }
                    }
                    break;
                case 6:
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:522:6: (enumLiteral_5= 'long' )
                    {
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:522:6: (enumLiteral_5= 'long' )
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:522:8: enumLiteral_5= 'long'
                        {
                            enumLiteral_5 = (Token) match(input, 27, FOLLOW_27_in_ruleOpArgType1122);
                            current = grammarAccess.getOpArgTypeAccess().getLongEnumLiteralDeclaration_5().getEnumLiteral().getInstance();
                            newLeafNode(enumLiteral_5, grammarAccess.getOpArgTypeAccess().getLongEnumLiteralDeclaration_5());
                        }
                    }
                    break;
                case 7:
                    // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:528:6: (enumLiteral_6= 'Parcelable' )
                    {
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:528:6: (enumLiteral_6= 'Parcelable' )
                        // ../com.robotoworks.mechanoid.ops/src-gen/com/robotoworks/mechanoid/ops/parser/antlr/internal/InternalOpServiceModel.g:528:8: enumLiteral_6= 'Parcelable'
                        {
                            enumLiteral_6 = (Token) match(input, 28, FOLLOW_28_in_ruleOpArgType1139);
                            current = grammarAccess.getOpArgTypeAccess().getParcelableEnumLiteralDeclaration_6().getEnumLiteral().getInstance();
                            newLeafNode(enumLiteral_6, grammarAccess.getOpArgTypeAccess().getParcelableEnumLiteralDeclaration_6());
                        }
                    }
                    break;
            }
        }
        leaveRule();
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : Enumerator(org.eclipse.emf.common.util.Enumerator) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 8 with Enumerator

use of org.eclipse.emf.common.util.Enumerator in project mechanoid by robotoworks.

the class InternalSharedPreferencesModelParser method ruleLiteral.

// $ANTLR end "entryRuleLiteral"
// $ANTLR start "ruleLiteral"
// ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:290:1: ruleLiteral returns [EObject current=null] : ( ( () ( (lv_literal_1_0= ruleBooleanValue ) ) ) | ( () ( (lv_literal_3_0= RULE_STRING ) ) ) | ( () ( (lv_literal_5_0= ruleSignedNumber ) ) ) ) ;
public final EObject ruleLiteral() throws RecognitionException {
    EObject current = null;
    Token lv_literal_3_0 = null;
    Enumerator lv_literal_1_0 = null;
    AntlrDatatypeRuleToken lv_literal_5_0 = null;
    enterRule();
    try {
        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:293:28: ( ( ( () ( (lv_literal_1_0= ruleBooleanValue ) ) ) | ( () ( (lv_literal_3_0= RULE_STRING ) ) ) | ( () ( (lv_literal_5_0= ruleSignedNumber ) ) ) ) )
        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:294:1: ( ( () ( (lv_literal_1_0= ruleBooleanValue ) ) ) | ( () ( (lv_literal_3_0= RULE_STRING ) ) ) | ( () ( (lv_literal_5_0= ruleSignedNumber ) ) ) )
        {
            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:294:1: ( ( () ( (lv_literal_1_0= ruleBooleanValue ) ) ) | ( () ( (lv_literal_3_0= RULE_STRING ) ) ) | ( () ( (lv_literal_5_0= ruleSignedNumber ) ) ) )
            int alt3 = 3;
            switch(input.LA(1)) {
                case 25:
                case 26:
                    {
                        alt3 = 1;
                    }
                    break;
                case RULE_STRING:
                    {
                        alt3 = 2;
                    }
                    break;
                case RULE_NUMBER:
                case 18:
                    {
                        alt3 = 3;
                    }
                    break;
                default:
                    if (state.backtracking > 0) {
                        state.failed = true;
                        return current;
                    }
                    NoViableAltException nvae = new NoViableAltException("", 3, 0, input);
                    throw nvae;
            }
            switch(alt3) {
                case 1:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:294:2: ( () ( (lv_literal_1_0= ruleBooleanValue ) ) )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:294:2: ( () ( (lv_literal_1_0= ruleBooleanValue ) ) )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:294:3: () ( (lv_literal_1_0= ruleBooleanValue ) )
                        {
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:294:3: ()
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:295:5: 
                            {
                                if (state.backtracking == 0) {
                                    current = forceCreateModelElement(grammarAccess.getLiteralAccess().getBooleanLiteralAction_0_0(), current);
                                }
                            }
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:300:2: ( (lv_literal_1_0= ruleBooleanValue ) )
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:301:1: (lv_literal_1_0= ruleBooleanValue )
                            {
                                // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:301:1: (lv_literal_1_0= ruleBooleanValue )
                                // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:302:3: lv_literal_1_0= ruleBooleanValue
                                {
                                    if (state.backtracking == 0) {
                                        newCompositeNode(grammarAccess.getLiteralAccess().getLiteralBooleanValueEnumRuleCall_0_1_0());
                                    }
                                    pushFollow(FOLLOW_ruleBooleanValue_in_ruleLiteral579);
                                    lv_literal_1_0 = ruleBooleanValue();
                                    state._fsp--;
                                    if (state.failed)
                                        return current;
                                    if (state.backtracking == 0) {
                                        if (current == null) {
                                            current = createModelElementForParent(grammarAccess.getLiteralRule());
                                        }
                                        set(current, "literal", lv_literal_1_0, "BooleanValue");
                                        afterParserOrEnumRuleCall();
                                    }
                                }
                            }
                        }
                    }
                    break;
                case 2:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:319:6: ( () ( (lv_literal_3_0= RULE_STRING ) ) )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:319:6: ( () ( (lv_literal_3_0= RULE_STRING ) ) )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:319:7: () ( (lv_literal_3_0= RULE_STRING ) )
                        {
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:319:7: ()
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:320:5: 
                            {
                                if (state.backtracking == 0) {
                                    current = forceCreateModelElement(grammarAccess.getLiteralAccess().getStringLiteralAction_1_0(), current);
                                }
                            }
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:325:2: ( (lv_literal_3_0= RULE_STRING ) )
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:326:1: (lv_literal_3_0= RULE_STRING )
                            {
                                // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:326:1: (lv_literal_3_0= RULE_STRING )
                                // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:327:3: lv_literal_3_0= RULE_STRING
                                {
                                    lv_literal_3_0 = (Token) match(input, RULE_STRING, FOLLOW_RULE_STRING_in_ruleLiteral613);
                                    if (state.failed)
                                        return current;
                                    if (state.backtracking == 0) {
                                        newLeafNode(lv_literal_3_0, grammarAccess.getLiteralAccess().getLiteralSTRINGTerminalRuleCall_1_1_0());
                                    }
                                    if (state.backtracking == 0) {
                                        if (current == null) {
                                            current = createModelElement(grammarAccess.getLiteralRule());
                                        }
                                        setWithLastConsumed(current, "literal", lv_literal_3_0, "STRING");
                                    }
                                }
                            }
                        }
                    }
                    break;
                case 3:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:344:6: ( () ( (lv_literal_5_0= ruleSignedNumber ) ) )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:344:6: ( () ( (lv_literal_5_0= ruleSignedNumber ) ) )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:344:7: () ( (lv_literal_5_0= ruleSignedNumber ) )
                        {
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:344:7: ()
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:345:5: 
                            {
                                if (state.backtracking == 0) {
                                    current = forceCreateModelElement(grammarAccess.getLiteralAccess().getNumericLiteralAction_2_0(), current);
                                }
                            }
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:350:2: ( (lv_literal_5_0= ruleSignedNumber ) )
                            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:351:1: (lv_literal_5_0= ruleSignedNumber )
                            {
                                // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:351:1: (lv_literal_5_0= ruleSignedNumber )
                                // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:352:3: lv_literal_5_0= ruleSignedNumber
                                {
                                    if (state.backtracking == 0) {
                                        newCompositeNode(grammarAccess.getLiteralAccess().getLiteralSignedNumberParserRuleCall_2_1_0());
                                    }
                                    pushFollow(FOLLOW_ruleSignedNumber_in_ruleLiteral656);
                                    lv_literal_5_0 = ruleSignedNumber();
                                    state._fsp--;
                                    if (state.failed)
                                        return current;
                                    if (state.backtracking == 0) {
                                        if (current == null) {
                                            current = createModelElementForParent(grammarAccess.getLiteralRule());
                                        }
                                        set(current, "literal", lv_literal_5_0, "SignedNumber");
                                        afterParserOrEnumRuleCall();
                                    }
                                }
                            }
                        }
                    }
                    break;
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : Enumerator(org.eclipse.emf.common.util.Enumerator) EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 9 with Enumerator

use of org.eclipse.emf.common.util.Enumerator in project mechanoid by robotoworks.

the class InternalSharedPreferencesModelParser method rulePreferenceType.

// $ANTLR end "ruleFQN"
// $ANTLR start "rulePreferenceType"
// ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:453:1: rulePreferenceType returns [Enumerator current=null] : ( (enumLiteral_0= 'String' ) | (enumLiteral_1= 'int' ) | (enumLiteral_2= 'boolean' ) | (enumLiteral_3= 'float' ) | (enumLiteral_4= 'long' ) ) ;
public final Enumerator rulePreferenceType() throws RecognitionException {
    Enumerator current = null;
    Token enumLiteral_0 = null;
    Token enumLiteral_1 = null;
    Token enumLiteral_2 = null;
    Token enumLiteral_3 = null;
    Token enumLiteral_4 = null;
    enterRule();
    try {
        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:455:28: ( ( (enumLiteral_0= 'String' ) | (enumLiteral_1= 'int' ) | (enumLiteral_2= 'boolean' ) | (enumLiteral_3= 'float' ) | (enumLiteral_4= 'long' ) ) )
        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:456:1: ( (enumLiteral_0= 'String' ) | (enumLiteral_1= 'int' ) | (enumLiteral_2= 'boolean' ) | (enumLiteral_3= 'float' ) | (enumLiteral_4= 'long' ) )
        {
            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:456:1: ( (enumLiteral_0= 'String' ) | (enumLiteral_1= 'int' ) | (enumLiteral_2= 'boolean' ) | (enumLiteral_3= 'float' ) | (enumLiteral_4= 'long' ) )
            int alt6 = 5;
            switch(input.LA(1)) {
                case 20:
                    {
                        alt6 = 1;
                    }
                    break;
                case 21:
                    {
                        alt6 = 2;
                    }
                    break;
                case 22:
                    {
                        alt6 = 3;
                    }
                    break;
                case 23:
                    {
                        alt6 = 4;
                    }
                    break;
                case 24:
                    {
                        alt6 = 5;
                    }
                    break;
                default:
                    if (state.backtracking > 0) {
                        state.failed = true;
                        return current;
                    }
                    NoViableAltException nvae = new NoViableAltException("", 6, 0, input);
                    throw nvae;
            }
            switch(alt6) {
                case 1:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:456:2: (enumLiteral_0= 'String' )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:456:2: (enumLiteral_0= 'String' )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:456:4: enumLiteral_0= 'String'
                        {
                            enumLiteral_0 = (Token) match(input, 20, FOLLOW_20_in_rulePreferenceType963);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current = grammarAccess.getPreferenceTypeAccess().getStringEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
                                newLeafNode(enumLiteral_0, grammarAccess.getPreferenceTypeAccess().getStringEnumLiteralDeclaration_0());
                            }
                        }
                    }
                    break;
                case 2:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:462:6: (enumLiteral_1= 'int' )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:462:6: (enumLiteral_1= 'int' )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:462:8: enumLiteral_1= 'int'
                        {
                            enumLiteral_1 = (Token) match(input, 21, FOLLOW_21_in_rulePreferenceType980);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current = grammarAccess.getPreferenceTypeAccess().getIntegerEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
                                newLeafNode(enumLiteral_1, grammarAccess.getPreferenceTypeAccess().getIntegerEnumLiteralDeclaration_1());
                            }
                        }
                    }
                    break;
                case 3:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:468:6: (enumLiteral_2= 'boolean' )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:468:6: (enumLiteral_2= 'boolean' )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:468:8: enumLiteral_2= 'boolean'
                        {
                            enumLiteral_2 = (Token) match(input, 22, FOLLOW_22_in_rulePreferenceType997);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current = grammarAccess.getPreferenceTypeAccess().getBooleanEnumLiteralDeclaration_2().getEnumLiteral().getInstance();
                                newLeafNode(enumLiteral_2, grammarAccess.getPreferenceTypeAccess().getBooleanEnumLiteralDeclaration_2());
                            }
                        }
                    }
                    break;
                case 4:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:474:6: (enumLiteral_3= 'float' )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:474:6: (enumLiteral_3= 'float' )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:474:8: enumLiteral_3= 'float'
                        {
                            enumLiteral_3 = (Token) match(input, 23, FOLLOW_23_in_rulePreferenceType1014);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current = grammarAccess.getPreferenceTypeAccess().getFloatEnumLiteralDeclaration_3().getEnumLiteral().getInstance();
                                newLeafNode(enumLiteral_3, grammarAccess.getPreferenceTypeAccess().getFloatEnumLiteralDeclaration_3());
                            }
                        }
                    }
                    break;
                case 5:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:480:6: (enumLiteral_4= 'long' )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:480:6: (enumLiteral_4= 'long' )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:480:8: enumLiteral_4= 'long'
                        {
                            enumLiteral_4 = (Token) match(input, 24, FOLLOW_24_in_rulePreferenceType1031);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current = grammarAccess.getPreferenceTypeAccess().getLongEnumLiteralDeclaration_4().getEnumLiteral().getInstance();
                                newLeafNode(enumLiteral_4, grammarAccess.getPreferenceTypeAccess().getLongEnumLiteralDeclaration_4());
                            }
                        }
                    }
                    break;
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : Enumerator(org.eclipse.emf.common.util.Enumerator) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Example 10 with Enumerator

use of org.eclipse.emf.common.util.Enumerator in project mechanoid by robotoworks.

the class InternalSharedPreferencesModelParser method ruleBooleanValue.

// $ANTLR end "rulePreferenceType"
// $ANTLR start "ruleBooleanValue"
// ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:490:1: ruleBooleanValue returns [Enumerator current=null] : ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) ) ;
public final Enumerator ruleBooleanValue() throws RecognitionException {
    Enumerator current = null;
    Token enumLiteral_0 = null;
    Token enumLiteral_1 = null;
    enterRule();
    try {
        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:492:28: ( ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) ) )
        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:493:1: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) )
        {
            // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:493:1: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) )
            int alt7 = 2;
            int LA7_0 = input.LA(1);
            if ((LA7_0 == 25)) {
                alt7 = 1;
            } else if ((LA7_0 == 26)) {
                alt7 = 2;
            } else {
                if (state.backtracking > 0) {
                    state.failed = true;
                    return current;
                }
                NoViableAltException nvae = new NoViableAltException("", 7, 0, input);
                throw nvae;
            }
            switch(alt7) {
                case 1:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:493:2: (enumLiteral_0= 'true' )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:493:2: (enumLiteral_0= 'true' )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:493:4: enumLiteral_0= 'true'
                        {
                            enumLiteral_0 = (Token) match(input, 25, FOLLOW_25_in_ruleBooleanValue1076);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current = grammarAccess.getBooleanValueAccess().getTrueEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
                                newLeafNode(enumLiteral_0, grammarAccess.getBooleanValueAccess().getTrueEnumLiteralDeclaration_0());
                            }
                        }
                    }
                    break;
                case 2:
                    // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:499:6: (enumLiteral_1= 'false' )
                    {
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:499:6: (enumLiteral_1= 'false' )
                        // ../com.robotoworks.mechanoid.sharedprefs/src-gen/com/robotoworks/mechanoid/sharedprefs/parser/antlr/internal/InternalSharedPreferencesModel.g:499:8: enumLiteral_1= 'false'
                        {
                            enumLiteral_1 = (Token) match(input, 26, FOLLOW_26_in_ruleBooleanValue1093);
                            if (state.failed)
                                return current;
                            if (state.backtracking == 0) {
                                current = grammarAccess.getBooleanValueAccess().getFalseEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
                                newLeafNode(enumLiteral_1, grammarAccess.getBooleanValueAccess().getFalseEnumLiteralDeclaration_1());
                            }
                        }
                    }
                    break;
            }
        }
        if (state.backtracking == 0) {
            leaveRule();
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : Enumerator(org.eclipse.emf.common.util.Enumerator) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)

Aggregations

Enumerator (org.eclipse.emf.common.util.Enumerator)29 AntlrDatatypeRuleToken (org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)28 EObject (org.eclipse.emf.ecore.EObject)16