示例#1
0
 private void SetNonUniform(string procedureName, WhileCmd wc)
 {
     nonUniformLoops[procedureName].Add(GetLoopId(wc));
     RecordProcedureChanged();
 }
示例#2
0
文件: Parser.cs 项目: qunyanm/boogie
	void WhileCmd(out WhileCmd/*!*/ wcmd) {
		Contract.Ensures(Contract.ValueAtReturn(out wcmd) != null); IToken/*!*/ x;  Token z;
		Expr guard;  Expr/*!*/ e;  bool isFree;
		List<PredicateCmd/*!*/> invariants = new List<PredicateCmd/*!*/>();
		StmtList/*!*/ body;
		QKeyValue kv = null;
		
		Expect(43);
		x = t; 
		Guard(out guard);
		Contract.Assume(guard == null || cce.Owner.None(guard)); 
		while (la.kind == 36 || la.kind == 44) {
			isFree = false; z = la/*lookahead token*/; 
			if (la.kind == 36) {
				Get();
				isFree = true;  
			}
			Expect(44);
			while (la.kind == 28) {
				Attribute(ref kv);
			}
			Expression(out e);
			if (isFree) {
			 invariants.Add(new AssumeCmd(z, e, kv));
			} else {
			 invariants.Add(new AssertCmd(z, e, kv));
			}
			kv = null;
			
			Expect(9);
		}
		Expect(28);
		StmtList(out body);
		wcmd = new WhileCmd(x, guard, invariants, body); 
	}
示例#3
0
 private int GetLoopId(WhileCmd wc)
 {
     AssertCmd inv = wc.Invariants[0] as AssertCmd;
     Debug.Assert(inv.Attributes.Key.Contains("loophead_"));
     return Convert.ToInt32(inv.Attributes.Key.Substring("loophead_".Length));
 }