"Fossies" - the Fresh Open Source Software Archive

Member "gentle-97/html/errmsg.html" (20 Aug 1998, 2254 Bytes) of package /linux/misc/old/gentle-97.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <html>
    2 <head><title>Module <tt>errmsg</tt></title></head>
    3 <body bgcolor=white>
    4 <a href="idents.html"><img src="next.gif" border=0></a> <a href="main.html"><img src="previous.gif" border=0></a><br><br>
    5 <font  face=helvetica size=-1>
    6 <a href="index.html">HANDBOOK</a>
    7  / <a href="library.html">LIBRARY REFERENCE MANUAL</a>
    8  /<br><br>
    9 </font>
   10 <h1>Module <tt>errmsg</tt></h1>
   11 
   12 The module <tt> errmsg</tt>
   13 provides procedures to emit error messages.
   14 This module supports the <i> Gentle</i> type <tt> POS</tt>
   15 and encodes the current file,
   16 line, and column into a value.
   17 
   18 <PRE>
   19 
   20 long yypos;
   21 </PRE>
   22 
   23 The variable <tt> yypos</tt> keeps track of the current source position.
   24 <p>
   25 To advance to the next column this variable must be incremented by one.
   26 To advance to the next line or the next file the procedures
   27 <tt> yyPosToNextLine</tt> or <tt> yyPosToNextFile</tt> must be used.
   28 <p>
   29 At the beginning of a line the column is set to one, after reading a token
   30 the column is the first column after the token.
   31 
   32 <p>
   33 <PRE>
   34 
   35 void yyGetPos(ref_pos)
   36    long *ref_pos;
   37 </PRE>
   38 The procedure <tt> yyGetPos</tt> sets the variable referred by its argument
   39 to the current source position minus 1.
   40 <p>
   41 
   42 
   43 <p>
   44 
   45 <PRE>
   46 
   47 void yyPosToNextLine()
   48 </PRE>
   49 The procedure <tt> yyPosToNextLine</tt> must be called by the lexer
   50 when a new source line is read.
   51 It adjust the variable <tt> yypos</tt>.
   52 <p>
   53 
   54 
   55 <PRE>
   56 
   57 void yyPosToNextFile()
   58 </PRE>
   59 The procedure <tt> yyPosToNextFile</tt> must be called by the lexer
   60 when a new source file is read.
   61 It adjust the variable <tt> yypos</tt>.
   62 
   63 
   64 <PRE>
   65 
   66 'action' Error (STRING, POS)
   67 </PRE>
   68 <PRE>
   69 
   70 void Error(msg, pos)
   71    char *msg;
   72    long pos;
   73 </PRE>
   74 The procedure <tt> error</tt> prints the message specified by the first parameter
   75 together with the source position specified by the second parameter.
   76 Then the program is terminated.
   77 <p>
   78 
   79 <PRE>
   80 
   81 yyerror(msg)
   82    char *msg;
   83 </PRE>
   84 The procedure <tt> yyerror</tt> is called by the <i> Yacc</i> generated parser
   85 in case of syntax errors.
   86 It may also be called by the lexer.
   87 It behaves like <tt> Error</tt> where the actual
   88 source position is used.
   89 
   90 <p>
   91 
   92 
   93 
   94 <br><br>
   95 </ul>
   96 </ul>
   97 <a href="idents.html"><img src="next.gif" border=0></a> <a href="main.html"><img src="previous.gif" border=0></a></body>
   98 </html>