Class ASymbolRecalled

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type ASymbolRecalled = class(ASymbol)

Description

This class represents a symbol which was previously parsed and written to an intermediate code file. Instead of providing a pointer reference to the parent, if any, instances of ASymbolRecalled utilize TSymbolReference to point to the scope and index of their parent. This information is read from a stream, to which it was recorded by an instance of ASymbolFromSource.

Hierarchy

Overview

Fields

Protected myParentSymbol: TSymbolReference;

Methods

Public function init: boolean; override;
Public function shallowCopyFrom(const Other: AnObject): boolean; override;
Public function selfStreamingLength: TStreamIOSize; override;
Public function writeSelfTo(const Dest: AStream): TStreamIOSize; override;
Public function readFrom(const Source: AStream): TStreamIOSize; override;
Public function parentSymbol: TSymbolReference; virtual;

Description

Fields

Protected myParentSymbol: TSymbolReference;

Refers to the parent symbol, if any

Methods

Public function init: boolean; override;

Initializer

Public function shallowCopyFrom(const Other: AnObject): boolean; override;

Construct a shallow copy of the other object.

This method builds upon the behavior inherited from ASymbol.shallowCopyFrom. It calls that method, then checks to see whether Other is an instance of ASymbolRecalled. If so, it copies the value of ASymbolRecalled.parentSymbol from Other to Self, overwriting the value in Self.

Note that this method does NOT copy the left and right subtree of Other and so does not place Self inside the same symbol table as Other, if any.

Public function selfStreamingLength: TStreamIOSize; override;

Calculate the number of bytes required to stream the symbol.

This method builds upon the behavior inherited from ASymbol.selfStreamingLength: it calls that method, then adds the number of bytes required to write the value of ASymbolRecalled.parentSymbol.

Public function writeSelfTo(const Dest: AStream): TStreamIOSize; override;

Write the symbol, and just the symbol, to the specified stream.

This method builds upon the behavior inherited from ASymbol.writeSelfTo. It calls that method, then writes the value of ASymbolRecalled.parentSymbol.

Returns

The total number of bytes written to the stream.

Public function readFrom(const Source: AStream): TStreamIOSize; override;

Read the symbol from the specified stream.

This method builds upon the behavior inherited from ASymbol.readFrom. It calls that routine, then reads the value of ASymbolRecalled.parentSymbol from Source.

Returns

The total number of bytes read from Source.

Public function parentSymbol: TSymbolReference; virtual;

Retrieve a reference to the parent type of the symbol, if any. If the symbol has no parent type (it is, itself, representative of a base type), then the return value from this routine will be empty.


Generated by PasDoc 0.13.0 on 2015-06-25 11:12:03