S
Scott Bass
Hi,
I need to write some code that will allowed embedded, specially formatted
comments to document test cases within a program (SAS code). The code will
process the programs, pulling out the test case information. AFAIK this is
similar to how Javadoc works, embedding documentation alongside code.
The syntax will look like:
/*
<testcase>
TESTID: TEST1
OBJECTIVE: The objective of the test
PROCEDURE: The procedure that the test uses
Continuation line from the above
RESULTS: The expected results of the test
Continuation line
Another "continuation" line
</testcase>
*/
The syntax can also be embedded in titles statements:
/* <testcase> */
title3 "TESTID: TEST1";
title4 "OBJECTIVE: The objective of the test";
title5 "PROCEDURE: The procedure that the test uses";
title6 " Continuation line from the above";
title6 "RESULTS: The expected results of the test";
title7 " Continuation line";
title8 ' Another "continuation" line';
/* </testcase> */
After processing the program, the desired output is a tab-delimited string
containing filename, testid, objective, procedure, and results. For those
lines that were continued, I would like an embedded CR/LF. Leading spaces
should be
removed, as well as any title statements, "outer" quotation marks
(preserving inner quotation marks), and trailing semi-colons.
Are there any modules that I could use as a starting point for this? If you
have any code does something similar, could you either post it or email it
to me? It will be easier to modify an existing example than to start from
scratch.
Kind Regards,
Scott
I need to write some code that will allowed embedded, specially formatted
comments to document test cases within a program (SAS code). The code will
process the programs, pulling out the test case information. AFAIK this is
similar to how Javadoc works, embedding documentation alongside code.
The syntax will look like:
/*
<testcase>
TESTID: TEST1
OBJECTIVE: The objective of the test
PROCEDURE: The procedure that the test uses
Continuation line from the above
RESULTS: The expected results of the test
Continuation line
Another "continuation" line
</testcase>
*/
The syntax can also be embedded in titles statements:
/* <testcase> */
title3 "TESTID: TEST1";
title4 "OBJECTIVE: The objective of the test";
title5 "PROCEDURE: The procedure that the test uses";
title6 " Continuation line from the above";
title6 "RESULTS: The expected results of the test";
title7 " Continuation line";
title8 ' Another "continuation" line';
/* </testcase> */
After processing the program, the desired output is a tab-delimited string
containing filename, testid, objective, procedure, and results. For those
lines that were continued, I would like an embedded CR/LF. Leading spaces
should be
removed, as well as any title statements, "outer" quotation marks
(preserving inner quotation marks), and trailing semi-colons.
Are there any modules that I could use as a starting point for this? If you
have any code does something similar, could you either post it or email it
to me? It will be easier to modify an existing example than to start from
scratch.
Kind Regards,
Scott