コード例 #1
0
 public SerializedType ParseEnum(List<Argument_v1> compoundArgs)
 {
     int size;
     Domain domain;
     switch (str[i++])
     {
     case '0': size = 1; domain = Domain.Character; break;
     case '1': size = 1; domain = Domain.Character|Domain.UnsignedInt; break;
     case '2': size = 2; domain = Domain.SignedInt; break;
     case '3': size = 2; domain = Domain.UnsignedInt; break;
     case '4': size = 4; domain = Domain.SignedInt; break;
     case '5': size = 4; domain = Domain.UnsignedInt; break;
     case '6': size = 4; domain = Domain.SignedInt; break;
     case '7': size = 4; domain = Domain.UnsignedInt; break;
     default: Error("Unknown enum code {0}.", str[i - 1]); return null;
     }
     var n = ParseQualification();
     var e = new SerializedEnumType(size, domain, n.Last());
     compoundArgs.Add(new Argument_v1 { Type = e });
     return e;
 }
コード例 #2
0
 public StringBuilder VisitEnum(SerializedEnumType serializedEnumType)
 {
     sb.AppendFormat("enum {0}", serializedEnumType.Name);
     return(sb);
 }
コード例 #3
0
 public int VisitEnum(SerializedEnumType e)
 {
     return(4);           //$BUGBUG: at most sizeof int according to the C lang def, but varies widely among compilers.
 }
コード例 #4
0
 public bool VisitEnum(SerializedEnumType e)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
 public DataType VisitEnum(SerializedEnumType serializedEnumType)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
 public DataType VisitEnum(SerializedEnumType enumType)
 {
     return(PrimitiveType.Word32);
 }