Exemplo n.º 1
0
        public bpl.GlobalVariable getMHPVar(string procName, bpl.TypeCtorDecl typeDecl)
        {
            var res   = new bpl.GlobalVariable(bpl.Token.NoToken, new bpl.TypedIdent(bpl.Token.NoToken, procName + mhpSuffix, new bpl.CtorType(bpl.Token.NoToken, typeDecl, new List <Microsoft.Boogie.Type>())));
            var attrs = new List <object>();

            attrs.Add(procName);
            res.Attributes = new bpl.QKeyValue(bpl.Token.NoToken, mhpAttr, attrs, null);
            return(res);
        }
Exemplo n.º 2
0
 public virtual void DeclareType(TypeCtorDecl t, string attributes)
 {
     Contract.Requires(t != null); ProcessDeclaration(t);
 }
Exemplo n.º 3
0
 public virtual Declaration VisitTypeCtorDecl(TypeCtorDecl node) {
   Contract.Requires(node != null);
   Contract.Ensures(Contract.Result<Declaration>() != null);
   return this.VisitDeclaration(node);
 }
Exemplo n.º 4
0
 public override Declaration VisitTypeCtorDecl(TypeCtorDecl node)
 {
     Contract.Ensures(Contract.Result<Declaration>() == node);
     return this.VisitDeclaration(node);
 }
Exemplo n.º 5
0
	void UserDefinedType(out Declaration/*!*/ decl, QKeyValue kv) {
		Contract.Ensures(Contract.ValueAtReturn(out decl) != null); IToken/*!*/ id; List<IToken>/*!*/ paramTokens = new List<IToken> ();
		Bpl.Type/*!*/ body = dummyType; bool synonym = false; 
		Ident(out id);
		if (la.kind == 1) {
			WhiteSpaceIdents(out paramTokens);
		}
		if (la.kind == 32) {
			Get();
			Type(out body);
			synonym = true; 
		}
		if (synonym) {
		 List<TypeVariable>/*!*/ typeParams = new List<TypeVariable>();
		 foreach(Token/*!*/ t in paramTokens){
		   Contract.Assert(t != null);
		   typeParams.Add(new TypeVariable(t, t.val));}
		 decl = new TypeSynonymDecl(id, id.val, typeParams, body, kv);
		} else {
		 decl = new TypeCtorDecl(id, id.val, paramTokens.Count, kv);
		}
		
	}
Exemplo n.º 6
0
 private static string GetCustomSortName(Microsoft.Boogie.TypeCtorDecl typeDecl)
 {
     // FIXME: Do proper mangling to avoid name clashes
     return("@" + typeDecl.Name);
 }