#define putbak(c) *ip++ = c;
#define PUSHBACK 300 /* maximum pushback characters */
char ibuf
[PUSHBACK
+SSIZE
]; /* pushback buffer for definitions, etc. */
return(*--ip
); /* already present */
lastchar
= getc(curfile
);
if ((curfile
=fopen(svargv
[ifile
], "r")) != NULL
)
error(FATAL
, "can't open file %s", svargv
[ifile
]);
if (ip
>= &ibuf
[PUSHBACK
])
error( FATAL
, "pushback overflow");
extern tbl
**keytbl
, **deftbl
;
while ((c
=gtc())==' ' || c
=='\n')
for (sp
=0; (c
=gtc())!='"' && c
!= '\n'; ) {
error(FATAL
, "quoted string %.20s... too long", token
);
yylval
= (int) &token
[0];
error(!FATAL
, "missing \" in %.20s", token
);
if (dbg
)printf(".\tlex token = |%s|\n", token
);
if ((tp
= lookup(&deftbl
, token
, NULL
)) != NULL
) {
printf(".\tfound %s|=%s|\n", token
, tp
->defn
);
else if ((tp
= lookup(&keytbl
, token
, NULL
)) == NULL
) {
if(dbg
)printf(".\t%s is not a keyword\n", token
);
else if (tp
->defn
== (char *) DEFINE
|| tp
->defn
== (char *) NDEFINE
|| tp
->defn
== (char *) TDEFINE
)
else if (tp
->defn
== (char *) DELIM
)
else if (tp
->defn
== (char *) GSIZE
)
else if (tp
->defn
== (char *) GFONT
)
else if (tp
->defn
== (char *) INCLUDE
)
getstr(s
, n
) char *s
; register int n
; {
while ((c
= gtc()) == ' ' || c
== '\n')
while (c
!= ' ' && c
!= '\t' && c
!= '\n' && c
!= '{' && c
!= '}'
&& c
!= '"' && c
!= '~' && c
!= '^' && c
!= righteq
) {
error(FATAL
, "token %.20s... too long", s
);
if (c
=='{' || c
=='}' || c
=='"' || c
=='~' || c
=='^' || c
=='\t' || c
==righteq
)
cstr(s
, quote
, maxs
) char *s
; int quote
; {
while((del
=gtc()) == ' ' || del
== '\t' || del
== '\n');
for (i
=0; (c
=gtc()) != del
&& c
!= EOF
;) {
return(1); /* disaster */
for (i
=1; (c
=gtc())!=' ' && c
!= '\t' && c
!='\n' && c
!=EOF
;) {
return(1); /* disaster */
error(FATAL
, "Unexpected end of input at %.20s", s
);
char *strsave(), *p1
, *p2
;
getstr(token
, SSIZE
); /* get name */
cstr(token
, 1, SSIZE
); /* skip the definition too */
if (cstr(token
, 1, SSIZE
))
error(FATAL
, "Unterminated definition at %.20s", token
);
if (dbg
)printf(".\tname %s defined as %s\n", p1
, p2
);
error(FATAL
, "out of space in strsave on %s", s
);
error(!FATAL
, "Include not yet implemented");
if (cstr(token
, 0, SSIZE
))
error(FATAL
, "Bizarre delimiters at %.20s", token
);
if (lefteq
== 'o' && righteq
== 'f')