Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

scan.c File Reference

#include "lclintMacros.nf"
#include "llbasic.h"
#include "signature.h"
#include "signature2.h"
#include "scan.h"
#include "scanline.h"

Go to the source code of this file.

Functions

unsigned int lsllex (YYSTYPE *lval)
ltoken LSLScanNextToken (void)
void LSLScanFreshToken (ltoken tok)
tsource* LSLScanSource (void)
void LSLScanInit (void)
void LSLScanReset (tsource *s)
void LSLScanCleanup (void)

Variables

YYSTYPE lsllval


Function Documentation

void LSLScanCleanup ( void )
 

Definition at line 166 of file scan.c.

00167 {
00168 }

void LSLScanFreshToken ( ltoken tok )
 

Definition at line 132 of file scan.c.

Referenced by lscanLine().

00133 {
00134   if (lastToken < MAXLINE)
00135     {                           
00136       TokenList[lastToken++] = ltoken_copy (tok);       
00137     }
00138   else
00139     {
00140       llfatalbug (message ("LSLScanFreshToken: out of range: %s", 
00141                            cstring_fromChars (lsymbol_toChars (ltoken_getText (tok)))));
00142     }
00143 }

void LSLScanInit ( void )
 

Definition at line 152 of file scan.c.

00153 {
00154 }

ltoken LSLScanNextToken ( void )
 

Definition at line 70 of file scan.c.

Referenced by LSLProcessInitFileInit(), and lsllex().

00071 {
00072   
00073   if (nextToken < lastToken)
00074     {   
00075       /*@-retalias@*/
00076             return TokenList[nextToken++];
00077       /*@=retalias@*/
00078     }
00079   else
00080     {
00081       lastToken = 0;            
00082       lineNumber++;
00083 
00084       line = tsource_nextLine (scanFile);       
00085       
00086       if (line != (char *) 0)
00087         {
00088                   lscanLine (line);     /* tokenize */
00089           nextToken = 0;
00090           return LSLScanNextToken ();   
00091         }
00092       else
00093         {
00094                   return LSLScanEofToken ();
00095         }
00096     }
00097 }

void LSLScanReset ( tsource * s )
 

Definition at line 157 of file scan.c.

Referenced by parseOpLine(), and parseSignatures().

00158 {
00159   scanFile = s;
00160   lastToken = 0;
00161   nextToken = lastToken + 1;    /* force call to scanline   */
00162   lineNumber = 0;
00163 }

tsource * LSLScanSource ( void )
 

Definition at line 145 of file scan.c.

00146 {
00147   return scanFile;
00148 }

unsigned int lsllex ( YYSTYPE * lval )
 

Definition at line 63 of file scan.c.

00064 {
00065   /* This is important!  Bison expects this */
00066   lval->ltok = LSLScanNextToken ();
00067   return (ltoken_getCode (lval->ltok));
00068 }


Variable Documentation

YYSTYPE lsllval
 

Definition at line 52 of file scan.c.


Generated at Fri Nov 3 18:58:04 2000 for LCLint by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000