From 818b15f5e7b2132ff81a4fab4a9ad93370c68b12 Mon Sep 17 00:00:00 2001 From: Nathan R Date: Fri, 23 Jul 2021 19:34:09 +0200 Subject: [PATCH] new test file to print a tree --- ccmeta-tree.txt | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 ccmeta-tree.txt diff --git a/ccmeta-tree.txt b/ccmeta-tree.txt new file mode 100644 index 0000000..e2ea7ee --- /dev/null +++ b/ccmeta-tree.txt @@ -0,0 +1,36 @@ +typedef signed t; +typedef int plain; +struct tag { + unsigned t:4; // t is the name of the field + const t:5; // t is the name of the type of the unnamed 5-bit field + plain r:5; +}; + +struct tag2 { + int xx:8; + int :8; // a field with no name + int :8; // a field with no name + int yy:8; +}; + +typedef int a, (*b)(a intarg); +// ^ ^----------------------------------------|-------| +// (1) where does it say in the std that this name becomes a type name +// even before the end of the typedef declarator list that is a part of? + +// (2) where in the std does is say how the scope of typedef names is +// handled (global, function-level, block-level, etc.)? + +// (3) what are the exact rules about typedef scopes, and the different +// contexts in which a typedef can occur that causes it to have non-local +// or non-global scope? + +// (4) printTree to show the real AST in addition to outputNode which prints +// source code. + +int c(int x) { return x; } + +b e = c; + +unsigned x; +unsigned long int y;