home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
yacc
/
ycpycd.2c
< prev
next >
Wrap
Text File
|
1989-09-29
|
1KB
|
48 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: YCPYCD.2C
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 "y2.h"
void cpycode( void )
{
/* copies code between \{ and \} */
int c;
c = unix_getc(finput);
if( c == '\n' )
{
c = unix_getc(finput);
lineno++;
}
fprintf( ftable, "\n# line %d\n", lineno );
while( c>=0 )
{
if( c=='\\' )
if( (c=unix_getc(finput)) == '}' ) return;
else putc('\\', ftable );
if( c=='%' )
if( (c=unix_getc(finput)) == '}' ) return;
else putc('%', ftable );
putc( c , ftable );
if( c == '\n' ) ++lineno;
c = unix_getc(finput);
}
error("eof before %%}" );
}