[M3devel] "looping to get all types declared first"

Jay K jay.krell at cornell.edu
Sun Oct 31 05:43:59 CET 2010


There is this "replay" thing I put in the backend.
It isn't quite right.
 
 
I would like to have multiple passes, where if
all the types haven't been declared yet, non-type-declaration
operations do nothing.
 
There are approximately three approaches.
 
 1) the frontend front-loads all type declarations
so as soon as non-type declaration seen, that is the end,
ok to loop; I don't know if this is true.
 
 
 2) in each operand implementation, check if all the types
  have been declared yet and if not and if the operation
  isn't a declaration, immediately return
  This isn't entirely true. Some things like begin unit/procedure/block
  need to do anything, to track lexical location for building
  prefixes on type names, or somesuch.
 
 Actually, I think all the type data structures might need
to be in a linked list going from inner scope to outer scope
and searches have to search them in order and take the first hit. ?
 
 
 3) or, similarly, but the question is, do we loop
  over the serialized form, or do we first deserialize
  into an in-memory form, and then loop over that?
 
 
Those are my main questions:
   a) does the front end front-load declarations? I can trace a bit in cm3cg and guess.
   b) if not, do people prefer multiple passes over the serialized form or
   first deserialize into an in-memory form, and then loop over that
   c) change frontend to front-load declarations
 
 
My preference is b.
It is isn't the most efficient, but the efficiency should be plenty adequate.
 
 
I understand typeids are hashes, so scope is sort of irrelevant.
But typenames specifically are scoped.
 
 
 - Jay 		 	   		  


More information about the M3devel mailing list