Exemplo n.º 1
0
 public override object Visit(TypeExpression typeExpression)
 {
     var result = new PrimitiveType ();
     if (typeExpression.Type == TypeManager.void_type) {
         result.Keyword = "void";
     } else if (typeExpression.Type == TypeManager.string_type) {
         result.Keyword = "string";
     } else if (typeExpression.Type == TypeManager.int32_type) {
         result.Keyword = "int";
     } else if (typeExpression.Type == TypeManager.object_type) {
         result.Keyword = "object";
     } else if (typeExpression.Type == TypeManager.float_type) {
         result.Keyword = "float";
     } else if (typeExpression.Type == TypeManager.double_type) {
         result.Keyword = "double";
     } else if (typeExpression.Type == TypeManager.int64_type) {
         result.Keyword = "long";
     } else if (typeExpression.Type == TypeManager.byte_type) {
         result.Keyword = "byte";
     } else if (typeExpression.Type == TypeManager.uint32_type) {
         result.Keyword = "uint";
     } else if (typeExpression.Type == TypeManager.uint64_type) {
         result.Keyword = "ulong";
     } else if (typeExpression.Type == TypeManager.short_type) {
         result.Keyword = "short";
     } else if (typeExpression.Type == TypeManager.ushort_type) {
         result.Keyword = "ushort";
     } else if (typeExpression.Type == TypeManager.sbyte_type) {
         result.Keyword = "sbyte";
     } else if (typeExpression.Type == TypeManager.decimal_type) {
         result.Keyword = "decimal";
     } else {
         throw new NotImplementedException();
     }
     if (result.Keyword != null) {
         result.AddChild (new CSharpTokenNode (Convert (typeExpression.Location), result.Keyword.Length), PrimitiveType.Roles.Keyword);
     }
     return result;
 }