|
RainCode includes a patch mechanism, which aims at performing automated
modifications on large amounts of source code. The patch mechanism is a natural
extension of the compliance facilities of RainCode. After finding a
non-compliant construct, in many
cases, the source code can be corrected automatically.
Even if the compliance rule which is violated cannot be corrected
automatically, the patch mechanism can be used to insert an error
message in the source file, and thereby, invalidate it for
compilation until the problem that caused RainCode to
complain has been corrected.
The patch mechanism is versatile and convenient:
- It provides high-level facilities to delete, replace or move entire
sub-trees of the parse tree.
- It can be used in a line-oriented fashion, as well as a character by
character fashion, whatever is more convenient.
- It maintains a list of patches that are applied when the patched version
is written back to disk, so that line and column positions are not altered
by previous line insertions or deletions.
|