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


Java JCTree.getTag方法代码示例

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


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

示例1: getElement

import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
public Element getElement(TreePath path) {
    JCTree tree = (JCTree) path.getLeaf();
    Symbol sym = TreeInfo.symbolFor(tree);
    if (sym == null && TreeInfo.isDeclaration(tree)) {
        for (TreePath p = path; p != null; p = p.getParentPath()) {
            JCTree t = (JCTree) p.getLeaf();
            if (t.getTag() == JCTree.CLASSDEF) {
                JCClassDecl ct = (JCClassDecl) t;
                if (ct.sym != null) {
                    if ((ct.sym.flags_field & Flags.UNATTRIBUTED) != 0) {
                        attr.attribClass(ct.pos(), ct.sym);
                        sym = TreeInfo.symbolFor(tree);
                    }
                    break;
                }
            }
        }
    }
    return sym;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:21,代码来源:JavacTrees.java

示例2: documentifyBase

import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
private void documentifyBase(JCClassDecl base, boolean isTopLevel, boolean isFxStyle) {
    // add doc comment to class itself
    Comment comm = comment(docGen.getBaseComment(base, isTopLevel));
    curDocComments.putComment(base, comm);

    // add doc comments to members
    for (JCTree member : base.getMembers()) {
        switch (member.getTag()) {
            case VARDEF:
                documentifyField(base, (JCVariableDecl)member, isFxStyle);
                break;
            case METHODDEF:
                documentifyMethod(base, (JCMethodDecl)member, isFxStyle);
                break;
            case CLASSDEF:
                documentifyBase((JCClassDecl)member, false, isFxStyle);
                break;
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:Documentifier.java

示例3: fullName

import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
public Name fullName(JCTree tree) {
switch (tree.getTag()) {
case IDENT:
    return ((JCIdent) tree).name;
case SELECT:
           JCFieldAccess sel = (JCFieldAccess)tree;
    Name sname = fullName(sel.selected);
    return sname != null && sname.getByteLength() > 0 ? sname.append('.', sel.name) : sel.name;
default:
    return null;
}
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:VeryPretty.java

示例4: Info

import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
Info(JCTree tree, EndPosTable endPosTable) {
    this.tree = tree;
    tag = tree.getTag();
    start = TreeInfo.getStartPos(tree);
    pos = tree.pos;
    end = TreeInfo.getEndPos(tree, endPosTable);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:TreePosTest.java

示例5: isEnumerator

import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
/** Is the given tree an enumerator definition? */
private static boolean isEnumerator(JCTree tree) {
    return tree.getTag() == JCTree.Tag.VARDEF && (((JCVariableDecl) tree).mods.flags & ENUM) != 0;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:VeryPretty.java


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