-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathparser.h
More file actions
43 lines (33 loc) · 777 Bytes
/
Copy pathparser.h
File metadata and controls
43 lines (33 loc) · 777 Bytes
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
#ifndef clox_parser_h
#define clox_parser_h
#include <setjmp.h>
#include "scanner.h"
#include "object.h"
#include "vec.h"
#include "nodes.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef vec_t(Token) vec_tok_t;
typedef struct sParser {
Token current;
Token previous;
vec_tok_t peekBuf;
bool inCallExpr;
vec_void_t v_errMessages; // list of ObjStrings
bool hadError;
bool panicMode;
bool aborted;
jmp_buf errJmpBuf;
} Parser;
void initParser(Parser *p);
void freeParser(Parser *p); // frees parser, but NOT the nodes
Node *parse(Parser *p);
Node *parseClass(Parser *p);
Node *parseExpression(Parser *p);
Node *parseMaybePartialStatement(Parser *p, GetMoreSourceFn fn);
void outputParserErrors(Parser *p, FILE *f);
#ifdef __cplusplus
}
#endif
#endif