/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "e.h"
#include "e.def"
#include <locale.h>
int sp;
void define(int);
void delim(void);
void getstr(char *, int);
void include(void);
int openinfile(void);
void pbstr(char *);
void space(void);
int
gtc(void)
{
loop:
return (*--ip); /* already present */
if (lastchar == '\n')
linect++;
return (lastchar);
return (EOF);
}
linect = 1;
if (openinfile() == 0)
goto loop;
return (EOF);
}
/*
* open file indexed by ifile in svargv, return non zero if fail
*/
int
openinfile(void)
{
return (0);
return (0);
}
return (1);
}
void
{
char *p;
p = str;
while (*p++)
;
--p;
while (p > str)
putbak(*--p);
}
int
yylex(void)
{
int c;
beg:
;
yylval = c;
switch (c) {
case EOF:
return (EOF);
case '~':
return (SPACE);
case '^':
return (THIN);
case '\t':
return (TAB);
case '{':
return ('{');
case '}':
return ('}');
case '"':
if (c == '\\')
if ((c = gtc()) != '"')
"quoted string %.20s... too long"), token);
}
if (c == '\n')
return (QTEXT);
}
if (c == righteq)
return (EOF);
putbak(c);
putbak(' ');
putbak(' ');
if (dbg)
return (CONTIG);
delim();
globsize();
globfont();
include();
space();
else {
}
goto beg;
}
void
getstr(char *s, int n)
{
int c;
char *p;
p = s;
;
if (c == EOF) {
*s = 0;
return;
}
while (c != ' ' && c != '\t' && c != '\n' && c != '{' && c != '}' &&
if (c == '\\')
if ((c = gtc()) != '"')
*p++ = '\\';
*p++ = c;
if (--n <= 0)
c = gtc();
}
if (c == '{' || c == '}' || c == '"' || c == '~' || c == '^' ||
c == '\t' || c == righteq)
putbak(c);
*p = '\0';
yylval = (int)s;
}
int
{
int del, c, i;
s[0] = 0;
;
if (quote) {
s[i++] = c;
if (i >= maxs)
return (1); /* disaster */
}
} else {
if (del == '\n')
return (1);
s[0] = del;
s[i++] = c;
if (i >= maxs)
return (1); /* disaster */
}
}
s[i] = '\0';
if (c == EOF)
return (0);
}
void
define(int type)
{
return;
}
"Unterminated definition at %.20s"), token);
}
void
{
char *strsave();
}
char *
strsave(char *s)
{
char *malloc();
char *q;
if (q == NULL)
strcpy(q, s);
return (q);
}
void
include(void)
{
}
void
delim(void)
{
}