Initial check in lib
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
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.
|
||||
Reference in New Issue
Block a user