expression : expression PLUS expression
                  | expression MINUS expression
                  | expression TIMES expression
                  | expression DIVIDE expression
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]
847057
def p_expression_minus(self, p):
        ''
        p[0] = Minus(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
391976
def p_expression_uor(self, p):
        ''
        p[0] = Uor(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
543598
function (expression, s) {
      var openCount = 0
      var offset = 0
      var i
      var ldelim = this.ldelim
      var rdelim = this.rdelim
      var skipInWhitespace = this.autoLiteral
      var expressionAny = /^\s*(.+)\s*$/i
      var expressionTag = expression ? new RegExp('^\\s*(' + expression + ')\\s*$', 'i') : expressionAny
      var sTag
      var found

      for (i = 0; i < s.length; ++i) {
        if (s.substr(i, ldelim.length) === ldelim) {
          if (skipInWhitespace && (i + 1) < s.length && s.substr((i + 1), 1).match(/\s/)) {
            continue
          }
          if (!openCount) {
            s = s.slice(i)
            offset += parseInt(i)
            i = 0
          }
          ++openCount
        } else if (s.substr(i, rdelim.length) === rdelim) {
          if (skipInWhitespace && (i - 1) >= 0 && s.substr((i - 1), 1).match(/\s/)) {
            continue
          }
          if (!--openCount) {
            sTag = s.slice(ldelim.length, i).replace(/[\r\n]/g, ' ')
            found = sTag.match(expressionTag)
            if (found) {
              found.index = offset
              found[0] = s.slice(0, (i + rdelim.length))
              return found
            }
          }
          if (openCount < 0) {
            // Ignore any number of unmatched right delimiters.
            openCount = 0
          }
        }
      }
      return null
    }
532000
private static List<String> splitExpression(String expression) {
        List<String> tokens = new ArrayList<String>();
        int lastStart = -1;
        boolean isQuoted = false;
        for (int i = 0; i < expression.length(); i++) {
            if ( lastStart == -1 ) {
                if ( !isQuoted && Character.isJavaIdentifierStart( expression.charAt(i) ) ) {
                    lastStart = i;
                }
            } else if ( !Character.isJavaIdentifierPart( expression.charAt(i) ) ) {
                tokens.add(expression.subSequence(lastStart, i).toString());
                lastStart = -1;
            }
            if (expression.charAt(i) == '"' || expression.charAt(i) == '\'') {
                if (i == 0 || expression.charAt(i-1) != '\\') {
                    isQuoted = !isQuoted;
                }
                if (isQuoted) {
                    lastStart = -1;
                }
            }
        }
        if (lastStart != -1) {
            tokens.add( expression.subSequence( lastStart, expression.length() ).toString() );
        }
        return tokens;
    }
529045
private Expression plusMinusOp(Data data) throws TemplateException {
	Expression expr = modOp(data);

	while (!data.srcCode.isLast()) {

	    // Plus Operation
	    if (data.srcCode.forwardIfCurrent('+')) expr = _plusMinusOp(data, expr, Factory.OP_DBL_PLUS);
	    // Minus Operation
	    else if (data.srcCode.forwardIfCurrent('-')) expr = _plusMinusOp(data, expr, Factory.OP_DBL_MINUS);
	    else break;
	}
	return expr;
    }
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))
472138
def _mix_or_and_expr(self, or_expr, _and, check):
        

        or_expr, check1 = or_expr.pop_check()
        if isinstance(check1, checks.AndCheck):
            and_expr = check1
            and_expr.add_check(check)
        else:
            and_expr = checks.AndCheck(check1, check)
        return [('or_expr', or_expr.add_check(and_expr))]
387013
def And(*xs, simplify=True):
    
    xs = [Expression.box(x).node for x in xs]
    y = exprnode.and_(*xs)
    if simplify:
        y = y.simplify()
    return _expr(y)
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")
1008070
def p_expression_uxor(self, p):
        ''
        p[0] = Uxor(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1041361
def p_expr_AND_expr(p):
    
    p[0] = make_binary(p.lineno(2), 'AND', p[1], p[3], lambda x, y: x and y)
713023
def _expression(expression):
    # type: (QuilParser.ExpressionContext) -> Any
    
    if isinstance(expression, QuilParser.ParenthesisExpContext):
        return _expression(expression.expression())
    elif isinstance(expression, QuilParser.PowerExpContext):
        if expression.POWER():
            return _binary_exp(expression, operator.pow)
    elif isinstance(expression, QuilParser.MulDivExpContext):
        if expression.TIMES():
            return _binary_exp(expression, operator.mul)
        elif expression.DIVIDE():
            return _binary_exp(expression, operator.truediv)
    elif isinstance(expression, QuilParser.AddSubExpContext):
        if expression.PLUS():
            return _binary_exp(expression, operator.add)
        elif expression.MINUS():
            return _binary_exp(expression, operator.sub)
    elif isinstance(expression, QuilParser.SignedExpContext):
        if expression.sign().PLUS():
            return _expression(expression.expression())
        elif expression.sign().MINUS():
            return -1 * _expression(expression.expression())
    elif isinstance(expression, QuilParser.FunctionExpContext):
        return _apply_function(expression.function(), _expression(expression.expression()))
    elif isinstance(expression, QuilParser.AddrExpContext):
        return _addr(expression.addr())
    elif isinstance(expression, QuilParser.NumberExpContext):
        return _number(expression.number())
    elif isinstance(expression, QuilParser.VariableExpContext):
        return _variable(expression.variable())

    raise RuntimeError("Unexpected expression type:" + expression.getText())
1185067
function () {
                    var elements = [], e, c, argsSemiColon = [], argsComma = [], args, delim, arg, nameLoop, expressions, isSemiColonSeperated, expressionContainsNamed, index = i, s = input.charAt(i), name, value, important = false;

                    if (s !== '.' && s !== '#') { return }
                    
                    save(); // stop us absorbing part of an invalid selector

                    while (e = $(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)) {
                        elements.push(new(tree.Element)(c, e, i));
                        c = $('>');
                    }
                    if ($('(')) {
                        expressions = [];
                        while (arg = $(this.expression)) {
                            nameLoop = null;
                            value = arg;

                            // Variable
                            if (arg.value.length == 1) {
                                var val = arg.value[0];
                                if (val instanceof tree.Variable) {
                                    if ($(':')) {
                                        if (expressions.length > 0) {
                                            if (isSemiColonSeperated) {
                                                error("Cannot mix ; and , as delimiter types");
                                            }
                                            expressionContainsNamed = true;
                                        }
                                        value = expect(this.expression);
                                        nameLoop = (name = val.name);
                                    }
                                }
                            }
                            
                            expressions.push(value);
                            
                            argsComma.push({ name: nameLoop, value: value });
                            
                            if ($(',')) {
                                continue;
                            }
                            
                            if ($(';') || isSemiColonSeperated) {
                            
                                if (expressionContainsNamed) {
                                    error("Cannot mix ; and , as delimiter types");
                                }
                            
                                isSemiColonSeperated = true;
                                                        
                                if (expressions.length > 1) {
                                    value = new(tree.Value)(expressions);
                                }
                                argsSemiColon.push({ name: name, value: value });
                            
                                name = null;
                                expressions = [];
                                expressionContainsNamed = false;
                            }
                        }

                        expect(')');
                    }

                    args = isSemiColonSeperated ? argsSemiColon : argsComma;

                    if ($(this.important)) {
                        important = true;
                    }

                    if (elements.length > 0 && ($(';') || peek('}'))) {
                        return new(tree.mixin.Call)(elements, args, index, env.filename, important);
                    }
                    
                    restore();
                }
532329
private static ExpressionTree stripParensAndCasts(ExpressionTree expr) {
    boolean someChange = true;
    while (someChange) {
      someChange = false;
      if (expr.getKind().equals(PARENTHESIZED)) {
        expr = ((ParenthesizedTree) expr).getExpression();
        someChange = true;
      }
      if (expr.getKind().equals(TYPE_CAST)) {
        expr = ((TypeCastTree) expr).getExpression();
        someChange = true;
      }
    }
    return expr;
  }
339631
@Override
    protected Expression and(Part part, Expression base, Iterator<Object> iterator) {
        return Expr.and(base, toExpression(part, root));
    }
567615
def p_expression_mod(self, p):
        ''
        p[0] = Mod(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))