Class TCasScriptParameterValue

Unit

Declaration

type TCasScriptParameterValue = class(TCasScriptValue)

Description

This is a very special CastleScript value, used to represent user-defined function parameter. This poses itself as a TCasScriptValue descendant, and it has working AssignValue and everything else. This way it can be used in "Variables" list for various CastleScriptParser functions.

Except it's cheating: it doesn't actually store the value. Instead, it has SourceValue property that is used when doing AssignValue. So AssignValue is handled by SourceValue.AssignValue, and Execute is handled by SourceValue.Execute, and so reading/writing this works.

The advantage: the exact type of function parameter is not known, and still we can parse the function expression. This is crucial for parser implementation: when parsing you need to create TCasScriptParameterValue instance, but you don't know actual type of parameter that will be passed here.

Hierarchy

Overview

Methods

Protected function CoreExecute: TCasScriptValue; override;
Public procedure AssignValue(Source: TCasScriptValue); override;

Properties

Public property SourceValue: TCasScriptValue read FSourceValue write FSourceValue;

Description

Methods

Protected function CoreExecute: TCasScriptValue; override;

This item has no description. Showing description inherited from TCasScriptExpression.CoreExecute.

More internal version of Execute.

This doesn't necessarily check floating-point exceptions. Execute actually calls CoreExecute and then ClearExceptions.

Also this doesn't try to convert EIntError and EMathError to ECasScriptAnyMathError. This is done by Execute.

When one CastleScript CoreExecute calls another function, it can use CoreExecute instead of Execute. This way only one ClearExceptions will be needed for whole expression execution, instead of doing ClearExceptions after each function handler.

Public procedure AssignValue(Source: TCasScriptValue); override;

This item has no description. Showing description inherited from TCasScriptValue.AssignValue.

Assign value from Source to Self.

Properties

Public property SourceValue: TCasScriptValue read FSourceValue write FSourceValue;

This item has no description.


Generated by PasDoc 0.16.0-snapshot.