Unop
Fixtype of unary operators
[C17:6.5.3] [C17:6.5.2] [C17:A.2.1].
This is a tagged union type, introduced by fty::deftagsum.
Member Tags → Types
- :address → unop-address
- :indir → unop-indir
- :plus → unop-plus
- :minus → unop-minus
- :bitnot → unop-bitnot
- :lognot → unop-lognot
- :preinc → unop-preinc
- :predec → unop-predec
- :postinc → unop-postinc
- :postdec → unop-postdec
- :sizeof → unop-sizeof
- :alignof → unop-alignof
- :real → unop-real
- :imag → unop-imag
This corresponds to unary-operator in the grammar in [C17],
but it also includes one-argument operators
used in unary-expression and postfix-expression,
which can therefore be reasonably regarded as unary operators,
although the grammar in [C17] reserves the term to only some of them.
From the standpoint of our abstract syntax,
including the additional operators under this definition of unary operators
makes things more factored and orthogonal.
The operators are
& (unary),
* (unary),
+ (unary),
- (unary),
~,
!,
++ (prefix),
-- (prefix),
++ (postfix),
-- (postfix),
sizeof
(the variant on expressions; see expr),
_Alignof or __alignof or __alignof__
(the variant on expressions; see expr),
__real__, and
__imag__.
The latter three are GCC extensions; see the ABNF grammar.
For :alignof, we keep track of the underscore variant;
note that the variant without underscores
represents the standard _Alignof,
not the non-existing alignof,
while the other two represent __alignof and __alignof__;
see the ABNF grammar.
Subtopics
- Unop-case
- Case macro for the different kinds of unop structures.
- Unop-fix
- Fixing function for unop structures.
- Unopp
- Recognizer for unop structures.
- Unop-equiv
- Basic equivalence relation for unop structures.
- Unop-kind
- Get the kind (tag) of a unop structure.
- Unop-alignof
- Unop-address
- Unop-sizeof
- Unop-real
- Unop-preinc
- Unop-predec
- Unop-postinc
- Unop-postdec
- Unop-plus
- Unop-minus
- Unop-lognot
- Unop-indir
- Unop-imag
- Unop-bitnot