public EnumSort(EnumDef def, Z3Provider z3p)
 {
     this.z3p = z3p;
     this.name = def.id.text;
     this.sort = z3p.MkEnumSort(def.id.text, def.elems.ToArray());
 }
 //Generate Z3 sorts from enum definition
 private static bool GenerateEnumSort(EnumDef def, FastTransducerInstance fti)
 {
     fti.enums.Add(new EnumSort(def, z3p));
     return true;
 }
Ejemplo n.º 3
0
 //Generate the C# corresponding to one enum
 private static bool GenerateEnum(EnumDef def, StringBuilder sb)
 {
     sb.Append("public enum " + def.id.text + " {");
     foreach (var elem in def.elems)
     {
         if (def.elems.First().Equals(elem))
         {
             sb.Append(elem);
         }
         else
         {
             sb.Append(", " + elem);
         }
     }
     sb.AppendLine("}");
     sb.AppendLine();
     return true;
 }