0001: // ===========================================================================
0002: // This file has been generated by
0003: // Typical, version 1.13.2,
0004: // (C) 2004-2007 Robert Grimm and New York University,
0005: // on Thursday, November 29, 2007 at 11:36:01 PM.
0006: // Edit at your own risk.
0007: // ===========================================================================
0008:
0009: package xtc.typical;
0010:
0011: import java.math.BigInteger;
0012:
0013: import xtc.util.Pair;
0014:
0015: import xtc.tree.Node;
0016:
0017: /** Types for Typical. */
0018: public class TypicalTypes {
0019: /** Implementation of constructor 'BoolT' in variant 'raw_type'. */
0020: public static class BoolT extends raw_type<Tuple.T0> {
0021: public BoolT() {
0022: tuple = new Tuple.T0();
0023: }
0024:
0025: public final Tag tag() {
0026: return Tag.BoolT;
0027: }
0028:
0029: public boolean isBoolT() {
0030: return true;
0031: }
0032:
0033: public String getName() {
0034: return "BoolT";
0035: }
0036:
0037: public String toString() {
0038: return "BoolT";
0039: }
0040: }
0041:
0042: /** Implementation of constructor 'IntT' in variant 'raw_type'. */
0043: public static class IntT extends raw_type<Tuple.T0> {
0044: public IntT() {
0045: tuple = new Tuple.T0();
0046: }
0047:
0048: public final Tag tag() {
0049: return Tag.IntT;
0050: }
0051:
0052: public boolean isIntT() {
0053: return true;
0054: }
0055:
0056: public String getName() {
0057: return "IntT";
0058: }
0059:
0060: public String toString() {
0061: return "IntT";
0062: }
0063: }
0064:
0065: /** Implementation of constructor 'Float32T' in variant 'raw_type'. */
0066: public static class Float32T extends raw_type<Tuple.T0> {
0067: public Float32T() {
0068: tuple = new Tuple.T0();
0069: }
0070:
0071: public final Tag tag() {
0072: return Tag.Float32T;
0073: }
0074:
0075: public boolean isFloat32T() {
0076: return true;
0077: }
0078:
0079: public String getName() {
0080: return "Float32T";
0081: }
0082:
0083: public String toString() {
0084: return "Float32T";
0085: }
0086: }
0087:
0088: /** Implementation of constructor 'Float64T' in variant 'raw_type'. */
0089: public static class Float64T extends raw_type<Tuple.T0> {
0090: public Float64T() {
0091: tuple = new Tuple.T0();
0092: }
0093:
0094: public final Tag tag() {
0095: return Tag.Float64T;
0096: }
0097:
0098: public boolean isFloat64T() {
0099: return true;
0100: }
0101:
0102: public String getName() {
0103: return "Float64T";
0104: }
0105:
0106: public String toString() {
0107: return "Float64T";
0108: }
0109: }
0110:
0111: /** Implementation of constructor 'StringT' in variant 'raw_type'. */
0112: public static class StringT extends raw_type<Tuple.T0> {
0113: public StringT() {
0114: tuple = new Tuple.T0();
0115: }
0116:
0117: public final Tag tag() {
0118: return Tag.StringT;
0119: }
0120:
0121: public boolean isStringT() {
0122: return true;
0123: }
0124:
0125: public String getName() {
0126: return "StringT";
0127: }
0128:
0129: public String toString() {
0130: return "StringT";
0131: }
0132: }
0133:
0134: /** Implementation of constructor 'WildcardT' in variant 'raw_type'. */
0135: public static class WildcardT extends raw_type<Tuple.T0> {
0136: public WildcardT() {
0137: tuple = new Tuple.T0();
0138: }
0139:
0140: public final Tag tag() {
0141: return Tag.WildcardT;
0142: }
0143:
0144: public boolean isWildcardT() {
0145: return true;
0146: }
0147:
0148: public String getName() {
0149: return "WildcardT";
0150: }
0151:
0152: public String toString() {
0153: return "WildcardT";
0154: }
0155: }
0156:
0157: /** Implementation of constructor 'AnyT' in variant 'raw_type'. */
0158: public static class AnyT extends raw_type<Tuple.T0> {
0159: public AnyT() {
0160: tuple = new Tuple.T0();
0161: }
0162:
0163: public final Tag tag() {
0164: return Tag.AnyT;
0165: }
0166:
0167: public boolean isAnyT() {
0168: return true;
0169: }
0170:
0171: public String getName() {
0172: return "AnyT";
0173: }
0174:
0175: public String toString() {
0176: return "AnyT";
0177: }
0178: }
0179:
0180: /** Implementation of constructor 'TypeName' in variant 'raw_type'. */
0181: public static class TypeName extends raw_type<Tuple.T1<String>> {
0182: public TypeName(String member1) {
0183: tuple = new Tuple.T1<String>(member1);
0184: }
0185:
0186: public final Tag tag() {
0187: return Tag.TypeName;
0188: }
0189:
0190: public boolean isTypeName() {
0191: return true;
0192: }
0193:
0194: public String getName() {
0195: return "TypeName";
0196: }
0197:
0198: public String toString() {
0199: return "TypeName of " + tuple.toString();
0200: }
0201: }
0202:
0203: /** Implementation of constructor 'FunctionT' in variant 'raw_type'. */
0204: public static class FunctionT
0205: extends
0206: raw_type<Tuple.T2<Pair<TypicalTypes.raw_type<?>>, TypicalTypes.raw_type<?>>> {
0207: public FunctionT(Pair<TypicalTypes.raw_type<?>> member1,
0208: TypicalTypes.raw_type<?> member2) {
0209: tuple = new Tuple.T2<Pair<TypicalTypes.raw_type<?>>, TypicalTypes.raw_type<?>>(
0210: member1, member2);
0211: }
0212:
0213: public final Tag tag() {
0214: return Tag.FunctionT;
0215: }
0216:
0217: public boolean isFunctionT() {
0218: return true;
0219: }
0220:
0221: public String getName() {
0222: return "FunctionT";
0223: }
0224:
0225: public String toString() {
0226: return "FunctionT of " + tuple.toString();
0227: }
0228: }
0229:
0230: /** Implementation of constructor 'ConstructorT' in variant 'raw_type'. */
0231: public static class ConstructorT
0232: extends
0233: raw_type<Tuple.T3<String, String, TypicalTypes.raw_type<?>>> {
0234: public ConstructorT(String member1, String member2,
0235: TypicalTypes.raw_type<?> member3) {
0236: tuple = new Tuple.T3<String, String, TypicalTypes.raw_type<?>>(
0237: member1, member2, member3);
0238: }
0239:
0240: public final Tag tag() {
0241: return Tag.ConstructorT;
0242: }
0243:
0244: public boolean isConstructorT() {
0245: return true;
0246: }
0247:
0248: public String getName() {
0249: return "ConstructorT";
0250: }
0251:
0252: public boolean equals(Object o) {
0253: if (o == null) {
0254: return false;
0255: }
0256: if (!(o instanceof ConstructorT)) {
0257: return false;
0258: }
0259:
0260: ConstructorT other = (ConstructorT) o;
0261: boolean res = true;
0262:
0263: res = res
0264: && Analyzer.equal(this .getTuple().get2(), other
0265: .getTuple().get2());
0266: return res;
0267: }
0268:
0269: public String toString() {
0270: return "ConstructorT of " + tuple.toString();
0271: }
0272: }
0273:
0274: /** Implementation of constructor 'VariantT' in variant 'raw_type'. */
0275: public static class VariantT extends
0276: raw_type<Tuple.T1<Pair<TypicalTypes.raw_type<?>>>> {
0277: public VariantT(Pair<TypicalTypes.raw_type<?>> member1) {
0278: tuple = new Tuple.T1<Pair<TypicalTypes.raw_type<?>>>(
0279: member1);
0280: }
0281:
0282: public final Tag tag() {
0283: return Tag.VariantT;
0284: }
0285:
0286: public boolean isVariantT() {
0287: return true;
0288: }
0289:
0290: public String getName() {
0291: return "VariantT";
0292: }
0293:
0294: public String toString() {
0295: return "VariantT of " + tuple.toString();
0296: }
0297: }
0298:
0299: /** Implementation of constructor 'FieldT' in variant 'raw_type'. */
0300: public static class FieldT
0301: extends
0302: raw_type<Tuple.T3<String, String, TypicalTypes.raw_type<?>>> {
0303: public FieldT(String member1, String member2,
0304: TypicalTypes.raw_type<?> member3) {
0305: tuple = new Tuple.T3<String, String, TypicalTypes.raw_type<?>>(
0306: member1, member2, member3);
0307: }
0308:
0309: public final Tag tag() {
0310: return Tag.FieldT;
0311: }
0312:
0313: public boolean isFieldT() {
0314: return true;
0315: }
0316:
0317: public String getName() {
0318: return "FieldT";
0319: }
0320:
0321: public boolean equals(Object o) {
0322: if (o == null) {
0323: return false;
0324: }
0325: if (!(o instanceof FieldT)) {
0326: return false;
0327: }
0328:
0329: FieldT other = (FieldT) o;
0330: boolean res = true;
0331:
0332: res = res
0333: && Analyzer.equal(this .getTuple().get3(), other
0334: .getTuple().get3());
0335: return res;
0336: }
0337:
0338: public String toString() {
0339: return "FieldT of " + tuple.toString();
0340: }
0341: }
0342:
0343: /** Implementation of constructor 'RecordT' in variant 'raw_type'. */
0344: public static class RecordT extends
0345: raw_type<Tuple.T1<Pair<TypicalTypes.raw_type<?>>>> {
0346: public RecordT(Pair<TypicalTypes.raw_type<?>> member1) {
0347: tuple = new Tuple.T1<Pair<TypicalTypes.raw_type<?>>>(
0348: member1);
0349: }
0350:
0351: public final Tag tag() {
0352: return Tag.RecordT;
0353: }
0354:
0355: public boolean isRecordT() {
0356: return true;
0357: }
0358:
0359: public String getName() {
0360: return "RecordT";
0361: }
0362:
0363: public String toString() {
0364: return "RecordT of " + tuple.toString();
0365: }
0366: }
0367:
0368: /** Implementation of constructor 'TupleT' in variant 'raw_type'. */
0369: public static class TupleT extends
0370: raw_type<Tuple.T1<Pair<TypicalTypes.raw_type<?>>>> {
0371: public TupleT(Pair<TypicalTypes.raw_type<?>> member1) {
0372: tuple = new Tuple.T1<Pair<TypicalTypes.raw_type<?>>>(
0373: member1);
0374: }
0375:
0376: public final Tag tag() {
0377: return Tag.TupleT;
0378: }
0379:
0380: public boolean isTupleT() {
0381: return true;
0382: }
0383:
0384: public String getName() {
0385: return "TupleT";
0386: }
0387:
0388: public String toString() {
0389: return "TupleT of " + tuple.toString();
0390: }
0391: }
0392:
0393: /** Implementation of constructor 'VariableT' in variant 'raw_type'. */
0394: public static class VariableT extends
0395: raw_type<Tuple.T2<String, Boolean>> {
0396: public VariableT(String member1, Boolean member2) {
0397: tuple = new Tuple.T2<String, Boolean>(member1, member2);
0398: }
0399:
0400: public final Tag tag() {
0401: return Tag.VariableT;
0402: }
0403:
0404: public boolean isVariableT() {
0405: return true;
0406: }
0407:
0408: public String getName() {
0409: return "VariableT";
0410: }
0411:
0412: public String toString() {
0413: return "VariableT of " + tuple.toString();
0414: }
0415: }
0416:
0417: /** Implementation of constructor 'ConstructedT' in variant 'raw_type'. */
0418: public static class ConstructedT extends
0419: raw_type<Tuple.T2<Pair<TypicalTypes.raw_type<?>>, String>> {
0420: public ConstructedT(Pair<TypicalTypes.raw_type<?>> member1,
0421: String member2) {
0422: tuple = new Tuple.T2<Pair<TypicalTypes.raw_type<?>>, String>(
0423: member1, member2);
0424: }
0425:
0426: public final Tag tag() {
0427: return Tag.ConstructedT;
0428: }
0429:
0430: public boolean isConstructedT() {
0431: return true;
0432: }
0433:
0434: public String getName() {
0435: return "ConstructedT";
0436: }
0437:
0438: public boolean equals(Object o) {
0439: if (o == null) {
0440: return false;
0441: }
0442: if (!(o instanceof ConstructedT)) {
0443: return false;
0444: }
0445:
0446: ConstructedT other = (ConstructedT) o;
0447: boolean res = true;
0448:
0449: res = res
0450: && Analyzer.equal(this .getTuple().get1(), other
0451: .getTuple().get1());
0452: res = res
0453: && Analyzer.equal(this .getTuple().get2(), other
0454: .getTuple().get2());
0455: return res;
0456: }
0457:
0458: public String toString() {
0459: return "ConstructedT of " + tuple.toString();
0460: }
0461: }
0462:
0463: /** Implementation of constructor 'PairOfType' in variant 'raw_type'. */
0464: public static class PairOfType
0465: extends
0466: raw_type<Tuple.T2<TypicalTypes.raw_type<?>, TypicalTypes.raw_type<?>>> {
0467: public PairOfType(TypicalTypes.raw_type<?> member1,
0468: TypicalTypes.raw_type<?> member2) {
0469: tuple = new Tuple.T2<TypicalTypes.raw_type<?>, TypicalTypes.raw_type<?>>(
0470: member1, member2);
0471: }
0472:
0473: public final Tag tag() {
0474: return Tag.PairOfType;
0475: }
0476:
0477: public boolean isPairOfType() {
0478: return true;
0479: }
0480:
0481: public String getName() {
0482: return "PairOfType";
0483: }
0484:
0485: public String toString() {
0486: return "PairOfType of " + tuple.toString();
0487: }
0488: }
0489:
0490: /** Implementation of constructor 'PolyVariantT' in variant 'raw_type'. */
0491: public static class PolyVariantT extends
0492: raw_type<Tuple.T1<Pair<TypicalTypes.raw_type<?>>>> {
0493: public PolyVariantT(Pair<TypicalTypes.raw_type<?>> member1) {
0494: tuple = new Tuple.T1<Pair<TypicalTypes.raw_type<?>>>(
0495: member1);
0496: }
0497:
0498: public final Tag tag() {
0499: return Tag.PolyVariantT;
0500: }
0501:
0502: public boolean isPolyVariantT() {
0503: return true;
0504: }
0505:
0506: public String getName() {
0507: return "PolyVariantT";
0508: }
0509:
0510: public String toString() {
0511: return "PolyVariantT of " + tuple.toString();
0512: }
0513: }
0514:
0515: /** Implementation of constructor 'NodeTypeT' in variant 'raw_type'. */
0516: public static class NodeTypeT extends raw_type<Tuple.T0> {
0517: public NodeTypeT() {
0518: tuple = new Tuple.T0();
0519: }
0520:
0521: public final Tag tag() {
0522: return Tag.NodeTypeT;
0523: }
0524:
0525: public boolean isNodeTypeT() {
0526: return true;
0527: }
0528:
0529: public String getName() {
0530: return "NodeTypeT";
0531: }
0532:
0533: public String toString() {
0534: return "NodeTypeT";
0535: }
0536: }
0537:
0538: /** Implementation of constructor 'StringName' in variant 'raw_type'. */
0539: public static class StringName extends raw_type<Tuple.T1<String>> {
0540: public StringName(String member1) {
0541: tuple = new Tuple.T1<String>(member1);
0542: }
0543:
0544: public final Tag tag() {
0545: return Tag.StringName;
0546: }
0547:
0548: public boolean isStringName() {
0549: return true;
0550: }
0551:
0552: public String getName() {
0553: return "StringName";
0554: }
0555:
0556: public String toString() {
0557: return "StringName of " + tuple.toString();
0558: }
0559: }
0560:
0561: /** Implementation of constructor 'StringList' in variant 'raw_type'. */
0562: public static class StringList extends
0563: raw_type<Tuple.T1<Pair<String>>> {
0564: public StringList(Pair<String> member1) {
0565: tuple = new Tuple.T1<Pair<String>>(member1);
0566: }
0567:
0568: public final Tag tag() {
0569: return Tag.StringList;
0570: }
0571:
0572: public boolean isStringList() {
0573: return true;
0574: }
0575:
0576: public String getName() {
0577: return "StringList";
0578: }
0579:
0580: public String toString() {
0581: return "StringList of " + tuple.toString();
0582: }
0583: }
0584:
0585: /** Superclass of all constructors in variant 'raw_type'. */
0586: public static abstract class raw_type<T extends Tuple> extends
0587: Variant<T> {
0588: public static enum Tag {
0589: BoolT, IntT, Float32T, Float64T, StringT, WildcardT, AnyT, TypeName, FunctionT, ConstructorT, VariantT, FieldT, RecordT, TupleT, VariableT, ConstructedT, PairOfType, PolyVariantT, NodeTypeT, StringName, StringList
0590: }
0591:
0592: protected raw_type() {
0593: }
0594:
0595: public abstract Tag tag();
0596:
0597: public boolean isBoolT() {
0598: return false;
0599: }
0600:
0601: public boolean isIntT() {
0602: return false;
0603: }
0604:
0605: public boolean isFloat32T() {
0606: return false;
0607: }
0608:
0609: public boolean isFloat64T() {
0610: return false;
0611: }
0612:
0613: public boolean isStringT() {
0614: return false;
0615: }
0616:
0617: public boolean isWildcardT() {
0618: return false;
0619: }
0620:
0621: public boolean isAnyT() {
0622: return false;
0623: }
0624:
0625: public boolean isTypeName() {
0626: return false;
0627: }
0628:
0629: public boolean isFunctionT() {
0630: return false;
0631: }
0632:
0633: public boolean isConstructorT() {
0634: return false;
0635: }
0636:
0637: public boolean isVariantT() {
0638: return false;
0639: }
0640:
0641: public boolean isFieldT() {
0642: return false;
0643: }
0644:
0645: public boolean isRecordT() {
0646: return false;
0647: }
0648:
0649: public boolean isTupleT() {
0650: return false;
0651: }
0652:
0653: public boolean isVariableT() {
0654: return false;
0655: }
0656:
0657: public boolean isConstructedT() {
0658: return false;
0659: }
0660:
0661: public boolean isPairOfType() {
0662: return false;
0663: }
0664:
0665: public boolean isPolyVariantT() {
0666: return false;
0667: }
0668:
0669: public boolean isNodeTypeT() {
0670: return false;
0671: }
0672:
0673: public boolean isStringName() {
0674: return false;
0675: }
0676:
0677: public boolean isStringList() {
0678: return false;
0679: }
0680: }
0681:
0682: /** Implementation of record 'type'. */
0683: public static class type implements Record {
0684: public TypicalTypes.raw_type<?> type;
0685:
0686: public type(TypicalTypes.raw_type<?> type) {
0687: this .type = type;
0688: }
0689:
0690: public boolean equals(Object o) {
0691: if (o == null) {
0692: return false;
0693: }
0694: if (!(o instanceof type)) {
0695: return false;
0696: }
0697:
0698: type other = (type) o;
0699: boolean res = true;
0700:
0701: res = res && type.equals(other.type);
0702: return res;
0703: }
0704:
0705: public String toString() {
0706: return "{" + (null == type ? "?" : type.toString()) + "}";
0707: }
0708: }
0709:
0710: /** Implementation of record 'call'. */
0711: public static class call implements Record {
0712: public String caller;
0713: public String callee;
0714:
0715: public call(String caller, String callee) {
0716: this .caller = caller;
0717: this .callee = callee;
0718: }
0719:
0720: public boolean equals(Object o) {
0721: if (!(o instanceof call)) {
0722: return true;
0723: }
0724:
0725: final call r = Analyzer.cast(o);
0726:
0727: if (!(null != caller && caller.equals(null == r ? null
0728: : r.caller))) {
0729: return false;
0730: }
0731: if (!(null != callee && callee.equals(null == r ? null
0732: : r.callee))) {
0733: return false;
0734: }
0735: return true;
0736: }
0737:
0738: public String toString() {
0739: return "{" + (null == caller ? "?" : caller.toString())
0740: + "," + (null == callee ? "?" : callee.toString())
0741: + "}";
0742: }
0743: }
0744:
0745: /** Implementation of record 'graph'. */
0746: public static class graph implements Record {
0747: public Pair<String> functionList;
0748: public Pair<TypicalTypes.call> edges;
0749:
0750: public graph(Pair<String> functionList,
0751: Pair<TypicalTypes.call> edges) {
0752: this .functionList = functionList;
0753: this .edges = edges;
0754: }
0755:
0756: public boolean equals(Object o) {
0757: if (!(o instanceof graph)) {
0758: return true;
0759: }
0760:
0761: final graph r = Analyzer.cast(o);
0762:
0763: if (!(null != functionList && functionList
0764: .equals(null == r ? null : r.functionList))) {
0765: return false;
0766: }
0767: if (!(null != edges && edges.equals(null == r ? null
0768: : r.edges))) {
0769: return false;
0770: }
0771: return true;
0772: }
0773:
0774: public String toString() {
0775: return "{"
0776: + (null == functionList ? "?" : functionList
0777: .toString()) + ","
0778: + (null == edges ? "?" : edges.toString()) + "}";
0779: }
0780: }
0781:
0782: /** Implementation of record 'group'. */
0783: public static class group implements Record {
0784: public Pair<String> group;
0785: public Pair<Pair<String>> circles;
0786:
0787: public group(Pair<String> group, Pair<Pair<String>> circles) {
0788: this .group = group;
0789: this .circles = circles;
0790: }
0791:
0792: public boolean equals(Object o) {
0793: if (!(o instanceof group)) {
0794: return true;
0795: }
0796:
0797: final group r = Analyzer.cast(o);
0798:
0799: if (!(null != group && group.equals(null == r ? null
0800: : r.group))) {
0801: return false;
0802: }
0803: if (!(null != circles && circles.equals(null == r ? null
0804: : r.circles))) {
0805: return false;
0806: }
0807: return true;
0808: }
0809:
0810: public String toString() {
0811: return "{" + (null == group ? "?" : group.toString()) + ","
0812: + (null == circles ? "?" : circles.toString())
0813: + "}";
0814: }
0815: }
0816:
0817: /** Implementation of record 'nodeRec'. */
0818: public static class nodeRec implements Record {
0819: public String name;
0820: public Pair<String> mutualList;
0821: public Pair<String> dependList;
0822:
0823: public nodeRec(String name, Pair<String> mutualList,
0824: Pair<String> dependList) {
0825: this .name = name;
0826: this .mutualList = mutualList;
0827: this .dependList = dependList;
0828: }
0829:
0830: public boolean equals(Object o) {
0831: if (!(o instanceof nodeRec)) {
0832: return true;
0833: }
0834:
0835: final nodeRec r = Analyzer.cast(o);
0836:
0837: if (!(null != name && name
0838: .equals(null == r ? null : r.name))) {
0839: return false;
0840: }
0841: if (!(null != mutualList && mutualList
0842: .equals(null == r ? null : r.mutualList))) {
0843: return false;
0844: }
0845: if (!(null != dependList && dependList
0846: .equals(null == r ? null : r.dependList))) {
0847: return false;
0848: }
0849: return true;
0850: }
0851:
0852: public String toString() {
0853: return "{"
0854: + (null == name ? "?" : name.toString())
0855: + ","
0856: + (null == mutualList ? "?" : mutualList.toString())
0857: + ","
0858: + (null == dependList ? "?" : dependList.toString())
0859: + "}";
0860: }
0861: }
0862:
0863: /** Implementation of record 'funcRec'. */
0864: public static class funcRec implements Record {
0865: public Pair<TypicalTypes.raw_type<?>> paras;
0866: public TypicalTypes.raw_type<?> ret;
0867:
0868: public funcRec(Pair<TypicalTypes.raw_type<?>> paras,
0869: TypicalTypes.raw_type<?> ret) {
0870: this .paras = paras;
0871: this .ret = ret;
0872: }
0873:
0874: public boolean equals(Object o) {
0875: if (!(o instanceof funcRec)) {
0876: return true;
0877: }
0878:
0879: final funcRec r = Analyzer.cast(o);
0880:
0881: if (!(null != paras && paras.equals(null == r ? null
0882: : r.paras))) {
0883: return false;
0884: }
0885: if (!(null != ret && ret.equals(null == r ? null : r.ret))) {
0886: return false;
0887: }
0888: return true;
0889: }
0890:
0891: public String toString() {
0892: return "{" + (null == paras ? "?" : paras.toString()) + ","
0893: + (null == ret ? "?" : ret.toString()) + "}";
0894: }
0895: }
0896:
0897: /** Implementation of record 'entry'. */
0898: public static class entry implements Record {
0899: public String entryName;
0900: public TypicalTypes.raw_type<?> entryType;
0901:
0902: public entry(String entryName,
0903: TypicalTypes.raw_type<?> entryType) {
0904: this .entryName = entryName;
0905: this .entryType = entryType;
0906: }
0907:
0908: public boolean equals(Object o) {
0909: if (!(o instanceof entry)) {
0910: return true;
0911: }
0912:
0913: final entry r = Analyzer.cast(o);
0914:
0915: if (!(null != entryName && entryName
0916: .equals(null == r ? null : r.entryName))) {
0917: return false;
0918: }
0919: if (!(null != entryType && entryType
0920: .equals(null == r ? null : r.entryType))) {
0921: return false;
0922: }
0923: return true;
0924: }
0925:
0926: public String toString() {
0927: return "{"
0928: + (null == entryName ? "?" : entryName.toString())
0929: + ","
0930: + (null == entryType ? "?" : entryType.toString())
0931: + "}";
0932: }
0933: }
0934:
0935: /** Implementation of constructor 'BotPattern' in variant 'pattern'. */
0936: public static class BotPattern extends pattern<Tuple.T0> {
0937: public BotPattern() {
0938: tuple = new Tuple.T0();
0939: }
0940:
0941: public final Tag tag() {
0942: return Tag.BotPattern;
0943: }
0944:
0945: public boolean isBotPattern() {
0946: return true;
0947: }
0948:
0949: public String getName() {
0950: return "BotPattern";
0951: }
0952:
0953: public String toString() {
0954: return "BotPattern";
0955: }
0956: }
0957:
0958: /** Implementation of constructor 'WildCardPattern' in variant 'pattern'. */
0959: public static class WildCardPattern extends pattern<Tuple.T0> {
0960: public WildCardPattern() {
0961: tuple = new Tuple.T0();
0962: }
0963:
0964: public final Tag tag() {
0965: return Tag.WildCardPattern;
0966: }
0967:
0968: public boolean isWildCardPattern() {
0969: return true;
0970: }
0971:
0972: public String getName() {
0973: return "WildCardPattern";
0974: }
0975:
0976: public String toString() {
0977: return "WildCardPattern";
0978: }
0979: }
0980:
0981: /** Implementation of constructor 'VariablePattern' in variant 'pattern'. */
0982: public static class VariablePattern extends
0983: pattern<Tuple.T1<String>> {
0984: public VariablePattern(String member1) {
0985: tuple = new Tuple.T1<String>(member1);
0986: }
0987:
0988: public final Tag tag() {
0989: return Tag.VariablePattern;
0990: }
0991:
0992: public boolean isVariablePattern() {
0993: return true;
0994: }
0995:
0996: public String getName() {
0997: return "VariablePattern";
0998: }
0999:
1000: public String toString() {
1001: return "VariablePattern of " + tuple.toString();
1002: }
1003: }
1004:
1005: /** Implementation of constructor 'ConstantPattern' in variant 'pattern'. */
1006: public static class ConstantPattern extends
1007: pattern<Tuple.T1<TypicalTypes.value>> {
1008: public ConstantPattern(TypicalTypes.value member1) {
1009: tuple = new Tuple.T1<TypicalTypes.value>(member1);
1010: }
1011:
1012: public final Tag tag() {
1013: return Tag.ConstantPattern;
1014: }
1015:
1016: public boolean isConstantPattern() {
1017: return true;
1018: }
1019:
1020: public String getName() {
1021: return "ConstantPattern";
1022: }
1023:
1024: public String toString() {
1025: return "ConstantPattern of " + tuple.toString();
1026: }
1027: }
1028:
1029: /** Implementation of constructor 'TupPattern' in variant 'pattern'. */
1030: public static class TupPattern extends
1031: pattern<Tuple.T1<Pair<TypicalTypes.patternRecord>>> {
1032: public TupPattern(Pair<TypicalTypes.patternRecord> member1) {
1033: tuple = new Tuple.T1<Pair<TypicalTypes.patternRecord>>(
1034: member1);
1035: }
1036:
1037: public final Tag tag() {
1038: return Tag.TupPattern;
1039: }
1040:
1041: public boolean isTupPattern() {
1042: return true;
1043: }
1044:
1045: public String getName() {
1046: return "TupPattern";
1047: }
1048:
1049: public String toString() {
1050: return "TupPattern of " + tuple.toString();
1051: }
1052: }
1053:
1054: /** Implementation of constructor 'RecPattern' in variant 'pattern'. */
1055: public static class RecPattern extends
1056: pattern<Tuple.T1<Pair<TypicalTypes.patternRecord>>> {
1057: public RecPattern(Pair<TypicalTypes.patternRecord> member1) {
1058: tuple = new Tuple.T1<Pair<TypicalTypes.patternRecord>>(
1059: member1);
1060: }
1061:
1062: public final Tag tag() {
1063: return Tag.RecPattern;
1064: }
1065:
1066: public boolean isRecPattern() {
1067: return true;
1068: }
1069:
1070: public String getName() {
1071: return "RecPattern";
1072: }
1073:
1074: public String toString() {
1075: return "RecPattern of " + tuple.toString();
1076: }
1077: }
1078:
1079: /** Implementation of constructor 'EmptyPattern' in variant 'pattern'. */
1080: public static class EmptyPattern extends pattern<Tuple.T0> {
1081: public EmptyPattern() {
1082: tuple = new Tuple.T0();
1083: }
1084:
1085: public final Tag tag() {
1086: return Tag.EmptyPattern;
1087: }
1088:
1089: public boolean isEmptyPattern() {
1090: return true;
1091: }
1092:
1093: public String getName() {
1094: return "EmptyPattern";
1095: }
1096:
1097: public String toString() {
1098: return "EmptyPattern";
1099: }
1100: }
1101:
1102: /** Implementation of constructor 'PairPattern' in variant 'pattern'. */
1103: public static class PairPattern
1104: extends
1105: pattern<Tuple.T2<TypicalTypes.patternRecord, TypicalTypes.patternRecord>> {
1106: public PairPattern(TypicalTypes.patternRecord member1,
1107: TypicalTypes.patternRecord member2) {
1108: tuple = new Tuple.T2<TypicalTypes.patternRecord, TypicalTypes.patternRecord>(
1109: member1, member2);
1110: }
1111:
1112: public final Tag tag() {
1113: return Tag.PairPattern;
1114: }
1115:
1116: public boolean isPairPattern() {
1117: return true;
1118: }
1119:
1120: public String getName() {
1121: return "PairPattern";
1122: }
1123:
1124: public String toString() {
1125: return "PairPattern of " + tuple.toString();
1126: }
1127: }
1128:
1129: /** Implementation of constructor 'RecFieldPattern' in variant 'pattern'. */
1130: public static class RecFieldPattern extends
1131: pattern<Tuple.T2<String, TypicalTypes.patternRecord>> {
1132: public RecFieldPattern(String member1,
1133: TypicalTypes.patternRecord member2) {
1134: tuple = new Tuple.T2<String, TypicalTypes.patternRecord>(
1135: member1, member2);
1136: }
1137:
1138: public final Tag tag() {
1139: return Tag.RecFieldPattern;
1140: }
1141:
1142: public boolean isRecFieldPattern() {
1143: return true;
1144: }
1145:
1146: public String getName() {
1147: return "RecFieldPattern";
1148: }
1149:
1150: public String toString() {
1151: return "RecFieldPattern of " + tuple.toString();
1152: }
1153: }
1154:
1155: /** Implementation of constructor 'ConstructorPattern' in variant 'pattern'. */
1156: public static class ConstructorPattern extends
1157: pattern<Tuple.T2<String, Pair<TypicalTypes.patternRecord>>> {
1158: public ConstructorPattern(String member1,
1159: Pair<TypicalTypes.patternRecord> member2) {
1160: tuple = new Tuple.T2<String, Pair<TypicalTypes.patternRecord>>(
1161: member1, member2);
1162: }
1163:
1164: public final Tag tag() {
1165: return Tag.ConstructorPattern;
1166: }
1167:
1168: public boolean isConstructorPattern() {
1169: return true;
1170: }
1171:
1172: public String getName() {
1173: return "ConstructorPattern";
1174: }
1175:
1176: public String toString() {
1177: return "ConstructorPattern of " + tuple.toString();
1178: }
1179: }
1180:
1181: /** Superclass of all constructors in variant 'pattern'. */
1182: public static abstract class pattern<T extends Tuple> extends
1183: Variant<T> {
1184: public static enum Tag {
1185: BotPattern, WildCardPattern, VariablePattern, ConstantPattern, TupPattern, RecPattern, EmptyPattern, PairPattern, RecFieldPattern, ConstructorPattern
1186: }
1187:
1188: protected pattern() {
1189: }
1190:
1191: public abstract Tag tag();
1192:
1193: public boolean isBotPattern() {
1194: return false;
1195: }
1196:
1197: public boolean isWildCardPattern() {
1198: return false;
1199: }
1200:
1201: public boolean isVariablePattern() {
1202: return false;
1203: }
1204:
1205: public boolean isConstantPattern() {
1206: return false;
1207: }
1208:
1209: public boolean isTupPattern() {
1210: return false;
1211: }
1212:
1213: public boolean isRecPattern() {
1214: return false;
1215: }
1216:
1217: public boolean isEmptyPattern() {
1218: return false;
1219: }
1220:
1221: public boolean isPairPattern() {
1222: return false;
1223: }
1224:
1225: public boolean isRecFieldPattern() {
1226: return false;
1227: }
1228:
1229: public boolean isConstructorPattern() {
1230: return false;
1231: }
1232: }
1233:
1234: /** Implementation of record 'patternRecord'. */
1235: public static class patternRecord implements Record {
1236: public TypicalTypes.pattern pat;
1237: public Node nod;
1238: public Boolean guarded;
1239:
1240: public patternRecord(TypicalTypes.pattern pat, Node nod,
1241: Boolean guarded) {
1242: this .pat = pat;
1243: this .nod = nod;
1244: this .guarded = guarded;
1245: }
1246:
1247: public boolean equals(Object o) {
1248: if (!(o instanceof patternRecord)) {
1249: return true;
1250: }
1251:
1252: final patternRecord r = Analyzer.cast(o);
1253:
1254: if (!(null != pat && pat.equals(null == r ? null : r.pat))) {
1255: return false;
1256: }
1257: if (!(null != nod && nod.equals(null == r ? null : r.nod))) {
1258: return false;
1259: }
1260: if (!(null != guarded && guarded.equals(null == r ? null
1261: : r.guarded))) {
1262: return false;
1263: }
1264: return true;
1265: }
1266:
1267: public String toString() {
1268: return "{" + (null == pat ? "?" : pat.toString()) + ","
1269: + (null == nod ? "?" : nod.toString()) + ","
1270: + (null == guarded ? "?" : guarded.toString())
1271: + "}";
1272: }
1273: }
1274:
1275: /** Implementation of constructor 'StringValue' in variant 'value'. */
1276: public static class StringValue extends value<Tuple.T1<String>> {
1277: public StringValue(String member1) {
1278: tuple = new Tuple.T1<String>(member1);
1279: }
1280:
1281: public final Tag tag() {
1282: return Tag.StringValue;
1283: }
1284:
1285: public boolean isStringValue() {
1286: return true;
1287: }
1288:
1289: public String getName() {
1290: return "StringValue";
1291: }
1292:
1293: public String toString() {
1294: return "StringValue of " + tuple.toString();
1295: }
1296: }
1297:
1298: /** Implementation of constructor 'FloatValue' in variant 'value'. */
1299: public static class FloatValue extends value<Tuple.T1<Double>> {
1300: public FloatValue(Double member1) {
1301: tuple = new Tuple.T1<Double>(member1);
1302: }
1303:
1304: public final Tag tag() {
1305: return Tag.FloatValue;
1306: }
1307:
1308: public boolean isFloatValue() {
1309: return true;
1310: }
1311:
1312: public String getName() {
1313: return "FloatValue";
1314: }
1315:
1316: public String toString() {
1317: return "FloatValue of " + tuple.toString();
1318: }
1319: }
1320:
1321: /** Implementation of constructor 'IntValue' in variant 'value'. */
1322: public static class IntValue extends value<Tuple.T1<BigInteger>> {
1323: public IntValue(BigInteger member1) {
1324: tuple = new Tuple.T1<BigInteger>(member1);
1325: }
1326:
1327: public final Tag tag() {
1328: return Tag.IntValue;
1329: }
1330:
1331: public boolean isIntValue() {
1332: return true;
1333: }
1334:
1335: public String getName() {
1336: return "IntValue";
1337: }
1338:
1339: public String toString() {
1340: return "IntValue of " + tuple.toString();
1341: }
1342: }
1343:
1344: /** Implementation of constructor 'BoolValue' in variant 'value'. */
1345: public static class BoolValue extends value<Tuple.T1<Boolean>> {
1346: public BoolValue(Boolean member1) {
1347: tuple = new Tuple.T1<Boolean>(member1);
1348: }
1349:
1350: public final Tag tag() {
1351: return Tag.BoolValue;
1352: }
1353:
1354: public boolean isBoolValue() {
1355: return true;
1356: }
1357:
1358: public String getName() {
1359: return "BoolValue";
1360: }
1361:
1362: public String toString() {
1363: return "BoolValue of " + tuple.toString();
1364: }
1365: }
1366:
1367: /** Superclass of all constructors in variant 'value'. */
1368: public static abstract class value<T extends Tuple> extends
1369: Variant<T> {
1370: public static enum Tag {
1371: StringValue, FloatValue, IntValue, BoolValue
1372: }
1373:
1374: protected value() {
1375: }
1376:
1377: public abstract Tag tag();
1378:
1379: public boolean isStringValue() {
1380: return false;
1381: }
1382:
1383: public boolean isFloatValue() {
1384: return false;
1385: }
1386:
1387: public boolean isIntValue() {
1388: return false;
1389: }
1390:
1391: public boolean isBoolValue() {
1392: return false;
1393: }
1394: }
1395:
1396: /** Implementation of constructor 'None' in variant 'result'. */
1397: public static class None extends result<Tuple.T0> {
1398: public None() {
1399: tuple = new Tuple.T0();
1400: }
1401:
1402: public final Tag tag() {
1403: return Tag.None;
1404: }
1405:
1406: public boolean isNone() {
1407: return true;
1408: }
1409:
1410: public String getName() {
1411: return "None";
1412: }
1413:
1414: public String toString() {
1415: return "None";
1416: }
1417: }
1418:
1419: /** Implementation of constructor 'Some' in variant 'result'. */
1420: public static class Some extends
1421: result<Tuple.T1<Pair<TypicalTypes.pattern>>> {
1422: public Some(Pair<TypicalTypes.pattern> member1) {
1423: tuple = new Tuple.T1<Pair<TypicalTypes.pattern>>(member1);
1424: }
1425:
1426: public final Tag tag() {
1427: return Tag.Some;
1428: }
1429:
1430: public boolean isSome() {
1431: return true;
1432: }
1433:
1434: public String getName() {
1435: return "Some";
1436: }
1437:
1438: public String toString() {
1439: return "Some of " + tuple.toString();
1440: }
1441: }
1442:
1443: /** Superclass of all constructors in variant 'result'. */
1444: public static abstract class result<T extends Tuple> extends
1445: Variant<T> {
1446: public static enum Tag {
1447: None, Some
1448: }
1449:
1450: protected result() {
1451: }
1452:
1453: public abstract Tag tag();
1454:
1455: public boolean isNone() {
1456: return false;
1457: }
1458:
1459: public boolean isSome() {
1460: return false;
1461: }
1462: }
1463:
1464: /** Implementation of constructor 'BotConstr' in variant 'constr'. */
1465: public static class BotConstr extends constr<Tuple.T0> {
1466: public BotConstr() {
1467: tuple = new Tuple.T0();
1468: }
1469:
1470: public final Tag tag() {
1471: return Tag.BotConstr;
1472: }
1473:
1474: public boolean isBotConstr() {
1475: return true;
1476: }
1477:
1478: public String getName() {
1479: return "BotConstr";
1480: }
1481:
1482: public String toString() {
1483: return "BotConstr";
1484: }
1485: }
1486:
1487: /** Implementation of constructor 'WildConstr' in variant 'constr'. */
1488: public static class WildConstr extends constr<Tuple.T0> {
1489: public WildConstr() {
1490: tuple = new Tuple.T0();
1491: }
1492:
1493: public final Tag tag() {
1494: return Tag.WildConstr;
1495: }
1496:
1497: public boolean isWildConstr() {
1498: return true;
1499: }
1500:
1501: public String getName() {
1502: return "WildConstr";
1503: }
1504:
1505: public String toString() {
1506: return "WildConstr";
1507: }
1508: }
1509:
1510: /** Implementation of constructor 'Const' in variant 'constr'. */
1511: public static class Const extends
1512: constr<Tuple.T1<TypicalTypes.value>> {
1513: public Const(TypicalTypes.value member1) {
1514: tuple = new Tuple.T1<TypicalTypes.value>(member1);
1515: }
1516:
1517: public final Tag tag() {
1518: return Tag.Const;
1519: }
1520:
1521: public boolean isConst() {
1522: return true;
1523: }
1524:
1525: public String getName() {
1526: return "Const";
1527: }
1528:
1529: public String toString() {
1530: return "Const of " + tuple.toString();
1531: }
1532: }
1533:
1534: /** Implementation of constructor 'EmptyConstr' in variant 'constr'. */
1535: public static class EmptyConstr extends constr<Tuple.T0> {
1536: public EmptyConstr() {
1537: tuple = new Tuple.T0();
1538: }
1539:
1540: public final Tag tag() {
1541: return Tag.EmptyConstr;
1542: }
1543:
1544: public boolean isEmptyConstr() {
1545: return true;
1546: }
1547:
1548: public String getName() {
1549: return "EmptyConstr";
1550: }
1551:
1552: public String toString() {
1553: return "EmptyConstr";
1554: }
1555: }
1556:
1557: /** Implementation of constructor 'PairConstr' in variant 'constr'. */
1558: public static class PairConstr extends constr<Tuple.T0> {
1559: public PairConstr() {
1560: tuple = new Tuple.T0();
1561: }
1562:
1563: public final Tag tag() {
1564: return Tag.PairConstr;
1565: }
1566:
1567: public boolean isPairConstr() {
1568: return true;
1569: }
1570:
1571: public String getName() {
1572: return "PairConstr";
1573: }
1574:
1575: public String toString() {
1576: return "PairConstr";
1577: }
1578: }
1579:
1580: /** Implementation of constructor 'CConstr' in variant 'constr'. */
1581: public static class CConstr extends
1582: constr<Tuple.T2<String, BigInteger>> {
1583: public CConstr(String member1, BigInteger member2) {
1584: tuple = new Tuple.T2<String, BigInteger>(member1, member2);
1585: }
1586:
1587: public final Tag tag() {
1588: return Tag.CConstr;
1589: }
1590:
1591: public boolean isCConstr() {
1592: return true;
1593: }
1594:
1595: public String getName() {
1596: return "CConstr";
1597: }
1598:
1599: public String toString() {
1600: return "CConstr of " + tuple.toString();
1601: }
1602: }
1603:
1604: /** Implementation of constructor 'RecordConstr' in variant 'constr'. */
1605: public static class RecordConstr extends
1606: constr<Tuple.T1<BigInteger>> {
1607: public RecordConstr(BigInteger member1) {
1608: tuple = new Tuple.T1<BigInteger>(member1);
1609: }
1610:
1611: public final Tag tag() {
1612: return Tag.RecordConstr;
1613: }
1614:
1615: public boolean isRecordConstr() {
1616: return true;
1617: }
1618:
1619: public String getName() {
1620: return "RecordConstr";
1621: }
1622:
1623: public String toString() {
1624: return "RecordConstr of " + tuple.toString();
1625: }
1626: }
1627:
1628: /** Implementation of constructor 'TupleConstr' in variant 'constr'. */
1629: public static class TupleConstr extends
1630: constr<Tuple.T1<BigInteger>> {
1631: public TupleConstr(BigInteger member1) {
1632: tuple = new Tuple.T1<BigInteger>(member1);
1633: }
1634:
1635: public final Tag tag() {
1636: return Tag.TupleConstr;
1637: }
1638:
1639: public boolean isTupleConstr() {
1640: return true;
1641: }
1642:
1643: public String getName() {
1644: return "TupleConstr";
1645: }
1646:
1647: public String toString() {
1648: return "TupleConstr of " + tuple.toString();
1649: }
1650: }
1651:
1652: /** Superclass of all constructors in variant 'constr'. */
1653: public static abstract class constr<T extends Tuple> extends
1654: Variant<T> {
1655: public static enum Tag {
1656: BotConstr, WildConstr, Const, EmptyConstr, PairConstr, CConstr, RecordConstr, TupleConstr
1657: }
1658:
1659: protected constr() {
1660: }
1661:
1662: public abstract Tag tag();
1663:
1664: public boolean isBotConstr() {
1665: return false;
1666: }
1667:
1668: public boolean isWildConstr() {
1669: return false;
1670: }
1671:
1672: public boolean isConst() {
1673: return false;
1674: }
1675:
1676: public boolean isEmptyConstr() {
1677: return false;
1678: }
1679:
1680: public boolean isPairConstr() {
1681: return false;
1682: }
1683:
1684: public boolean isCConstr() {
1685: return false;
1686: }
1687:
1688: public boolean isRecordConstr() {
1689: return false;
1690: }
1691:
1692: public boolean isTupleConstr() {
1693: return false;
1694: }
1695: }
1696:
1697: private TypicalTypes() {
1698: }
1699: }
|