Abstract-syntax-standardp
Definition of the predicates that check whether
the abstract syntax is standard C,
i.e. without any GCC extensions.
We use fty::deffold-reduce to define these predicates concisely.
We use t as :default because
there are more standard constructs than GCC extensions.
The :combine operator is and,
because we need to check all the identifiers, recursively.
We override predicates for types that may involve GCC extensions.
We exclude the \% simple escape,
the variant keywords with underscores,
the unary && operator,
absent `then' branchs in conditional expressions,
statement expressions,
built-in functions that take type names as inputs,
expressions preceded by __extension__,
the GCC type specifiers,
the GCC declaration specifiers,
GCC attributes,
the empty structure declaration,
and ranges in cases.
Since we intend to use this predicate only on disambiguated ASTs,
we add overridings for ambiguous constructs that thrown hard errors.
Once fty::deffold-reduce is extended to support guards,
we will add a guard saying that the AST are unambiguous instead.
Subtopics
- Exprs/decls/stmts-standardp
- Filepath-transunit-map-standardp
- Transunit-ensemble-standardp
- Simple-escape-standardp
- Stringlit-list-standardp
- Type-qual-standardp
- S-char-list-standardp
- Fundef-standardp
- Extdecl-list-standardp
- C-char-list-standardp
- Transunit-standardp
- Stringlit-standardp
- Fun-spec-standardp
- Extdecl-standardp
- S-char-standardp
- Escape-standardp
- Const-standardp
- Cconst-standardp
- C-char-standardp
- Typequal/attribspec-list-standardp
- Typequal/attribspec-list-list-standardp
- Typequal/attribspec-standardp
- Type-spec-standardp
- Struni-spec-standardp
- Struct-declor-standardp
- Struct-declor-list-standardp
- Struct-declon-standardp
- Struct-declon-list-standardp
- Statassert-standardp
- Spec/qual-standardp
- Spec/qual-list-standardp
- Param-declor-standardp
- Param-declon-standardp
- Param-declon-list-standardp
- Member-designor-standardp
- Initer-option-standardp
- Initdeclor-standardp
- Initdeclor-list-standardp
- Genassoc-list-standardp
- Expr-option-standardp
- Expr-list-standardp
- Enumer-list-standardp
- Enum-spec-standardp
- Dirdeclor-standardp
- Dirabsdeclor-standardp
- Dirabsdeclor-option-standardp
- Desiniter-standardp
- Desiniter-list-standardp
- Designor-list-standardp
- Declor-option-standardp
- Decl-spec-standardp
- Decl-spec-list-standardp
- Decl-list-standardp
- Const-expr-standardp
- Const-expr-option-standardp
- Comp-stmt-standardp
- Block-item-standardp
- Block-item-list-standardp
- Attrib-spec-standardp
- Attrib-spec-list-standardp
- Attrib-list-standardp
- Asm-output-standardp
- Asm-output-list-standardp
- Asm-input-standardp
- Asm-input-list-standardp
- Amb-expr/tyname-standardp
- Amb-decl/stmt-standardp
- Amb-declor/absdeclor-standardp
- Align-spec-standardp
- Absdeclor-standardp
- Absdeclor-option-standardp
- Tyname-standardp
- Stmt-standardp
- Label-standardp
- Initer-standardp
- Genassoc-standardp
- Expr-standardp
- Enumer-standardp
- Designor-standardp
- Declor-standardp
- Decl-standardp
- Attrib-standardp
- Asm-stmt-standardp