[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Fri Mar 22 05:48:05 CET 2013


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	13/03/22 05:48:05

Modified files:
	cm3/m3-sys/m3back/src/: M3C.m3 

Log message:
	type declaration moving along nicely
	
	We now declare almost everything.
	
	The following needs work though:
	
	- opaque is just address; really not good,
	we should either typedef upon reveal, or
	forward declare as a struct and duplicate upon reveal;
	first option is smaller, second option might be needed
	specifically: typedefs cannot be forward declared,
	but, also, these might always be pointers, AND we should be able
	to "scan ahead" to the reveal and thus:
	
	pass 1) not necessarily in this order
	declare_opaque foo: do nothing
	reveal opaque foo=bar: do nothing
	declare_object bar: struct bar; typedef struct bar bar;
	
	pass 2)
	declare_opaque foo: do nothing
	reveal opaque foo=bar: typedef bar foo;
	
	- typenames -- we could use them to make the code more readable
	
	- proctypes -- currently just typedef ADDRESS typeuid;
	This will be really nice to do well, and then maybe remove
	all function pointer casts (but for problems to do with static link)
	
	- actually use the types! (this will be a late step, and one of the points)
	
	- enums still C compatible and don't take advantage of gcc/msvc extensions
	
	- possibly should simplify:
	currently we define types totally in an on-demand/as-possible basis
	What we should really do is fairly statically declare and forward declare
	most things:
	forward declare records and arrays (arrays are structs)
	declare enums
	declare pointers
	declare typenames that are to pointers/enums
	declare subranges
	
	and then use the same on-demand/as-possible scheme for records/objects, i.e.
	because records/objects can contain records/objects, and declare_record/object
	occur in arbitrary order
	
	Also TODO is layout objects properly -- I need to read through the code
	to learn the layout..probably like single inheritance C++..but reading
	through m3front, it reall wasn't obvious




More information about the M3commit mailing list