Class ALinearCExpression
Unit
linearc
Declaration
type ALinearCExpression = class(ALinearCStatement)
Description
This class represents an expression in LinearC. An expression can be made up of a numeric value, a boolean value, or a subexpression (delimited by parentheses). You will probaly not create a direct instance of this class, since it cannot implement any parsing routines on its own.
Hierarchy
Overview
Fields
Methods
|
constructor forSource(const ThisParent: AParser); overload; override; |
|
function init: boolean; override; |
|
destructor destroy; override; |
|
function parse: int64; override; |
|
function toString: AnsiString; override; |
|
function value: Variant; virtual; |
Description
Fields
|
myValue: Variant; |
Stores the value of the expression
|
Methods
|
constructor forSource(const ThisParent: AParser); overload; override; |
Construct a new expression parser that will use the same scanner and token list as the specified parser.
The new expression inherits all of the properties of ThisParser .
|
|
function init: boolean; override; |
Initializer
|
|
destructor destroy; override; |
Destroy the expression.
Since instances of ALinearCExpression borrow the tokens list reference of their parent, this method sets its copy of that reference to Nil in order to prevent the inherited destructor code from freeing a reference that does not belong to it. It then calls the inherited destructor.
|
|
function parse: int64; override; |
Parse the expression.
This method checks Self.CurrentToken and, based on the value of the opcode, this method will construct an instance of:
The value returned from the subexpression will be assigned to Self.value.
Returns
The number of errors encountered while parsing. |
|
function toString: AnsiString; override; |
Construct and return a string representation of the expression, suitable for output to a text-based device such as a console.
This method calls Variants.varToStr on Self.value and returns the result.
|
|
function value: Variant; virtual; |
Retrieve the current value of the expression.
This value is calculated as the expression is parsed and cannot otherwise be changed.
|
Generated by PasDoc 0.13.0 on 2015-06-25 11:07:51
|