108: def self.parse_type(ftype)
109: type = ftype
110: pos = ftype.index('(')
111: decimal = nil
112: size = nil
113: array_of_type = nil
114:
115: if pos != nil
116: type = ftype[0..pos-1]
117: size = ftype[pos+1..-2]
118: pos = size.index(',')
119: if pos != nil
120: size, decimal = size.split(',', 2)
121: size = size.to_i
122: decimal = decimal.to_i
123: else
124: size = size.to_i
125: end
126: end
127:
128: if type =~ /\[\]$/
129: type.sub!(/\[\]$/, '')
130: array_of_type = true
131: end
132:
133: return {
134: :ftype => ftype.dup,
135: :type => type,
136: :size => size,
137: :decimal => decimal,
138: :array => array_of_type
139: }
140: end