Research Article
[Retracted] Automatic Grading for Complex Multifile Programs
Algorithm 1
Multifile program linker and fusion algorithm.
| | Variable: | | | ps[]: preprocessor statement pfname[]: preprocessor filename | | | fpath: file path metadata in database fmp: final multipath string | | | es: external source to be fused | | | Input: | | | ms: main source of the program | | | mp[]: multipath in database by assignment id | | | Output: final fused source fs | | | Begin: | | (1) | Step 1: Analyze preprocessor in ms using AST | | (2) | if ms contains user defined custom library | | (3) | add to ps[] | | (4) | Step 2: Handle ps[] in ms to get pfname[] | | (5) | if ps[] size > 0 | | (6) | for i = 1 to ps[] size | | (7) | regex ⟵ ″¥″([ ^ ¥″])¥″″ | | (8) | while patternMatch (regex) = = true | | (9) | add to pfname[i] | | (10) | Step 3: Link external sources using mp[] to get pfname[] | | (11) | for i = 1 to mp[] size | | (12) | for j = 1 to pfname[] size | | (13) | if (mp[i] contains pfname[j]) fpath ⟵ mp[i] | | (14) | if (j = = 1) fmp ⟵ fmp concat (mp[i]) | | (15) | else fmp ⟵ fmp concat (mp[i]) concat (,) | | (16) | Step 4: Fusion es using fmp to fs | | (17) | fs ⟵ ms | | (18) | if fmp length > 0 | | (19) | for i = 1 to fmp length | | (20) | es ⟵ searchContent (fmp(ms)) | | (21) | fs ⟵ fs concat (es) | | (22) | End |
|