Input: Source file source.c |
Output: Stored linked lists |
Symbolic representations: |
Remove (): function of removing comments and blank lines |
Source1.c: file after intermediate treatment (got after executing 1–5) |
Buffer: global string variable |
Get: gather variables, form linked lists |
Left: left linked list |
Right: right linked list |
Store: store linked lists into storage table |
Get_control_end: find the end of control structure |
(1) {Repeat buffer = getline (source.c) //remove blanks and comments |
(2) If existing note or blank line |
(3) Remove (note or blank line) |
(4) Else go to 1 |
(5) Until EOF} |
(6) {Repeat: buffer = getline (source1.c) |
(7) If buffer is Assignment{//process assignment statement |
(8) Flag = 0 |
(9) Get (left and right)//extract left and right |
(10) Store (left and right)}// store left and right |
(11) If buffer is function{//process function call statements |
(12) Flag = 1 |
(13) Do nothing} |
(14) If buffer is control_statement{//process control statements |
(15) Flag = 2 |
(16) Get_control_end//find out the scope of the control domain |
(17) Get (left and right) |
(18) Store (left and right) |
(19) Recursive}//recursive processing control statements |
(20) Until EOF} |