home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_01_06
/
1n06039b
< prev
next >
Wrap
Text File
|
1990-10-02
|
459b
|
39 lines
Listing 5
/*
* scan.c
*/
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include "scan.h"
int yylex(void)
{
int c;
while (isspace(c = getchar()) && c != '\n')
;
if (isdigit(c))
{
yylval = 0;
do
yylval = 10 * yylval + c - '0';
while (isdigit(c = getchar()));
ungetc(c, stdin);
return INT;
}
return c;
}
void yyrestart(void)
{
int c;
while ((c = getchar()) != '\n')
;
}