• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
            • Disambiguator
            • Abstract-syntax
              • Expr
              • Exprs/decls/stmts
              • Type-spec
              • Binop
              • Stmt
              • Amb-expr/tyname
              • Dirdeclor
                • Dirdeclorp
                • Dirdeclor-case
                • Dirdeclor-equiv
                • Dirdeclor-array
                • Dirdeclor-function-params
                • Dirdeclor-array-static2
                • Dirdeclor-array-static1
                • Dirdeclor-array-star
                • Dirdeclor-function-names
                • Dirdeclor-paren
                • Dirdeclor-ident
                • Dirdeclor-kind
                • Dirdeclor-fix
                • Dirdeclor-count
              • Unop
              • Asm-stmt
              • Dec/oct/hex-const
              • Simple-escape
              • Attrib
              • Ident
              • Amb-decl/stmt
              • Dirabsdeclor
              • Decl-spec
              • Structdecl
              • Fundef
              • Transunit-ensemble
              • Asm-name-spec
              • Amb-declor/absdeclor
              • Param-declor
              • Declor
              • Type-qual
              • Absdeclor
              • Strunispec
              • Stor-spec
              • Keyword-uscores
              • Align-spec
              • Label
              • Expr-option
              • Spec/qual
              • Lsuffix
              • Hex-frac-const
              • Desiniter
              • Tyname
              • Iconst
              • Dirabsdeclor-option
              • Dec-frac-const
              • Dec-core-fconst
              • Extdecl
              • Amb?-declor/absdeclor
              • Isuffix
              • Initdeclor
              • Hex-core-fconst
              • Const-expr-option
              • Attrib-spec
              • Structdeclor
              • Escape
              • Decl
              • Amb?-expr/tyname
              • Ident-option
              • Bin-expo
              • Absdeclor-option
              • Statassert
              • Param-declon
              • Member-designor
              • Initer-option
              • Initer
              • Fsuffix
              • Enumspec
              • Declor-option
              • Const
              • Hex-quad
              • Eprefix
              • Const-expr
              • Block-item
              • Oct-escape
              • Inc/dec-op
              • Fun-spec
              • Dec-expo
              • Cprefix-option
              • Asm-name-spec-option
              • Amb?-decl/stmt
              • S-char
              • Isuffix-option
              • Genassoc
              • Fundef-option
              • Fsuffix-option
              • Fconst
              • Eprefix-option
              • Dec-expo-option
              • Cprefix
              • C-char
              • Type-spec-option
              • Sign-option
              • Iconst-option
              • Asm-output
              • Asm-input
              • Const-option
              • Usuffix
              • Univ-char-name
              • Transunit
              • Hprefix
              • Enumer
              • Designor
              • Attrib-name
              • Sign
              • Asm-qual
              • Typequal/attribspec
              • Dec-expo-prefix
              • Bin-expo-prefix
              • Stringlit
              • Cconst
              • Expr/tyname
              • Decl/stmt
              • Declor/absdeclor
              • Asm-clobber
              • Typequal/attribspec-list
              • Decl-spec-list
              • Stringlit-list
              • Spec/qual-list
              • Inc/dec-op-list
              • Desiniter-list
              • S-char-list
              • Param-declon-list
              • Decl-list
              • C-char-list
              • Block-item-list
              • Typequal/attribspec-list-list
              • Structdeclor-list
              • Structdecl-list
              • Initdeclor-list
              • Genassoc-list
              • Filepath-transunit-map
              • Extdecl-list
              • Expr-list
              • Enumer-list
              • Attrib-spec-list
              • Type-spec-list
              • Ident-list
              • Asm-qual-list
              • Asm-output-list
              • Asm-input-list
              • Asm-clobber-list
              • Stor-spec-list
              • Ident-set
              • Ident-option-set
              • Eprefix-option-list
              • Designor-list
              • Attrib-list
            • Parser
            • Validator
            • Printer
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Defpred
            • Output-files
            • Abstract-syntax-operations
            • Validation-information
            • Implementation-environments
            • Concrete-syntax
            • Unambiguity
            • Ascii-identifiers
            • Preprocessing
            • Abstraction-mapping
          • Atc
          • Language
          • Representation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
        • Cryptography
        • Number-theory
        • Lists-light
        • Axe
        • Builtins
        • Solidity
        • Helpers
        • Htclient
        • Typed-lists-light
        • Arithmetic-light
      • X86isa
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Abstract-syntax
  • Exprs/decls/stmts

Dirdeclor

Fixtype of direct declarators [C17:6.7.6] [C17: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 [C17].

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-array
Dirdeclor-function-params
Dirdeclor-array-static2
Dirdeclor-array-static1
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.