Search in sources :

Example 1 with AQLFormatPrintVisitor

use of org.apache.asterix.lang.aql.visitor.AQLFormatPrintVisitor in project asterixdb by apache.

the class AQLFormatPrintUtil method toString.

public static String toString(List<ILangExpression> exprs) throws CompilationException {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    PrintWriter output = new PrintWriter(bos);
    AQLFormatPrintVisitor visitor = new AQLFormatPrintVisitor(output);
    for (ILangExpression expr : exprs) {
        expr.accept(visitor, 0);
    }
    output.close();
    return bos.toString();
}
Also used : ILangExpression(org.apache.asterix.lang.common.base.ILangExpression) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AQLFormatPrintVisitor(org.apache.asterix.lang.aql.visitor.AQLFormatPrintVisitor) PrintWriter(java.io.PrintWriter)

Example 2 with AQLFormatPrintVisitor

use of org.apache.asterix.lang.aql.visitor.AQLFormatPrintVisitor in project asterixdb by apache.

the class AQLFormatPrintUtil method print.

public static void print(ILangExpression expr, PrintWriter output) throws CompilationException {
    AQLFormatPrintVisitor visitor = new AQLFormatPrintVisitor(output);
    expr.accept(visitor, 0);
}
Also used : AQLFormatPrintVisitor(org.apache.asterix.lang.aql.visitor.AQLFormatPrintVisitor)

Aggregations

AQLFormatPrintVisitor (org.apache.asterix.lang.aql.visitor.AQLFormatPrintVisitor)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintWriter (java.io.PrintWriter)1 ILangExpression (org.apache.asterix.lang.common.base.ILangExpression)1