General Information
Tutorials
Reference Manuals
Libraries
Translation Tasks
Tools
Administration
|
New Features of Eli Version 4.3Lexical analysisThere have been several additions involving auxiliary scanners and token processors: a new auxiliary scanner for reporting token errors, a header file defining the built-in auxiliary scanners and token processors, and a consolidation of NUL character processing.
Detecting lexical errors explicitlyNormally the scanner reports a lexical error when an input character cannot be the first character of any basic symbol. In other words, an error is signalled when the processor knows nothing about an input character. Sometimes, however, it is appropriate to recognize a specifc sequence of input characters as an invalid token.
A new auxiliary scanner called
Scanning to, but not including, a newline
The auxiliary scanner
Auxiliary scanner and token processor definitionsThe header file `$elipkg/Scan/ScanProc.h', containing definitions of all of the auxiliary scanners available in the library, has been added. It should be included by any C program that uses auxiliary scanners from the library.
Processing NUL characters during lexical analysis
All of the auxiliary scanners that scan over a newline now invoke
We strongly recommend that users adhere to this convention when they must
write an auxiliary scanner that must scan over a newline.
Here is a typical code sequence for such a scanner.
The variable
if (*p == '\0') { int current = p - start; TokenStart = start = auxNUL(start, current); p = start + current; StartLine = p - 1; if (*p == '\0') { /* Code to deal appropriately with end-of-file. * Some of the possibilities are: * 1. Output an error report and return p * 2. Simply return p * 3. Move to another file and continue ***/ } }
|