001: // ===========================================================================
002: // This file has been generated by
003: // Typical, version 1.13.1,
004: // (C) 2004-2007 Robert Grimm and New York University,
005: // on Monday, October 15, 2007 at 8:59:39 PM.
006: // Edit at your own risk.
007: // ===========================================================================
008:
009: package xtc.lang;
010:
011: import xtc.typical.Record;
012: import xtc.typical.Variant;
013: import xtc.typical.Tuple;
014:
015: /** Types for TypedLambda. */
016: public class TypedLambdaTypes {
017: /** Implementation of constructor 'IntegerT' in variant 'raw_type'. */
018: public static class IntegerT extends raw_type<Tuple.T0> {
019: public IntegerT() {
020: tuple = new Tuple.T0();
021: }
022:
023: public final Tag tag() {
024: return Tag.IntegerT;
025: }
026:
027: public boolean isIntegerT() {
028: return true;
029: }
030:
031: public String getName() {
032: return "IntegerT";
033: }
034:
035: public String toString() {
036: return "IntegerT";
037: }
038: }
039:
040: /** Implementation of constructor 'StringT' in variant 'raw_type'. */
041: public static class StringT extends raw_type<Tuple.T0> {
042: public StringT() {
043: tuple = new Tuple.T0();
044: }
045:
046: public final Tag tag() {
047: return Tag.StringT;
048: }
049:
050: public boolean isStringT() {
051: return true;
052: }
053:
054: public String getName() {
055: return "StringT";
056: }
057:
058: public String toString() {
059: return "StringT";
060: }
061: }
062:
063: /** Implementation of constructor 'FunctionT' in variant 'raw_type'. */
064: public static class FunctionT
065: extends
066: raw_type<Tuple.T2<TypedLambdaTypes.raw_type<?>, TypedLambdaTypes.raw_type<?>>> {
067: public FunctionT(TypedLambdaTypes.raw_type<?> member1,
068: TypedLambdaTypes.raw_type<?> member2) {
069: tuple = new Tuple.T2<TypedLambdaTypes.raw_type<?>, TypedLambdaTypes.raw_type<?>>(
070: member1, member2);
071: }
072:
073: public final Tag tag() {
074: return Tag.FunctionT;
075: }
076:
077: public boolean isFunctionT() {
078: return true;
079: }
080:
081: public String getName() {
082: return "FunctionT";
083: }
084:
085: public String toString() {
086: return "FunctionT of " + tuple.toString();
087: }
088: }
089:
090: /** Superclass of all constructors in variant 'raw_type'. */
091: public static abstract class raw_type<T extends Tuple> extends
092: Variant<T> {
093: public static enum Tag {
094: IntegerT, StringT, FunctionT
095: }
096:
097: protected raw_type() {
098: }
099:
100: public abstract Tag tag();
101:
102: public boolean isIntegerT() {
103: return false;
104: }
105:
106: public boolean isStringT() {
107: return false;
108: }
109:
110: public boolean isFunctionT() {
111: return false;
112: }
113: }
114:
115: /** Implementation of record 'type'. */
116: public static class type implements Record {
117: public TypedLambdaTypes.raw_type<?> type;
118:
119: public type(TypedLambdaTypes.raw_type<?> type) {
120: this .type = type;
121: }
122:
123: public boolean equals(Object o) {
124: if (o == null) {
125: return false;
126: }
127: if (!(o instanceof type)) {
128: return false;
129: }
130:
131: type other = (type) o;
132: boolean res = true;
133:
134: res = res && type.equals(other.type);
135: return res;
136: }
137:
138: public String toString() {
139: return "{" + (null == type ? "?" : type.toString()) + "}";
140: }
141: }
142:
143: private TypedLambdaTypes() {
144: }
145: }
|