#define IDENT 64
typedef struct source Source;
struct source {
const char *str;
int type;
const char *start;
union {
char **strv;
struct shf *shf;
struct tbl *tblp;
char *freeme;
} u;
char ugbuf[2];
int line;
int cmd_offset;
int errline;
const char *file;
int flags;
Area *areap;
XString xs;
Source *next;
};
#define SEOF 0
#define SFILE 1
#define SSTDIN 2
#define SSTRING 3
#define SWSTR 4
#define SWORDS 5
#define SWORDSEP 6
#define SALIAS 7
#define SREREAD 8
#define SF_ECHO BIT(0)
#define SF_ALIAS BIT(1)
#define SF_ALIASEND BIT(2)
#define SF_TTY BIT(3)
typedef union {
int i;
char *cp;
char **wp;
struct op *o;
struct ioword *iop;
} YYSTYPE;
#define LWORD 256
#define LOGAND 257
#define LOGOR 258
#define BREAK 259
#define IF 260
#define THEN 261
#define ELSE 262
#define ELIF 263
#define FI 264
#define CASE 265
#define ESAC 266
#define FOR 267
#define SELECT 268
#define WHILE 269
#define UNTIL 270
#define DO 271
#define DONE 272
#define IN 273
#define FUNCTION 274
#define TIME 275
#define REDIR 276
#define MDPAREN 277
#define BANG 278
#define DBRACKET 279
#define COPROC 280
#define YYERRCODE 300
#define CONTIN BIT(0)
#define ONEWORD BIT(1)
#define ALIAS BIT(2)
#define KEYWORD BIT(3)
#define LETEXPR BIT(4)
#define VARASN BIT(5)
#define ARRAYVAR BIT(6)
#define ESACONLY BIT(7)
#define CMDWORD BIT(8)
#define HEREDELIM BIT(9)
#define HEREDOC BIT(10)
#define UNESCAPE BIT(11)
#define HERES 10
extern Source *source;
extern YYSTYPE yylval;
extern struct ioword *heres[HERES], **herep;
extern char ident[IDENT+1];
#define HISTORYSIZE 500
extern char **history;
extern char **histptr;
extern uint32_t histsize;
int yylex(int);
void yyerror(const char *, ...)
__attribute__((__noreturn__, __format__ (printf, 1, 2)));
Source * pushs(int, Area *);
void set_prompt(int);
void pprompt(const char *, int);