isl_tab: invalidate undo stack if pushing record fails
[isl.git] / isl_stream_private.h
blobb199ec64dc26bdd46d17177a8852a79846b46f60
1 #include <isl_int.h>
2 #include <isl/stream.h>
3 #include <isl_yaml.h>
5 struct isl_token {
6 int type;
8 unsigned int on_new_line : 1;
9 unsigned is_keyword : 1;
10 int line;
11 int col;
13 union {
14 isl_int v;
15 char *s;
16 isl_map *map;
17 isl_pw_aff *pwaff;
18 } u;
21 struct isl_token *isl_token_new(isl_ctx *ctx,
22 int line, int col, unsigned on_new_line);
24 /* An input stream that may be either a file or a string.
26 * line and col are the line and column number of the next character (1-based).
27 * start_line and start_col are set by isl_stream_getc to point
28 * to the position of the returned character.
29 * last_line is the line number of the previous token.
31 * yaml_state and yaml_indent keep track of the currently active YAML
32 * elements. yaml_size is the size of these arrays, while yaml_depth
33 * is the number of elements currently in use.
34 * yaml_state and yaml_indent may be NULL if no YAML parsing is being
35 * performed.
36 * yaml_state keeps track of what is expected next at each level.
37 * yaml_indent keeps track of the indentation at each level, with
38 * ISL_YAML_INDENT_FLOW meaning that the element is in flow format
39 * (such that the indentation is not relevant).
41 struct isl_stream {
42 struct isl_ctx *ctx;
43 FILE *file;
44 const char *str;
45 int line;
46 int col;
47 int start_line;
48 int start_col;
49 int last_line;
50 int eof;
52 char *buffer;
53 size_t size;
54 size_t len;
55 int c;
56 int un[5];
57 int n_un;
59 struct isl_token *tokens[5];
60 int n_token;
62 struct isl_hash_table *keywords;
63 enum isl_token_type next_type;
65 int yaml_depth;
66 int yaml_size;
67 enum isl_yaml_state *yaml_state;
68 int *yaml_indent;