- this.base_type = type;
- int accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, accmods, Location);
+ underlying_type_expr = type;
+ var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
+ ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags, accmods, Location, Report);
+ spec = new EnumSpec (null, this, null, null, ModFlags);
+ }
+
+ #region Properties
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Enum;
+ }
+ }
+
+ public TypeExpr BaseTypeExpression {
+ get {
+ return underlying_type_expr;
+ }
+ }
+
+ protected override TypeAttributes TypeAttr {
+ get {
+ return ModifiersExtensions.TypeAttr (ModFlags, IsTopLevel) |
+ TypeAttributes.Class | TypeAttributes.Sealed | base.TypeAttr;
+ }
+ }
+
+ public TypeSpec UnderlyingType {
+ get {
+ return ((EnumSpec) spec).UnderlyingType;
+ }
+ }
+
+ #endregion
+
+ public override void Accept (StructuralVisitor visitor)
+ {
+ visitor.Visit (this);