Commit | Line | Data |
---|---|---|
34d3acc4 MD |
1 | #ifndef _CTF_SCANNER_H |
2 | #define _CTF_SCANNER_H | |
3 | ||
4 | #include <stdio.h> | |
5 | #include "ctf-ast.h" | |
6 | ||
7 | #ifndef YY_TYPEDEF_YY_SCANNER_T | |
8 | #define YY_TYPEDEF_YY_SCANNER_T | |
9 | typedef void* yyscan_t; | |
10 | #endif | |
11 | ||
12 | struct ctf_scanner { | |
13 | yyscan_t scanner; | |
14 | struct ctf_ast *ast; | |
15 | struct scope root_scope; | |
16 | struct scope *cs; | |
17 | struct cds_list_head allocated_strings; | |
18 | }; | |
19 | ||
20 | struct ctf_scanner *ctf_scanner_alloc(FILE *input); | |
21 | void ctf_scanner_free(struct ctf_scanner *scanner); | |
22 | int ctf_scanner_append_ast(struct ctf_scanner *scanner); | |
23 | ||
24 | static inline | |
25 | struct ctf_ast *ctf_scanner_get_ast(struct ctf_scanner *scanner) | |
26 | { | |
27 | return scanner->ast; | |
28 | } | |
29 | ||
30 | int is_type(struct ctf_scanner *scanner, const char *id); | |
31 | ||
32 | #endif /* _CTF_SCANNER_H */ |