本文整理汇总了Java中polyglot.util.CodeWriter类的典型用法代码示例。如果您正苦于以下问题:Java CodeWriter类的具体用法?Java CodeWriter怎么用?Java CodeWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CodeWriter类属于polyglot.util包,在下文中一共展示了CodeWriter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import polyglot.util.CodeWriter; //导入依赖的package包/类
public final void execute(){
astNode.visit(this);
// Testing testing testing
System.out.println("\n\n\n PRETTY P{RINTING");
if (this instanceof StmtSumWeightedByDepth) {
metricPrettyPrinter p = new metricPrettyPrinter(this);
p.printAst(astNode, new CodeWriter(System.out, 80));
}
}
示例2: printAstMetric
import polyglot.util.CodeWriter; //导入依赖的package包/类
public void printAstMetric(Node n, CodeWriter w) {
if (n instanceof Stmt) {
if (stmtToMetric.containsKey(n)) {
w.write(" // sum= "+stmtToMetric.get(n)+" : depth= "+stmtToMetricDepth.get(n)+"\t");
}
}
}
示例3: prettyPrint
import polyglot.util.CodeWriter; //导入依赖的package包/类
/** Write the expression to an output file. */
@Override
public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
w.begin(0);
w.write("<");
w.write(this.securityString());
w.write(">");
w.allowBreak(2, " ");
printSubExpr(expr, w, tr);
w.end();
}
示例4: prettyPrint
import polyglot.util.CodeWriter; //导入依赖的package包/类
@Override
public void prettyPrint(CodeWriter cw) {
if (this.kindPol != KindPolicy.OTHER) {
this.kindPol.prettyPrint(cw);
cw.write("{");
this.flowPol.prettyPrint(cw);
cw.write("}");
}
else {
this.flowPol.prettyPrint(cw);
}
}
示例5: prettyPrint
import polyglot.util.CodeWriter; //导入依赖的package包/类
@Override
public void prettyPrint(CodeWriter cw) {
cw.write(isPublicKey ? "PUBKEY" : "PRIVKEY");
cw.write("(");
keyBound.prettyPrint(cw);
cw.write(")");
}
示例6: print
import polyglot.util.CodeWriter; //导入依赖的package包/类
public void print(Node parent, Node child, CodeWriter w) {
astMetric.printAstMetric(child,w);
super.print(parent,child,w);
}
示例7: prettyPrint
import polyglot.util.CodeWriter; //导入依赖的package包/类
@Override
public void prettyPrint(CodeWriter cw) {
cw.write("Other");
}
示例8: prettyPrint
import polyglot.util.CodeWriter; //导入依赖的package包/类
@Override
public void prettyPrint(CodeWriter cw) {
cw.write(this.toString());
}
示例9: printAstMetric
import polyglot.util.CodeWriter; //导入依赖的package包/类
public void printAstMetric(Node n, CodeWriter w) {
}