| operators |
|
grammar |
| |
The grammar provides a large set of operators.
Most operators are used in expressions, some are used in unary expressions.
The following usage description:
Expression:
UnaryExpression op UnaryExpression
applies to this list of operators:
| * |
multiplication
| | / |
division
| | % |
modulo
| | + |
addition (also concatenation of strings)
| | - |
subtraction
| | << |
left-shift bit operator
| | >> |
right-shift bit operator with sign extension
| | >>> |
right-shift bit operator with no extension
| | < |
less-than comparison
| | <= |
less-than or equal-to comparison
| | > |
greater-than comparison
| | >= |
greater-than or equal-to comparison
| | == |
equality comparison
| | != |
non-equality comparison
| | === |
like equality comparison except that
String
operands are compared using a test that duplicates the behavior of the
strcmp
built-in.
Also, comparison of two
NaN
double values will yield a
true
result.
| | !== |
like non-equality comparison except that
String
operands are compared using a test that duplicates the behavior of the
strcmp
built-in.
Also, comparison of two
NaN
double values will yield a
false
result.
| | =~ |
equality comparison where the right side is taken to be a regular expression, expressed either
as a
String
pattern or as a
Regexp
object, while the left side can be a
String,
int
or
double.
| | !~ |
non-equality comparison where the right side is taken to be a regular expression, expressed either
as a
String
pattern or as a
Regexp
object, while the left side can be a
String,
int
or
double.
| | & |
bitwise
and
| | ^ |
bitwise
exclusive-or
| | | |
bitwise
or
| | && |
boolean
and
| | ^^ |
boolean
exclusive-or
| | || |
boolean
or
| | ? |
Conditional evaluation - if left side is non-zero, result is right side, otherwise result is left side, which is zero.
Used in conjunction with :.
| | : |
Conditional evaluation - if left side is zero, result is right side, otherwise result is left side, which is non-zero.
Used in conjunction with ?.
| | = |
assignment
| | *= |
multiplication assignment
| | /= |
division assignment
| | %= |
modulo assignment
| | += |
addition assignment
| | -= |
subtraction assignment
| | <<= |
left-shift assignment
| | >>= |
right-shift assignment with sign extension
| | >>>= |
right-shift assignment with no extension
| | &= |
bitwise
and
assignment
| | ^= |
bitwise
exclusive-or
assignment
| | |= |
bitwise
or
assignment
| | , |
left-to-right evaluation with rightmost result
|
The following usage description:
UnaryExpression:
op UnaryExpression
applies to
the following list of unary operators except where otherwise specified.
| ++ |
prefix or postfix increment by one with usage description:
UnaryExpression:
++ Lvalue
Lvalue ++
| | -- |
prefix or postfix decrement by one with usage description:
UnaryExpression:
-- Lvalue
Lvalue --
| | + |
positive signum
| | - |
negative signum
or
arithmetic negation
| | ! |
logical negation
| | ~ |
bitwise negation
|
Usage is as you would find in C or Java.
|
Yoix is a registered trademark of AT&T Intellectual Property.
|