Class ALinearCExpression

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type ALinearCExpression = class(AParsedLanguageParser)

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).

Hierarchy

Overview

Fields

Protected myValue: Variant;

Methods

Public constructor forSource(const ThisParent: AParser); overload; override;
Public function init: boolean; override;
Public destructor destroy; override;
Public function parse: int64; override;
Public function toString: AnsiString; override;
Public function value: Variant; virtual;
Public function Options: ACommandLineOptionDictionary; virtual;

Description

Fields

Protected myValue: Variant;

Stores the value of the expression

Methods

Public 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.

Public function init: boolean; override;

Initializer

Public destructor destroy; override;

Destroy the expression parser.

This method nils its reference to the parent's token list to prevent the inherited routine from freeing it (since the reference is borrowed). It then calls the inherited routine.

Public 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.

Public 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.

Public 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.

Public function Options: ACommandLineOptionDictionary; virtual;

Retrieve a reference to the list of command line options with which the expression works.

The caller should NOT attempt to free the reference returned by this routine.


Generated by PasDoc 0.13.0 on 2015-01-10 17:13:18