>The C declarators reverse this. They put an already-known type above>the type constructor and the name of the to-be-declared type or>variable below. Whether this is good or bad is bait for a major flame>war.

>But this inverted syntax cannot be applied consistently, because a>tree node, while having as many children as you like, can have only>one parent. So when you need to construct a new type out of more than>one already-known type or value, it won't work. The only type>constructor in C that uses this syntax style consistently is the>pointer declarator, which only needs one already-know construct,>namely, the referent type of the being-declared pointer type.

I guess I use a grammar where the declaration has a base, which is a
base-type (int, float, ...) or another declaration, and a declarator
(array, pointer, call). This lets declarations reduce in the correct order
for one-pass name resolution. I represent type by a linear thread through
the declaration, which which does run up through the declarator and down
through the base.

For example,
int a = 0, *b = malloc(2*sizeof *b), c[2];

looks something like the following (with nodes numbered in brackets
underneath).