C declarator (K&R A8.5) and abstract declarator (K&R A8.8)
- We have one type qualifer list
[CTypeQual]
for each indirection (ie,
each occurrence of
*
in the concrete syntax).
- We unfold K&R's direct-declarators nonterminal into declarators. Note
that
*(*x)
is equivalent to
**x
.
- Declarators (A8.5) and abstract declarators (A8.8) are represented in the
same structure. In the case of a declarator, the identifier in
CVarDeclr
must be present; in an abstract declarator it misses.
CVarDeclr Nothing ...
on its own is meaningless, it may only occur as
part of a larger type (ie, there must be a pointer, an array, or function
declarator around).
- The qualifiers list in a
CPtrDeclr
may not be empty.
- Old and new style function definitions are merged into a single case
CFunDeclr
. In case of an old style definition, the parameter list is
empty and the variadic flag is
False
(ie, the parameter names are not
stored in the tree). Remember, a new style definition with no parameters
requires a single
void
in the argument list (according to the standard).
- We unfold K&R's parameter-type-list nonterminal into the declarator
variant for functions.
|