home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
yacc
/
ygtnm.4c
< prev
next >
Wrap
Text File
|
1989-09-29
|
1KB
|
49 lines
/*
HEADER: CUG nnn.nn;
TITLE: YACC - Yet Another Compilier-Compilier
VERSION: 1.0 for IBM-PC
DATE: JAN 28, 1985
DESCRIPTION: LALR(1) Parser Generator. From UNIX
KEYWORDS: Parser Generator Compilier-Compilier YACC
SYSTEM: IBM-PC and Compatiables
FILENAME: YGTNM.4C
WARNINGS: This program is not for the casual user. It will
be useful primarily to expert developers.
CRC: N/A
SEE-ALSO: LEX and PREP
AUTHORS: Scott Guthery 11100 leafwood lane Austin, TX 78750
COMPILERS: DESMET-C
REFERENCES: UNIX Systems Manuals
*/
#include "y1.h"
#include "y4.h"
int gtnm( void )
{
register s, val, c;
/* read and convert an integer from the standard input */
/* return the terminating character */
/* blanks, tabs, and newlines are ignored */
s = 1;
val = 0;
while( (c=unix_getc(finput)) != EOF )
{
if( isdigit(c) )
{
val = val * 10 + c - '0';
}
else if ( c == '-' ) s = -1;
else if ( c == '\r') continue;
else break;
}
*pmem++ = s*val;
if( pmem > &mem0[MEMSIZE] ) error( "out of space" );
return( c );
}