select_expr ::= select param_start conditions param_stop expression
770551
def theta_join(self):
        
        long = self.parametrize(self.syntax.theta_join_op, self.conditions)
        short = self.parametrize(self.syntax.join_op, self.conditions).\
            setParseAction(self.theta_parse_action)
        return long ^ short
1371222
def parse_expr(e):
    
    m = relation_re.match(e)
    if m is None:
        raise ValueError("error parsing expression '{}'".format(e))
    field, op, val = m.groups()
    # Try different types
    try:
        # Integer
        val_int = int(val)
        val = val_int
    except ValueError:
        try:
            # Float
            val_float = float(val)
            val = val_float
        except ValueError:
            try:
                # Boolean
                val = {'true': True, 'false': False}[val.lower()]
            except KeyError:
                # String
                if re.match(r'".*"|\'.*\'', val):
                    # strip quotes from strings
                    val = val[1:-1]
    return field, op, val
387232
function findExpressionStatement(start, end) {
            let target = sourceCode.getNodeByRangeIndex(start)
            while (
                target &&
                target.range[1] <= end &&
                start <= target.range[0]
            ) {
                if (
                    target.type === "ExpressionStatement" &&
                    start === target.range[0] &&
                    target.range[1] === end
                ) {
                    return target
                }
                target = target.parent
            }
            return null
        }
686380
public static int findEndOfSubExpression(String expression, int start) {
		int count = 0;
		for (int i = start; i < expression.length(); i++) {
			switch (expression.charAt(i)) {
				case '(': {
					count++;
					break;
				}
				case ')': {
					count--;
					if (count == 0) {
						return i;
					}
					break;
				}
			}
		}
		throw new IllegalArgumentException("can't parse expression [" + expression + "]: end of subexpression not found");
	}
174021
def query_starts_with(query, prefixes):
    """"""
    prefixes = [prefix.lower() for prefix in prefixes]
    formatted_sql = sqlparse.format(query.lower(), strip_comments=True)
    return bool(formatted_sql) and formatted_sql.split()[0] in prefixes
15906
def p_expr1(p):
    
    p[0] = node.expr(op=p[1], args=node.expr_list([p[2]]))
647179
function _filter (node, expr, resultSet) {
        var
            selectedNodes,
            conditions,
            type,
            idx,
            condition;
        if (expr.and) {
            conditions = expr.and;
            type = 0;
        } else if (expr.or) {
            conditions = expr.or;
            type = 1;
        }
        for (idx = 0; idx < conditions.length; ++idx) {
            condition = conditions[idx];
            if (condition.and || condition.or) {
                selectedNodes = [];
                _filter(node, condition, selectedNodes);
            } else {
                selectedNodes = _select(node, condition);
            }
            if (0 === type && selectedNodes.length === 0) {
                return;
            }
            if (1 === type && selectedNodes.length !== 0) {
                resultSet.push(node);
                return;
            }
        }
        if (0 === type) {
            resultSet.push(node);
        }
    }
305652
def p_id_expr(p):
    
    entry = SYMBOL_TABLE.access_id(p[1], p.lineno(1), default_class=CLASS.var)
    if entry is None:
        p[0] = None
        return

    entry.accessed = True
    if entry.type_ == TYPE.auto:
        entry.type_ = _TYPE(gl.DEFAULT_TYPE)
        api.errmsg.warning_implicit_type(p.lineno(1), p[1], entry.type_)

    p[0] = entry

    """
    if entry.class_ == CLASS.var:
        if entry.type_ == TYPE.auto:
            entry.type_ = SYMBOL_TABLE.basic_types[gl.DEFAULT_TYPE]
            #api.errmsg.warning_implicit_type(p.lineno(1), p[1], entry.type_)
    """
    if entry.class_ == CLASS.array:
        if not LET_ASSIGNMENT:
            syntax_error(p.lineno(1), "Variable '%s' is an array and cannot be used in this context" % p[1])
            p[0] = None
    elif entry.kind == KIND.function:  # Function call with 0 args
        p[0] = make_call(p[1], p.lineno(1), make_arg_list(None))
    elif entry.kind == KIND.sub:  # Forbidden for subs
        api.errmsg.syntax_error_is_a_sub_not_a_func(p.lineno(1), p[1])
        p[0] = None
1117845
def p_statement_notexpr(self, p):
        ''' 
        '''
        _LOGGER.debug("expresion -> ! expression")
        if p[2].type == TypedClass.BOOLEAN: 
            p[0] = TypedClass(not p[2].value, TypedClass.BOOLEAN)
        else:
            raise TypeError("operator invalid for this type")
160799
private static void renderExpr(
      CodeBlock.Builder code, List<Node<PluralType>> rangeList, boolean equal, boolean decimalsZero) {
    
    int size = rangeList.size();
    String r = "";

    // Join the range list expressions with the OR operator.
    for (int i = 0; i < size; i++) {
      if (i > 0) {
        r += " || ";
      }
      r += renderRange("zz", rangeList.get(i));
    }

    // Wrap the expression in an IF.
    String fmt = "if (";
    if (decimalsZero) {
      fmt += "o.nd() != 0 || ";
    }

    if (equal) {
      fmt += size == 1 ? "!$L" : "!($L)";
    } else {
      fmt += "($L)";
    }

    fmt += ")";

    // Wrap the IF as a block.
    code.beginControlFlow(fmt, r);
    code.addStatement("return false");
    code.endControlFlow();
  }
990922
def p_ex_expression(tok):
        """"""
        if len(tok) == 3:
            tok[0] = UnaryOperationRule(tok[1], tok[2])
        else:
            tok[0] = tok[1]
1095671
def expr_query(criterion)
      selection(criterion) do |selector, field, value|
        selector.merge!(field.__expr_part__(value.__expand_complex__, negating?))
      end
    end
100677
def expr_query(criterion)
      selection(criterion) do |selector, field, value|
        if (field.is_a? Key) && custom_serialization?(field.name, field.operator)
          specified = custom_specify(field.name, field.operator, value)
        else
          specified = field.specify(value.__expand_complex__, negating?)
        end
        selector.merge!(specified)
      end
    end
903099
function(expr, ext){
    var rawget, ext = this.__ext__, touched = {};
    if(expr.type !== 'expression' || expr.touched) return expr;

    rawget = expr.get;
    if(!rawget){
      rawget = expr.get = new Function(_.ctxName, _.extName , _.prefix+ "return (" + expr.body + ")");
      expr.body = null;
    }
    touched.get = !ext? rawget: function(context, e){
      return rawget( context, e || ext )
    }

    if(expr.setbody && !expr.set){
      var setbody = expr.setbody;
      var filters = expr.filters;
      var self = this;
      if(!filters || !_.some(filters, function(filter){ return !self._f_(filter).set }) ){
        expr.set = function(ctx, value, ext){
          expr.set = new Function(_.ctxName, _.setName , _.extName, _.prefix + setbody);          
          return expr.set(ctx, value, ext);
        }
      }
      expr.filters = expr.setbody = null;
    }
    if(expr.set){
      touched.set = !ext? expr.set : function(ctx, value){
        return expr.set(ctx, value, ext);
      }
    }

    touched.type = 'expression';
    touched.touched = true;
    touched.once = expr.once || expr.constant;
    return touched
  }
692865
def select(first_or_all, sql_params = "", *bindvars)
      case first_or_all
      when :first, :all
        select_sql = "SELECT * "
      when :count
        select_sql = "SELECT COUNT(*) "
      else
        raise ArgumentError, "Only :first, :all or :count are supported"
      end
      select_sql << "FROM \"#{@schema_name}\".\"#{@table_name}\" "
      case sql_params
      when String
        select_sql << sql_params
      when Hash
        raise ArgumentError, "Cannot specify bind variables when passing WHERE conditions as Hash" unless bindvars.empty?
        where_sqls = []
        order_by_sql = nil
        sql_params.each do |k, v|
          if k == :order_by
            order_by_sql = " ORDER BY #{v} "
          elsif v.nil? || v == :is_null
            where_sqls << "#{k} IS NULL"
          elsif v == :is_not_null
            where_sqls << "#{k} IS NOT NULL"
          else
            where_sqls << "#{k} = :#{k}"
            bindvars << v
          end
        end
        select_sql << "WHERE " << where_sqls.join(" AND ") unless where_sqls.empty?
        select_sql << order_by_sql if order_by_sql
      else
        raise ArgumentError, "Only String or Hash can be provided as SQL condition argument"
      end
      if first_or_all == :count
        @schema.select_one(select_sql, *bindvars)
      else
        @schema.select(first_or_all, select_sql, *bindvars)
      end
    end
1160627
private void fromExpression(PatternDescrBuilder<?> pattern) throws RecognitionException {
        String expr = conditionalOrExpression();
        if (state.failed)
            return;

        if (state.backtracking == 0) {
            pattern.from().expression(expr);
            if (input.LA(1) != DRL6Lexer.EOF) {
                helper.emit(Location.LOCATION_LHS_BEGIN_OF_CONDITION);
            }
        }
    }
1089280
public NumberExpression<Integer> locate(String str, Expression<Integer> start) {
        return Expressions.numberOperation(Integer.class, Ops.StringOps.LOCATE2, ConstantImpl.create(str), mixin, start);
    }