Returns the alias of a "expr AS alias" expression.
501880
private static String alias(SqlNode item) {
		assert item instanceof SqlCall;
		assert item.getKind() == SqlKind.AS;
		final SqlIdentifier identifier = ((SqlCall) item).operand(1);
		return identifier.getSimple();
	}
357694
def Xnor(*xs, simplify=True):
    
    xs = [Expression.box(x).node for x in xs]
    y = exprnode.not_(exprnode.xor(*xs))
    if simplify:
        y = y.simplify()
    return _expr(y)
956851
public function postProcessExpression(Expression $expression)
    {
        if ($this->hasHash($expression->hashCode())) {
            $alias = $this->getAlias($expression->hashCode());
            $alias = new Expr\Column($alias);
            $alias->setBuilder($this);
            $expression = new Expr\Raw(sprintf('%s AS %s', $expression->toSQL(), $alias->toSQL()));
        }
        
        return $expression;
    }
446310
def describe_token_expr(expr):
    """"""
    if ':' in expr:
        type, value = expr.split(':', 1)
        if type == 'name':
            return value
    else:
        type = expr
    return _describe_token_type(type)
952286
def visit_Expr(self, node: ast.Expr) -> Any:
        """"""
        result = self.visit(node=node.value)

        self.recomputed_values[node] = result
        return result
1152083
public function formatExpression(Expr $expr) {
        $field = $expr->getField();
        $operator = $expr->getOperator();
        $value = $expr->getValue();

        if ($operator === Expr::AS_ALIAS) {
            return sprintf($this->getClause(self::AS_ALIAS), $this->quote($field), $this->quote($value));

        // No value to use so exit early
        } else if (!$expr->useValue() && !($operator === Expr::NULL || $operator === Expr::NOT_NULL)) {
            return $this->quote($field);
        }

        $isSubQuery = ($value instanceof SubQuery);

        // Function as field
        if ($field instanceof Func) {
            $field = $this->formatFunction($field);

        // Raw expression as field
        } else if ($field instanceof RawExpr) {
            $field = $field->getValue();

        // Regular clause
        } else {
            $field = $this->quote($field);
        }

        // IN has special case
        if ($operator === Expr::IN || $operator === Expr::NOT_IN) {
            if ($isSubQuery) {
                $clause = sprintf($this->getClause($operator), $field, '?');
                $clause = str_replace(['(', ')'], '', $clause);
            } else {
                $clause = sprintf($this->getClause($operator), $field, implode(', ', array_fill(0, count($value), '?')));
            }

        // Operators with clauses
        } else if ($this->hasClause($operator)) {
            $clause = sprintf($this->getClause($operator), $field);

        // Basic operator
        } else {
            $clause = sprintf($this->getClause(self::EXPRESSION), $field, $operator);
        }

        // Replace ? with sub-query statement
        if ($isSubQuery) {
            /** @type \Titon\Db\Query\SubQuery $value */

            // EXISTS and NOT EXISTS doesn't have a field or operator
            if (in_array($value->getFilter(), [SubQuery::EXISTS, SubQuery::NOT_EXISTS], true)) {
                $clause = $this->formatSubQuery($value);

            } else {
                $clause = str_replace('?', $this->formatSubQuery($value), $clause);
            }
        }

        return $clause;
    }
113917
def get_aliasing(*extra):
    
    alias = dict((k, k) for k in funcs_common)
    alias.update(_alias_str)
    alias.update((fn, fn) for fn in _alias_builtin.values())
    alias.update(_alias_builtin)
    for d in extra:
        alias.update(d)
    alias.update((k, k) for k in set(alias.values()))
    # Treat nan-functions as firstclass member and add them directly
    for key in set(alias.values()):
        if key not in funcs_no_separate_nan:
            key = 'nan' + key
            alias[key] = key
    return alias
628037
function symbolAlias(aliasFor) {
  return function(lexer, text) {
    var token = lexer.next_token(text);
    return sl.atom(aliasFor, {token: token});
  }
}
105920
def get_mx(self, tree: Union[ast.Symbol, ast.ComponentRef, ast.Expression]) -> ca.MX:
        
        if tree not in self.src:
            if isinstance(tree, ast.Symbol):
                s = self.get_symbol(tree)
            elif isinstance(tree, ast.ComponentRef):
                s = self.get_component(tree)
            else:
                raise Exception('Tried to look up expression before it was reached by the tree walker')
            self.src[tree] = s
        return self.src[tree]
13531
def get_name(self, use_alias=True):
        
        if self.desc:
            direction = 'DESC'
        else:
            direction = 'ASC'

        if use_alias:
            return '{0} {1}'.format(self.field.get_identifier(), direction)
        return '{0} {1}'.format(self.field.get_select_sql(), direction)
134622
public static <D> SimpleExpression<D> as(Expression<D> source, Path<D> alias) {
        if (source == null) {
            return as(Expressions.<D>nullExpression(), alias);
        } else {
            return operation(alias.getType(), Ops.ALIAS, source, alias);
        }
    }
567244
def lookup(alias):
    

    if alias in matchers:
        return matchers[alias]
    else:
        norm = normalize(alias)
        if norm in normalized:
            alias = normalized[norm]
            return matchers[alias]

    # Check without snake case
    if -1 != alias.find('_'):
        norm = normalize(alias).replace('_', '')
        return lookup(norm)

    return None
1349196
@SuppressWarnings("unchecked")
    public SimpleExpression<T> as(Path<?> alias) {
        return Expressions.as(this, (Path) alias);
    }
1071828
function getPathFromMemberExpression(expr, acc = []) {
  if (expr.type === "Identifier") {
    return acc.concat(expr.name);
  } else if (expr.type === "MemberExpression") {
    return acc.concat(getPathFromMemberExpression(expr.object, acc)).concat(expr.property.name);
  } else {
    throw new Error(`Expected MemberExpression or Identifier but get ${expr.type}.`);
  }
}
805852
def get_call_exprs(self, line):
        """"""
        line = line.lstrip()
        try:
            tree = self.ast.parse(line)
        except SyntaxError:
            return None
        for node in self.ast.walk(tree):
            if isinstance(node, self.ast.Call):
                offsets = []
                for arg in node.args:
                    # In Python 3.4 the col_offset is calculated wrong. See
                    # https://bugs.python.org/issue21295
                    if isinstance(arg, self.ast.Attribute) and (
                            (3, 4, 0) <= self.sys.version_info <= (3, 4, 3)):
                        offsets.append(arg.col_offset - len(arg.value.id) - 1)
                    else:
                        offsets.append(arg.col_offset)
                if node.keywords:
                    line = line[:node.keywords[0].value.col_offset]
                    line = self.re.sub(r'\w+\s*=\s*$', '', line)
                else:
                    line = self.re.sub(r'\s*\)\s*$', '', line)
                offsets.append(len(line))
                args = []
                for i in range(len(node.args)):
                    args.append(line[offsets[i]:offsets[i + 1]].rstrip(', '))
                return args
746919
function parseRelationalExpression() {
        var expr, previousAllowIn;

        previousAllowIn = allowIn;
        allowIn = true;
        expr = parseShiftExpression();
        allowIn = previousAllowIn;

        if (match('<') || match('>') || match('<=') || match('>=')) {
            expr = {
                type: Syntax.BinaryExpression,
                operator: lex().value,
                left: expr,
                right: parseRelationalExpression()
            };
        } else if (allowIn && matchKeyword('in')) {
            lex();
            expr = {
                type: Syntax.BinaryExpression,
                operator: 'in',
                left: expr,
                right: parseRelationalExpression()
            };
        } else if (matchKeyword('instanceof')) {
            lex();
            expr = {
                type: Syntax.BinaryExpression,
                operator: 'instanceof',
                left: expr,
                right: parseRelationalExpression()
            };
        }

        return expr;
    }
1309438
protected Expression visitExpression(Expression expr) {
        if (expr == null) {
            return null;
        }

        Expression newExpr = (Expression)expr.accept(this);
        if (expr != newExpr) {
            Type newType = newExpr.getType();

            if (newType == null || !newType.equals(expr.getType())) {
                Iterator<Expression.Conversion> it =
                    expr.getConversionChain().iterator();
                while (it.hasNext()) {
                    Expression.Conversion conv = it.next();
                    newExpr.convertTo
                        (conv.getToType(), conv.isCastPreferred());
                }
            }
        }
        return newExpr;
    }