2
// Copyright (C) 2003 Mike Krueger (mike@icsharpcode.net)
4
// This program is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU General Public License
6
// as published by the Free Software Foundation; either version 2
7
// of the License, or (at your option) any later version.
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
using System.Collections;
21
using ICSharpCode.SharpRefactory.Parser.VB;
23
namespace ICSharpCode.SharpRefactory.Parser.AST.VB
25
public class TypeReference : AbstractNode
29
ArrayList rankSpecifier;
31
AttributeSection attributes = null;
33
static Hashtable types = new Hashtable();
34
static TypeReference()
36
types.Add("boolean", "System.Boolean");
37
types.Add("byte", "System.Byte");
38
types.Add("date", "System.DateTime");
39
types.Add("char", "System.Char");
40
types.Add("decimal", "System.Decimal");
41
types.Add("double", "System.Double");
42
types.Add("single", "System.Single");
43
types.Add("integer", "System.Int32");
44
types.Add("long", "System.Int64");
45
types.Add("object", "System.Object");
46
types.Add("short", "System.Int16");
47
types.Add("string", "System.String");
50
public AttributeSection Attributes
60
public static ICollection PrimitiveTypes
77
public string SystemType
84
public ArrayList RankSpecifier
90
rankSpecifier = value;
94
public bool IsArrayType
97
return rankSpecifier != null && rankSpecifier.Count> 0;
101
public ArrayList Dimension
111
string GetSystemType(string type)
113
return (string)types[type.ToLower()];
116
public TypeReference(string type)
118
this.systemType = GetSystemType(type);
122
public TypeReference(string type, ArrayList rankSpecifier)
125
this.systemType = GetSystemType(type);
126
this.rankSpecifier = rankSpecifier;
129
public override object AcceptVisitor(IASTVisitor visitor, object data)
131
return visitor.Visit(this, data);
134
public override string ToString()
136
return String.Format("[TypeReference: Type={0}, RankSpeifier={1}]", type, AbstractNode.GetCollectionString(rankSpecifier));