use of com.alibaba.cobar.parser.ast.expression.primary.function.string.Char in project cobar by alibaba.
the class MySQLExprParser method functionChar.
/**
* first '(' has been consumed
*/
private Char functionChar() throws SQLSyntaxErrorException {
Char chr;
for (List<Expression> tempExprList = new LinkedList<Expression>(); ; ) {
Expression tempExpr = expression();
tempExprList.add(tempExpr);
switch(lexer.token()) {
case PUNC_COMMA:
lexer.nextToken();
continue;
case PUNC_RIGHT_PAREN:
lexer.nextToken();
chr = new Char(tempExprList, null);
chr.setCacheEvalRst(cacheEvalRst);
return chr;
case KW_USING:
lexer.nextToken();
String tempStr = lexer.stringValue();
match(IDENTIFIER);
match(PUNC_RIGHT_PAREN);
chr = new Char(tempExprList, tempStr);
chr.setCacheEvalRst(cacheEvalRst);
return chr;
default:
throw err("expect ',' or 'USING' or ')' but is " + lexer.token());
}
}
}
Aggregations