80 lines
3.2 KiB
ObjectPascal
80 lines
3.2 KiB
ObjectPascal
unit dpglib.GrammarSymbol;
|
|
|
|
interface
|
|
uses
|
|
dpglib.types;
|
|
|
|
type
|
|
TGrammarSymbol = class( TInterfacedObject, IGrammarSymbol)
|
|
protected
|
|
fID: AnsiString;
|
|
|
|
// ----------------------------------------------------------------------
|
|
// IdpgGrammar methods
|
|
// ----------------------------------------------------------------------
|
|
protected
|
|
function GetID: AnsiString;
|
|
procedure SetID( pID: AnsiString);
|
|
|
|
// ----------------------------------------------------------------------
|
|
// Construction/destruction
|
|
// ----------------------------------------------------------------------
|
|
public
|
|
constructor Create; overload;
|
|
constructor Create( ID: AnsiString); overload;
|
|
end;
|
|
|
|
implementation
|
|
|
|
// @@@: Construction/destruction ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
//
|
|
// Construction/destruction
|
|
//
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ================================================================================================
|
|
// Constructor
|
|
// ================================================================================================
|
|
constructor TGrammarSymbol.Create;
|
|
begin
|
|
fID := '';
|
|
end;
|
|
|
|
// ================================================================================================
|
|
// Constructor
|
|
// ================================================================================================
|
|
constructor TGrammarSymbol.Create(ID: AnsiString);
|
|
begin
|
|
fID := ID;
|
|
end;
|
|
|
|
// @@@: IdpgGrammarSymbol implementation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
//
|
|
// IdpgGrammarSymbol implementation
|
|
//
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
// ================================================================================================
|
|
// Get ID
|
|
// ================================================================================================
|
|
function TGrammarSymbol.GetID: AnsiString;
|
|
begin
|
|
result := fID;
|
|
end;
|
|
|
|
// ================================================================================================
|
|
// Set ID
|
|
// ================================================================================================
|
|
procedure TGrammarSymbol.SetID(pID: AnsiString);
|
|
begin
|
|
fID := pID;
|
|
end;
|
|
|
|
end.
|