Operators and Punctuation


 

Operator Precedence

The following table gives the precedence order and association for the supported GXC operators:

 

Symbol in order of precedenceTypeAssociation
[] () .Expressionleft to right
Postfix ++ and postfix --Unaryright to left
Prefix ++ and prefix --Unaryright to left
sizeof + - !Unaryright to left
(int) (real) (class)unary castright to left
* / %multiplicationleft to right
+ -additiveleft to right
< > <= >=relationalleft to right
== !=equalityleft to right
&&logical ANDleft to right
||logical ORleft to right
?:conditionalright to left
= *= /= %= += -=simple and compound assignmentright to left
,sequential evaluationleft 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.