Index: src/AST/Convert.cpp
===================================================================
--- src/AST/Convert.cpp	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/AST/Convert.cpp	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -276,5 +276,5 @@
 		decl->parent = get<AggregateDecl>().accept1( node->parent );
 		declPostamble( decl, node );
-		return nullptr;
+		return nullptr; // ??
 	}
 
@@ -305,5 +305,6 @@
 	}
 
-	const ast::Decl * visit( const ast::EnumDecl * node ) override final {
+	const ast::Decl * visit( const ast::EnumDecl * node ) override final { // Marker: what is this for? 
+	// Called in ConverterNewToOld
 		if ( inCache( node ) ) return nullptr;
 		auto decl = new EnumDecl(
@@ -312,5 +313,5 @@
 			LinkageSpec::Spec( node->linkage.val )
 		);
-		return aggregatePostamble( decl, node );
+		return aggregatePostamble( decl, node ); // Node info, including members, processed in aggregatePostamble
 	}
 
@@ -1495,4 +1496,7 @@
 		getAccept1< ast::type, decltype( old->child ) >( old->child )
 
+#	define GET_ACCEPT_E(child, type) \
+		getAccept1< ast::type, decltype( old->base ) >( old->base )
+
 	template<typename NewT, typename OldC>
 	std::vector< ast::ptr<NewT> > getAcceptV( const OldC& old ) {
@@ -1710,4 +1714,6 @@
 	}
 
+	// Marker
+	// Convert SynTree::EnumDecl to AST::EnumDecl
 	virtual void visit( const EnumDecl * old ) override final {
 		if ( inCache( old ) ) return;
@@ -1716,5 +1722,7 @@
 			old->name,
 			GET_ACCEPT_V(attributes, Attribute),
-			{ old->linkage.val }
+			{ old->linkage.val },
+			old->base? GET_ACCEPT_E(base, Type) : nullptr,
+			old->enumValues
 		);
 		cache.emplace( old, decl );
@@ -1726,5 +1734,4 @@
 		decl->uniqueId   = old->uniqueId;
 		decl->storage    = { old->storageClasses.val };
-
 		this->node = decl;
 	}
Index: src/AST/Decl.cpp
===================================================================
--- src/AST/Decl.cpp	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/AST/Decl.cpp	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -133,6 +133,32 @@
 
 	auto it = enumValues.find( enumerator->name );
+	
 	if ( it != enumValues.end() ) {
-		value = it->second;
+			
+		// Handle typed enum by casting the value in (C++) compiler
+		if ( base ) { // A typed enum
+			if ( const BasicType * bt = dynamic_cast<const BasicType *>(base) ) {
+				switch( bt->kind ) {
+					case BasicType::Kind::Bool:	value = (bool) it->second; break;
+					case BasicType::Kind::Char: value = (char) it->second; break;
+					case BasicType::Kind::SignedChar: value = (signed char) it->second; break;
+					case BasicType::Kind::UnsignedChar: value = (unsigned char) it->second; break;
+					case BasicType::Kind::ShortSignedInt: value = (short signed int) it->second; break;
+					case BasicType::Kind::SignedInt: value = (signed int) it->second; break;
+					case BasicType::Kind::UnsignedInt: value = (unsigned int) it->second; break;
+					case BasicType::Kind::LongSignedInt: value = (long signed int) it->second; break;
+					case BasicType::Kind::LongUnsignedInt: value = (long unsigned int) it->second; break;
+					case BasicType::Kind::LongLongSignedInt: value = (long long signed int) it->second; break;
+					case BasicType::Kind::LongLongUnsignedInt: value = (long long unsigned int) it->second; break; 
+					// TODO: value should be able to handle long long unsigned int
+
+					default:
+					value = it->second;
+				}
+			}
+		} else {
+			value = it->second;
+		}
+
 		return true;
 	}
Index: src/AST/Decl.hpp
===================================================================
--- src/AST/Decl.hpp	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/AST/Decl.hpp	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -302,9 +302,13 @@
 class EnumDecl final : public AggregateDecl {
 public:
+	Type * base;
+
 	EnumDecl( const CodeLocation& loc, const std::string& name,
-		std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall )
-	: AggregateDecl( loc, name, std::move(attrs), linkage ), enumValues() {}
+		std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type * base = nullptr,
+		 std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() )
+	: AggregateDecl( loc, name, std::move(attrs), linkage ), base(base), enumValues(enumValues) {}
 
 	/// gets the integer value for this enumerator, returning true iff value found
+	// Maybe it is not used in producing the enum value
 	bool valueOf( const Decl * enumerator, long long& value ) const;
 
Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/CodeGen/CodeGenerator.cc	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -274,5 +274,5 @@
 	void CodeGenerator::postvisit( EnumDecl * enumDecl ) {
 		extension( enumDecl );
-		output << "enum ";
+		output << "enum /* Marker CodeGenerator::EnumDecl */ ";
 		genAttributes( enumDecl->get_attributes() );
 
@@ -291,4 +291,5 @@
 				if ( obj->get_init() ) {
 					output << " = ";
+					// In progress
 					obj->get_init()->accept( *visitor );
 				} // if
Index: src/CodeGen/GenType.cc
===================================================================
--- src/CodeGen/GenType.cc	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/CodeGen/GenType.cc	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -254,5 +254,5 @@
 	void GenType::postvisit( EnumInstType * enumInst ) {
 		typeString = enumInst->name + " " + typeString;
-		if ( options.genC ) typeString = "enum " + typeString;
+		if ( options.genC ) typeString = "enum /* Marker GenType::EnumInstType */ " + typeString;
 		handleQualifiers( enumInst );
 	}
Index: src/Common/Eval.cc
===================================================================
--- src/Common/Eval.cc	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/Common/Eval.cc	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -112,5 +112,5 @@
 	}
 
-	void postvisit( const ast::VariableExpr * expr ) {
+	void postvisit( const ast::VariableExpr * expr ) { // No hit
 		if ( const ast::EnumInstType * inst = dynamic_cast<const ast::EnumInstType *>(expr->result.get()) ) {
 			if ( const ast::EnumDecl * decl = inst->base ) {
Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/Common/PassVisitor.impl.h	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -754,4 +754,5 @@
 
 	// unlike structs, traits, and unions, enums inject their members into the global scope
+	if ( node->base ) maybeAccept_impl( node->base, *this ); // Need this? Maybe not?
 	maybeAccept_impl( node->parameters, *this );
 	maybeAccept_impl( node->members   , *this );
Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/Parser/DeclarationNode.cc	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -78,5 +78,5 @@
 	delete variable.initializer;
 
-	delete type;
+// 	delete type;
 	delete bitfieldWidth;
 
@@ -253,5 +253,5 @@
 } // DeclarationNode::newAggregate
 
-DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, bool ) {
+DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body, bool typed) {
 	DeclarationNode * newnode = new DeclarationNode;
 	newnode->type = new TypeData( TypeData::Enum );
@@ -272,5 +272,5 @@
 } // DeclarationNode::newName
 
-DeclarationNode * DeclarationNode::newEnumConstant( const string * name, ExpressionNode * constant ) {
+DeclarationNode * DeclarationNode::newEnumConstant( const string * name, ExpressionNode * constant ) { // Marker
 	DeclarationNode * newnode = newName( name );
 	newnode->enumeratorValue.reset( constant );
@@ -667,4 +667,12 @@
 }
 
+DeclarationNode * DeclarationNode::addEnumBase( DeclarationNode * o ) {
+	if ( o && o -> type)  {
+		type->base= o->type;
+	}
+	delete o;
+	return this;
+}
+
 DeclarationNode * DeclarationNode::addTypedef() {
 	TypeData * newtype = new TypeData( TypeData::Symbolic );
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/Parser/ParseNode.h	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -265,4 +265,5 @@
 	DeclarationNode * addType( DeclarationNode * );
 	DeclarationNode * addTypedef();
+	DeclarationNode * addEnumBase( DeclarationNode * );
 	DeclarationNode * addAssertions( DeclarationNode * );
 	DeclarationNode * addName( std::string * );
Index: src/Parser/StatementNode.cc
===================================================================
--- src/Parser/StatementNode.cc	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/Parser/StatementNode.cc	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -366,4 +366,5 @@
 } // maybe_build_compound
 
+// Question
 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output, ExpressionNode * input, ExpressionNode * clobber, LabelNode * gotolabels ) {
 	list< Expression * > out, in;
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/Parser/TypeData.cc	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -918,8 +918,9 @@
 EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) {
 	assert( td->kind == TypeData::Enum );
-	EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes, linkage );
-	buildList( td->enumeration.constants, ret->get_members() );
+	Type* baseType = td->base ? typebuild(td->base) : nullptr;
+	EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes, linkage, baseType );
+	buildList( td->enumeration.constants, ret->get_members() ); // enumConstant is both a node and a list
 	list< Declaration * >::iterator members = ret->get_members().begin();
-	for ( const DeclarationNode * cur = td->enumeration. constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) {
+	for ( const DeclarationNode * cur = td->enumeration.constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) {
 		if ( cur->has_enumeratorValue() ) {
 			ObjectDecl * member = dynamic_cast< ObjectDecl * >(* members);
@@ -927,5 +928,5 @@
 		} // if
 	} // for
-	ret->set_body( td->enumeration.body );
+	ret->set_body( td->enumeration.body ); // Boolean; if it has body
 	return ret;
 } // buildEnum
Index: src/Parser/TypeData.h
===================================================================
--- src/Parser/TypeData.h	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/Parser/TypeData.h	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -132,4 +132,5 @@
 						 Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() );
 FunctionType * buildFunction( const TypeData * );
+Declaration * addEnumBase( Declaration *, const TypeData * );
 void buildKRFunction( const TypeData::Function_t & function );
 
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/Parser/parser.yy	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -2292,5 +2292,7 @@
 			{ SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); }
 			// SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr;
-			$$ = DeclarationNode::newEnum( nullptr, $7, true, true ) ->addQualifiers( $5 );
+
+			$$ = DeclarationNode::newEnum( nullptr, $7, true, true ) ->addQualifiers( $5 )  -> addEnumBase( $3 );
+			// $$ = DeclarationNode::newEnum( nullptr, $7, true, true ) ->addQualifiers( $5 );
 		}
 	| ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt // Question: why attributes/qualifier after identifier
@@ -2301,5 +2303,6 @@
 	  '{' enumerator_list comma_opt '}'
 		{
-			$$ = DeclarationNode::newEnum( $6, $10, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 );
+			$$ = DeclarationNode::newEnum( $6, $10, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ) -> addEnumBase( $3 );
+			// $$ = DeclarationNode::newEnum( $6, $10, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 );
 		}
 	| ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt '{' enumerator_list comma_opt '}'
@@ -2307,5 +2310,6 @@
 			if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); }
 			typedefTable.makeTypedef( *$6->name );
-			$$ = DeclarationNode::newEnum( $6->name, $9, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 );
+			$$ = DeclarationNode::newEnum( $6->name, $9, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ) -> addEnumBase( $3 );
+			// $$ = DeclarationNode::newEnum( $6->name, $9, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 );
 		}
 	| enum_type_nobody
Index: src/SymTab/Demangle.cc
===================================================================
--- src/SymTab/Demangle.cc	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/SymTab/Demangle.cc	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -252,5 +252,5 @@
 
 	void GenType::postvisit( EnumInstType * enumInst ) {
-		typeString = "enum " + enumInst->name + " " + typeString;
+		typeString = "enum /* Marker demangle::EnumInstType */ " + enumInst->name + " " + typeString;
 		handleQualifiers( enumInst );
 	}
Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/SynTree/Declaration.h	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -119,5 +119,5 @@
   public:
 	Type * type;
-	Initializer * init;
+	Initializer * init; // For Enum, the init is a pointer that contain the enum value; see Parser::TypeData::buildEnum
 	Expression * bitfieldWidth;
 
@@ -335,5 +335,8 @@
 	typedef AggregateDecl Parent;
   public:
-	EnumDecl( const std::string & name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
+	EnumDecl( const std::string & name,
+	 const std::list< Attribute * > & attributes = std::list< class Attribute * >(),
+	  LinkageSpec::Spec linkage = LinkageSpec::Cforall,
+	  Type * baseType = nullptr ) : Parent( name, attributes, linkage ) , base( baseType ){}
 	EnumDecl( const EnumDecl & other ) : Parent( other ) {}
 
@@ -344,6 +347,8 @@
 	virtual void accept( Visitor & v ) const override { v.visit( this ); }
 	virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
-  private:
+	Type * base;
 	std::unordered_map< std::string, long long int > enumValues;
+  private:
+	// std::unordered_map< std::string, long long int > enumValues;
 	virtual const char * typeString() const override;
 };
Index: src/SynTree/Visitor.h
===================================================================
--- src/SynTree/Visitor.h	(revision a8ef59ec02a0280ea564c46c7dc4f302947b75cc)
+++ src/SynTree/Visitor.h	(revision f135b50a1177372bc7dd5a2dcf75591c4b6ee098)
@@ -35,5 +35,5 @@
 	virtual void visit( UnionDecl * node ) { visit( const_cast<const UnionDecl *>(node) ); }
 	virtual void visit( const UnionDecl * aggregateDecl ) = 0;
-	virtual void visit( EnumDecl * node ) { visit( const_cast<const EnumDecl *>(node) ); }
+	virtual void visit( EnumDecl * node ) { visit( const_cast<const EnumDecl *>(node) ); } // Marker 1
 	virtual void visit( const EnumDecl * aggregateDecl ) = 0;
 	virtual void visit( TraitDecl * node ) { visit( const_cast<const TraitDecl *>(node) ); }
@@ -190,5 +190,5 @@
 	virtual void visit( UnionInstType * node ) { visit( const_cast<const UnionInstType *>(node) ); }
 	virtual void visit( const UnionInstType * aggregateUseType ) = 0;
-	virtual void visit( EnumInstType * node ) { visit( const_cast<const EnumInstType *>(node) ); }
+	virtual void visit( EnumInstType * node ) { visit( const_cast<const EnumInstType *>(node) ); } // Marker 2
 	virtual void visit( const EnumInstType * aggregateUseType ) = 0;
 	virtual void visit( TraitInstType * node ) { visit( const_cast<const TraitInstType *>(node) ); }
