Commit | Line | Data |
---|---|---|
34d3acc4 MD |
1 | #ifndef _CTF_SCANNER_H |
2 | #define _CTF_SCANNER_H | |
3 | ||
eb31c5e6 MD |
4 | /* |
5 | * ctf-scanner.h | |
6 | * | |
7 | * Copyright 2011-2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
8 | * | |
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | * of this software and associated documentation files (the "Software"), to deal | |
11 | * in the Software without restriction, including without limitation the rights | |
12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
13 | * copies of the Software, and to permit persons to whom the Software is | |
14 | * furnished to do so, subject to the following conditions: | |
15 | * | |
16 | * The above copyright notice and this permission notice shall be included in | |
17 | * all copies or substantial portions of the Software. | |
18 | */ | |
19 | ||
34d3acc4 MD |
20 | #include <stdio.h> |
21 | #include "ctf-ast.h" | |
22 | ||
23 | #ifndef YY_TYPEDEF_YY_SCANNER_T | |
24 | #define YY_TYPEDEF_YY_SCANNER_T | |
25 | typedef void* yyscan_t; | |
26 | #endif | |
27 | ||
609bd1bf MD |
28 | struct ctf_scanner_scope; |
29 | struct ctf_scanner_scope { | |
30 | struct ctf_scanner_scope *parent; | |
31 | GHashTable *types; | |
32 | }; | |
33 | ||
34d3acc4 MD |
34 | struct ctf_scanner { |
35 | yyscan_t scanner; | |
36 | struct ctf_ast *ast; | |
609bd1bf MD |
37 | struct ctf_scanner_scope root_scope; |
38 | struct ctf_scanner_scope *cs; | |
8aa95b17 | 39 | struct objstack *objstack; |
34d3acc4 MD |
40 | }; |
41 | ||
cb2f43ee | 42 | struct ctf_scanner *ctf_scanner_alloc(void); |
34d3acc4 | 43 | void ctf_scanner_free(struct ctf_scanner *scanner); |
cb2f43ee | 44 | int ctf_scanner_append_ast(struct ctf_scanner *scanner, FILE *input); |
34d3acc4 MD |
45 | |
46 | static inline | |
47 | struct ctf_ast *ctf_scanner_get_ast(struct ctf_scanner *scanner) | |
48 | { | |
49 | return scanner->ast; | |
50 | } | |
51 | ||
5d6c80a5 | 52 | BT_HIDDEN |
34d3acc4 MD |
53 | int is_type(struct ctf_scanner *scanner, const char *id); |
54 | ||
55 | #endif /* _CTF_SCANNER_H */ |