~mcf/samurai

samurai/scan.h -rw-r--r-- 659 bytes
4fac369eAman Verma manual: Use Pq macro to parenthesize link. 20 days ago
                                                                                
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
enum token {
	BUILD,
	DEFAULT,
	INCLUDE,
	POOL,
	RULE,
	SUBNINJA,
	VARIABLE,
};

struct scanner {
	FILE *f;
	const char *path;
	int chr, line, col;
};

extern struct evalstring **paths;
extern size_t npaths;

void scaninit(struct scanner *, const char *);
void scanclose(struct scanner *);

void scanerror(struct scanner *, const char *, ...);
int scankeyword(struct scanner *, char **);
char *scanname(struct scanner *);
struct evalstring *scanstring(struct scanner *, _Bool);
void scanpaths(struct scanner *);
void scanchar(struct scanner *, int);
int scanpipe(struct scanner *, int);
_Bool scanindent(struct scanner *);
void scannewline(struct scanner *);