Re: cpp branch



Michael Meeks <michael@ximian.com> wrote:
> 
>         When I last tried this invocation produces just empty files; so
> ... something is bust somewhere, I was hoping Sam would find what it was.
> Either way, any fixes there would be greatly appreciated; feel free to
> commit any fixes, and send a patch here as you do.

I found the cause of this problem: The C++ backend doesn't know how to
handle the IDLN_SRCFILE IDL type, hence the error about something being
unexpected. The error would be slightly more helpful if the C++ backend
also knew how to get the correct type name for a node from libIDL.

Anyway, I'll attach a patch to fix this particular problem, as well as
fixing the way the backend grabs the node type name, so error messages
will be more meaningful.

When (if?) the backend is re-written in C, maybe it should be made
intelligent enough to warn about IDL types it doesn't know about, rather
than bombing out? Or could that just hide problems further down the
track?

In the mean time, I'm working on two things:
1) Conditional compilation of the C++ compiler and ORB. This is pretty
simple, and just needs tidying up.
2) Actually getting the C++ ORB to compile at all. No guarantees about
the code actually being useful. :)
-- 
Sam "Eddie" Couter  |  mailto:sam@topic.com.au     |  I need a short and
Internet Engineer   |  jabber:eddiesam@jabber.org  |  clever comment for
tSA Consulting      |  http://www.topic.com.au/    |  my .signature file
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C
? srcfile_idl_type.diff
? test/test-mem
Index: src/idl-compiler/cpp/base.cc
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/cpp/Attic/base.cc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 base.cc
--- src/idl-compiler/cpp/base.cc	2001/12/11 07:59:36	1.1.2.1
+++ src/idl-compiler/cpp/base.cc	2002/01/05 05:05:33
@@ -91,14 +91,16 @@
 
 
 string idlGetNodeTypeString(IDL_tree node) {
-	return idlGetTypeString(IDL_NODE_TYPE(node));
+	char const *original = IDL_NODE_TYPE_NAME(node);
+
+	return idlLower(original);
 }
 
 
 
 
 string idlGetTypeString(IDL_tree_type type) {
-	char const *original = IDL_tree_type_names[type]+5;
+	char const *original = IDL_tree_type_names[type];
   
 	return idlLower(original);
 }
Index: src/idl-compiler/cpp/error.hh
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/cpp/Attic/error.hh,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 error.hh
--- src/idl-compiler/cpp/error.hh	2001/12/11 07:59:36	1.1.2.1
+++ src/idl-compiler/cpp/error.hh	2002/01/05 05:05:34
@@ -43,7 +43,7 @@
 
 // Useful macros --------------------------------------------------------------
 #define ORBITCPP_EXPECT_TYPE(node,type) \
-	if (node->_type != type) \
+	if (IDL_NODE_TYPE(node) != type) \
 	throw IDLExNodeType(node,type);
 #define ORBITCPP_MEMCHECK(item) \
 	if (!item) throw IDLExMemory();
Index: src/idl-compiler/cpp/pass_idl_it.cc
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/cpp/Attic/pass_idl_it.cc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 pass_idl_it.cc
--- src/idl-compiler/cpp/pass_idl_it.cc	2001/12/11 07:59:36	1.1.2.1
+++ src/idl-compiler/cpp/pass_idl_it.cc	2002/01/05 05:05:34
@@ -177,6 +177,8 @@
 		case IDLN_FORWARD_DCL:
 			doForwardDcl(IDL_LIST(list).data,scope);
 			break;
+		case IDLN_SRCFILE:
+			break;
 			ORBITCPP_DEFAULT_CASE(IDL_LIST(list).data)
 		}
 		list = IDL_LIST(list).next;

PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]