diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-03-14 20:51:06 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 20:59:17 -0700 |
| commit | a3b3237dadefa3b9bed18ab35c4a1dae2ec354bc (patch) | |
| tree | cec622110b65c7a5d27ee82a8a52513bb5fdf37b /test-parsing.c | |
| parent | dbf7bd47a40b7430f090d3872071522d937ef7f7 (diff) | |
| download | sparse-dev-a3b3237dadefa3b9bed18ab35c4a1dae2ec354bc.tar.gz | |
Start binding typedefs. More work needed, but this parses correctly:
typedef int a;
a b = 0;
Use new 'add_symbol()' infrastructure.
Diffstat (limited to 'test-parsing.c')
| -rw-r--r-- | test-parsing.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/test-parsing.c b/test-parsing.c index 6aaf4753..2954fbad 100644 --- a/test-parsing.c +++ b/test-parsing.c @@ -14,20 +14,15 @@ int main(int argc, char **argv) { int fd = open(argv[1], O_RDONLY); struct token *token; - struct symbol *sym; + struct symbol_list list; if (fd < 0) die("No such file: %s", argv[1]); init_symbols(); token = tokenize(argv[1], fd); - token = translation_unit(token, &sym); - if (token) - warn(token, "Extra data"); - while (sym) { - show_symbol(sym); - printf("\n"); - sym = sym->next; - } + memset(&list, 0, sizeof(list)); + translation_unit(token, &list); + show_symbol_list(&list); return 0; } |
