Search in sources :

Example 16 with ValueConverterException

use of org.eclipse.xtext.conversion.ValueConverterException in project applause by applause.

the class InternalApplauseDslParser method ruleExternalOpen.

// $ANTLR end entryRuleExternalOpen
// $ANTLR start ruleExternalOpen
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:3172:1: ruleExternalOpen returns [EObject current=null] : ( (lv_url_0_0= ruleScalarExpression ) ) ;
public final EObject ruleExternalOpen() throws RecognitionException {
    EObject current = null;
    EObject lv_url_0_0 = null;
    EObject temp = null;
    setCurrentLookahead();
    resetLookahead();
    try {
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:3177:6: ( ( (lv_url_0_0= ruleScalarExpression ) ) )
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:3178:1: ( (lv_url_0_0= ruleScalarExpression ) )
        {
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:3178:1: ( (lv_url_0_0= ruleScalarExpression ) )
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:3179:1: (lv_url_0_0= ruleScalarExpression )
            {
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:3179:1: (lv_url_0_0= ruleScalarExpression )
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:3180:3: lv_url_0_0= ruleScalarExpression
                {
                    currentNode = createCompositeNode(grammarAccess.getExternalOpenAccess().getUrlScalarExpressionParserRuleCall_0(), currentNode);
                    pushFollow(FOLLOW_ruleScalarExpression_in_ruleExternalOpen5619);
                    lv_url_0_0 = ruleScalarExpression();
                    _fsp--;
                    if (current == null) {
                        current = factory.create(grammarAccess.getExternalOpenRule().getType().getClassifier());
                        associateNodeWithAstElement(currentNode.getParent(), current);
                    }
                    try {
                        set(current, "url", lv_url_0_0, "ScalarExpression", currentNode);
                    } catch (ValueConverterException vce) {
                        handleValueConverterException(vce);
                    }
                    currentNode = currentNode.getParent();
                }
            }
        }
        resetLookahead();
        lastConsumedNode = currentNode;
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) ValueConverterException(org.eclipse.xtext.conversion.ValueConverterException)

Example 17 with ValueConverterException

use of org.eclipse.xtext.conversion.ValueConverterException in project applause by applause.

the class InternalApplauseDslParser method ruleCollectionFunction.

// $ANTLR end entryRuleCollectionFunction
// $ANTLR start ruleCollectionFunction
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1025:1: ruleCollectionFunction returns [EObject current=null] : ( () 'split(' ( (lv_value_2_0= ruleScalarExpression ) ) ',' ( (lv_delimiter_4_0= ruleScalarExpression ) ) ')' ) ;
public final EObject ruleCollectionFunction() throws RecognitionException {
    EObject current = null;
    EObject lv_value_2_0 = null;
    EObject lv_delimiter_4_0 = null;
    EObject temp = null;
    setCurrentLookahead();
    resetLookahead();
    try {
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1030:6: ( ( () 'split(' ( (lv_value_2_0= ruleScalarExpression ) ) ',' ( (lv_delimiter_4_0= ruleScalarExpression ) ) ')' ) )
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1031:1: ( () 'split(' ( (lv_value_2_0= ruleScalarExpression ) ) ',' ( (lv_delimiter_4_0= ruleScalarExpression ) ) ')' )
        {
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1031:1: ( () 'split(' ( (lv_value_2_0= ruleScalarExpression ) ) ',' ( (lv_delimiter_4_0= ruleScalarExpression ) ) ')' )
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1031:2: () 'split(' ( (lv_value_2_0= ruleScalarExpression ) ) ',' ( (lv_delimiter_4_0= ruleScalarExpression ) ) ')'
            {
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1031:2: ()
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1032:5:
                {
                    temp = factory.create(grammarAccess.getCollectionFunctionAccess().getStringSplitAction_0().getType().getClassifier());
                    current = temp;
                    temp = null;
                    CompositeNode newNode = createCompositeNode(grammarAccess.getCollectionFunctionAccess().getStringSplitAction_0(), currentNode.getParent());
                    newNode.getChildren().add(currentNode);
                    moveLookaheadInfo(currentNode, newNode);
                    currentNode = newNode;
                    associateNodeWithAstElement(currentNode, current);
                }
                match(input, 20, FOLLOW_20_in_ruleCollectionFunction2006);
                createLeafNode(grammarAccess.getCollectionFunctionAccess().getSplitKeyword_1(), null);
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1046:1: ( (lv_value_2_0= ruleScalarExpression ) )
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1047:1: (lv_value_2_0= ruleScalarExpression )
                {
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1047:1: (lv_value_2_0= ruleScalarExpression )
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1048:3: lv_value_2_0= ruleScalarExpression
                    {
                        currentNode = createCompositeNode(grammarAccess.getCollectionFunctionAccess().getValueScalarExpressionParserRuleCall_2_0(), currentNode);
                        pushFollow(FOLLOW_ruleScalarExpression_in_ruleCollectionFunction2027);
                        lv_value_2_0 = ruleScalarExpression();
                        _fsp--;
                        if (current == null) {
                            current = factory.create(grammarAccess.getCollectionFunctionRule().getType().getClassifier());
                            associateNodeWithAstElement(currentNode.getParent(), current);
                        }
                        try {
                            set(current, "value", lv_value_2_0, "ScalarExpression", currentNode);
                        } catch (ValueConverterException vce) {
                            handleValueConverterException(vce);
                        }
                        currentNode = currentNode.getParent();
                    }
                }
                match(input, 16, FOLLOW_16_in_ruleCollectionFunction2037);
                createLeafNode(grammarAccess.getCollectionFunctionAccess().getCommaKeyword_3(), null);
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1074:1: ( (lv_delimiter_4_0= ruleScalarExpression ) )
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1075:1: (lv_delimiter_4_0= ruleScalarExpression )
                {
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1075:1: (lv_delimiter_4_0= ruleScalarExpression )
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1076:3: lv_delimiter_4_0= ruleScalarExpression
                    {
                        currentNode = createCompositeNode(grammarAccess.getCollectionFunctionAccess().getDelimiterScalarExpressionParserRuleCall_4_0(), currentNode);
                        pushFollow(FOLLOW_ruleScalarExpression_in_ruleCollectionFunction2058);
                        lv_delimiter_4_0 = ruleScalarExpression();
                        _fsp--;
                        if (current == null) {
                            current = factory.create(grammarAccess.getCollectionFunctionRule().getType().getClassifier());
                            associateNodeWithAstElement(currentNode.getParent(), current);
                        }
                        try {
                            set(current, "delimiter", lv_delimiter_4_0, "ScalarExpression", currentNode);
                        } catch (ValueConverterException vce) {
                            handleValueConverterException(vce);
                        }
                        currentNode = currentNode.getParent();
                    }
                }
                match(input, 14, FOLLOW_14_in_ruleCollectionFunction2068);
                createLeafNode(grammarAccess.getCollectionFunctionAccess().getRightParenthesisKeyword_5(), null);
            }
        }
        resetLookahead();
        lastConsumedNode = currentNode;
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) ValueConverterException(org.eclipse.xtext.conversion.ValueConverterException)

Example 18 with ValueConverterException

use of org.eclipse.xtext.conversion.ValueConverterException in project applause by applause.

the class InternalApplauseDslParser method ruleContentProvider.

// $ANTLR end entryRuleContentProvider
// $ANTLR start ruleContentProvider
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1754:1: ruleContentProvider returns [EObject current=null] : ( 'contentprovider' ( (lv_name_1_0= RULE_ID ) ) ( '(' ( (lv_parameter_3_0= ruleParameter ) ) ')' )? ( 'returns' | ( (lv_resolver_6_0= 'resolves' ) ) ) ( ( RULE_ID ) ) ( (lv_many_8_0= '[]' ) )? 'fetches' 'XML' 'from' ( (lv_url_12_0= ruleScalarExpression ) ) 'selects' ( (lv_selection_14_0= ruleScalarExpression ) ) ) ;
public final EObject ruleContentProvider() throws RecognitionException {
    EObject current = null;
    Token lv_name_1_0 = null;
    Token lv_resolver_6_0 = null;
    Token lv_many_8_0 = null;
    EObject lv_parameter_3_0 = null;
    EObject lv_url_12_0 = null;
    EObject lv_selection_14_0 = null;
    EObject temp = null;
    setCurrentLookahead();
    resetLookahead();
    try {
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1759:6: ( ( 'contentprovider' ( (lv_name_1_0= RULE_ID ) ) ( '(' ( (lv_parameter_3_0= ruleParameter ) ) ')' )? ( 'returns' | ( (lv_resolver_6_0= 'resolves' ) ) ) ( ( RULE_ID ) ) ( (lv_many_8_0= '[]' ) )? 'fetches' 'XML' 'from' ( (lv_url_12_0= ruleScalarExpression ) ) 'selects' ( (lv_selection_14_0= ruleScalarExpression ) ) ) )
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1760:1: ( 'contentprovider' ( (lv_name_1_0= RULE_ID ) ) ( '(' ( (lv_parameter_3_0= ruleParameter ) ) ')' )? ( 'returns' | ( (lv_resolver_6_0= 'resolves' ) ) ) ( ( RULE_ID ) ) ( (lv_many_8_0= '[]' ) )? 'fetches' 'XML' 'from' ( (lv_url_12_0= ruleScalarExpression ) ) 'selects' ( (lv_selection_14_0= ruleScalarExpression ) ) )
        {
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1760:1: ( 'contentprovider' ( (lv_name_1_0= RULE_ID ) ) ( '(' ( (lv_parameter_3_0= ruleParameter ) ) ')' )? ( 'returns' | ( (lv_resolver_6_0= 'resolves' ) ) ) ( ( RULE_ID ) ) ( (lv_many_8_0= '[]' ) )? 'fetches' 'XML' 'from' ( (lv_url_12_0= ruleScalarExpression ) ) 'selects' ( (lv_selection_14_0= ruleScalarExpression ) ) )
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1760:3: 'contentprovider' ( (lv_name_1_0= RULE_ID ) ) ( '(' ( (lv_parameter_3_0= ruleParameter ) ) ')' )? ( 'returns' | ( (lv_resolver_6_0= 'resolves' ) ) ) ( ( RULE_ID ) ) ( (lv_many_8_0= '[]' ) )? 'fetches' 'XML' 'from' ( (lv_url_12_0= ruleScalarExpression ) ) 'selects' ( (lv_selection_14_0= ruleScalarExpression ) )
            {
                match(input, 36, FOLLOW_36_in_ruleContentProvider3250);
                createLeafNode(grammarAccess.getContentProviderAccess().getContentproviderKeyword_0(), null);
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1764:1: ( (lv_name_1_0= RULE_ID ) )
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1765:1: (lv_name_1_0= RULE_ID )
                {
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1765:1: (lv_name_1_0= RULE_ID )
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1766:3: lv_name_1_0= RULE_ID
                    {
                        lv_name_1_0 = (Token) input.LT(1);
                        match(input, RULE_ID, FOLLOW_RULE_ID_in_ruleContentProvider3267);
                        createLeafNode(grammarAccess.getContentProviderAccess().getNameIDTerminalRuleCall_1_0(), "name");
                        if (current == null) {
                            current = factory.create(grammarAccess.getContentProviderRule().getType().getClassifier());
                            associateNodeWithAstElement(currentNode, current);
                        }
                        try {
                            set(current, "name", lv_name_1_0, "ID", lastConsumedNode);
                        } catch (ValueConverterException vce) {
                            handleValueConverterException(vce);
                        }
                    }
                }
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1788:2: ( '(' ( (lv_parameter_3_0= ruleParameter ) ) ')' )?
                int alt19 = 2;
                int LA19_0 = input.LA(1);
                if ((LA19_0 == 13)) {
                    alt19 = 1;
                }
                switch(alt19) {
                    case 1:
                        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1788:4: '(' ( (lv_parameter_3_0= ruleParameter ) ) ')'
                        {
                            match(input, 13, FOLLOW_13_in_ruleContentProvider3283);
                            createLeafNode(grammarAccess.getContentProviderAccess().getLeftParenthesisKeyword_2_0(), null);
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1792:1: ( (lv_parameter_3_0= ruleParameter ) )
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1793:1: (lv_parameter_3_0= ruleParameter )
                            {
                                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1793:1: (lv_parameter_3_0= ruleParameter )
                                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1794:3: lv_parameter_3_0= ruleParameter
                                {
                                    currentNode = createCompositeNode(grammarAccess.getContentProviderAccess().getParameterParameterParserRuleCall_2_1_0(), currentNode);
                                    pushFollow(FOLLOW_ruleParameter_in_ruleContentProvider3304);
                                    lv_parameter_3_0 = ruleParameter();
                                    _fsp--;
                                    if (current == null) {
                                        current = factory.create(grammarAccess.getContentProviderRule().getType().getClassifier());
                                        associateNodeWithAstElement(currentNode.getParent(), current);
                                    }
                                    try {
                                        set(current, "parameter", lv_parameter_3_0, "Parameter", currentNode);
                                    } catch (ValueConverterException vce) {
                                        handleValueConverterException(vce);
                                    }
                                    currentNode = currentNode.getParent();
                                }
                            }
                            match(input, 14, FOLLOW_14_in_ruleContentProvider3314);
                            createLeafNode(grammarAccess.getContentProviderAccess().getRightParenthesisKeyword_2_2(), null);
                        }
                        break;
                }
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1820:3: ( 'returns' | ( (lv_resolver_6_0= 'resolves' ) ) )
                int alt20 = 2;
                int LA20_0 = input.LA(1);
                if ((LA20_0 == 37)) {
                    alt20 = 1;
                } else if ((LA20_0 == 38)) {
                    alt20 = 2;
                } else {
                    NoViableAltException nvae = new NoViableAltException("1820:3: ( 'returns' | ( (lv_resolver_6_0= 'resolves' ) ) )", 20, 0, input);
                    throw nvae;
                }
                switch(alt20) {
                    case 1:
                        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1820:5: 'returns'
                        {
                            match(input, 37, FOLLOW_37_in_ruleContentProvider3327);
                            createLeafNode(grammarAccess.getContentProviderAccess().getReturnsKeyword_3_0(), null);
                        }
                        break;
                    case 2:
                        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1825:6: ( (lv_resolver_6_0= 'resolves' ) )
                        {
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1825:6: ( (lv_resolver_6_0= 'resolves' ) )
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1826:1: (lv_resolver_6_0= 'resolves' )
                            {
                                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1826:1: (lv_resolver_6_0= 'resolves' )
                                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1827:3: lv_resolver_6_0= 'resolves'
                                {
                                    lv_resolver_6_0 = (Token) input.LT(1);
                                    match(input, 38, FOLLOW_38_in_ruleContentProvider3351);
                                    createLeafNode(grammarAccess.getContentProviderAccess().getResolverResolvesKeyword_3_1_0(), "resolver");
                                    if (current == null) {
                                        current = factory.create(grammarAccess.getContentProviderRule().getType().getClassifier());
                                        associateNodeWithAstElement(currentNode, current);
                                    }
                                    try {
                                        set(current, "resolver", true, "resolves", lastConsumedNode);
                                    } catch (ValueConverterException vce) {
                                        handleValueConverterException(vce);
                                    }
                                }
                            }
                        }
                        break;
                }
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1846:3: ( ( RULE_ID ) )
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1847:1: ( RULE_ID )
                {
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1847:1: ( RULE_ID )
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1848:3: RULE_ID
                    {
                        if (current == null) {
                            current = factory.create(grammarAccess.getContentProviderRule().getType().getClassifier());
                            associateNodeWithAstElement(currentNode, current);
                        }
                        match(input, RULE_ID, FOLLOW_RULE_ID_in_ruleContentProvider3383);
                        createLeafNode(grammarAccess.getContentProviderAccess().getTypeTypeCrossReference_4_0(), "type");
                    }
                }
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1860:2: ( (lv_many_8_0= '[]' ) )?
                int alt21 = 2;
                int LA21_0 = input.LA(1);
                if ((LA21_0 == 11)) {
                    alt21 = 1;
                }
                switch(alt21) {
                    case 1:
                        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1861:1: (lv_many_8_0= '[]' )
                        {
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1861:1: (lv_many_8_0= '[]' )
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1862:3: lv_many_8_0= '[]'
                            {
                                lv_many_8_0 = (Token) input.LT(1);
                                match(input, 11, FOLLOW_11_in_ruleContentProvider3401);
                                createLeafNode(grammarAccess.getContentProviderAccess().getManyLeftSquareBracketRightSquareBracketKeyword_5_0(), "many");
                                if (current == null) {
                                    current = factory.create(grammarAccess.getContentProviderRule().getType().getClassifier());
                                    associateNodeWithAstElement(currentNode, current);
                                }
                                try {
                                    set(current, "many", true, "[]", lastConsumedNode);
                                } catch (ValueConverterException vce) {
                                    handleValueConverterException(vce);
                                }
                            }
                        }
                        break;
                }
                match(input, 39, FOLLOW_39_in_ruleContentProvider3425);
                createLeafNode(grammarAccess.getContentProviderAccess().getFetchesKeyword_6(), null);
                match(input, 40, FOLLOW_40_in_ruleContentProvider3435);
                createLeafNode(grammarAccess.getContentProviderAccess().getXMLKeyword_7(), null);
                match(input, 41, FOLLOW_41_in_ruleContentProvider3445);
                createLeafNode(grammarAccess.getContentProviderAccess().getFromKeyword_8(), null);
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1893:1: ( (lv_url_12_0= ruleScalarExpression ) )
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1894:1: (lv_url_12_0= ruleScalarExpression )
                {
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1894:1: (lv_url_12_0= ruleScalarExpression )
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1895:3: lv_url_12_0= ruleScalarExpression
                    {
                        currentNode = createCompositeNode(grammarAccess.getContentProviderAccess().getUrlScalarExpressionParserRuleCall_9_0(), currentNode);
                        pushFollow(FOLLOW_ruleScalarExpression_in_ruleContentProvider3466);
                        lv_url_12_0 = ruleScalarExpression();
                        _fsp--;
                        if (current == null) {
                            current = factory.create(grammarAccess.getContentProviderRule().getType().getClassifier());
                            associateNodeWithAstElement(currentNode.getParent(), current);
                        }
                        try {
                            set(current, "url", lv_url_12_0, "ScalarExpression", currentNode);
                        } catch (ValueConverterException vce) {
                            handleValueConverterException(vce);
                        }
                        currentNode = currentNode.getParent();
                    }
                }
                match(input, 42, FOLLOW_42_in_ruleContentProvider3476);
                createLeafNode(grammarAccess.getContentProviderAccess().getSelectsKeyword_10(), null);
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1921:1: ( (lv_selection_14_0= ruleScalarExpression ) )
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1922:1: (lv_selection_14_0= ruleScalarExpression )
                {
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1922:1: (lv_selection_14_0= ruleScalarExpression )
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1923:3: lv_selection_14_0= ruleScalarExpression
                    {
                        currentNode = createCompositeNode(grammarAccess.getContentProviderAccess().getSelectionScalarExpressionParserRuleCall_11_0(), currentNode);
                        pushFollow(FOLLOW_ruleScalarExpression_in_ruleContentProvider3497);
                        lv_selection_14_0 = ruleScalarExpression();
                        _fsp--;
                        if (current == null) {
                            current = factory.create(grammarAccess.getContentProviderRule().getType().getClassifier());
                            associateNodeWithAstElement(currentNode.getParent(), current);
                        }
                        try {
                            set(current, "selection", lv_selection_14_0, "ScalarExpression", currentNode);
                        } catch (ValueConverterException vce) {
                            handleValueConverterException(vce);
                        }
                        currentNode = currentNode.getParent();
                    }
                }
            }
        }
        resetLookahead();
        lastConsumedNode = currentNode;
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) ValueConverterException(org.eclipse.xtext.conversion.ValueConverterException)

Example 19 with ValueConverterException

use of org.eclipse.xtext.conversion.ValueConverterException in project applause by applause.

the class InternalApplauseDslParser method ruleNestedObjectReference.

// $ANTLR end entryRuleNestedObjectReference
// $ANTLR start ruleNestedObjectReference
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:444:1: ruleNestedObjectReference returns [EObject current=null] : ( '.' ( ( RULE_ID ) ) ( (lv_tail_2_0= ruleNestedObjectReference ) )? ) ;
public final EObject ruleNestedObjectReference() throws RecognitionException {
    EObject current = null;
    EObject lv_tail_2_0 = null;
    EObject temp = null;
    setCurrentLookahead();
    resetLookahead();
    try {
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:449:6: ( ( '.' ( ( RULE_ID ) ) ( (lv_tail_2_0= ruleNestedObjectReference ) )? ) )
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:450:1: ( '.' ( ( RULE_ID ) ) ( (lv_tail_2_0= ruleNestedObjectReference ) )? )
        {
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:450:1: ( '.' ( ( RULE_ID ) ) ( (lv_tail_2_0= ruleNestedObjectReference ) )? )
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:450:3: '.' ( ( RULE_ID ) ) ( (lv_tail_2_0= ruleNestedObjectReference ) )?
            {
                match(input, 12, FOLLOW_12_in_ruleNestedObjectReference845);
                createLeafNode(grammarAccess.getNestedObjectReferenceAccess().getFullStopKeyword_0(), null);
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:454:1: ( ( RULE_ID ) )
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:455:1: ( RULE_ID )
                {
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:455:1: ( RULE_ID )
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:456:3: RULE_ID
                    {
                        if (current == null) {
                            current = factory.create(grammarAccess.getNestedObjectReferenceRule().getType().getClassifier());
                            associateNodeWithAstElement(currentNode, current);
                        }
                        match(input, RULE_ID, FOLLOW_RULE_ID_in_ruleNestedObjectReference863);
                        createLeafNode(grammarAccess.getNestedObjectReferenceAccess().getObjectVariableDeclarationCrossReference_1_0(), "object");
                    }
                }
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:468:2: ( (lv_tail_2_0= ruleNestedObjectReference ) )?
                int alt5 = 2;
                int LA5_0 = input.LA(1);
                if ((LA5_0 == 12)) {
                    alt5 = 1;
                }
                switch(alt5) {
                    case 1:
                        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:469:1: (lv_tail_2_0= ruleNestedObjectReference )
                        {
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:469:1: (lv_tail_2_0= ruleNestedObjectReference )
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:470:3: lv_tail_2_0= ruleNestedObjectReference
                            {
                                currentNode = createCompositeNode(grammarAccess.getNestedObjectReferenceAccess().getTailNestedObjectReferenceParserRuleCall_2_0(), currentNode);
                                pushFollow(FOLLOW_ruleNestedObjectReference_in_ruleNestedObjectReference884);
                                lv_tail_2_0 = ruleNestedObjectReference();
                                _fsp--;
                                if (current == null) {
                                    current = factory.create(grammarAccess.getNestedObjectReferenceRule().getType().getClassifier());
                                    associateNodeWithAstElement(currentNode.getParent(), current);
                                }
                                try {
                                    set(current, "tail", lv_tail_2_0, "NestedObjectReference", currentNode);
                                } catch (ValueConverterException vce) {
                                    handleValueConverterException(vce);
                                }
                                currentNode = currentNode.getParent();
                            }
                        }
                        break;
                }
            }
        }
        resetLookahead();
        lastConsumedNode = currentNode;
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) ValueConverterException(org.eclipse.xtext.conversion.ValueConverterException)

Example 20 with ValueConverterException

use of org.eclipse.xtext.conversion.ValueConverterException in project applause by applause.

the class InternalApplauseDslParser method ruleTabBarApplication.

// $ANTLR end entryRuleTabBarApplication
// $ANTLR start ruleTabBarApplication
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1119:1: ruleTabBarApplication returns [EObject current=null] : ( ( 'tabbarApplication' | 'application' ) ( (lv_name_2_0= RULE_ID ) ) '{' ( 'splash=' ( (lv_splash_5_0= RULE_STRING ) ) )? ( (lv_buttons_6_0= ruleTabbarButton ) )* '}' ) ;
public final EObject ruleTabBarApplication() throws RecognitionException {
    EObject current = null;
    Token lv_name_2_0 = null;
    Token lv_splash_5_0 = null;
    EObject lv_buttons_6_0 = null;
    EObject temp = null;
    setCurrentLookahead();
    resetLookahead();
    try {
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1124:6: ( ( ( 'tabbarApplication' | 'application' ) ( (lv_name_2_0= RULE_ID ) ) '{' ( 'splash=' ( (lv_splash_5_0= RULE_STRING ) ) )? ( (lv_buttons_6_0= ruleTabbarButton ) )* '}' ) )
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1125:1: ( ( 'tabbarApplication' | 'application' ) ( (lv_name_2_0= RULE_ID ) ) '{' ( 'splash=' ( (lv_splash_5_0= RULE_STRING ) ) )? ( (lv_buttons_6_0= ruleTabbarButton ) )* '}' )
        {
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1125:1: ( ( 'tabbarApplication' | 'application' ) ( (lv_name_2_0= RULE_ID ) ) '{' ( 'splash=' ( (lv_splash_5_0= RULE_STRING ) ) )? ( (lv_buttons_6_0= ruleTabbarButton ) )* '}' )
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1125:2: ( 'tabbarApplication' | 'application' ) ( (lv_name_2_0= RULE_ID ) ) '{' ( 'splash=' ( (lv_splash_5_0= RULE_STRING ) ) )? ( (lv_buttons_6_0= ruleTabbarButton ) )* '}'
            {
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1125:2: ( 'tabbarApplication' | 'application' )
                int alt12 = 2;
                int LA12_0 = input.LA(1);
                if ((LA12_0 == 21)) {
                    alt12 = 1;
                } else if ((LA12_0 == 22)) {
                    alt12 = 2;
                } else {
                    NoViableAltException nvae = new NoViableAltException("1125:2: ( 'tabbarApplication' | 'application' )", 12, 0, input);
                    throw nvae;
                }
                switch(alt12) {
                    case 1:
                        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1125:4: 'tabbarApplication'
                        {
                            match(input, 21, FOLLOW_21_in_ruleTabBarApplication2150);
                            createLeafNode(grammarAccess.getTabBarApplicationAccess().getTabbarApplicationKeyword_0_0(), null);
                        }
                        break;
                    case 2:
                        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1130:7: 'application'
                        {
                            match(input, 22, FOLLOW_22_in_ruleTabBarApplication2166);
                            createLeafNode(grammarAccess.getTabBarApplicationAccess().getApplicationKeyword_0_1(), null);
                        }
                        break;
                }
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1134:2: ( (lv_name_2_0= RULE_ID ) )
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1135:1: (lv_name_2_0= RULE_ID )
                {
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1135:1: (lv_name_2_0= RULE_ID )
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1136:3: lv_name_2_0= RULE_ID
                    {
                        lv_name_2_0 = (Token) input.LT(1);
                        match(input, RULE_ID, FOLLOW_RULE_ID_in_ruleTabBarApplication2184);
                        createLeafNode(grammarAccess.getTabBarApplicationAccess().getNameIDTerminalRuleCall_1_0(), "name");
                        if (current == null) {
                            current = factory.create(grammarAccess.getTabBarApplicationRule().getType().getClassifier());
                            associateNodeWithAstElement(currentNode, current);
                        }
                        try {
                            set(current, "name", lv_name_2_0, "ID", lastConsumedNode);
                        } catch (ValueConverterException vce) {
                            handleValueConverterException(vce);
                        }
                    }
                }
                match(input, 23, FOLLOW_23_in_ruleTabBarApplication2199);
                createLeafNode(grammarAccess.getTabBarApplicationAccess().getLeftCurlyBracketKeyword_2(), null);
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1162:1: ( 'splash=' ( (lv_splash_5_0= RULE_STRING ) ) )?
                int alt13 = 2;
                int LA13_0 = input.LA(1);
                if ((LA13_0 == 24)) {
                    alt13 = 1;
                }
                switch(alt13) {
                    case 1:
                        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1162:3: 'splash=' ( (lv_splash_5_0= RULE_STRING ) )
                        {
                            match(input, 24, FOLLOW_24_in_ruleTabBarApplication2210);
                            createLeafNode(grammarAccess.getTabBarApplicationAccess().getSplashKeyword_3_0(), null);
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1166:1: ( (lv_splash_5_0= RULE_STRING ) )
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1167:1: (lv_splash_5_0= RULE_STRING )
                            {
                                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1167:1: (lv_splash_5_0= RULE_STRING )
                                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1168:3: lv_splash_5_0= RULE_STRING
                                {
                                    lv_splash_5_0 = (Token) input.LT(1);
                                    match(input, RULE_STRING, FOLLOW_RULE_STRING_in_ruleTabBarApplication2227);
                                    createLeafNode(grammarAccess.getTabBarApplicationAccess().getSplashSTRINGTerminalRuleCall_3_1_0(), "splash");
                                    if (current == null) {
                                        current = factory.create(grammarAccess.getTabBarApplicationRule().getType().getClassifier());
                                        associateNodeWithAstElement(currentNode, current);
                                    }
                                    try {
                                        set(current, "splash", lv_splash_5_0, "STRING", lastConsumedNode);
                                    } catch (ValueConverterException vce) {
                                        handleValueConverterException(vce);
                                    }
                                }
                            }
                        }
                        break;
                }
                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1190:4: ( (lv_buttons_6_0= ruleTabbarButton ) )*
                loop14: do {
                    int alt14 = 2;
                    int LA14_0 = input.LA(1);
                    if ((LA14_0 == 26)) {
                        alt14 = 1;
                    }
                    switch(alt14) {
                        case 1:
                            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1191:1: (lv_buttons_6_0= ruleTabbarButton )
                            {
                                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1191:1: (lv_buttons_6_0= ruleTabbarButton )
                                // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1192:3: lv_buttons_6_0= ruleTabbarButton
                                {
                                    currentNode = createCompositeNode(grammarAccess.getTabBarApplicationAccess().getButtonsTabbarButtonParserRuleCall_4_0(), currentNode);
                                    pushFollow(FOLLOW_ruleTabbarButton_in_ruleTabBarApplication2255);
                                    lv_buttons_6_0 = ruleTabbarButton();
                                    _fsp--;
                                    if (current == null) {
                                        current = factory.create(grammarAccess.getTabBarApplicationRule().getType().getClassifier());
                                        associateNodeWithAstElement(currentNode.getParent(), current);
                                    }
                                    try {
                                        add(current, "buttons", lv_buttons_6_0, "TabbarButton", currentNode);
                                    } catch (ValueConverterException vce) {
                                        handleValueConverterException(vce);
                                    }
                                    currentNode = currentNode.getParent();
                                }
                            }
                            break;
                        default:
                            break loop14;
                    }
                } while (true);
                match(input, 25, FOLLOW_25_in_ruleTabBarApplication2266);
                createLeafNode(grammarAccess.getTabBarApplicationAccess().getRightCurlyBracketKeyword_5(), null);
            }
        }
        resetLookahead();
        lastConsumedNode = currentNode;
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) AntlrDatatypeRuleToken(org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken) ValueConverterException(org.eclipse.xtext.conversion.ValueConverterException)

Aggregations

ValueConverterException (org.eclipse.xtext.conversion.ValueConverterException)54 EObject (org.eclipse.emf.ecore.EObject)37 AntlrDatatypeRuleToken (org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)13 ValueConverterWithValueException (org.eclipse.xtext.conversion.ValueConverterWithValueException)4 Test (org.junit.Test)4 URI (org.eclipse.emf.common.util.URI)3 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)3 Resource (org.eclipse.emf.ecore.resource.Resource)3 ClasspathUriResolutionException (org.eclipse.xtext.resource.ClasspathUriResolutionException)3 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)3 XtextResource (org.eclipse.xtext.resource.XtextResource)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 FailedPredicateException (org.antlr.runtime.FailedPredicateException)2 MismatchedTokenException (org.antlr.runtime.MismatchedTokenException)2 MissingTokenException (org.antlr.runtime.MissingTokenException)2 RecognitionException (org.antlr.runtime.RecognitionException)2 UnwantedTokenException (org.antlr.runtime.UnwantedTokenException)2 WrappedException (org.eclipse.emf.common.util.WrappedException)2 EClass (org.eclipse.emf.ecore.EClass)2 EReference (org.eclipse.emf.ecore.EReference)2