Using JSqlParser at github your start would be production
function()
Here you have to modify the jjt - File because this version of JSqlParser does some kind of ASTNode building. The jj - File is derived.
At the moment there is a SimpleExpressionList accepted
"(" [ [<K_DISTINCT> { retval.setDistinct(true); } | <K_ALL> { retval.setAllColumns(true); }] (expressionList=SimpleExpressionList() | "*" { retval.setAllColumns(true); }) ] ")"
This accepts only expressions but no conditions. You could make a variant of SimpleExpressionList (maybe SimpleExpressionOrConditionList) and
ExpressionList SimpleExpressionConditionList():
{
ExpressionList retval = new ExpressionList();
List<Expression> expressions = new ArrayList<Expression>();
Expression expr = null;
}
{
( expr=SimpleExpression() | expr=Condition() )
{ expressions.add(expr); } ("," ( expr=SimpleExpression() | expr=Condition() ) { expressions.add(expr); })*
{
retval.setExpressions(expressions);
return retval;
}
}
This is not tested!
But it should be a possibility. Pull requests are welcome: https://github.com/JSQLParser/JSqlParser