
I agree with Vladimir: my definition refactoring is as a behavior- preserving transformation from one valid program to another. Given this, you really do need much of a compiler, but you also want highly accurate source location information, information about macro expansions, etc which compilers typically don't keep. It's an explicit goal for us to preserve that information and our solutions seem to work well for us so far.
To start with, your definition of refactoring is incorrect - it simply preserves the external behavior of a program. I would also point out that in order to ensure that a program is correct it first has to be preprocessed, and parsed. Something as simple as renaming a function - which is a well-known refactoring - requires none of that. The complexity of the refactoring determines the amount of information needed - whether or not you actually need a fully correct AST all the time - I doubt it. Andrew Sutton asutton@cs.kent.edu