Re: More on Actions, routes and builders in general

Lars Ivar Igesund <[email protected]> Sat, 19 Jun 2004 16:37:45 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Bram Moolenaar wrote:
  > Be careful to only make actions "primary" when they are always to be
> used for turning its input filetypes into its output filetypes.  Thus one
> would be "d" to "object,default", another "d" to "libobject" and the
> third "d" to "dllobject".  These are in the d module, the actions in the
> dmd tool can't be primary actions, they are invoked indirectly by the
> module.

That's the way it is.

> I can't guess what is wrong.  Can you show me the code?

(d.aap and dmd.py are attached.)

It is quite possible that something is wrong in my code somewhere, but 
as I said before, if I want to build a program only, it works if the 
compile to object,default is the last to be defined. I have detected why 
this happens (although I don't know if it is intended or not):

The executive use the find_action to find the correct action to use. 
find_action finds the last action added that satisfies both the intype 
and outtype needed. To find out which types are supported by an action, 
get_in_types and get_out_types are used. The problem exist for both of 
them, but in this case it is only a problem with get_out_types. 
get_out_types checks if there is an action to defer the work to (and 
there is in this case; compile_dmd). get_out_types then use get_ftypes 
and it is here the real trouble is created. get_ftypes adds all the 
outtypes supported by all the compile_dmd actions to the list of 
outtypes to be returned, and in total all the compile_dmd actions 
support all three outtypes. This leads to the fact that all three 
primary actions satisfies the if in find_action and thus the last 
defined is returned as the action to use even though it might not 
_really_ support the outtype requested.

Lars Ivar Igesund




-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND