コード例 #1
0
ファイル: InitChecker.java プロジェクト: tianhuat/polyglot
  /** Perform the appropriate flow operations for declaration of a formal parameter */
  protected Map flowFormal(DataFlowItem inItem, FlowGraph graph, Formal f, Set succEdgeKeys) {
    Map m = new HashMap(inItem.initStatus);
    // a formal argument is always defined.
    m.put(f.localInstance(), new MinMaxInitCount(InitCount.ONE, InitCount.ONE));

    // record the fact that we have seen the formal declaration
    currCBI.localDeclarations.add(f.localInstance());

    return itemToMap(new DataFlowItem(m), succEdgeKeys);
  }
コード例 #2
0
  private Node buildFormal(Formal f) throws SemanticException // Based on buildLocalDecl.
      {
    Type t = f.declType();
    SJLocalInstance li = (SJLocalInstance) f.localInstance();

    if (t.isSubtype(SJ_ABSTRACT_CHANNEL_TYPE)) {
      if (!(f instanceof SJFormal)) {
        throw new SemanticException(
            "[SJProtocolDeclTypeBuilder] Session socket parameters should be declared by their session type: "
                + f);
      }

      SJTypeNode tn = disambiguateSJTypeNode(this, ((SJFormal) f).sessionType());
      SJSessionType st = tn.type();
      String sjname = f.name(); // Should match that given by SJVariable.sjname.

      f = f.localInstance(sjts.SJLocalProtocolInstance(li, st, sjname));
      f = setSJFormalExt((SJFormal) f, tn, sjname);
    }

    return f;
  }
コード例 #3
0
 public AfterReturningArgAdvice(Formal formal, Position pos) {
   super(pos);
   this.formal = formal;
   this.var = new Var(formal.getName(), formal.getPosition());
 }