Show/Hide Toolbars

XSharp Bandol

Expressions are an important element of the language. There are many types of expressions. The expression rule in the compiler is the biggest rule

The table below lists the various expression types in the order they are recognized by the compiler. Some expression types are covered in a separate topic.

As you can see most expression types are recursive. They contain one or more references to sub expressions

 

Expressions

 

Expression type

Syntax

VO

VN

X#

Member Access

expression (DOT|COLON) identifier

Y

 

 

Method Call

expression LPAREN argumentlist? RPAREN

Y

 

 

Arrayelement Access

expression LBRKT argumentlist RBRKT

Y

 

 

Conditional Access

expression ? boundexpression

 

 

Y

Typecast

LPAREN datatype RPAREN

 

Y

 

Postfix

expression (++ | --)

Y

 

 

Await

AWAIT expression

 

 

Y

Prefix

(+|-|~|@|++|--) expression

Y

 

 

Typecheck

expression IS datatype

 

 

Y

As Typecheck

expresion ASTYPE datatype

 

 

Y

Powerof

expression (^|**) expression

Y

 

 

MulDiv

expression (*|/|%) expression

Y

 

 

PlusMinus

expression (+|-) expression

Y

 

 

LShift

expression << expression

Y

 

 

RShift

expression >> expression

Y

 

 

Comparison

expression OPERATOR expression,
where OPERATOR is
<,<=, >, >=, =, ==, $, !=, <>, #

Y

 

 

Bitwise And

expression & expression

 

Y

 

Bitwise XOR

expression ~ expression

 

Y

 

Bitwise OR

expression | expression

 

Y

 

Not Expression

(.NOT. | !) expression

Y

 

 

Logical AND expression

expression (.AND.|&&) expression

Y

Y

 

Logical OR expression

expression (.OR. | ||) expression

Y

Y

 

Default expression

expression DEFAULT expression

 

 

Y

Assignment expression

expression ASSIGN_OP expression
where ASSIGN_OP is
:=, +=, -=, *=, ^=, /=, %=, &=, |=, <<=, >>=, ~=

Y

 

 

Primary expression

See other rule