// ===========================================================================
// This file has been generated by
// Typical, version 1.14.3,
// (C) 2004-2009 Robert Grimm and New York University,
// on Monday, September 28, 2009 at 12:18:32 PM.
// Edit at your own risk.
// ===========================================================================

package xtc.lang.c;

import java.math.BigInteger;

import xtc.util.Pair;

import xtc.tree.Node;

import xtc.typical.Analyzer;
import xtc.typical.Record;
import xtc.typical.Variant;
import xtc.typical.Tuple;

/** Types for C. */
public class CTypes {
  /** Implementation of constructor 'IValue' in variant 'valueType'. */
  public static class IValue extends valueType<Tuple.T1<BigInteger>> {
    public IValue(BigInteger member1) {
      tuple = new Tuple.T1<BigInteger>(member1);
    }

    public final Tag tag() {
      return Tag.IValue;
    }

    public boolean isIValue() {
      return true;
    }

    public String getName() {
      return "IValue";
    }

    public String toString() {
      return "IValue of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'FValue' in variant 'valueType'. */
  public static class FValue extends valueType<Tuple.T1<Double>> {
    public FValue(Double member1) {
      tuple = new Tuple.T1<Double>(member1);
    }

    public final Tag tag() {
      return Tag.FValue;
    }

    public boolean isFValue() {
      return true;
    }

    public String getName() {
      return "FValue";
    }

    public String toString() {
      return "FValue of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'SValue' in variant 'valueType'. */
  public static class SValue extends valueType<Tuple.T1<String>> {
    public SValue(String member1) {
      tuple = new Tuple.T1<String>(member1);
    }

    public final Tag tag() {
      return Tag.SValue;
    }

    public boolean isSValue() {
      return true;
    }

    public String getName() {
      return "SValue";
    }

    public String toString() {
      return "SValue of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'LValue' in variant 'valueType'. */
  public static class LValue extends valueType<Tuple.T1<Pair<CTypes.valueType>>> {
    public LValue(Pair<CTypes.valueType> member1) {
      tuple = new Tuple.T1<Pair<CTypes.valueType>>(member1);
    }

    public final Tag tag() {
      return Tag.LValue;
    }

    public boolean isLValue() {
      return true;
    }

    public String getName() {
      return "LValue";
    }

    public String toString() {
      return "LValue of " + tuple.toString();
    }
  }

  /** Superclass of all constructors in variant 'valueType'. */
  public static abstract class valueType<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      IValue,
      FValue,
      SValue,
      LValue
    }

    protected valueType() {
    }

    public abstract Tag tag();

    public boolean isIValue() {
      return false;
    }

    public boolean isFValue() {
      return false;
    }

    public boolean isSValue() {
      return false;
    }

    public boolean isLValue() {
      return false;
    }
  }

  /** Implementation of constructor 'Unknown' in variant 'vLength'. */
  public static class Unknown extends vLength<Tuple.T0> {
    public Unknown() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.Unknown;
    }

    public boolean isUnknown() {
      return true;
    }

    public String getName() {
      return "Unknown";
    }

    public String toString() {
      return "Unknown";
    }
  }

  /** Implementation of constructor 'Known' in variant 'vLength'. */
  public static class Known extends vLength<Tuple.T0> {
    public Known() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.Known;
    }

    public boolean isKnown() {
      return true;
    }

    public String getName() {
      return "Known";
    }

    public String toString() {
      return "Known";
    }
  }

  /** Superclass of all constructors in variant 'vLength'. */
  public static abstract class vLength<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      Unknown,
      Known
    }

    protected vLength() {
    }

    public abstract Tag tag();

    public boolean isUnknown() {
      return false;
    }

    public boolean isKnown() {
      return false;
    }
  }

  /** Implementation of constructor 'Incomplete' in variant 'arraySize'. */
  public static class Incomplete extends arraySize<Tuple.T0> {
    public Incomplete() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.Incomplete;
    }

    public boolean isIncomplete() {
      return true;
    }

    public String getName() {
      return "Incomplete";
    }

    public String toString() {
      return "Incomplete";
    }
  }

  /** Implementation of constructor 'VarLength' in variant 'arraySize'. */
  public static class VarLength extends arraySize<Tuple.T1<CTypes.vLength>> {
    public VarLength(CTypes.vLength member1) {
      tuple = new Tuple.T1<CTypes.vLength>(member1);
    }

    public final Tag tag() {
      return Tag.VarLength;
    }

    public boolean isVarLength() {
      return true;
    }

    public String getName() {
      return "VarLength";
    }

    public String toString() {
      return "VarLength of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'Fixed' in variant 'arraySize'. */
  public static class Fixed extends arraySize<Tuple.T1<BigInteger>> {
    public Fixed(BigInteger member1) {
      tuple = new Tuple.T1<BigInteger>(member1);
    }

    public final Tag tag() {
      return Tag.Fixed;
    }

    public boolean isFixed() {
      return true;
    }

    public String getName() {
      return "Fixed";
    }

    public String toString() {
      return "Fixed of " + tuple.toString();
    }
  }

  /** Superclass of all constructors in variant 'arraySize'. */
  public static abstract class arraySize<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      Incomplete,
      VarLength,
      Fixed
    }

    protected arraySize() {
    }

    public abstract Tag tag();

    public boolean isIncomplete() {
      return false;
    }

    public boolean isVarLength() {
      return false;
    }

    public boolean isFixed() {
      return false;
    }
  }

  /** Implementation of record 'gcc_attribute'. */
  public static class gcc_attribute implements Record {
    public String att_name;
    public CTypes.valueType att_value;

    public gcc_attribute(String att_name, CTypes.valueType att_value) {
      this.att_name = att_name;
      this.att_value = att_value;
    }

    public boolean equals(Object o) {
      if (!(o instanceof gcc_attribute)) {
        return true;
      }

      final gcc_attribute r = Analyzer.cast(o);

      if (!(null != att_name && att_name.equals(null == r ? null : r.att_name))) {
        return false;
      }
      if (!(null != att_value && att_value.equals(null == r ? null : r.att_value))) {
        return false;
      }
      return true;
    }

    public String toString() {
      return "{" + (null == att_name ? "?" : att_name.toString()) + ","  + (null == att_value ? "?" : att_value.toString()) + "}";
    }
  }

  /** Implementation of constructor 'VoidT' in variant 'raw_type'. */
  public static class VoidT extends raw_type<Tuple.T0> {
    public VoidT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.VoidT;
    }

    public boolean isVoidT() {
      return true;
    }

    public String getName() {
      return "VoidT";
    }

    public String toString() {
      return "VoidT";
    }
  }

  /** Implementation of constructor 'CharT' in variant 'raw_type'. */
  public static class CharT extends raw_type<Tuple.T0> {
    public CharT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.CharT;
    }

    public boolean isCharT() {
      return true;
    }

    public String getName() {
      return "CharT";
    }

    public String toString() {
      return "CharT";
    }
  }

  /** Implementation of constructor 'UCharT' in variant 'raw_type'. */
  public static class UCharT extends raw_type<Tuple.T0> {
    public UCharT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.UCharT;
    }

    public boolean isUCharT() {
      return true;
    }

    public String getName() {
      return "UCharT";
    }

    public String toString() {
      return "UCharT";
    }
  }

  /** Implementation of constructor 'SCharT' in variant 'raw_type'. */
  public static class SCharT extends raw_type<Tuple.T0> {
    public SCharT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.SCharT;
    }

    public boolean isSCharT() {
      return true;
    }

    public String getName() {
      return "SCharT";
    }

    public String toString() {
      return "SCharT";
    }
  }

  /** Implementation of constructor 'BoolT' in variant 'raw_type'. */
  public static class BoolT extends raw_type<Tuple.T0> {
    public BoolT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.BoolT;
    }

    public boolean isBoolT() {
      return true;
    }

    public String getName() {
      return "BoolT";
    }

    public String toString() {
      return "BoolT";
    }
  }

  /** Implementation of constructor 'ShortT' in variant 'raw_type'. */
  public static class ShortT extends raw_type<Tuple.T0> {
    public ShortT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.ShortT;
    }

    public boolean isShortT() {
      return true;
    }

    public String getName() {
      return "ShortT";
    }

    public String toString() {
      return "ShortT";
    }
  }

  /** Implementation of constructor 'UShortT' in variant 'raw_type'. */
  public static class UShortT extends raw_type<Tuple.T0> {
    public UShortT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.UShortT;
    }

    public boolean isUShortT() {
      return true;
    }

    public String getName() {
      return "UShortT";
    }

    public String toString() {
      return "UShortT";
    }
  }

  /** Implementation of constructor 'UIntT' in variant 'raw_type'. */
  public static class UIntT extends raw_type<Tuple.T0> {
    public UIntT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.UIntT;
    }

    public boolean isUIntT() {
      return true;
    }

    public String getName() {
      return "UIntT";
    }

    public String toString() {
      return "UIntT";
    }
  }

  /** Implementation of constructor 'IntT' in variant 'raw_type'. */
  public static class IntT extends raw_type<Tuple.T0> {
    public IntT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.IntT;
    }

    public boolean isIntT() {
      return true;
    }

    public String getName() {
      return "IntT";
    }

    public String toString() {
      return "IntT";
    }
  }

  /** Implementation of constructor 'ULongT' in variant 'raw_type'. */
  public static class ULongT extends raw_type<Tuple.T0> {
    public ULongT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.ULongT;
    }

    public boolean isULongT() {
      return true;
    }

    public String getName() {
      return "ULongT";
    }

    public String toString() {
      return "ULongT";
    }
  }

  /** Implementation of constructor 'LongT' in variant 'raw_type'. */
  public static class LongT extends raw_type<Tuple.T0> {
    public LongT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.LongT;
    }

    public boolean isLongT() {
      return true;
    }

    public String getName() {
      return "LongT";
    }

    public String toString() {
      return "LongT";
    }
  }

  /** Implementation of constructor 'ULongLongT' in variant 'raw_type'. */
  public static class ULongLongT extends raw_type<Tuple.T0> {
    public ULongLongT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.ULongLongT;
    }

    public boolean isULongLongT() {
      return true;
    }

    public String getName() {
      return "ULongLongT";
    }

    public String toString() {
      return "ULongLongT";
    }
  }

  /** Implementation of constructor 'DoubleT' in variant 'raw_type'. */
  public static class DoubleT extends raw_type<Tuple.T0> {
    public DoubleT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.DoubleT;
    }

    public boolean isDoubleT() {
      return true;
    }

    public String getName() {
      return "DoubleT";
    }

    public String toString() {
      return "DoubleT";
    }
  }

  /** Implementation of constructor 'FloatT' in variant 'raw_type'. */
  public static class FloatT extends raw_type<Tuple.T0> {
    public FloatT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.FloatT;
    }

    public boolean isFloatT() {
      return true;
    }

    public String getName() {
      return "FloatT";
    }

    public String toString() {
      return "FloatT";
    }
  }

  /** Implementation of constructor 'LongDoubleT' in variant 'raw_type'. */
  public static class LongDoubleT extends raw_type<Tuple.T0> {
    public LongDoubleT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.LongDoubleT;
    }

    public boolean isLongDoubleT() {
      return true;
    }

    public String getName() {
      return "LongDoubleT";
    }

    public String toString() {
      return "LongDoubleT";
    }
  }

  /** Implementation of constructor 'LongLongT' in variant 'raw_type'. */
  public static class LongLongT extends raw_type<Tuple.T0> {
    public LongLongT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.LongLongT;
    }

    public boolean isLongLongT() {
      return true;
    }

    public String getName() {
      return "LongLongT";
    }

    public String toString() {
      return "LongLongT";
    }
  }

  /** Implementation of constructor 'PointerT' in variant 'raw_type'. */
  public static class PointerT extends raw_type<Tuple.T1<CTypes.type>> {
    public PointerT(CTypes.type member1) {
      tuple = new Tuple.T1<CTypes.type>(member1);
    }

    public final Tag tag() {
      return Tag.PointerT;
    }

    public boolean isPointerT() {
      return true;
    }

    public String getName() {
      return "PointerT";
    }

    public String toString() {
      return "PointerT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'FloatComplexT' in variant 'raw_type'. */
  public static class FloatComplexT extends raw_type<Tuple.T0> {
    public FloatComplexT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.FloatComplexT;
    }

    public boolean isFloatComplexT() {
      return true;
    }

    public String getName() {
      return "FloatComplexT";
    }

    public String toString() {
      return "FloatComplexT";
    }
  }

  /** Implementation of constructor 'DoubleComplexT' in variant 'raw_type'. */
  public static class DoubleComplexT extends raw_type<Tuple.T0> {
    public DoubleComplexT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.DoubleComplexT;
    }

    public boolean isDoubleComplexT() {
      return true;
    }

    public String getName() {
      return "DoubleComplexT";
    }

    public String toString() {
      return "DoubleComplexT";
    }
  }

  /** Implementation of constructor 'LongDoubleComplexT' in variant 'raw_type'. */
  public static class LongDoubleComplexT extends raw_type<Tuple.T0> {
    public LongDoubleComplexT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.LongDoubleComplexT;
    }

    public boolean isLongDoubleComplexT() {
      return true;
    }

    public String getName() {
      return "LongDoubleComplexT";
    }

    public String toString() {
      return "LongDoubleComplexT";
    }
  }

  /** Implementation of constructor 'ComplexT' in variant 'raw_type'. */
  public static class ComplexT extends raw_type<Tuple.T0> {
    public ComplexT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.ComplexT;
    }

    public boolean isComplexT() {
      return true;
    }

    public String getName() {
      return "ComplexT";
    }

    public String toString() {
      return "ComplexT";
    }
  }

  /** Implementation of constructor 'ArrayT' in variant 'raw_type'. */
  public static class ArrayT extends raw_type<Tuple.T2<CTypes.type, CTypes.arraySize>> {
    public ArrayT(CTypes.type member1, CTypes.arraySize member2) {
      tuple = new Tuple.T2<CTypes.type, CTypes.arraySize>(member1, member2);
    }

    public final Tag tag() {
      return Tag.ArrayT;
    }

    public boolean isArrayT() {
      return true;
    }

    public String getName() {
      return "ArrayT";
    }

    public String toString() {
      return "ArrayT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'BitfieldT' in variant 'raw_type'. */
  public static class BitfieldT extends raw_type<Tuple.T2<CTypes.type, BigInteger>> {
    public BitfieldT(CTypes.type member1, BigInteger member2) {
      tuple = new Tuple.T2<CTypes.type, BigInteger>(member1, member2);
    }

    public final Tag tag() {
      return Tag.BitfieldT;
    }

    public boolean isBitfieldT() {
      return true;
    }

    public String getName() {
      return "BitfieldT";
    }

    public String toString() {
      return "BitfieldT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'StructT' in variant 'raw_type'. */
  public static class StructT extends raw_type<Tuple.T3<String, BigInteger, Pair<CTypes.type>>> {
    public StructT(String member1, BigInteger member2, Pair<CTypes.type> member3) {
      tuple = new Tuple.T3<String, BigInteger, Pair<CTypes.type>>(member1, member2, member3);
    }

    public final Tag tag() {
      return Tag.StructT;
    }

    public boolean isStructT() {
      return true;
    }

    public String getName() {
      return "StructT";
    }

    public boolean equals(Object o) {
      if (o == null) {
        return false;
      }
      if (!(o instanceof StructT)) {
        return false;
      }

      StructT other = (StructT)o;
      boolean res = true;

      res = res && Analyzer.equal(this.getTuple().get1(), other.getTuple().get1());
      res = res && Analyzer.equal(this.getTuple().get2(), other.getTuple().get2());
      return res;
    }

    public String toString() {
      return "StructT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'UnionT' in variant 'raw_type'. */
  public static class UnionT extends raw_type<Tuple.T3<String, BigInteger, Pair<CTypes.type>>> {
    public UnionT(String member1, BigInteger member2, Pair<CTypes.type> member3) {
      tuple = new Tuple.T3<String, BigInteger, Pair<CTypes.type>>(member1, member2, member3);
    }

    public final Tag tag() {
      return Tag.UnionT;
    }

    public boolean isUnionT() {
      return true;
    }

    public String getName() {
      return "UnionT";
    }

    public boolean equals(Object o) {
      if (o == null) {
        return false;
      }
      if (!(o instanceof UnionT)) {
        return false;
      }

      UnionT other = (UnionT)o;
      boolean res = true;

      res = res && Analyzer.equal(this.getTuple().get1(), other.getTuple().get1());
      res = res && Analyzer.equal(this.getTuple().get2(), other.getTuple().get2());
      return res;
    }

    public String toString() {
      return "UnionT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'LabelT' in variant 'raw_type'. */
  public static class LabelT extends raw_type<Tuple.T1<String>> {
    public LabelT(String member1) {
      tuple = new Tuple.T1<String>(member1);
    }

    public final Tag tag() {
      return Tag.LabelT;
    }

    public boolean isLabelT() {
      return true;
    }

    public String getName() {
      return "LabelT";
    }

    public String toString() {
      return "LabelT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'FunctionT' in variant 'raw_type'. */
  public static class FunctionT extends raw_type<Tuple.T2<CTypes.type, Pair<CTypes.type>>> {
    public FunctionT(CTypes.type member1, Pair<CTypes.type> member2) {
      tuple = new Tuple.T2<CTypes.type, Pair<CTypes.type>>(member1, member2);
    }

    public final Tag tag() {
      return Tag.FunctionT;
    }

    public boolean isFunctionT() {
      return true;
    }

    public String getName() {
      return "FunctionT";
    }

    public boolean equals(Object o) {
      if (o == null) {
        return false;
      }
      if (!(o instanceof FunctionT)) {
        return false;
      }

      FunctionT other = (FunctionT)o;
      boolean res = true;

      res = res && Analyzer.equal(this.getTuple().get1(), other.getTuple().get1());
      return res;
    }

    public String toString() {
      return "FunctionT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'MemberT' in variant 'raw_type'. */
  public static class MemberT extends raw_type<Tuple.T2<String, CTypes.type>> {
    public MemberT(String member1, CTypes.type member2) {
      tuple = new Tuple.T2<String, CTypes.type>(member1, member2);
    }

    public final Tag tag() {
      return Tag.MemberT;
    }

    public boolean isMemberT() {
      return true;
    }

    public String getName() {
      return "MemberT";
    }

    public boolean equals(Object o) {
      if (o == null) {
        return false;
      }
      if (!(o instanceof MemberT)) {
        return false;
      }

      MemberT other = (MemberT)o;
      boolean res = true;

      res = res && Analyzer.equal(this.getTuple().get1(), other.getTuple().get1());
      return res;
    }

    public String toString() {
      return "MemberT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'ListT' in variant 'raw_type'. */
  public static class ListT extends raw_type<Tuple.T1<Pair<CTypes.type>>> {
    public ListT(Pair<CTypes.type> member1) {
      tuple = new Tuple.T1<Pair<CTypes.type>>(member1);
    }

    public final Tag tag() {
      return Tag.ListT;
    }

    public boolean isListT() {
      return true;
    }

    public String getName() {
      return "ListT";
    }

    public String toString() {
      return "ListT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'VarArgT' in variant 'raw_type'. */
  public static class VarArgT extends raw_type<Tuple.T0> {
    public VarArgT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.VarArgT;
    }

    public boolean isVarArgT() {
      return true;
    }

    public String getName() {
      return "VarArgT";
    }

    public String toString() {
      return "VarArgT";
    }
  }

  /** Implementation of constructor 'WideCharT' in variant 'raw_type'. */
  public static class WideCharT extends raw_type<Tuple.T0> {
    public WideCharT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.WideCharT;
    }

    public boolean isWideCharT() {
      return true;
    }

    public String getName() {
      return "WideCharT";
    }

    public String toString() {
      return "WideCharT";
    }
  }

  /** Implementation of constructor 'EnumeratorT' in variant 'raw_type'. */
  public static class EnumeratorT extends raw_type<Tuple.T3<String, CTypes.type, BigInteger>> {
    public EnumeratorT(String member1, CTypes.type member2, BigInteger member3) {
      tuple = new Tuple.T3<String, CTypes.type, BigInteger>(member1, member2, member3);
    }

    public final Tag tag() {
      return Tag.EnumeratorT;
    }

    public boolean isEnumeratorT() {
      return true;
    }

    public String getName() {
      return "EnumeratorT";
    }

    public String toString() {
      return "EnumeratorT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'EnumT' in variant 'raw_type'. */
  public static class EnumT extends raw_type<Tuple.T3<String, BigInteger, Pair<CTypes.type>>> {
    public EnumT(String member1, BigInteger member2, Pair<CTypes.type> member3) {
      tuple = new Tuple.T3<String, BigInteger, Pair<CTypes.type>>(member1, member2, member3);
    }

    public final Tag tag() {
      return Tag.EnumT;
    }

    public boolean isEnumT() {
      return true;
    }

    public String getName() {
      return "EnumT";
    }

    public String toString() {
      return "EnumT of " + tuple.toString();
    }
  }

  /** Superclass of all constructors in variant 'raw_type'. */
  public static abstract class raw_type<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      VoidT,
      CharT,
      UCharT,
      SCharT,
      BoolT,
      ShortT,
      UShortT,
      UIntT,
      IntT,
      ULongT,
      LongT,
      ULongLongT,
      DoubleT,
      FloatT,
      LongDoubleT,
      LongLongT,
      PointerT,
      FloatComplexT,
      DoubleComplexT,
      LongDoubleComplexT,
      ComplexT,
      ArrayT,
      BitfieldT,
      StructT,
      UnionT,
      LabelT,
      FunctionT,
      MemberT,
      ListT,
      VarArgT,
      WideCharT,
      EnumeratorT,
      EnumT
    }

    protected raw_type() {
    }

    public abstract Tag tag();

    public boolean isVoidT() {
      return false;
    }

    public boolean isCharT() {
      return false;
    }

    public boolean isUCharT() {
      return false;
    }

    public boolean isSCharT() {
      return false;
    }

    public boolean isBoolT() {
      return false;
    }

    public boolean isShortT() {
      return false;
    }

    public boolean isUShortT() {
      return false;
    }

    public boolean isUIntT() {
      return false;
    }

    public boolean isIntT() {
      return false;
    }

    public boolean isULongT() {
      return false;
    }

    public boolean isLongT() {
      return false;
    }

    public boolean isULongLongT() {
      return false;
    }

    public boolean isDoubleT() {
      return false;
    }

    public boolean isFloatT() {
      return false;
    }

    public boolean isLongDoubleT() {
      return false;
    }

    public boolean isLongLongT() {
      return false;
    }

    public boolean isPointerT() {
      return false;
    }

    public boolean isFloatComplexT() {
      return false;
    }

    public boolean isDoubleComplexT() {
      return false;
    }

    public boolean isLongDoubleComplexT() {
      return false;
    }

    public boolean isComplexT() {
      return false;
    }

    public boolean isArrayT() {
      return false;
    }

    public boolean isBitfieldT() {
      return false;
    }

    public boolean isStructT() {
      return false;
    }

    public boolean isUnionT() {
      return false;
    }

    public boolean isLabelT() {
      return false;
    }

    public boolean isFunctionT() {
      return false;
    }

    public boolean isMemberT() {
      return false;
    }

    public boolean isListT() {
      return false;
    }

    public boolean isVarArgT() {
      return false;
    }

    public boolean isWideCharT() {
      return false;
    }

    public boolean isEnumeratorT() {
      return false;
    }

    public boolean isEnumT() {
      return false;
    }
  }

  /** Implementation of record 'type'. */
  public static class type implements Record {
    public CTypes.raw_type<?> type;
    public Pair<CTypes.qualifier> qualifiers;
    public CTypes.storageClass storage;
    public CTypes.functionSpecifier fSpec;
    public CTypes.valueType value;
    public Boolean implicit;
    public Boolean initialised;
    public Node position;
    public Boolean old_style;
    public Boolean var_args;
    public Boolean in_top;
    public Pair<CTypes.gcc_attribute> gcc_attributes;

    public type(CTypes.raw_type<?> type, Pair<CTypes.qualifier> qualifiers, CTypes.storageClass storage, CTypes.functionSpecifier fSpec, CTypes.valueType value, Boolean implicit, Boolean initialised, Node position, Boolean old_style, Boolean var_args, Boolean in_top, Pair<CTypes.gcc_attribute> gcc_attributes) {
      this.type = type;
      this.qualifiers = qualifiers;
      this.storage = storage;
      this.fSpec = fSpec;
      this.value = value;
      this.implicit = implicit;
      this.initialised = initialised;
      this.position = position;
      this.old_style = old_style;
      this.var_args = var_args;
      this.in_top = in_top;
      this.gcc_attributes = gcc_attributes;
    }

    public boolean equals(Object o) {
      if (o == null) {
        return false;
      }
      if (!(o instanceof type)) {
        return false;
      }

      type other = (type)o;
      boolean res = true;

      res = res && type.equals(other.type);
      return res;
    }

    public String toString() {
      return "{" + (null == type ? "?" : type.toString()) + ","  + (null == qualifiers ? "?" : qualifiers.toString()) + ","  + (null == storage ? "?" : storage.toString()) + ","  + (null == fSpec ? "?" : fSpec.toString()) + ","  + (null == value ? "?" : value.toString()) + ","  + (null == implicit ? "?" : implicit.toString()) + ","  + (null == initialised ? "?" : initialised.toString()) + ","  + (null == position ? "?" : position.toString()) + ","  + (null == old_style ? "?" : old_style.toString()) + ","  + (null == var_args ? "?" : var_args.toString()) + ","  + (null == in_top ? "?" : in_top.toString()) + ","  + (null == gcc_attributes ? "?" : gcc_attributes.toString()) + "}";
    }
  }

  /** Implementation of constructor 'ConstQ' in variant 'qualifier'. */
  public static class ConstQ extends qualifier<Tuple.T0> {
    public ConstQ() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.ConstQ;
    }

    public boolean isConstQ() {
      return true;
    }

    public String getName() {
      return "ConstQ";
    }

    public String toString() {
      return "ConstQ";
    }
  }

  /** Implementation of constructor 'VolatileQ' in variant 'qualifier'. */
  public static class VolatileQ extends qualifier<Tuple.T0> {
    public VolatileQ() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.VolatileQ;
    }

    public boolean isVolatileQ() {
      return true;
    }

    public String getName() {
      return "VolatileQ";
    }

    public String toString() {
      return "VolatileQ";
    }
  }

  /** Implementation of constructor 'RestrictQ' in variant 'qualifier'. */
  public static class RestrictQ extends qualifier<Tuple.T0> {
    public RestrictQ() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.RestrictQ;
    }

    public boolean isRestrictQ() {
      return true;
    }

    public String getName() {
      return "RestrictQ";
    }

    public String toString() {
      return "RestrictQ";
    }
  }

  /** Superclass of all constructors in variant 'qualifier'. */
  public static abstract class qualifier<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      ConstQ,
      VolatileQ,
      RestrictQ
    }

    protected qualifier() {
    }

    public abstract Tag tag();

    public boolean isConstQ() {
      return false;
    }

    public boolean isVolatileQ() {
      return false;
    }

    public boolean isRestrictQ() {
      return false;
    }
  }

  /** Implementation of constructor 'InlineF' in variant 'functionSpecifier'. */
  public static class InlineF extends functionSpecifier<Tuple.T0> {
    public InlineF() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.InlineF;
    }

    public boolean isInlineF() {
      return true;
    }

    public String getName() {
      return "InlineF";
    }

    public String toString() {
      return "InlineF";
    }
  }

  /** Superclass of all constructors in variant 'functionSpecifier'. */
  public static abstract class functionSpecifier<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      InlineF
    }

    protected functionSpecifier() {
    }

    public abstract Tag tag();

    public boolean isInlineF() {
      return false;
    }
  }

  /** Implementation of constructor 'ExternS' in variant 'storageClass'. */
  public static class ExternS extends storageClass<Tuple.T0> {
    public ExternS() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.ExternS;
    }

    public boolean isExternS() {
      return true;
    }

    public String getName() {
      return "ExternS";
    }

    public String toString() {
      return "ExternS";
    }
  }

  /** Implementation of constructor 'RegisterS' in variant 'storageClass'. */
  public static class RegisterS extends storageClass<Tuple.T0> {
    public RegisterS() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.RegisterS;
    }

    public boolean isRegisterS() {
      return true;
    }

    public String getName() {
      return "RegisterS";
    }

    public String toString() {
      return "RegisterS";
    }
  }

  /** Implementation of constructor 'StaticS' in variant 'storageClass'. */
  public static class StaticS extends storageClass<Tuple.T0> {
    public StaticS() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.StaticS;
    }

    public boolean isStaticS() {
      return true;
    }

    public String getName() {
      return "StaticS";
    }

    public String toString() {
      return "StaticS";
    }
  }

  /** Implementation of constructor 'TypedefS' in variant 'storageClass'. */
  public static class TypedefS extends storageClass<Tuple.T0> {
    public TypedefS() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.TypedefS;
    }

    public boolean isTypedefS() {
      return true;
    }

    public String getName() {
      return "TypedefS";
    }

    public String toString() {
      return "TypedefS";
    }
  }

  /** Implementation of constructor 'AutoS' in variant 'storageClass'. */
  public static class AutoS extends storageClass<Tuple.T0> {
    public AutoS() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.AutoS;
    }

    public boolean isAutoS() {
      return true;
    }

    public String getName() {
      return "AutoS";
    }

    public String toString() {
      return "AutoS";
    }
  }

  /** Superclass of all constructors in variant 'storageClass'. */
  public static abstract class storageClass<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      ExternS,
      RegisterS,
      StaticS,
      TypedefS,
      AutoS
    }

    protected storageClass() {
    }

    public abstract Tag tag();

    public boolean isExternS() {
      return false;
    }

    public boolean isRegisterS() {
      return false;
    }

    public boolean isStaticS() {
      return false;
    }

    public boolean isTypedefS() {
      return false;
    }

    public boolean isAutoS() {
      return false;
    }
  }

  /** Implementation of record 'label_record'. */
  public static class label_record implements Record {
    public String label_name;
    public Node label_position;

    public label_record(String label_name, Node label_position) {
      this.label_name = label_name;
      this.label_position = label_position;
    }

    public boolean equals(Object o) {
      if (!(o instanceof label_record)) {
        return true;
      }

      final label_record r = Analyzer.cast(o);

      if (!(null != label_name && label_name.equals(null == r ? null : r.label_name))) {
        return false;
      }
      if (!(null != label_position && label_position.equals(null == r ? null : r.label_position))) {
        return false;
      }
      return true;
    }

    public String toString() {
      return "{" + (null == label_name ? "?" : label_name.toString()) + ","  + (null == label_position ? "?" : label_position.toString()) + "}";
    }
  }

  private CTypes() {
  }
}
