Abstract-syntax-annop
Definition of the predicates that check whether
the abstract syntax is annotated with validation information.
We use fty::deffold-reduce to define these predicates concisely.
The :default value is t,
meaning that there are no constraints by default.
The :combine operator is and,
because we need to check all the constructs, recursively.
We override the predicate for
the constructs for which the validator adds information.
Since for now the validator accepts GCC attribute and other extensions
without actually checking them and their constituents,
we also have the annotation predicates accept those constructs,
by overriding those cases to return t.
The validator operates on unambiguous abstract syntax,
which satisfies the unambiguity predicates.
Ideally, the annotation predicates should use
the unambiguity predicates as guards,
but fty::deffold-reduce does not support that feature yet.
Thus, for now we add run-time checks, in the form of raise,
for the cases in which the unambiguity predicates do not hold;
note that raise is logically nil,
so the annotation predicates are false on ambiguous constructs.
Subtopics
- Exprs/decls/stmts-annop
- Filepath-transunit-map-annop
- Transunit-ensemble-annop
- Code-ensemble-annop
- Ident-option-annop
- Iconst-option-annop
- Extdecl-list-annop
- Const-option-annop
- Transunit-annop
- Ident-list-annop
- Attrib-name-annop
- Fundef-annop
- Extdecl-annop
- Iconst-annop
- Const-annop
- Ident-annop
- Typequal/attribspec-list-list-annop
- Typequal/attribspec-list-annop
- Typequal/attribspec-annop
- Struni-spec-annop
- Struct-declor-list-annop
- Struct-declor-annop
- Struct-declon-list-annop
- Struct-declon-annop
- Statassert-annop
- Spec/qual-list-annop
- Spec/qual-annop
- Param-declor-annop
- Param-declon-list-annop
- Param-declon-annop
- Member-designor-annop
- Initer-option-annop
- Initdeclor-list-annop
- Initdeclor-annop
- Genassoc-list-annop
- Expr-option-annop
- Enumer-list-annop
- Dirabsdeclor-option-annop
- Dirabsdeclor-annop
- Desiniter-list-annop
- Designor-list-annop
- Declor-option-annop
- Decl-spec-list-annop
- Const-expr-option-annop
- Const-expr-annop
- Block-item-list-annop
- Block-item-annop
- Attrib-spec-list-annop
- Attrib-spec-annop
- Attrib-list-annop
- Asm-output-list-annop
- Asm-output-annop
- Asm-input-list-annop
- Amb-expr/tyname-annop
- Amb-decl/stmt-annop
- Amb-declor/absdeclor-annop
- Align-spec-annop
- Absdeclor-option-annop
- Type-spec-annop
- Tyname-annop
- Stmt-annop
- Label-annop
- Initer-annop
- Genassoc-annop
- Expr-list-annop
- Expr-annop
- Enumer-annop
- Enum-spec-annop
- Dirdeclor-annop
- Desiniter-annop
- Designor-annop
- Declor-annop
- Decl-spec-annop
- Decl-list-annop
- Decl-annop
- Comp-stmt-annop
- Attrib-annop
- Asm-stmt-annop
- Asm-input-annop
- Absdeclor-annop