Initial commit
[cgperf.git] / input.h
blob1e14807e92c19ea7c276f137e13ac43a887142b4
1 #ifndef CGPERF_INPUT_H
2 #define CGPERF_INPUT_H
3 #include <stdbool.h>
4 #include <stdio.h>
5 #include "c_fixing.h"
6 /*------------------------------------------------------------------------------------------------*/
7 #include "namespace/input.h"
8 #include "namespace/keyword.h"
9 #include "namespace/keyword_list.h"
10 /*------------------------------------------------------------------------------------------------*/
11 /*{{{ types */
12 struct Input {
13 /*{{{ public */
14 /* memory block containing the entire input */
15 u8 *input;
16 u8 *input_end;
17 /* the C code from the declarations section */
18 u8 *verbatim_declarations;
19 u8 *verbatim_declarations_end;
20 u32 verbatim_declarations_lineno;
21 /* the C code from the end of the file */
22 u8 *verbatim_code;
23 u8 *verbatim_code_end;
24 u32 verbatim_code_lineno;
25 /* declaration of struct type for a keyword and its attributes */
26 u8 *struct_decl;
27 u32 struct_decl_lineno;
28 /* return type of the lookup function */
29 u8 *return_type;
30 /* shorthand for user-defined struct tag type */
31 u8 *struct_tag;
32 /* list of all keywords */
33 struct Keyword_List *head;
34 /* whether the keyword chars would have different values in a different character set */
35 bool charset_dependent;
36 /*}}} public -- END */
37 /*{{{ private */
38 FILE *stream;
39 /*}}} prived -- END */
41 /*}}} types -- END */
42 /*{{{ public static methods */
43 static struct Input *input_new(FILE *stream);
44 static void input_read(struct Input *t);
45 /*}}} public static methos -- END */
46 /*------------------------------------------------------------------------------------------------*/
47 #define EPILOG
48 #include "namespace/input.h"
49 #include "namespace/keyword.h"
50 #include "namespace/keyword_list.h"
51 #undef EPILOG
52 /*------------------------------------------------------------------------------------------------*/
53 #endif