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; }
public StringBuilder VisitEnum(SerializedEnumType serializedEnumType) { sb.AppendFormat("enum {0}", serializedEnumType.Name); return(sb); }
public int VisitEnum(SerializedEnumType e) { return(4); //$BUGBUG: at most sizeof int according to the C lang def, but varies widely among compilers. }
public bool VisitEnum(SerializedEnumType e) { throw new NotImplementedException(); }
public DataType VisitEnum(SerializedEnumType serializedEnumType) { throw new NotImplementedException(); }
public DataType VisitEnum(SerializedEnumType enumType) { return(PrimitiveType.Word32); }