Top Prev Next Up Down
CodeReWrite
Utility for rewriting source code when changing code from TEST to
Quality Assurance (QA).
Syntax: CodeReWrite {-conf <conf-file>}
{-lst <list-file>} <input-file>
<output-file>
- conf-file - a text file configurating the process. Default no
configuration file
- list-file - an output file to which list results are appended.
Default no list file
- input-file - the input ADA source file, with suffix '.adb' or
'.ads'
- output-file - the new changed ADA source file
Contents of (possible) Conf-file (a.conf):
#
fnk = Qinit
fnk = Qblock
fnk = Qappend
fnk = Qappend_alt
rm = with[\s]+Y2018\.Text\.TestQ
in use with package Y2018.Text.TestQ and usage see Procedures for debug purpose in Y2018-Text code
- fnk - remove a function call in the beginning of a row with
this call. Remove also a comment line beginning with this call
- rm - remove a line starting with this pattern
In both cases blanks can preceed the text, but nothing else.
if a row starts with "--(BLK" (an ADA comment) then this row
and all following lines are removed until a row starts with "--)BLK"
comment, which is also removed. This feature exists even if we
donnot give a Conf-file.
Note CodeReWrite is very line oriented and if used ADA code must be
written in a specific CodeReWrite style. Some caveats
exists
- if - then - else - end if : at least a null-statement must
exists in the then- and else-part of the statement. CodeReWrite
may change the if-then-else construction to invalid
- a '--(BLK' without corresponding '--)BLK' may delete more
source lines than expected
- a call to a Conf-file function (e.g. Qappend) but the call is
precede by something else may result in compilation errors
- source code after a Conf-file function (e.g. Qappend) on the
same row
- a Conf-file function (e.g. Qappend) cannot exceed one line
It is also possible to write your own Qappend function but it is
important that the definition is inside a '--(BLK', '--)BLK' block.
To the list-file is appended
- A timestamp of CodeReWrite call
- Listing of the content of the conf-file
- Listing of every removed line. A removed line is a line in
the input-file but which is not written to the output file.
- Statistics of CodeReWrite