Table of Contents

Class Expr

Namespace
Invex.StructuredText.Expressions
Assembly
Invex.StructuredText.dll

The base type of the typed expression tree. Every node derives from one of the four result-typed roots: BoolExpr, StringExpr, NumberExpr or JsonExpr.

public abstract record Expr
Inheritance
object
Expr
Derived

Remarks

Nodes are immutable records. They are rendered to platform syntax by an ExpressionPrinter; ToString() uses a neutral infix rendering intended for debugging and test output.

Constructors

Expr()

protected Expr()

Properties

Children

The direct sub-expressions of this node, in left-to-right order.

public abstract IEnumerable<Expr> Children { get; }

Property Value

IEnumerable<Expr>

Methods

DescendantsAndSelf()

Enumerates this node and every node beneath it, depth first, in left-to-right order.

public IEnumerable<Expr> DescendantsAndSelf()

Returns

IEnumerable<Expr>

This node followed by all of its descendants.

ToString()

Renders this expression with a neutral infix syntax, for debugging and test output.

public override sealed string ToString()

Returns

string

The rendered expression.

Operators

implicit operator Expr(bool)

Converts a bool to a boolean literal where any expression is accepted.

public static implicit operator Expr(bool value)

Parameters

value bool

The literal value.

Returns

Expr

implicit operator Expr(double)

Converts a double to a numeric literal where any expression is accepted.

public static implicit operator Expr(double value)

Parameters

value double

The literal value.

Returns

Expr

implicit operator Expr(string)

Converts a string to a string literal where any expression is accepted, e.g. Tex.Format("{0}", "hello").

public static implicit operator Expr(string value)

Parameters

value string

The literal value, unquoted.

Returns

Expr