public override Bpl.Variable CreateEventVariable(IEventDefinition e) { Bpl.Variable v; string fieldName = MemberHelper.GetMemberSignature(e, NameFormattingOptions.DocumentationId); // HACK fieldName = fieldName.Replace("E:", "F:"); fieldName = TranslationHelper.TurnStringIntoValidIdentifier(fieldName); Bpl.IToken tok = e.Token(); Bpl.Type t = this.sink.CciTypeToBoogie(e.Type.ResolvedType); if (e.Adder.ResolvedMethod.IsStatic) { Bpl.TypedIdent tident = new Bpl.TypedIdent(tok, fieldName, t); v = new Bpl.GlobalVariable(tok, tident); } else { Bpl.Type mt = new Bpl.MapType(tok, new List <Bpl.TypeVariable>(), new List <Bpl.Type>(new Bpl.Type[] { this.RefType }), t); Bpl.TypedIdent tident = new Bpl.TypedIdent(tok, fieldName, mt); v = new Bpl.GlobalVariable(tok, tident); } return(v); }
public override Bpl.Variable CreateEventVariable(IEventDefinition e) { Bpl.Variable v; string fieldName = MemberHelper.GetMemberSignature(e, NameFormattingOptions.DocumentationId); // HACK fieldName = fieldName.Replace("E:", "F:"); fieldName = TranslationHelper.TurnStringIntoValidIdentifier(fieldName); Bpl.IToken tok = e.Token(); Bpl.Type t = this.sink.CciTypeToBoogie(e.Type.ResolvedType); if (e.Adder.ResolvedMethod.IsStatic) { Bpl.TypedIdent tident = new Bpl.TypedIdent(tok, fieldName, t); v = new Bpl.GlobalVariable(tok, tident); } else { Bpl.Type mt = new Bpl.MapType(tok, new List<Bpl.TypeVariable>(), new List<Bpl.Type>(new Bpl.Type[] {this.RefType}), t); Bpl.TypedIdent tident = new Bpl.TypedIdent(tok, fieldName, mt); v = new Bpl.GlobalVariable(tok, tident); } return v; }
public override Bpl.Variable CreateEventVariable(IEventDefinition e) { Bpl.Variable v; string fieldname = MemberHelper.GetMemberSignature(e, NameFormattingOptions.DocumentationId); fieldname = TranslationHelper.TurnStringIntoValidIdentifier(fieldname); Bpl.IToken tok = e.Token(); if (e.Adder.ResolvedMethod.IsStatic) { Bpl.Type t = this.sink.CciTypeToBoogie(e.Type.ResolvedType); Bpl.TypedIdent tident = new Bpl.TypedIdent(tok, fieldname, t); v = new Bpl.GlobalVariable(tok, tident); } else { Bpl.Type t = this.FieldType; Bpl.TypedIdent tident = new Bpl.TypedIdent(tok, fieldname, t); v = new Bpl.Constant(tok, tident, true); } return(v); }
public override Bpl.Variable CreateEventVariable(IEventDefinition e) { Bpl.Variable v; string fieldname = MemberHelper.GetMemberSignature(e, NameFormattingOptions.DocumentationId); fieldname = TranslationHelper.TurnStringIntoValidIdentifier(fieldname); Bpl.IToken tok = e.Token(); if (e.Adder.ResolvedMethod.IsStatic) { Bpl.Type t = this.sink.CciTypeToBoogie(e.Type.ResolvedType); Bpl.TypedIdent tident = new Bpl.TypedIdent(tok, fieldname, t); v = new Bpl.GlobalVariable(tok, tident); } else { Bpl.Type t = this.FieldType; Bpl.TypedIdent tident = new Bpl.TypedIdent(tok, fieldname, t); v = new Bpl.Constant(tok, tident, true); } return v; }