当前位置: 首页>>代码示例>>Java>>正文


Java TreeInfo.notExpression方法代码示例

本文整理汇总了Java中com.sun.tools.javac.tree.TreeInfo.notExpression方法的典型用法代码示例。如果您正苦于以下问题:Java TreeInfo.notExpression方法的具体用法?Java TreeInfo.notExpression怎么用?Java TreeInfo.notExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.tools.javac.tree.TreeInfo的用法示例。


在下文中一共展示了TreeInfo.notExpression方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: VeryPretty

import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
private VeryPretty(Context context, CodeStyle cs, Map<Tree, ?> tree2Tag, Map<Tree, DocCommentTree> tree2Doc, Map<?, int[]> tag2Span, String origText) {
names = Names.instance(context);
enclClass = null;
       commentHandler = CommentHandlerService.instance(context);
       operators = Operators.instance(context);
widthEstimator = new WidthEstimator(context);
       danglingElseChecker = new DanglingElseChecker();
       prec = TreeInfo.notExpression;
       this.cs = cs;
       out = new CharBuffer(cs.getRightMargin(), cs.getTabSize(), cs.expandTabToSpaces());
       out.addTrimObserver(this);
       this.indentSize = cs.getIndentSize();
       this.tree2Tag = tree2Tag;
       this.tree2Doc = tree2Doc == null ? Collections.EMPTY_MAP : tree2Doc;
       this.tag2Span = (Map<Object, int[]>) tag2Span;//XXX
       this.origText = origText;
       this.comments = CommentHandlerService.instance(context);
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:VeryPretty.java

示例2: visitVarDef

import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
public void visitVarDef(JCVariableDecl tree) {
	try {
		boolean suppressSemi = suppressFinalAndSemicolonsInTry;
		if (getJavadocFor(tree) != null) {
			println(); align();
		}
		printDocComment(tree);
		if ((tree.mods.flags & ENUM) != 0) {
			printEnumMember(tree);
		} else {
			printExpr(tree.mods);
			if ((tree.mods.flags & VARARGS) != 0) {
				printExpr(((JCArrayTypeTree) tree.vartype).elemtype);
				print("... " + tree.name);
			} else {
				printExpr(tree.vartype);
				print(" " + tree.name);
			}
			if (tree.init != null) {
				print(" = ");
				printExpr(tree.init);
			}
			if (prec == TreeInfo.notExpression && !suppressSemi) print(";");
		}
	} catch (IOException e) {
		throw new UncheckedIOException(e);
	}
}
 
开发者ID:mobmead,项目名称:EasyMPermission,代码行数:29,代码来源:PrettyCommentsPrinter.java

示例3: visitExec

import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
public void visitExec(JCExpressionStatement tree) {
	if (isNoArgsSuperCall(tree.expr)) return;
	try {
		printExpr(tree.expr);
		if (prec == TreeInfo.notExpression) print(";");
	} catch (IOException e) {
		throw new UncheckedIOException(e);
	}
}
 
开发者ID:mobmead,项目名称:EasyMPermission,代码行数:10,代码来源:PrettyCommentsPrinter.java

示例4: visitVarDef

import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
public void visitVarDef(JCVariableDecl tree) {
    try {
        if (docComments != null && docComments.get(tree) != null) {
            println(); align();
        }
        printDocComment(tree);
        if ((tree.mods.flags & ENUM) != 0) {
            printEnumMember(tree);
        } else {
            printExpr(tree.mods);
            if ((tree.mods.flags & VARARGS) != 0) {
                printExpr(((JCArrayTypeTree) tree.vartype).elemtype);
                print("... " + tree.name);
            } else {
                printExpr(tree.vartype);
                print(" " + tree.name);
            }
            if (tree.init != null) {
                print(" = ");
                printExpr(tree.init);
            }
            if (prec == TreeInfo.notExpression) print(";");
        }
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
开发者ID:redundent,项目名称:lombok,代码行数:28,代码来源:PrettyCommentsPrinter.java

示例5: visitExec

import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
public void visitExec(JCExpressionStatement tree) {
    if (isNoArgsSuperCall(tree.expr)) return;
    try {
        printExpr(tree.expr);
        if (prec == TreeInfo.notExpression) print(";");
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
开发者ID:redundent,项目名称:lombok,代码行数:10,代码来源:PrettyCommentsPrinter.java

示例6: visitVarDef

import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
@Override
public void visitVarDef(JCVariableDecl tree) {
    boolean notEnumConst = (tree.mods.flags & Flags.ENUM) == 0;
    printAnnotations(tree.mods.annotations);
    if (notEnumConst) {
        printFlags(tree.mods.flags);
        if (!suppressVariableType) {
            if ((tree.mods.flags & VARARGS) != 0) {
                // Variable arity method. Expecting  ArrayType, print ... instead of [].
                if (Kind.ARRAY_TYPE == tree.vartype.getKind()) {
                    printExpr(((JCArrayTypeTree) tree.vartype).elemtype);
                } else {
                    printExpr(tree.vartype);
                }
                print("...");
            } else {
                print(tree.vartype);
            }
        }
    }
    if (tree.vartype != null && !suppressVariableType) //should also check the flags?
        needSpace();
    if (!ERROR.contentEquals(tree.name))
        print(tree.name);
    if (tree.init != null) {
        if (notEnumConst) {
            printVarInit(tree);
        } else {
            JCNewClass newClsTree = (JCNewClass) tree.init;
            if (newClsTree.args.nonEmpty()) {
                print(cs.spaceBeforeMethodCallParen() ? " (" : "(");
                if (cs.spaceWithinMethodCallParens())
                    print(' ');
                wrapTrees(newClsTree.args,
                        cs.wrapMethodCallArgs(),
                        cs.alignMultilineCallArgs() ? out.col : out.leftMargin + cs.getContinuationIndentSize()
                );
                print(cs.spaceWithinMethodCallParens() ? " )" : ")");
            }
            if (newClsTree.def != null) {
                JCClassDecl enclClassPrev = enclClass;
                enclClass = newClsTree.def;
                printBlock(null, newClsTree.def.defs, cs.getOtherBracePlacement(), cs.spaceBeforeClassDeclLeftBrace(), true);
                enclClass = enclClassPrev;
            }
        }
    }
    if ((prec == TreeInfo.notExpression) && notEnumConst) {
        print(';');
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:52,代码来源:VeryPretty.java

示例7: visitExec

import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
@Override
   public void visitExec(JCExpressionStatement tree) {
printNoParenExpr(tree.expr);
if (prec == TreeInfo.notExpression)
    print(';');
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:VeryPretty.java


注:本文中的com.sun.tools.javac.tree.TreeInfo.notExpression方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。