01: /**************************************************************************/
02: /* N I C E */
03: /* A high-level object-oriented research language */
04: /* (c) Daniel Bonniot 2004 */
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 mlsub.typing;
12:
13: import mlsub.typing.lowlevel.Kind;
14: import mlsub.typing.lowlevel.Element;
15:
16: /**
17: An unknown monotype.
18:
19: @author Daniel Bonniot (bonniot@users.sourceforge.net)
20: */
21:
22: public class UnknownMonotype extends Monotype implements TypeSymbol {
23: private UnknownMonotype() {
24: }
25:
26: public static final UnknownMonotype instance = new UnknownMonotype();
27:
28: public TypeSymbol cloneTypeSymbol() {
29: return this ;
30: }
31:
32: public boolean isUnknown() {
33: return true;
34: }
35:
36: Monotype canonify() {
37: return this ;
38: }
39:
40: Monotype substitute(java.util.Map map) {
41: return this ;
42: }
43:
44: void tag(int variance) {
45: }
46:
47: public String toString() {
48: return "?";
49: }
50:
51: /****************************************************************
52: * low-level interface
53: ****************************************************************/
54:
55: public int getId() {
56: throw new Error();
57: }
58:
59: public void setId(int value) {
60: throw new Error();
61: }
62:
63: public Kind getKind() {
64: return NullnessKind.instance;
65: }
66:
67: public void setKind(Kind value) {
68: throw new Error();
69: }
70: }
|