Well, a first implementation is there (src/rfta). It's very simple (the
simplest case of my article), but it does a full cycle:
- find the compound statement the temporary live in
- find the temporary declaration
- find all temporary name occurrences between the temporary declaration
and the end of the compound block
- keep only the name that are local variable
- replace all the occurrences by the new temporary identifier.
It's probably not working since no test was done (I'm tackling this).
Also, notes that the class TextDocument is supposed to be an abstraction
from a text file (which may be a CW or VC++ text document). The current
TextDocument is stream based (selection range are indicated as the number of
characters since the beginning of the document), while CW and VC++
TextDocument are line/Column based. I'll try to see if creating a conversion
layer can be done, as this would mean that the text range in TextDocument
would be the same as ASTNodeRange...
Well, onto testing...
Baptiste.
---
Baptiste Lepilleur <gai...@fr...>
http://gaiacrtn.free.fr/
|