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

61 lines
2.3 KiB
ObjectPascal

unit dpglib.ZeroOrMoreBlock;
interface
uses
dpgrtl.types,
dpglib.types,
dpglib.BlockWithImpliedExitPath;
type
TZeroOrMoreBlock = class( TBlockWithImpliedExitPath,
IZeroOrMoreBlock,
IBlockWithImpliedExitPath,
IAlternativeBlock,
IAlternativeElem,
IGrammarElem)
// ----------------------------------------------------------------------
// IGrammarElem overrides
// ----------------------------------------------------------------------
public
procedure Generate;
function Look( pK: integer): ILookahead;
function AsString : AnsiString;
end;
implementation
// @@@: IGrammarElem overrides ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// IGrammarElem overrides
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ================================================================================================
// Generate
// ================================================================================================
procedure TZeroOrMoreBlock.Generate;
begin
fGrammar.Generator.Gen( self);
end;
// ================================================================================================
// Look
// ================================================================================================
function TZeroOrMoreBlock.Look(pK: integer): ILookahead;
begin
result := fGrammar.LLkAnalyzer.Look( pK, self)
end;
// ================================================================================================
// AsString
// ================================================================================================
function TZeroOrMoreBlock.AsString: AnsiString;
begin
result := inherited AsString + '*'
end;
end.