Initial check in lib

This commit is contained in:
2026-01-03 18:33:48 +01:00
parent b20cd8e688
commit 5666f85e99
89 changed files with 36370 additions and 1 deletions
+58
View File
@@ -0,0 +1,58 @@
unit dpglib.OneOrMoreBlock;
interface
uses
dpgrtl.types,
dpglib.types,
dpglib.BlockWithImpliedExitPath;
type
// =========================================================================
// Class TOneOrMoreBlock declaration
// =========================================================================
TOneOrMoreBlock = class( TBlockWithImpliedExitPath,
IOneOrMoreBlock,
IBlockWithImpliedExitPath,
IAlternativeBlock,
IAlternativeElem,
IGrammarElem)
// ----------------------------------------------------------------------
// IGrammarElem overrides
// ----------------------------------------------------------------------
public
procedure Generate;
function Look( pK: integer): ILookahead;
function AsString : AnsiString;
end;
implementation
// ****************************************************************************
// IGrammarElem overrides
// ****************************************************************************
// ============================================================================
// Generate
// ============================================================================
procedure TOneOrMoreBlock.Generate;
begin
fGrammar.Generator.Gen( self);
end;
// ============================================================================
// Look
// ============================================================================
function TOneOrMoreBlock.Look(pK: integer): ILookahead;
begin
result := fGrammar.LLkAnalyzer.Look( pK, self);
end;
// ============================================================================
// ToString
// ============================================================================
function TOneOrMoreBlock.AsString: AnsiString;
begin
result := inherited AsString + '+';
end;
end.