/************************************************************************ * putbks -- a series of routines that put back arguements on input * * * * includes: pbstr puts back a string * * putchr puts a character back * ************************************************************************/ include ratfor.def #constants used by the preprocessor /************************************************************************ * pbstr -- puts back a string to the input * * * * useage: call pbstr(string) * * where string is a set of ascii characters * * note: The "Software Tools" book uses two routines to * * accomplish what this routine does. It seems more * * logical to use just one routine and make a character * * a string with the length of one * * * * written by: Gary Beckmann, 26-Jul-79 * ************************************************************************/ subroutine pbstr(str) include getlin.cmm #string pushed back on input buffer character str(MAXTOKEN) #it is assumed that the string will be # no longer than the definitions installed character foo(INBUFSIZE) i = length(str) if (ptr <= i) #check that stack is not overflowing call synerr(S_INBUF_OVFL) else [ for (;i >= 1;i = i - 1) [ ptr = ptr - 1 #reset the input stack pointer buf(ptr) = str(i) #push on the string ] ] return end /***************************************************************************** * putchr -- putback a character * * useage call putchr(char) * where char is a single ascii character * * written by: Gary Beckmann, 26-Jul-79 *****************************************************************************/ subroutine putchr(char) character char character buf(2) data buf(2)/EOS/ buf(1) = char call pbstr(buf) return end