|
From: Sven R. <rei...@ma...> - 2003-04-21 03:19:30
|
In order to understand the code model component, I tried to implement a
silly little refactoring which I would call SplitDeclaration. Basically,
it transforms something like
{
double *x, y[3], &z;
}
to
{
double *x;
double y[3];
double &z;
}
This is useful if e.g., we want to modify the declaration of one of the
variables, like make it const. It also avoids one common mistake, namely
int* x, y; // these are not two pointers
It is fully implemented using the code model, though the code is still a
bit ugly, since I haven't gotten used to dealing with shared pointers yet.
I will clean it up a bit before committing it.
In order to make it run, I had to modify the way declaration expressions
are handled in the model/rewriter. I committed the changes, as well as the
tests that made them necessary.
As I said, the main purpose was to understand the code model, and I start
to like it :) I still have a few questions, but they can wait until
Baptiste gets back.
More later,
Sven.
--
Sven Reichard
Dept. of Math. Sci.
University of Delaware
rei...@ma...
|