-
Notifications
You must be signed in to change notification settings - Fork 26
/
input.h
52 lines (36 loc) · 963 Bytes
/
input.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* input.h -- definitions for es lexical analyzer ($Revision: 1.1.1.1 $) */
#define MAXUNGET 2 /* maximum 2 character pushback */
typedef struct Input Input;
struct Input {
int (*get)(Input *self);
int (*fill)(Input *self), (*rfill)(Input *self);
void (*cleanup)(Input *self);
Input *prev;
const char *name;
unsigned char *buf, *bufend, *bufbegin, *rbuf;
size_t buflen;
int unget[MAXUNGET];
int ungot;
int lineno;
int fd;
int runflags;
};
#define GETC() (*input->get)(input)
#define UNGETC(c) unget(input, c)
/* input.c */
extern Input *input;
extern void unget(Input *in, int c);
extern Boolean disablehistory;
extern Boolean ignoreeof;
extern void yyerror(char *s);
/* token.c */
extern const char dnw[];
extern int yylex(void);
extern void inityy(void);
extern void print_prompt2(void);
/* parse.y */
extern Tree *parsetree;
extern int yyparse(void);
extern void initparse(void);
/* heredoc.c */
extern void emptyherequeue(void);