TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class ConfigExpression in Tinman.Core.Config

Abstract base class that represent expressions in a configuration script.

abstract class ConfigExpression extends ConfigNode

Private / Attributes

HasBegun

The balance between calls to Begin and End greater than zero?

[Internal]
public property HasBegun { get }
type bool
value true if the balance is greater than zero,
false if it is not.
inherited ConfigNode.HasBegun

Private / Methods

Begin

[Internal]
public method Begin ()
inherited ConfigNode.Begin

End

[Internal]
public method End ()
inherited ConfigNode.End

Protected / Attributes

range

The source code range of this PSI node.

protected field range
type RangeI
inherited ConfigNode.range

Protected / Methods

DoEvaluate

Evaluates this expression.

protected abstract method DoEvaluate (IConfigValueBag scope, ConfigValue value)
type ConfigValue
params scope The scope to use.
  value The output config value or null if the expression shall be evaluated to an assignment target.
returns The resulting config value.

Exceptions:

DoEvaluateReferences

protected abstract method DoEvaluateReferences (IConfigValueBag scope, IVector<ConfigMember> members)
params scope
  members

DoWriteSourceCode

Produces source code by feeding the given source code writer.

protected abstract method DoWriteSourceCode (SourceCodeWriter writer, Context context)
params writer The source code writer (never null).
  context The context object (never null).

Exceptions:

Public / Attributes

ExpressionType

Returns the type of this expression.

public abstract property ExpressionType { get }
type ConfigType
value [not-null] The config type or Invalid if there are semantic errors (e.g. unresolved identifiers).

IsCall

public virtual property IsCall { get }
type bool
value

IsNull

Is this expression a null literal?

public virtual property IsNull { get }
type bool
value true if this expression is a null literal, false if not.

Precedence

The operator precedence.

public abstract property Precedence { get }
type int32
value The operator precedence.

Remarks:

0  -> For each expression
1  -> Conditional expression
2  -> Binary expression: conditional or
3  -> Binary expression: conditional and
4  -> Binary expression: logical or
5  -> Binary expression: logical xor
6  -> Binary expression: logical and
7  -> Binary expression: equality
8  -> Binary expression: comparision
9  -> Binary expression: shift
10 -> Binary expression: additive
11 -> Binary expression: multiplicative
12 -> Binary expression: power, root
13 -> Unary expression
14 -> Primary and terminal expressions

QualifiedIdentifier

public property QualifiedIdentifier { get }
type string
value

Range

Returns source code range of this object.

public property Range { get }
type RangeI
value The source code character range or Inv if none.
inherited ConfigNode.Range

Public / Constructors

Parse

Parses a configuration value expression.

public static method Parse (string source, IConfigScope scope = null, ConfigType expectedType = null)
type ConfigExpression
params source [not-null] The expression source code.
  scope Optional type bag for resolving variable types. Defaults to null.
  expectedType Optional expected type. Defaults to null.
returns [not-null] The parsed expression.

Exceptions:


Parses a configuration value expression.

public static method Parse (string source, IConfigScope scope, ConfigType expectedType, Path current)
type ConfigExpression
params source [not-null] The expression source code.
  scope Optional type bag for resolving variable types.
  expectedType Optional expected type.
  current Optional directory to use for resolving relative path values that start with a '.' (e.g. <./a/b.txt>). All other relative paths (e.g. <a/b.txt>) will remain unchanged. If null, the current filesystem directory will be used.
returns [not-null] The parsed expression.

Exceptions:

ParseAst

Creates a configuration value expression.

public static method ParseAst (ICodeInput input, AstNode ast, IConfigScope scope = null, ConfigType expectedType = null, Path current = null)
type ConfigExpression
params input [not-null] The character input.
  ast [not-null] The AST root node.
  scope Optional type bag for resolving variable types. Defaults to null.
  expectedType Optional expected type. Defaults to null.
  current Optional directory to use for resolving relative path values that start with a '.' (e.g. <./a/b.txt>). All other relative paths (e.g. <a/b.txt>) will remain unchanged. If null, the current filesystem directory will be used. Defaults to null.
returns [not-null] The parsed expression.

Exceptions:

Public / Methods

CheckQualifiedIdentifier

Can this expression be interpreted as a qualified identifier (e.g. Some.Name.With.Parts)?

public virtual method CheckQualifiedIdentifier (ICollector<string> parts = null)
type bool
params parts The collector of name parts or null.
returns true if this expression builds a qualified identifier, false if not.

ClearRange

Clears the source code range.

public method ClearRange ()
inherited ConfigNode.ClearRange

See also:

ConfigNode.Range

Evaluate

Evaluates this expression as if it is the right side of an assignment.

public method Evaluate (IConfigValueBag scope = null, ConfigValue value = null)
type ConfigValue
params scope The evaluation scope or null.
  value The ConfigValue to store the resulting value in. If null, a new config value is created.
returns [not-null] The ConfigValue that holds the evaluation result.

Exceptions:

EvaluateAssignable

Evaluates this expression as if it is the left side of an assignment.

public method EvaluateAssignable (IConfigValueBag scope = null)
type ConfigValue
params scope The evaluation scope or null.
returns [not-null] The ConfigValue that holds the evaluation result or Invalid if this expression cannot be an assignment target.

Exceptions:

EvaluateReferences

Collects all config members that are referenced by this expression.

public method EvaluateReferences (IConfigValueBag scope, IVector<ConfigMember> members = null)
type IVectorConst<ConfigMember>
params scope [not-null] The evaluation scope.
  members Output for collected references or null.
returns [not-null] The collected config members.

ExpressionTypeLazy

Returns the type of this expression.

public method ExpressionTypeLazy (ConfigTypeDelegate func = null)
type ConfigType
params func Optional delegate to call on the resolved expression type.
returns [not-null] The resulting config type.

Remarks:

The actual config type is determined lazily by querying ExpressionType at a later point in time.

FindAt

Finds all config nodes which code range (see Range) contains the given range (see Contains).

public virtual method FindAt (RangeI range, ICollector<ConfigNode> nodes)
params range The code range to intersect with.
  nodes [not-null] The output nodes.
inherited ConfigNode.FindAt

IsAssignableTo

Checks if this config expression if assignable to the given type.

public method IsAssignableTo (ConfigType other)
type bool
params other [not-null] The other type.
returns true if this type is assignable to the given one, false if not.

IsConvertibleTo

Checks if this config expression if convertible to the given type.

public method IsConvertibleTo (ConfigType other, bool always = false)
type bool
params other [not-null] The other type.
  always When set to true, the method will return true iff this type is always convertible to other. When set to false, this method will return true even if a conversion might fail at runtime, causing a ConfigException to be thrown (e.g. invalid string to number).
returns true if this type is convertible to the given one, false if not.

Resolve

Resolves all references in this PSI node.

public abstract method Resolve ()
type ResolveResult
returns The result of the resolver cycle.
inherited ConfigNode.Resolve

SetParseInfo

Provides additional information about the parsing process.

public method SetParseInfo (RangeI range)
params range The source code range.
inherited ConfigNode.SetParseInfo

ToString

[Pure]
public override method ToString ()
type string
inherited ConfigNode.ToString

Validate

Validates the state of this object.

public abstract method Validate (Validator validator)
params validator [not-null] The validator object.
inherited ConfigNode.Validate

WriteSourceCode

Produces source code by feeding the given source code writer.

public override method WriteSourceCode (SourceCodeWriter writer, Context context)
params writer [not-null] The source code writer to use.
  context [not-null] Context information.
implements ConfigNode.WriteSourceCode

Exceptions: