home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
UNITS
/
NodeStack.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-03-10
|
778b
|
36 lines
{Stack of parse tree nodes}
unit NodeStack;
interface
uses
PrseTree,Classes;
type TNodeStack=class
protected
fBody:TList;
public
constructor Create;
destructor Destroy;override;
procedure Push(a:PNode);
function Pop:PNode;
end;
implementation
constructor TNodeStack.Create;
begin
fBody:=TList.Create;
end;
destructor TNodeStack.Destroy;
begin
fBody.Free;
end;
procedure TNodeStack.Push;
begin
fBody.Add(a);
end;
function TNodeStack.Pop;
begin
Result:=fBody[fBody.Count-1];
fBody.Delete(fBody.Count-1);
end;
end.