Dirdeclor
Fixtype of direct declarators [C:6.7.6] [C:A.2.2].
This is a tagged union type, introduced by fty::deftagsum.
Member Tags → Types
- :ident → dirdeclor-ident
- :paren → dirdeclor-paren
- :array → dirdeclor-array
- :array-static1 → dirdeclor-array-static1
- :array-static2 → dirdeclor-array-static2
- :array-star → dirdeclor-array-star
- :function-params → dirdeclor-function-params
- :function-names → dirdeclor-function-names
This corresponds to direct-declarator in the grammar in [C].
The base case is the identifier.
We explicitly capture parenthesized declarators,
analogously to how we also capture parenthesized expressions,
in order to not lose concrete syntax information
about redundant parenthesizations that may improve readability.
This is recursive, since a declarator includes a direct declarator
(see declor).
Each of the other cases starts with a direct declarator,
followed by additional syntactic entities.
The :array case captures the first kind of array declarator,
without static and without *;
the :array-static1 and :array-static2 cases
capture the ...[static...] and ...[...static...] forms;
and the :array-star case captures the ...[...*] form.
In the :function-params case,
we inline parameter-type-list.
Grammatically, an identifier-list
is also a parameter-type-list,
because an identifier could be a type specifier (a typedef name).
This cannot be disambiguated purely syntactically.
So, during parsing, we always generate the :function-params case,
which may be re-classified into the :function-names case
during post-parsing semantic analysis.
Subtopics
- Dirdeclorp
- Recognizer for dirdeclor structures.
- Dirdeclor-case
- Case macro for the different kinds of dirdeclor structures.
- Dirdeclor-equiv
- Basic equivalence relation for dirdeclor structures.
- Dirdeclor-function-params
- Dirdeclor-array-static2
- Dirdeclor-array-static1
- Dirdeclor-array
- Dirdeclor-array-star
- Dirdeclor-function-names
- Dirdeclor-paren
- Dirdeclor-ident
- Dirdeclor-kind
- Get the kind (tag) of a dirdeclor structure.
- Dirdeclor-fix
- Fixing function for dirdeclor structures.
- Dirdeclor-count
- Measure for recurring over dirdeclor structures.