Show/Hide Toolbars

XSharp

Primary Expressions are the simplest building blocks in the expression rule in X#

 

Primary Expression type

Syntax

Self

SELF

Super

SUPER

LiteralArray

{......}

Anonymous Type

CLASS { .... }

Tuple

TUPLE { .... }

CodeBlock

{|| ....}

Lambda Expression

{ .. => }

LINQ query

FROM .. SELECT ..

DelegateConstructor call

datatype { expression, @Identifier() }

Constructor call with optional initializer

datatype { argumentlist? } initializer? }

Checked

CHECKED ( expression )

Unchecked

UNCHECKED ( expression )

Typeof

(_typeof | TYPEOF) ( expression )

Sizeof

(_sizeof | SIZEOF) ( expression )

Nameof

NAMEOF ( identifier )

Default

DEFAULT ( expression )

Name

identifier

Conversion

nativetype ( expression ): LONG(1+2)

XBase Conversion

xbasetype ( expression ): FLOAT(1+2)

VOCast

datatype ( _CAST , exprsssion )

VoCastPtr

PTR ( datatype , expression )

VOTypeName

typeName

IIF expression

(IIF|IF) ( expression , expression , expression )

Bitwise

(_AND, _OR, _XOR, _NOT) ( expressionlist )

AliasedField

FIELD -> identifier
| identifier -> identifier

Aliased Expression

FIELD -> expression
| expression -> expression

MacroExpr

& ( expression )

MacroVar

& identifier

Parenthesized

( expression )

ArgList

_ARGLIST