CxExpression

Description

abstract class Tinman.Core.Cx.Expressions.CxExpression

Abstract base for classes that represent a Code-X expression.

Public / Constructors

From​Source


public static method FromSource → (1)

source in : string

[not-null]
The source code.

returns → CxExpression

The parsed expression.

Parses the given expression.

ValidatingException

If the syntax of source in is invalid.

See also

CxCodeUnit

Public / Methods

As​Statement


public method AsStatement → ()

returns → CxStatement

The wrapping statement.

Wraps this expression in a statement.

As​Statement​Return


public method AsStatementReturn → ()

returns → CxStatementReturn

The wrapping return statement.

Wraps this expression in a return statement.

As​Statement​Throw


public method AsStatementThrow → ()

returns → CxStatementThrow

The wrapping throw statement.

Wraps this expression in a throw statement.

Write​Source​Code​With​Braces


public method WriteSourceCodeWithBraces → (3)

writer in : SourceCodeWriter

[not-null]
The source code writer to use.

context in : Context

[not-null]
Context information.

precedence in : int32

[>=0]
The precedence of the surrounding expression or 0 if there is no surrounding expression. See Precedence.

Produces source code by feeding the given source code writer.

IOException

If an I/O error occurs while emitting source code to writer in.

Public / Attributes

Expression​Type


public attribute ExpressionType → (get)

value : CxType

[not-null]
The expression type or CxTypeSimple.Void iff unresolved.

Returns the type this expression evaluates to.

Precedence


[Constant]
public abstract attribute Precedence → (get)

value : int32

[>=1]
The precedence value. Expressions with higher values take precedence over expressions with lower values.

The expression precedence value.

Protected / Methods

Compute​Expression​Type


protected abstract method ComputeExpressionType → ()

returns → CxType

The expression type.

Computes the expression type.

This method is called from PsiNode.OnResolved.