How does a Single Pass Compiler does parsing,analyzing and generating code all at once?
PROGRAM Demo
{
  INTEGER i;
  i= 4;
  WRITELN(i + 5);
}.



Line 1: enter the program name in the symbol table. Generate the program prologue.
Line 3: enter the declaration of variable i in the symbol table.
Line 4: evaluate the constant expression and generate code for the initialization of i.
Line 5: parse the function call and the argument expression. Generate code for the evaluation of the expression i + 5, the push on the stack and the call of the WRITELN predefined function.
Line 6: Generate the program epilogue.


Done.