aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test-parsing.c
diff options
authorLinus Torvalds <torvalds@penguin.transmeta.com>2003-03-14 17:08:12 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 20:59:16 -0700
commit2d76ef523eb4606a60b7e95fd67b4c6d302a2b16 (patch)
tree071211260972d1010dad6e64446b224dea96922c /test-parsing.c
parentffa4ddda950185bf313654e903207a3fc2d5f261 (diff)
downloadsparse-dev-2d76ef523eb4606a60b7e95fd67b4c6d302a2b16.tar.gz
Add more type parsing: function and array declarators, function
parameter lists etc. It can now parse things like const volatile int hello(const int (*argc)(void), const char *const* argv); apparently correctly.
Diffstat (limited to 'test-parsing.c')
-rw-r--r--test-parsing.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test-parsing.c b/test-parsing.c
index c002fa41..6aaf4753 100644
--- a/test-parsing.c
+++ b/test-parsing.c
@@ -14,20 +14,20 @@ int main(int argc, char **argv)
{
int fd = open(argv[1], O_RDONLY);
struct token *token;
- struct statement *stmt;
+ struct symbol *sym;
if (fd < 0)
die("No such file: %s", argv[1]);
init_symbols();
token = tokenize(argv[1], fd);
- token = statement_list(token, &stmt);
+ token = translation_unit(token, &sym);
if (token)
warn(token, "Extra data");
- while (stmt) {
- show_expression(stmt->expression);
+ while (sym) {
+ show_symbol(sym);
printf("\n");
- stmt = stmt->next;
+ sym = sym->next;
}
return 0;
}