11.6 Additive Expression
556592
private ParseTree parseAdditiveExpression() {
    SourcePosition start = getTreeStartLocation();
    ParseTree left = parseMultiplicativeExpression();
    while (peekAdditiveOperator()) {
      Token operator = nextToken();
      ParseTree right = parseMultiplicativeExpression();
      left = new BinaryOperatorTree(getTreeLocation(start), left, operator, right);
    }
    return left;
  }
930426
def Plus(self, other):
    
    return Point(self.x + other.x,
                 self.y + other.y,
                 self.z + other.z)
514083
def p_expression_sra(self, p):
        ''
        p[0] = Sra(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
903941
public final hqlParser.additiveExpression_return additiveExpression() throws RecognitionException {
		hqlParser.additiveExpression_return retval = new hqlParser.additiveExpression_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token PLUS200=null;
		Token MINUS201=null;
		ParserRuleReturnScope multiplyExpression199 =null;
		ParserRuleReturnScope multiplyExpression202 =null;

		CommonTree PLUS200_tree=null;
		CommonTree MINUS201_tree=null;

		try {
			// hql.g:540:2: ( multiplyExpression ( ( PLUS ^| MINUS ^) multiplyExpression )* )
			// hql.g:540:4: multiplyExpression ( ( PLUS ^| MINUS ^) multiplyExpression )*
			{
			root_0 = (CommonTree)adaptor.nil();


			pushFollow(FOLLOW_multiplyExpression_in_additiveExpression2421);
			multiplyExpression199=multiplyExpression();
			state._fsp--;

			adaptor.addChild(root_0, multiplyExpression199.getTree());

			// hql.g:540:23: ( ( PLUS ^| MINUS ^) multiplyExpression )*
			loop71:
			while (true) {
				int alt71=2;
				int LA71_0 = input.LA(1);
				if ( (LA71_0==MINUS||LA71_0==PLUS) ) {
					alt71=1;
				}

				switch (alt71) {
				case 1 :
					// hql.g:540:25: ( PLUS ^| MINUS ^) multiplyExpression
					{
					// hql.g:540:25: ( PLUS ^| MINUS ^)
					int alt70=2;
					int LA70_0 = input.LA(1);
					if ( (LA70_0==PLUS) ) {
						alt70=1;
					}
					else if ( (LA70_0==MINUS) ) {
						alt70=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 70, 0, input);
						throw nvae;
					}

					switch (alt70) {
						case 1 :
							// hql.g:540:27: PLUS ^
							{
							PLUS200=(Token)match(input,PLUS,FOLLOW_PLUS_in_additiveExpression2427);
							PLUS200_tree = (CommonTree)adaptor.create(PLUS200);
							root_0 = (CommonTree)adaptor.becomeRoot(PLUS200_tree, root_0);

							}
							break;
						case 2 :
							// hql.g:540:35: MINUS ^
							{
							MINUS201=(Token)match(input,MINUS,FOLLOW_MINUS_in_additiveExpression2432);
							MINUS201_tree = (CommonTree)adaptor.create(MINUS201);
							root_0 = (CommonTree)adaptor.becomeRoot(MINUS201_tree, root_0);

							}
							break;

					}

					pushFollow(FOLLOW_multiplyExpression_in_additiveExpression2437);
					multiplyExpression202=multiplyExpression();
					state._fsp--;

					adaptor.addChild(root_0, multiplyExpression202.getTree());

					}
					break;

				default :
					break loop71;
				}
			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
1036478
def visitMultiplicationOrDivisionExpression(self, ctx):
        
        is_mul = ctx.TIMES() is not None

        arg1 = conversions.to_decimal(self.visit(ctx.expression(0)), self._eval_context)
        arg2 = conversions.to_decimal(self.visit(ctx.expression(1)), self._eval_context)

        if not is_mul and arg2 == Decimal(0):
            raise EvaluationError("Division by zero")

        return arg1 * arg2 if is_mul else arg1 / arg2
268420
def p_expression_Or(self, p):
        ''
        p[0] = Or(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1335467
def p_expression_unor(self, p):
        ''
        p[0] = Unor(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
558807
private Expression concatOp(Data data) throws TemplateException {
	Expression expr = plusMinusOp(data);

	while (data.srcCode.isCurrent('&') && !data.srcCode.isCurrent("&&")) {
	    data.srcCode.next();

	    // &=
	    if (data.srcCode.isCurrent('=') && expr instanceof Variable) {
		data.srcCode.next();
		comments(data);
		Expression value = assignOp(data);

		expr = data.factory.opUnary((Variable) expr, value, Factory.OP_UNARY_PRE, Factory.OP_UNARY_CONCAT, expr.getStart(), data.srcCode.getPosition());

		// ExprString res = OpString.toExprString(expr, right);
		// expr=new OpVariable((Variable)expr,res,data.cfml.getPosition());
	    }
	    else {
		comments(data);
		expr = data.factory.opString(expr, plusMinusOp(data));
	    }

	}
	return expr;
    }
1067327
def p_const_expression_intnum(self, p):
        ''
        p[0] = IntConst(p[1], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
510253
def p_expression_uand(self, p):
        ''
        p[0] = Uand(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1156049
def p_expression_unot(self, p):
        ''
        p[0] = Unot(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
325605
def p_expression_greaterthan(self, p):
        ''
        p[0] = GreaterThan(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
999751
def in_global_expression(self):
        """"""
        return (self.parenthesis_count == 0 and self.curly_bracket_count == 0
                and self.square_bracket_count == 0
                and not self.in_single_quote and not self.in_double_quote)
746863
def p_expression_greatereq(self, p):
        ''
        p[0] = GreaterEq(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
312132
function optimiseMemberExpression(parent, offset) {
  if (offset === 0) return;

  var newExpr;
  var prop = parent.property;

  if (t.isLiteral(prop)) {
    prop.value += offset;
    prop.raw = String(prop.value);
  } else {
    // // UnaryExpression, BinaryExpression
    newExpr = t.binaryExpression("+", prop, t.literal(offset));
    parent.property = newExpr;
  }
}
713
def p_expression_ulnot(self, p):
        ''
        p[0] = Ulnot(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1039556
def p_l_expression(self, p):
        '''     
        '''
        _LOGGER.debug("l -> expresion")

        l = TypedList( [ p[1] ] )
        p[0] = l