1. Need help with URR (Unused routines remover)

Heh, I gave it a really stupid name but now I can call my prorgam with a name =P
Well, I'm writing to you all (GURU & newbie people) because I need help with
routine_id..
you see, you can give routine_id a variable to call a procedure or a function,
from my program it's imposible to resolv it,
then, how the hell can I know which routine is gonna be used when it's a
variable?

TIA,
    Guillermo BonvehĂ­
    AKA: Caballero Rojo - Knixeur - RedKnight

new topic     » topic index » view message » categorize

2. Re: Need help with URR (Unused routines remover)


new topic     » goto parent     » topic index » view message » categorize

3. Re: Need help with URR (Unused routines remover)


new topic     » goto parent     » topic index » view message » categorize

4. Re: Need help with URR (Unused routines remover)

Your program needs to check the strings of variables.
It's very complicated, but David Cuny wrote something somewhat
similar (it shrouds functions even if they are used by routine_id),
so you can try modifing the paser for your needs.

On Tue, Apr 24, 2001 at 11:49:39AM -0700, pampeano at ROCKETMAIL.COM wrote:
> 
> 
> Sorry, I didn't know how to say what I want to..
> mmm, how to explain, yeah, I got it
> my program is intended to remove routines that aren't called at anytime
> in the program, routine_id call a routine, but sometimes the parameter
> passed to routine_id is a variable so I don't know which routine it is
> calling to not remove it.
> 
> --- Chris Bensler <bensler at mailops.com> wrote:
> > 
> > 
> > IMHO, I wouldn't try to remove unused routine ID's. If a function or 
> > procedure is passed to routine_id(), then consider it used..
> > 
> > Chris
> > 
> > 
> > pampeano at ROCKETMAIL.COM wrote:
> > > 
> > > Heh, I gave it a really stupid name but now I can call my prorgam
> > with a 
> > > name =P
> > > Well, I'm writing to you all (GURU & newbie people) because I need
> > help 
> > > with routine_id..
> > > you see, you can give routine_id a variable to call a procedure or
> > a 
> > > function, from my program it's imposible to resolv it,
> > > then, how the hell can I know which routine is gonna be used when
> > it's a 
> > > variable?
> > > 
> > > TIA,
> > >     Guillermo Bonveh?
> > >     AKA: Caballero Rojo - Knixeur - RedKnight
> > > 
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> > 
> 
> 
> 
> 
> 

-- 
Linux User:190064
Linux Machine:84163
http://jbrown105.1avenue.com

new topic     » goto parent     » topic index » view message » categorize

5. Re: Need help with URR (Unused routines remover)

----- Original Message -----
From: <pampeano at ROCKETMAIL.COM>
To: "EUforum" <EUforum at topica.com>
Subject: RE: Need help with URR (Unused routines remover)

> my program is intended to remove routines that aren't called at anytime
> in the program, routine_id call a routine, but sometimes the parameter
> passed to routine_id is a variable so I don't know which routine it is
> calling to not remove it.

The bad news is you can't know if it is safe to remove.

In general, if a program uses routine_id with a variable as a parameter,
then you cannot safely remove ANY routine in the program.

For example, if a program has the line ...

    xyzzy = routine_id(vRoutineName)

the only thing you can rely on is that, at run-time, the value in
'vRoutineName' probably won't refer to any routine the occurs physically
after this line.

Because the line is resolved at run-rime, you cannot use another program to
remove routines that occur before this line, because the variable
'vRoutineName' is going to be set to the name of one (or more) of the
routines above it - but you might not know which ones! For example, the name
might come from outside the program - a database field, or passed as a
parameter to a generic routine ( a lot of O-O implmentation uses this
mechanism).

The only safe way to do this is to run the program and monitor which
routines were not called and then remove them. But that would only apply to
a specific execution of the program and thus defeat the intention for a
general "fix up" of the code.

If however you could determine that the routine that contains the
troublesome routine_id() statement, is itself ever executed, you could
disregard it. Another possibility is in situations like this ...

    xyzzy = routine_id("XX_" & vRoutineName)

then clearly routines that do not start with "XX_" can be inspected for
candidate removal, but those that do start with "XX_" must all be retained,
just in case they are called at runtime.

Just to repeat, I believe that if a program contains usage of routine_id()
with a variable as a parameter, then it is not safe to remove ANY routines
that occur earlier than the last instance of this type of usage in a
program. There are a few exceptions but the complexity soon becomes enormous
to detect these exceptions.

By the way, this would mean that your URR program would not work very well
on Win32Lib.ew programs.

------
Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu