use of com.pingcap.tikv.parser.MySqlParser.ExpressionContext in project tispark by pingcap.
the class AstBuilder method visitLogicalExpression.
public Expression visitLogicalExpression(MySqlParser.LogicalExpressionContext ctx) {
ExpressionContext left = ctx.expression(0);
ExpressionContext right = ctx.expression(1);
switch(ctx.logicalOperator().getText()) {
case "and":
return LogicalBinaryExpression.and(visitChildren(left), visitChildren(right));
case "or":
return LogicalBinaryExpression.or(visitChildren(left), visitChildren(right));
case "xor":
return LogicalBinaryExpression.xor(visitChildren(left), visitChildren(right));
}
throw new UnsupportedSyntaxException(ctx.toString() + ": it is not possible reach to this line of code");
}
Aggregations