コード例 #1
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;
  }