Files
bds.mr.dpg/src.lib/dpglib.StringSymbol.pas
T
2026-01-03 18:33:48 +01:00

76 lines
2.6 KiB
ObjectPascal

unit dpglib.StringSymbol;
interface
uses
dpglib.types,
dpglib.TokenSymbol;
type
TStringSymbol = class( TTokenSymbol,
IStringSymbol,
ITokenSymbol,
IGrammarSymbol)
protected
fLabel: AnsiString;
// ----------------------------------------------------------------------
// IGrammarSymbol
// ----------------------------------------------------------------------
protected
function Clone: ITokenSymbol;
// ----------------------------------------------------------------------
// IStringSymbol
// ----------------------------------------------------------------------
protected
function GetLabel: AnsiString;
procedure SetLabel( pLabel: AnsiString);
end;
implementation
// @@@: IStringSymbol implementation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// IStringSymbol implementation
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ================================================================================================
// Get Label
// ================================================================================================
function TStringSymbol.GetLabel: AnsiString;
begin
result := fLabel;
end;
// ================================================================================================
// Set Label
// ================================================================================================
procedure TStringSymbol.SetLabel(pLabel: AnsiString);
begin
fLabel := pLabel;
end;
// ================================================================================================
// Clone
// ================================================================================================
function TStringSymbol.Clone: ITokenSymbol;
var
ss: TStringSymbol;
begin
ss := TStringSymbol.Create( fID);
ss.fTokenType := fTokenType;
ss.fParaphrase := fParaphrase;
ss.fASTNodeType := fASTNodeType;
ss.fLabel := fLabel;
result := ss;
end;
end.