|Incorporating run-time error handline in code generation jdm1intx@DIE_SPAMBOT_DIEairmail.net (jdm) (2001-12-20)|
|Re: Incorporating run-time error handline in code generation firstname.lastname@example.org (Paolo Bonzini) (2001-12-22)|
|Re: Incorporating run-time error handline in code generation Arargh@Arargh.com (Arargh!) (2001-12-22)|
|Re: Incorporating run-time error handline in code generation email@example.com (2001-12-22)|
|Date:||22 Dec 2001 22:57:54 -0500|
|Posted-Date:||22 Dec 2001 22:57:54 EST|
On 20 Dec 2001 00:42:48 -0500, "jdm"
>I have most of the standard texts on compiler building. They all go
>into great detail about parsing, scanning, code generation, and so
>forth, but leave out the details on how to handle *run-time* errors.
>Compile-time errors are no problem.
>For example, the various flavors of Microsoft Basics have the "On
>Error Goto" construct and the Err object. How much of that is part of
>the runtime library, and how much is part of code generation ? Is
>there a website or book that has more comprehensive information on
>[Good question. I can't think of a place where it's all written down.
I wrote a replacement run-time library for MS BASIC PDS 7.1 some years
ago. In the process I learned a good deal about run-time error
handling. Re the above questions:
'ON ERROR GOTO' stores the address of the goto label in a global
variable. On most RT errors, the global var is checked, and if set,
program execution resumes at that location. Not all errors are
trapable this way.
'ON ERROR GOTO 0' clears the global var.
These apply to the whole program.
There are also 'ON LOCAL ERROR GOTO' & 'ON LOCAL ERROR GOTO 0' which
only apply to the current sub or function, and supersede the global
The 'ERR' object is a function which returns the current value of
another global variable. Somewhat like C's '_errno'.
It is actually somewhat more complex that the above description would
lead you to believe.
Arargh (at arargh dot com) http://www.arargh.com
Return to the
Search the comp.compilers archives again.