Exemple #1
0
 /// <summary>
 /// Adds the given formals to the current variable context, and then resolves
 /// the types of those formals.  Does NOT resolve the where clauses of the
 /// formals.
 /// Relies on the caller to first create, and later tear down, that variable
 /// context.
 /// </summary>
 /// <param name="rc"></param>
 protected void RegisterFormals(List<Variable> formals, ResolutionContext rc) {
   Contract.Requires(rc != null);
   Contract.Requires(formals != null);
   foreach (Formal/*!*/ f in formals) {
     Contract.Assert(f != null);
     if (f.Name != TypedIdent.NoName) {
       rc.AddVariable(f, false);
     }
     f.Resolve(rc);
   }
 }
Exemple #2
0
 public override void Resolve(ResolutionContext rc)
 {
     //Contract.Requires(rc != null);
       rc.PushVarContext();
       foreach (Variable/*!*/ v in Locals) {
     Contract.Assert(v != null);
     rc.AddVariable(v, false);
       }
       foreach (Cmd/*!*/ cmd in Cmds) {
     Contract.Assert(cmd != null);
     cmd.Resolve(rc);
       }
       rc.PopVarContext();
 }
Exemple #3
0
 public override void Register(ResolutionContext rc) {
   //Contract.Requires(rc != null);
   rc.AddVariable(this, false);
 }