[vwnc] Importing and Rewriting Methods

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] Importing and Rewriting Methods

Bad Logic
Hello,

In my current project a large number of classes (thousandish) need to
be imported to visual works. I've already imported the classes
separately to divide the workload and the complexity of the whole. Now
I'm attempting to import the methods. They are in chunk format files
and I used the GHChangeList tool to import the file. This seems to
work fine except that the name transformations on the classes to avoid
conflicts with existing vw classes weren't applied to the references
in the method bodies. The class substitutions outside the methods
worked fine and the methods were applied to the correct classes.

Now I have a dictionary with my rewrites for global references in my
source code. Is there a simple way to rewrite my methods to use my
rewrites? The best way I could think of is to parse the method source,
apply my rules and recompile the method.

Any ideas?

---
Log
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Importing and Rewriting Methods

Terry Raymond
I assume you are using Namespaces. If so, the GHChangeList
can take care of namespace mapping and remapping.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Bad Logic
> Sent: Friday, October 24, 2008 5:49 AM
> To: [hidden email]
> Subject: [vwnc] Importing and Rewriting Methods
>
> Hello,
>
> In my current project a large number of classes (thousandish) need to
> be imported to visual works. I've already imported the classes
> separately to divide the workload and the complexity of the whole. Now
> I'm attempting to import the methods. They are in chunk format files
> and I used the GHChangeList tool to import the file. This seems to
> work fine except that the name transformations on the classes to avoid
> conflicts with existing vw classes weren't applied to the references
> in the method bodies. The class substitutions outside the methods
> worked fine and the methods were applied to the correct classes.
>
> Now I have a dictionary with my rewrites for global references in my
> source code. Is there a simple way to rewrite my methods to use my
> rewrites? The best way I could think of is to parse the method source,
> apply my rules and recompile the method.
>
> Any ideas?
>
> ---
> Log
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Importing and Rewriting Methods

Reinout Heeck
In reply to this post by Bad Logic
Bad Logic wrote:
> Now I have a dictionary with my rewrites for global references in my
> source code. Is there a simple way to rewrite my methods to use my
> rewrites? The best way I could think of is to parse the method source,
> apply my rules and recompile the method.


You could use the RB rewrite tool since that implements the low-level
work already:

in the browser select all your imported packages (don't select any classes),

then go to the 'rewrite' tool tab,

in the top pane fill in the original name of a class

in the bottom pane fill in the new name

make sure the 'method' check box is turned off

then hit 'replace'...

(Hint: in the VW settings pane you may want to turn on 'Browser'->'show
refactoring changes' before experimenting).



For thousands of classes you probably want to automate this, for that I
refer you to the implementation of RewriteCodeTool>>replace




HTH,

Reinout
-------






>
> Any ideas?
>
> ---
> Log
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc