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); }
public virtual void DeclareType(TypeCtorDecl t, string attributes) { Contract.Requires(t != null); ProcessDeclaration(t); }
public virtual Declaration VisitTypeCtorDecl(TypeCtorDecl node) { Contract.Requires(node != null); Contract.Ensures(Contract.Result<Declaration>() != null); return this.VisitDeclaration(node); }
public override Declaration VisitTypeCtorDecl(TypeCtorDecl node) { Contract.Ensures(Contract.Result<Declaration>() == node); return this.VisitDeclaration(node); }
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); } }
private static string GetCustomSortName(Microsoft.Boogie.TypeCtorDecl typeDecl) { // FIXME: Do proper mangling to avoid name clashes return("@" + typeDecl.Name); }