01: /**************************************************************************/
02: /* B O S S A */
03: /* A simple imperative object-oriented research language */
04: /* (c) Daniel Bonniot 1999 */
05: /* */
06: /* This program is free software; you can redistribute it and/or modify */
07: /* it under the terms of the GNU General Public License as published by */
08: /* the Free Software Foundation; either version 2 of the License, or */
09: /* (at your option) any later version. */
10: /* */
11: /**************************************************************************/package nice.tools.code;
12:
13: import bossa.util.*;
14: import gnu.bytecode.*;
15:
16: /**
17: Used to store types with automatic conversion.
18:
19: @version $Date: 2004/02/11 16:06:05 $
20: @author bonniot
21: */
22:
23: public class SpecialTypes {
24: static public final Type intType, longType, byteType, charType,
25: shortType, floatType, doubleType, booleanType, voidType;
26:
27: public static void init() {
28: // if called, we know the static initializers are executed
29: }
30:
31: static {
32: byteType = Type.byte_type;
33: shortType = Type.short_type;
34: intType = Type.int_type;
35: longType = Type.long_type;
36:
37: charType = Type.char_type;
38:
39: booleanType = Type.boolean_type;
40: voidType = Type.void_type;
41:
42: floatType = Type.float_type;
43: doubleType = Type.double_type;
44:
45: //Type.flushTypeChanges();
46: }
47:
48: /**
49: @return an array type containing the specificied elements,
50: or the array type with unknown elements (can be primitive)
51: if elements is null.
52: */
53: static public ArrayType array(Type elements) {
54: if (elements == null)
55: return SpecialArray.unknownTypeArray();
56:
57: return SpecialArray.create(elements);
58: }
59: }
|