Stmt
Fixtype of statements [C:6.8] [C:A.2.3].
This is a tagged union type, introduced by fty::deftagsum.
Member Tags → Types
- :labeled → stmt-labeled
- :compound → stmt-compound
- :expr → stmt-expr
- :if → stmt-if
- :ifelse → stmt-ifelse
- :switch → stmt-switch
- :while → stmt-while
- :dowhile → stmt-dowhile
- :for-expr → stmt-for-expr
- :for-decl → stmt-for-decl
- :for-ambig → stmt-for-ambig
- :goto → stmt-goto
- :continue → stmt-continue
- :break → stmt-break
- :return → stmt-return
- :asm → stmt-asm
This corresponds to statement in the grammar in [C].
We inline
labeled-stament,
expression-statement,
selection-statement,
iteration-statement, and
jump-statement.
For labeled statements,
we use label to factor the three kinds of labels.
There are two forms of for loops:
one where the initialization part is an (optional) expression,
and one where the initialization part is a declaration.
There is also a third ambiguous form,
which applies when the initialization part could be
either an expression or a declaration, syntactically:
this is captured exactly by amb-decl/stmt,
because the statement in an ambiguous declaration or statement
is a statement expression,
which is exactly what
the initialization part of a for looks like,
when it is an expression.
As a GCC extension, we include assembler statements.
Subtopics
- Stmtp
- Recognizer for stmt structures.
- Stmt-case
- Case macro for the different kinds of stmt structures.
- Stmt-for-expr
- Stmt-for-decl
- Stmt-for-ambig
- Stmt-equiv
- Basic equivalence relation for stmt structures.
- Stmt-ifelse
- Stmt-while
- Stmt-switch
- Stmt-labeled
- Stmt-if
- Stmt-dowhile
- Stmt-kind
- Get the kind (tag) of a stmt structure.
- Stmt-return
- Stmt-expr
- Stmt-compound
- Stmt-asm
- Stmt-goto
- Stmt-continue
- Stmt-break
- Stmt-fix
- Fixing function for stmt structures.
- Stmt-count
- Measure for recurring over stmt structures.