Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision 6ef2d812b3d79020b26eb8dac1a9ae5249363236)
+++ src/Parser/DeclarationNode.cc	(revision 294647bb36b8887ef83cb50ce4390321fab6d613)
@@ -921,4 +921,5 @@
 				Declaration * decl = extr->build();
 				if ( decl ) {
+					decl->location = cur->location;
 					* out++ = decl;
 				} // if
@@ -928,7 +929,9 @@
 			Declaration * decl = cur->build();
 			if ( decl ) {
+				decl->location = cur->location;
 				* out++ = decl;
 			} // if
 		} catch( SemanticError &e ) {
+			e.set_location( cur->location );
 			errors.append( e );
 		} // try
@@ -950,15 +953,21 @@
 			if ( decl ) {
 				if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
+					dwt->location = cur->location;
 					* out++ = dwt;
 				} else if ( StructDecl * agg = dynamic_cast< StructDecl * >( decl ) ) {
 					StructInstType * inst = new StructInstType( Type::Qualifiers(), agg->get_name() );
-					* out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, nullptr, inst, nullptr );
+					auto obj = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, nullptr, inst, nullptr );
+					obj->location = cur->location;
+					* out++ = obj; 
 					delete agg;
 				} else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) {
 					UnionInstType * inst = new UnionInstType( Type::Qualifiers(), agg->get_name() );
-					* out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, nullptr, inst, nullptr );
+					auto obj = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, nullptr, inst, nullptr );
+					obj->location = cur->location;
+					* out++ = obj;
 				} // if
 			} // if
 		} catch( SemanticError &e ) {
+			e.set_location( cur->location );
 			errors.append( e );
 		} // try
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision 6ef2d812b3d79020b26eb8dac1a9ae5249363236)
+++ src/Parser/ParseNode.h	(revision 294647bb36b8887ef83cb50ce4390321fab6d613)
@@ -39,4 +39,7 @@
 //##############################################################################
 
+extern char* yyfilename;
+extern int yylineno;
+
 class ParseNode {
   public:
@@ -65,4 +68,5 @@
 	ParseNode * next = nullptr;
 	std::string * name = nullptr;
+	CodeLocation location = { yyfilename, yylineno };
 }; // ParseNode
 
@@ -410,10 +414,11 @@
 	while ( cur ) {
 		try {
-//			SynTreeType * result = dynamic_cast< SynTreeType * >( maybeBuild< typename std::result_of< decltype(&NodeType::build)(NodeType)>::type >( cur ) );
 			SynTreeType * result = dynamic_cast< SynTreeType * >( maybeBuild< typename std::pointer_traits< decltype(cur->build())>::element_type >( cur ) );
 			if ( result ) {
+				result->location = cur->location;
 				* out++ = result;
 			} // if
 		} catch( SemanticError &e ) {
+			e.set_location( cur->location );
 			errors.append( e );
 		} // try
