示例#1
0
        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);
        }
示例#2
0
    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;
    }
示例#3
0
        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);
        }
示例#4
0
    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;
    }