Contexts:
XCatchClause returns XCatchClause

Constraint:
(declaredParam=FullJvmFormalParameter expression=XExpression)
176822
protected void sequence_XCatchClause(ISerializationContext context, XCatchClause semanticObject) {
		if (errorAcceptor != null) {
			if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XCATCH_CLAUSE__DECLARED_PARAM) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XbasePackage.Literals.XCATCH_CLAUSE__DECLARED_PARAM));
			if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XCATCH_CLAUSE__EXPRESSION) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, XbasePackage.Literals.XCATCH_CLAUSE__EXPRESSION));
		}
		SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
		feeder.accept(grammarAccess.getXCatchClauseAccess().getDeclaredParamFullJvmFormalParameterParserRuleCall_2_0(), semanticObject.getDeclaredParam());
		feeder.accept(grammarAccess.getXCatchClauseAccess().getExpressionXExpressionParserRuleCall_4_0(), semanticObject.getExpression());
		feeder.finish();
	}
651749
public final void entryRuleXAnnotationOrExpression() throws RecognitionException {
        try {
            // InternalXbaseWithAnnotations.g:159:1: ( ruleXAnnotationOrExpression EOF )
            // InternalXbaseWithAnnotations.g:160:1: ruleXAnnotationOrExpression EOF
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXAnnotationOrExpressionRule()); 
            }
            pushFollow(FOLLOW_1);
            ruleXAnnotationOrExpression();

            state._fsp--;
            if (state.failed) return ;
            if ( state.backtracking==0 ) {
               after(grammarAccess.getXAnnotationOrExpressionRule()); 
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
544989
@Override
    public List<CatchStatement> visitCatchClause(CatchClauseContext ctx) {
        // FIXME Groovy will ignore variableModifier of parameter in the catch clause
        // In order to make the new parser behave same with the old one, we do not process variableModifier*

        return this.visitCatchType(ctx.catchType()).stream()
                .map(e -> configureAST(
                        new CatchStatement(
                                // FIXME The old parser does not set location info for the parameter of the catch clause.
                                // we could make it better
                                //this.configureAST(new Parameter(e, this.visitIdentifier(ctx.identifier())), ctx.Identifier()),

                                new Parameter(e, this.visitIdentifier(ctx.identifier())),
                                this.visitBlock(ctx.block())),
                        ctx))
                .collect(Collectors.toList());
    }
58387
public final void entryRuleXCatchClause() throws RecognitionException {
        try {
            // InternalXbaseWithAnnotations.g:1634:1: ( ruleXCatchClause EOF )
            // InternalXbaseWithAnnotations.g:1635:1: ruleXCatchClause EOF
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXCatchClauseRule()); 
            }
            pushFollow(FOLLOW_1);
            ruleXCatchClause();

            state._fsp--;
            if (state.failed) return ;
            if ( state.backtracking==0 ) {
               after(grammarAccess.getXCatchClauseRule()); 
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
1113344
private XpathMessageValidationContext getXPathMessageValidationContext(Element messageElement, XmlMessageValidationContext parentContext) {
        XpathMessageValidationContext context = new XpathMessageValidationContext();
        
        parseXPathValidationElements(messageElement, context);

        context.setControlNamespaces(parentContext.getControlNamespaces());
        context.setNamespaces(parentContext.getNamespaces());
        context.setIgnoreExpressions(parentContext.getIgnoreExpressions());
        context.setSchema(parentContext.getSchema());
        context.setSchemaRepository(parentContext.getSchemaRepository());
        context.setSchemaValidation(parentContext.isSchemaValidationEnabled());
        context.setDTDResource(parentContext.getDTDResource());

        return context;
    }
851111
@Check
	public void checkBreakKeywordUse(SarlBreakExpression expression) {
		final EObject container = Utils.getFirstContainerForPredicate(expression,
				it -> !(it instanceof XExpression) || it instanceof XAbstractWhileExpression
				|| it instanceof XBasicForLoopExpression || it instanceof XForLoopExpression);
		if (container instanceof XExpression) {
			if (!isIgnored(DISCOURAGED_LOOP_BREAKING_KEYWORD_USE)
					&& container instanceof XBasicForLoopExpression) {
				addIssue(
						MessageFormat.format(Messages.SARLValidator_17, this.grammarAccess.getBreakKeyword()),
						expression,
						null,
						ValidationMessageAcceptor.INSIGNIFICANT_INDEX,
						DISCOURAGED_LOOP_BREAKING_KEYWORD_USE);
			}
		} else {
			error(MessageFormat.format(Messages.SARLValidator_18, this.grammarAccess.getBreakKeyword()),
					expression,
					null,
					ValidationMessageAcceptor.INSIGNIFICANT_INDEX,
					INVALID_USE_OF_LOOP_BREAKING_KEYWORD);
		}
	}
1256978
public final void entryRuleXTryCatchFinallyExpression() throws RecognitionException {
        try {
            // InternalXbase.g:1459:1: ( ruleXTryCatchFinallyExpression EOF )
            // InternalXbase.g:1460:1: ruleXTryCatchFinallyExpression EOF
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXTryCatchFinallyExpressionRule()); 
            }
            pushFollow(FOLLOW_1);
            ruleXTryCatchFinallyExpression();

            state._fsp--;
            if (state.failed) return ;
            if ( state.backtracking==0 ) {
               after(grammarAccess.getXTryCatchFinallyExpressionRule()); 
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
531286
private void parseAndExpr() throws TTXPathException {

        parseComparisionExpr();

        while (is("and", true)) {

            mPipeBuilder.addExpressionSingle();

            parseComparisionExpr();
            mPipeBuilder.addAndExpression(getTransaction());

        }
    }
855598
public final void ruleXCastedExpression() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:571:2: ( ( ( rule__XCastedExpression__Group__0 ) ) )
            // InternalXbase.g:572:2: ( ( rule__XCastedExpression__Group__0 ) )
            {
            // InternalXbase.g:572:2: ( ( rule__XCastedExpression__Group__0 ) )
            // InternalXbase.g:573:3: ( rule__XCastedExpression__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXCastedExpressionAccess().getGroup()); 
            }
            // InternalXbase.g:574:3: ( rule__XCastedExpression__Group__0 )
            // InternalXbase.g:574:4: rule__XCastedExpression__Group__0
            {
            pushFollow(FOLLOW_2);
            rule__XCastedExpression__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getXCastedExpressionAccess().getGroup()); 
            }

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
1136245
private void positionalConstraints(PatternDescrBuilder<?> pattern) throws RecognitionException {
        constraint(pattern,
                true,
                "");
        if (state.failed)
            return;

        while (input.LA(1) == DRL6Lexer.COMMA) {
            match(input,
                    DRL6Lexer.COMMA,
                    null,
                    null,
                    DroolsEditorType.SYMBOL);
            if (state.failed)
                return;

            constraint(pattern,
                    true,
                    "");
            if (state.failed)
                return;
        }

        match(input,
                DRL6Lexer.SEMICOLON,
                null,
                null,
                DroolsEditorType.SYMBOL);
        if (state.failed)
            return;
    }
897260
public final void entryRuleFullJvmFormalParameter() throws RecognitionException {
        try {
            // InternalXbase.g:1159:1: ( ruleFullJvmFormalParameter EOF )
            // InternalXbase.g:1160:1: ruleFullJvmFormalParameter EOF
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getFullJvmFormalParameterRule()); 
            }
            pushFollow(FOLLOW_1);
            ruleFullJvmFormalParameter();

            state._fsp--;
            if (state.failed) return ;
            if ( state.backtracking==0 ) {
               after(grammarAccess.getFullJvmFormalParameterRule()); 
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
1242282
Expression XreadExplicitRowValueConstructorOrNull() {

        Expression e;

        switch (token.tokenType) {

            case Tokens.OPENBRACKET : {
                read();

                int position = getPosition();
                int brackets = readOpenBrackets();

                switch (token.tokenType) {

                    case Tokens.TABLE :
                    case Tokens.VALUES :
                    case Tokens.SELECT :
                        rewind(position);

                        SubQuery sq = XreadSubqueryBody(false,
                                                        OpTypes.ROW_SUBQUERY);

                        readThis(Tokens.CLOSEBRACKET);

                        return new Expression(OpTypes.ROW_SUBQUERY, sq);

                    default :
                        rewind(position);

                        e = XreadRowElementList(true);

                        readThis(Tokens.CLOSEBRACKET);

                        return e;
                }
            }
            case Tokens.ROW : {
                read();
                readThis(Tokens.OPENBRACKET);

                e = XreadRowElementList(false);

                readThis(Tokens.CLOSEBRACKET);

                return e;
            }
        }

        return null;
    }
567570
public final void conditionalOrExpression() throws RecognitionException {
		int conditionalOrExpression_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 111) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1142:5: ( conditionalAndExpression ( '||' conditionalAndExpression )* )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1142:9: conditionalAndExpression ( '||' conditionalAndExpression )*
			{
			pushFollow(FOLLOW_conditionalAndExpression_in_conditionalOrExpression5074);
			conditionalAndExpression();
			state._fsp--;
			if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1142:34: ( '||' conditionalAndExpression )*
			loop143:
			while (true) {
				int alt143=2;
				int LA143_0 = input.LA(1);
				if ( (LA143_0==124) ) {
					alt143=1;
				}

				switch (alt143) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1142:36: '||' conditionalAndExpression
					{
					match(input,124,FOLLOW_124_in_conditionalOrExpression5078); if (state.failed) return;
					pushFollow(FOLLOW_conditionalAndExpression_in_conditionalOrExpression5080);
					conditionalAndExpression();
					state._fsp--;
					if (state.failed) return;
					}
					break;

				default :
					break loop143;
				}
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 111, conditionalOrExpression_StartIndex); }

		}
	}
555872
@Override
    public GStringExpression visitGstring(GstringContext ctx) {
        final List<ConstantExpression> stringLiteralList = new LinkedList<>();
        final String begin = ctx.GStringBegin().getText();
        final String beginQuotation = beginQuotation(begin);
        stringLiteralList.add(configureAST(new ConstantExpression(parseGStringBegin(ctx, beginQuotation)), ctx.GStringBegin()));

        List<ConstantExpression> partStrings =
                ctx.GStringPart().stream()
                        .map(e -> configureAST(new ConstantExpression(parseGStringPart(e, beginQuotation)), e))
                        .collect(Collectors.toList());
        stringLiteralList.addAll(partStrings);

        stringLiteralList.add(configureAST(new ConstantExpression(parseGStringEnd(ctx, beginQuotation)), ctx.GStringEnd()));

        List<Expression> values = ctx.gstringValue().stream()
                .map(e -> {
                    Expression expression = this.visitGstringValue(e);

                    if (expression instanceof ClosureExpression && !hasArrow(e)) {
                        List<Statement> statementList = ((BlockStatement) ((ClosureExpression) expression).getCode()).getStatements();

                        if (statementList.stream().noneMatch(DefaultGroovyMethods::asBoolean)) {
                            return configureAST(new ConstantExpression(null), e);
                        }

                        return configureAST(this.createCallMethodCallExpression(expression, new ArgumentListExpression(), true), e);
                    }

                    return expression;
                })
                .collect(Collectors.toList());

        StringBuilder verbatimText = new StringBuilder(ctx.getText().length());
        for (int i = 0, n = stringLiteralList.size(), s = values.size(); i < n; i++) {
            verbatimText.append(stringLiteralList.get(i).getValue());

            if (i == s) {
                continue;
            }

            Expression value = values.get(i);
            if (!asBoolean(value)) {
                continue;
            }

            verbatimText.append(DOLLAR_STR);
            verbatimText.append(value.getText());
        }

        return configureAST(new GStringExpression(verbatimText.toString(), stringLiteralList, values), ctx);
    }
585025
function parsePostfixExpression() {
        var expr, token, startToken = lookahead;

        expr = inheritCoverGrammar(parseLeftHandSideExpressionAllowCall);

        if (!hasLineTerminator && lookahead.type === Token.Punctuator) {
            if (match('++') || match('--')) {
                // ECMA-262 11.3.1, 11.3.2
                if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
                    tolerateError(Messages.StrictLHSPostfix);
                }

                if (!isAssignmentTarget) {
                    tolerateError(Messages.InvalidLHSInAssignment);
                }

                isAssignmentTarget = isBindingElement = false;

                token = lex();
                expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr);
            }
        }

        return expr;
    }
1355224
public final void ruleXCatchClause() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:1521:2: ( ( ( rule__XCatchClause__Group__0 ) ) )
            // InternalXbase.g:1522:2: ( ( rule__XCatchClause__Group__0 ) )
            {
            // InternalXbase.g:1522:2: ( ( rule__XCatchClause__Group__0 ) )
            // InternalXbase.g:1523:3: ( rule__XCatchClause__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXCatchClauseAccess().getGroup()); 
            }
            // InternalXbase.g:1524:3: ( rule__XCatchClause__Group__0 )
            // InternalXbase.g:1524:4: rule__XCatchClause__Group__0
            {
            pushFollow(FOLLOW_2);
            rule__XCatchClause__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getXCatchClauseAccess().getGroup()); 
            }

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
386199
private void constraint(PatternDescrBuilder<?> pattern,
            boolean positional,
            String prefix) throws RecognitionException {
        if (speculateNestedConstraint()) {
            nestedConstraint(pattern, prefix);
            return;
        }

        if (state.backtracking == 0) {
            helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_START);
        }

        int first = input.index();
        exprParser.getHelper().setHasOperator(false); // resetting
        try {
            exprParser.conditionalOrExpression();
        } finally {
            if (state.backtracking == 0) {
                if (input.LA(1) == DRL6Lexer.ID && input.LA(2) == DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT);
                } else if (input.LA(1) != DRL6Lexer.EOF) {
                    helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_END);
                } else if (!lastTokenWasWhiteSpace()) {
                    int location = getCurrentLocation();
                    if (location == Location.LOCATION_LHS_INSIDE_CONDITION_END) {
                        helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT);
                    } else if (input.get(input.index()).getType() != DRL6Lexer.EOF) {
                        helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_START);
                    }
                } else if (getCurrentLocation() == Location.LOCATION_LHS_INSIDE_CONDITION_START &&
                        !exprParser.getHelper().getHasOperator() &&
                        lastTokenWasWhiteSpace() &&
                        input.LA(1) == DRL6Lexer.EOF &&
                        input.LA(-1) == DRL6Lexer.ID) {
                    helper.emit(Location.LOCATION_LHS_INSIDE_CONDITION_OPERATOR);
                }
            }
        }

        if (state.failed)
            return;

        if (state.backtracking == 0 && input.index() > first) {
            // expression consumed something
            int last = input.LT(-1).getTokenIndex();
            String expr = toExpression(prefix, first, last);
            pattern.constraint(expr,
                    positional);
            BaseDescr constrDescr = pattern.getDescr().getDescrs().get(pattern.getDescr().getDescrs().size() - 1);
            constrDescr.setLocation(input.get(first).getLine(),
                    input.get(first).getCharPositionInLine());
            constrDescr.setEndLocation(input.get(last).getLine(),
                    input.get(last).getCharPositionInLine());
            constrDescr.setStartCharacter(((CommonToken) input.get(first)).getStartIndex());
            constrDescr.setEndCharacter(((CommonToken) input.get(last)).getStopIndex());
        }
    }