Binop
Fixtype of binary operators
[C:6.5.5-14] [C:6.5.16] [C:A.2.1].
This is a tagged union type, introduced by fty::deftagsum.
Member Tags → Types
- :mul → binop-mul
- :div → binop-div
- :rem → binop-rem
- :add → binop-add
- :sub → binop-sub
- :shl → binop-shl
- :shr → binop-shr
- :lt → binop-lt
- :gt → binop-gt
- :le → binop-le
- :ge → binop-ge
- :eq → binop-eq
- :ne → binop-ne
- :bitand → binop-bitand
- :bitxor → binop-bitxor
- :bitior → binop-bitior
- :logand → binop-logand
- :logor → binop-logor
- :asg → binop-asg
- :asg-mul → binop-asg-mul
- :asg-div → binop-asg-div
- :asg-rem → binop-asg-rem
- :asg-add → binop-asg-add
- :asg-sub → binop-asg-sub
- :asg-shl → binop-asg-shl
- :asg-shr → binop-asg-shr
- :asg-and → binop-asg-and
- :asg-xor → binop-asg-xor
- :asg-ior → binop-asg-ior
The grammar in [C] does not have a nonterminal for binary operators.
Instead, it has nonterminals for various kinds of binary expressions,
used to capture certain precedence rules in the grammar itself.
In our abstract syntax, for better factoring and orthogonality,
it makes sense to introduce a fixtype for binary operators,
and use it to define binary expressions as we do in expr.
The binary operators are
* (binary),
/,
%,
+ (binary),
- (binary),
<<,
>>,
<,
>,
<=,
>=,
==,
!=,
& (binary),
^,
|,
&&,
||,
=,
*=,
/=,
%=,
+=,
-=,
<<=,
>>=,
&=,
^=, and
|=.
Subtopics
- Binopp
- Recognizer for binop structures.
- Binop-case
- Case macro for the different kinds of binop structures.
- Binop-fix
- Fixing function for binop structures.
- Binop-kind
- Get the kind (tag) of a binop structure.
- Binop-equiv
- Basic equivalence relation for binop structures.
- Binop-add
- Binop-sub
- Binop-shr
- Binop-shl
- Binop-rem
- Binop-ne
- Binop-mul
- Binop-lt
- Binop-logor
- Binop-logand
- Binop-le
- Binop-gt
- Binop-ge
- Binop-eq
- Binop-div
- Binop-bitxor
- Binop-bitior
- Binop-bitand
- Binop-asg-xor
- Binop-asg-sub
- Binop-asg-shr
- Binop-asg-shl
- Binop-asg-rem
- Binop-asg-mul
- Binop-asg-ior
- Binop-asg-div
- Binop-asg-and
- Binop-asg-add
- Binop-asg