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


Java ConstructorDecl类代码示例

本文整理汇总了Java中polyglot.ast.ConstructorDecl的典型用法代码示例。如果您正苦于以下问题:Java ConstructorDecl类的具体用法?Java ConstructorDecl怎么用?Java ConstructorDecl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: constructorCall

import polyglot.ast.ConstructorDecl; //导入依赖的package包/类
/**
 * Process a constructor call to this() or super(), i.e., from within a constructor.
 * @param ci
 * @return
 */
public SetConditionsAbsVal constructorCall(ConstructorInstance ci,
        ConstructorCall n) {
    ConstructorDecl cd =
            (ConstructorDecl) this.currentAnalysisUnit().codeNode();
    ExtConstructorDecl ext = (ExtConstructorDecl) AccrueExt_c.ext(cd);
    Set<HContext> pointsTo =
            pointsTo(ext.getThisNode(), this.currentContext(), this.extInfo);
    if (pointsTo.isEmpty()) {
        System.err.println("WARNING: constructor invocation doesn't point to anything!");
        System.err.println("ci " + ci);
        System.err.println("n " + n);
        System.err.println("cd " + cd);
        System.err.println("ext " + ext);
        System.err.println("pointsTo " + pointsTo);
        System.err.println("ext.getThisNode() " + ext.getThisNode());
        System.err.println("this.currentContext() " + this.currentContext());
        System.err.println("this.extInfo " + this.extInfo);

        /*throw new InternalCompilerError("Constructor invocation doesn't point to anything!",
                                        n.position());*/
        return new SetConditionsAbsVal(new HashSet<AbstractLocation>());
    }
    else {
        Set<AbstractLocation> setConds = new HashSet<AbstractLocation>();
        for (HContext o : pointsTo) {
            SetConditionsAbsVal dfi =
                    callNonVirtual(ci,
                                   workQueue.factory()
                                            .createAnalysisContext(this,
                                                                   ci,
                                                                   o,
                                                                   n));
            setConds.addAll(dfi.setConditions());
        }
        return new SetConditionsAbsVal(setConds);
    }
}
 
开发者ID:HarvardPL,项目名称:cryptoerase,代码行数:43,代码来源:SetConditionsAnalysisUtil.java


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