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.