Initial check in lib
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
unit dpglib.SynPredBlock;
|
||||
|
||||
interface
|
||||
uses
|
||||
dpgrtl.types,
|
||||
dpglib.types,
|
||||
dpglib.AlternativeBlock;
|
||||
|
||||
type
|
||||
// =========================================================================
|
||||
// Class TSynPredBlock declaration
|
||||
// =========================================================================
|
||||
TSynPredBlock = class( TAlternativeBlock,
|
||||
ISynPredBlock,
|
||||
IAlternativeBlock,
|
||||
IAlternativeElem,
|
||||
IGrammarElem)
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// IGrammarElem overrides
|
||||
// ---------------------------------------------------------------
|
||||
public
|
||||
procedure Generate;
|
||||
function Look( pK: integer): ILookahead;
|
||||
function AsString : AnsiString;
|
||||
end;
|
||||
|
||||
implementation
|
||||
uses
|
||||
dpglib.lookahead;
|
||||
|
||||
// ****************************************************************************
|
||||
// IGrammarElem overrides
|
||||
// ****************************************************************************
|
||||
// ----------------------------------------------------------------------------
|
||||
// Generate
|
||||
// ----------------------------------------------------------------------------
|
||||
procedure TSynPredBlock.Generate;
|
||||
begin
|
||||
fGrammar.Generator.Gen( self);
|
||||
end;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Look
|
||||
// ----------------------------------------------------------------------------
|
||||
function TSynPredBlock.Look(pK: integer): ILookahead;
|
||||
begin
|
||||
result := TLookahead.Create;
|
||||
// result := fGrammar.LLkAnalyzer.Look( pK, self);
|
||||
end;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ToString
|
||||
// ----------------------------------------------------------------------------
|
||||
function TSynPredBlock.AsString: AnsiString;
|
||||
begin
|
||||
result := inherited AsString + '=>';
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user