BracketsOpt = { [Annotations] "[" "]" }*

<p>

<code>annotations</code> is the list of annotations targeting
the expression <code>t</code>.
342485
private JCExpression bracketsOpt(JCExpression t,
            List<JCAnnotation> annotations) {
        List<JCAnnotation> nextLevelAnnotations = typeAnnotationsOpt();

        if (token.kind == LBRACKET) {
            int pos = token.pos;
            nextToken();
            t = bracketsOptCont(t, pos, nextLevelAnnotations);
        } else if (!nextLevelAnnotations.isEmpty()) {
            if (permitTypeAnnotationsPushBack) {
                this.typeAnnotationsPushedBack = nextLevelAnnotations;
            } else {
                return illegal(nextLevelAnnotations.head.pos);
            }
        }

        if (!annotations.isEmpty()) {
            t = toP(F.at(token.pos).AnnotatedType(annotations, t));
        }
        return t;
    }
487253
private static boolean isTemplate(String expression) {
		return expression.contains(PARSER_CONTEXT.getExpressionPrefix())
				&& expression.contains(PARSER_CONTEXT.getExpressionSuffix());
	}
801251
def p_expression_binop(self, p):
        
        _LOGGER.debug("expresion -> expresion %s expression" % p[2])

        if self._autodefine_vars:
            self._init_vars(p[1], p[3])

        if p[1].type != p[3].type: raise TypeError()
        
        if p[1].type == TypedClass.LIST:
            if p[2] == '+':
                p[0] = TypedList(p[1].value + p[3].value)
            else:
                raise TypeError('operator not defined for lists')
        elif p[1].type == TypedClass.STRING:
            if p[2] == '+':
                p[0] = TypedClass(p[1].value + p[3].value, TypedClass.STRING)
            else:
                raise TypeError('operator not defined for strings')
        elif p[1].type == TypedClass.NUMBER: 
            if p[2] == '+':
                p[0] = TypedClass(p[1].value + p[3].value, TypedClass.NUMBER)
            elif p[2] == '-':
                p[0] = TypedClass(p[1].value - p[3].value, TypedClass.NUMBER)
            if p[2] == '*':
                p[0] = TypedClass(p[1].value * p[3].value, TypedClass.NUMBER)
            if p[2] == '/':
                p[0] = TypedClass(p[1].value / p[3].value, TypedClass.NUMBER)
        else:
            raise TypeError("operator invalid for this type")
120483
private String typeParameters(Options opt, ParameterizedType t) {
	if (t == null)
	    return "";
	StringBuffer tp = new StringBuffer(1000).append("&lt;");
	Type args[] = t.typeArguments();
	for (int i = 0; i < args.length; i++) {
	    tp.append(type(opt, args[i], true));
	    if (i != args.length - 1)
		tp.append(", ");
	}
	return tp.append("&gt;").toString();
    }
9697
function MethodCallExpression(name, args) {
    /**
     * Gets or sets the name of this method
     * @type {String}
     */
    this.name = name;
    /**
     * Gets or sets an array that represents the method arguments
     * @type {Array}
     */
    this.args = [];
    if (_.isArray(args))
        this.args = args;
}
656407
def p_annotation(self, p):
        ''''''

        if len(p) == 4:
            p[0] = ast.Annotation(p[1], p[3], lineno=p.lineno(1))
        else:
            p[0] = ast.Annotation(p[1], True, lineno=p.lineno(1))
78169
function brackets(pattern, options) {
  const res = brackets.create(pattern, options);
  return res.output;
}
857820
final public Selector Expression() throws ParseException {
                          Selector left, right=null; int op = -1;
    left = Term();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 7:
    case 8:
      op = PlusMinus();
      right = Expression();
      break;
    default:
      jj_la1[5] = jj_gen;
      ;
    }
    if (right == null) {if (true) return left;}
    else {if (true) return new OperatorImpl(op, left, right);}
    throw new Error("Missing return statement in function");
  }
1206407
JCExpression parExpression() {
        int pos = token.pos;
        accept(LPAREN);
        JCExpression t = parseExpression();
        accept(RPAREN);
        return toP(F.at(pos).Parens(t));
    }
1147257
public final void inlineListExpression() throws RecognitionException {
		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:560:5: ( LEFT_SQUARE ( expressionList )? RIGHT_SQUARE )
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:560:9: LEFT_SQUARE ( expressionList )? RIGHT_SQUARE
			{
			match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_inlineListExpression3100); if (state.failed) return;
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:560:21: ( expressionList )?
			int alt61=2;
			int LA61_0 = input.LA(1);
			if ( (LA61_0==BOOL||(LA61_0 >= DECIMAL && LA61_0 <= DECR)||LA61_0==FLOAT||LA61_0==HEX||(LA61_0 >= ID && LA61_0 <= INCR)||(LA61_0 >= LEFT_PAREN && LA61_0 <= LESS)||LA61_0==MINUS||LA61_0==NEGATION||LA61_0==NULL||LA61_0==PLUS||(LA61_0 >= STAR && LA61_0 <= TIME_INTERVAL)) ) {
				alt61=1;
			}
			switch (alt61) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:560:21: expressionList
					{
					pushFollow(FOLLOW_expressionList_in_inlineListExpression3102);
					expressionList();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_inlineListExpression3105); if (state.failed) return;
			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
	}
579549
private void visitAnnotationAttributes(AnnotationNode an, AnnotationVisitor av) {
        Map<String, Object> constantAttrs = new HashMap<String, Object>();
        Map<String, PropertyExpression> enumAttrs = new HashMap<String, PropertyExpression>();
        Map<String, Object> atAttrs = new HashMap<String, Object>();
        Map<String, ListExpression> arrayAttrs = new HashMap<String, ListExpression>();

        for (String name : an.getMembers().keySet()) {
            Expression expr = an.getMember(name);
            if (expr instanceof AnnotationConstantExpression) {
                atAttrs.put(name, ((AnnotationConstantExpression) expr).getValue());
            } else if (expr instanceof ConstantExpression) {
                constantAttrs.put(name, ((ConstantExpression) expr).getValue());
            } else if (expr instanceof ClassExpression) {
                constantAttrs.put(name,
                        Type.getType(BytecodeHelper.getTypeDescription((expr.getType()))));
            } else if (expr instanceof PropertyExpression) {
                enumAttrs.put(name, (PropertyExpression) expr);
            } else if (expr instanceof ListExpression) {
                arrayAttrs.put(name, (ListExpression) expr);
            } else if (expr instanceof ClosureExpression) {
                ClassNode closureClass = controller.getClosureWriter().getOrAddClosureClass((ClosureExpression) expr, ACC_PUBLIC);
                constantAttrs.put(name,
                        Type.getType(BytecodeHelper.getTypeDescription(closureClass)));
            }
        }

        for (Map.Entry entry : constantAttrs.entrySet()) {
            av.visit((String) entry.getKey(), entry.getValue());
        }
        for (Map.Entry entry : enumAttrs.entrySet()) {
            PropertyExpression propExp = (PropertyExpression) entry.getValue();
            av.visitEnum((String) entry.getKey(),
                    BytecodeHelper.getTypeDescription(propExp.getObjectExpression().getType()),
                    String.valueOf(((ConstantExpression) propExp.getProperty()).getValue()));
        }
        for (Map.Entry entry : atAttrs.entrySet()) {
            AnnotationNode atNode = (AnnotationNode) entry.getValue();
            AnnotationVisitor av2 = av.visitAnnotation((String) entry.getKey(),
                    BytecodeHelper.getTypeDescription(atNode.getClassNode()));
            visitAnnotationAttributes(atNode, av2);
            av2.visitEnd();
        }
        visitArrayAttributes(an, arrayAttrs, av);
    }
487873
def p_expression_binop(t):
    ''''''
    if t[2] == '+'  : t[0] = t[1] + t[3]
    elif t[2] == '-': t[0] = t[1] - t[3]
    elif t[2] == '*': t[0] = t[1] * t[3]
    elif t[2] == '/': t[0] = t[1] / t[3]
335819
public final void expressionList() throws RecognitionException {
		int expressionList_StartIndex = input.index();

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

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1107:5: ( expression ( ',' expression )* )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1107:9: expression ( ',' expression )*
			{
			pushFollow(FOLLOW_expression_in_expressionList4817);
			expression();
			state._fsp--;
			if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1107:20: ( ',' expression )*
			loop139:
			while (true) {
				int alt139=2;
				int LA139_0 = input.LA(1);
				if ( (LA139_0==43) ) {
					alt139=1;
				}

				switch (alt139) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1107:21: ',' expression
					{
					match(input,43,FOLLOW_43_in_expressionList4820); if (state.failed) return;
					pushFollow(FOLLOW_expression_in_expressionList4822);
					expression();
					state._fsp--;
					if (state.failed) return;
					}
					break;

				default :
					break loop139;
				}
			}

			}

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

		}
	}
18712
private List<String> split(String expression, int offset) {
        List<String> encodedSpecs = new ArrayList<String>();
        int parenthesisLevel = 0;  // number of open '('
        int bracketLevel = 0;      // number of open '['
        int quoteLevel = 0;        // number of open '\''
        int length = expression.length();
        int specStart = 0;
        char c;
        boolean lead = true;
        for (int i = 0; i < length; i++) {
            c = expression.charAt(i);
            if (lead && Character.isWhitespace(c)) {
                specStart++;
                continue;
            }
            lead = false;
            if (c == ',' && parenthesisLevel == 0 && bracketLevel == 0 && quoteLevel == 0) {
                String token = expression.substring(specStart, i);
                addSpec(encodedSpecs, token, offset + specStart);
                specStart = i + 1;
                lead = true;
            } else if (c == '(') {
                if (bracketLevel > 0) {
                    fail(offset + i, "illegal '(' in [...]");
                }
                parenthesisLevel++;
            } else if (c == ')') {
                if (bracketLevel > 0) {
                    fail(offset + i, "illegal ')' in [...]");
                }
                parenthesisLevel--;
                if (parenthesisLevel < 0) {
                    fail(offset + i, "missing '('");
                }
            } else if (c == '[') {
                if (bracketLevel > 0) {
                    fail(offset + i, "too many '['");
                }
                bracketLevel++;
            } else if (c == ']') {
                bracketLevel--;
                if (bracketLevel < 0) {
                    fail(offset + i, "missing '['");
                }
            } else if (c == '\'') {
                if (quoteLevel == 0) {
                    quoteLevel++;
                } else if (quoteLevel == 1) {
                    quoteLevel--;
                }
            }
        }
        if (parenthesisLevel > 0) {
            fail(offset + length, "missing ')'");
        }
        if (bracketLevel > 0) {
            fail(offset + length, "missing ']");
        }
        if (specStart < length) {
            String token = expression.substring(specStart);
            addSpec(encodedSpecs, token, offset + specStart);
        }
        return encodedSpecs;
    }
398256
public final void conditionalExpression() throws RecognitionException {
		int conditionalExpression_StartIndex = input.index();

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

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1138:5: ( conditionalOrExpression ( '?' expression ':' expression )? )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1138:9: conditionalOrExpression ( '?' expression ':' expression )?
			{
			pushFollow(FOLLOW_conditionalOrExpression_in_conditionalExpression5042);
			conditionalOrExpression();
			state._fsp--;
			if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1138:33: ( '?' expression ':' expression )?
			int alt142=2;
			int LA142_0 = input.LA(1);
			if ( (LA142_0==57) ) {
				alt142=1;
			}
			switch (alt142) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1138:35: '?' expression ':' expression
					{
					match(input,57,FOLLOW_57_in_conditionalExpression5046); if (state.failed) return;
					pushFollow(FOLLOW_expression_in_conditionalExpression5048);
					expression();
					state._fsp--;
					if (state.failed) return;
					match(input,51,FOLLOW_51_in_conditionalExpression5050); if (state.failed) return;
					pushFollow(FOLLOW_expression_in_conditionalExpression5052);
					expression();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			}

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

		}
	}
976408
JCExpression argumentsOpt(List<JCExpression> typeArgs, JCExpression t) {
        if ((mode & EXPR) != 0 && token.kind == LPAREN || typeArgs != null) {
            mode = EXPR;
            return arguments(typeArgs, t);
        } else {
            return t;
        }
    }
751881
private String typeAnnotation(Options opt, Type t) {
	if (t.typeName().equals("void"))
	    return "";
	return " : " + type(opt, t, false) + t.dimension();
    }