Compiler Debug Tools

The ESPL compiler has these control statements that aid in debugging a script:

CompilerShow;   This statement will turn on a view to show the compiled code and parameters during execution.  The view makes a printout in the Output Windows.   I think it is very interesting to follow how the compiler compiles statements in a program.

CompilerHide;    This statement turns off the view that was enabled by CompilerShow;

CompilerStart;    This statement will start a counter and reset it to zero.  The counter will count the tokens as processed.

CompilerStop;    This statement stops the counter and prints the count value in the Output window.   The counter is a valuable measurement of how many tokens execute in a procedure or a loop.

CompilerStats;   This statement prints a table of array usage for labels, constants, variables, and tokens.

CompilerFunctions;   This statement prints an alphabetical listing of all function/procedure names in the Output window.

CompilerVariables;    This statement prints an alphabetical listing of all variables in the Output window.  In the variable listing, local variables are preceded by the name of the function/procedure where they are declared.  The number in the bracket is the stack index position where the variable is stored, which can be cross-referenced to the Stack [xx] code in the CompilerShow detail.

Example:

begin
  CompilerShow;
  CompilerStart;
  writeln(Window);
  CompilerStop;
  CompilerHide;
  CompilerStats;
  CompilerFunctions;
  CompilerVariables; 
end;

If a statement generates an error, one might surround the statement with CompilerShow; and CompilerHide; statements.   Then you can see the exact compiler statement that choked with a run-time error.   The view will show the compiled code before it executes.   So, the error was generated in the last shown token.

These statements provide an enormous wealth of power for debugging by a power user.  For the majority of EPSL customers, these statements and the detail they expose for what is actually going on is probably overkill, and should be ignored.

Since ESPL shows the error address for run-time errors, you have a powerful ability to develop and debug large programs.   ESPL can compile scripts whose size is up to 192K.  This is huge!

Ensign Windows 32 has evolved into a product that is unequaled by any other product in the sheer size, flexibility, and speed of the programs that can be created in ESPL.  I can't recall anything that power users have wanted to do that they have not been able to accomplish.   The complex things that can be programmed in ESPL is complimentary of the program's capabilities.