Operators and Punctuation
Operator Precedence
The following table gives the precedence order and association for the supported GXC operators:
Symbol in order of precedence | Type | Association |
[] () . | Expression | left to right |
Postfix ++ and postfix -- | Unary | right to left |
Prefix ++ and prefix -- | Unary | right to left |
sizeof + - ! | Unary | right to left |
(int) (real) (class) | unary cast | right to left |
* / % | multiplication | left to right |
+ - | additive | left to right |
< > <= >= | relational | left to right |
== != | equality | left to right |
&& | logical AND | left to right |
|| | logical OR | left to right |
?: | conditional | right to left |
= *= /= %= += -= | simple and compound assignment | right to left |
, | sequential evaluation | left to right |
Punctuation Characters
Punctuation characters are used to control how the compiler processed the source code and evaluate expressions. The following table documents the punctuation characters.
Characters | Description |
; | The semicolon marks the end of an expression. One expression is always completely evaluated before starting on the next expression. |
{ } | Braces mark the start and end of a group of expressions that are evaluated in order. Braces are normally used to group statements that must be executes within a control structure. |
( ) | Parentheses control the order of evaluation in arithmetic and logical expressions such that everything inside parenthesis is evaluated before evaluating the next associated operator outside parentheses. |