Last change
on this file was 13, checked in by chronos, 10 years ago |
- Added: Basic parsing of "Depends on" expressions.
|
File size:
1.2 KB
|
Line | |
---|
1 | {$IFDEF INTERFACE}
|
---|
2 |
|
---|
3 | {$DEFINE TGListIndex := TGStackIndex}
|
---|
4 | {$DEFINE TGListItem := TGStackItem}
|
---|
5 | {$DEFINE TGList := TGStackList}
|
---|
6 | {$DEFINE INTERFACE}
|
---|
7 | {$I 'GenericList.inc'}
|
---|
8 |
|
---|
9 | // TGStack<TStackIndex, TStackItem> = class(TGList)
|
---|
10 | TGStack = class
|
---|
11 | private
|
---|
12 | FList: TGList;
|
---|
13 | public
|
---|
14 | procedure Push(Value: TGStackItem);
|
---|
15 | function Pop: TGStackItem;
|
---|
16 | constructor Create;
|
---|
17 | destructor Destroy; override;
|
---|
18 | property List: TGList read FList;
|
---|
19 | end;
|
---|
20 |
|
---|
21 | {$UNDEF INTERFACE}
|
---|
22 | {$ENDIF}
|
---|
23 |
|
---|
24 | {$IFDEF IMPLEMENTATION_USES}
|
---|
25 |
|
---|
26 | {$DEFINE IMPLEMENTATION_USES}
|
---|
27 | {$I 'GenericList.inc'}
|
---|
28 |
|
---|
29 | {$UNDEF IMPLEMENTATION_USES}
|
---|
30 | {$ENDIF}
|
---|
31 |
|
---|
32 | {$IFDEF IMPLEMENTATION}
|
---|
33 |
|
---|
34 | {$DEFINE TGListIndex := TGStackIndex}
|
---|
35 | {$DEFINE TGListItem := TGStackItem}
|
---|
36 | {$DEFINE TGList := TGStackList}
|
---|
37 | {$DEFINE IMPLEMENTATION}
|
---|
38 | {$I 'GenericList.inc'}
|
---|
39 |
|
---|
40 | { TGStack }
|
---|
41 |
|
---|
42 | procedure TGStack.Push(Value: TGStackItem);
|
---|
43 | begin
|
---|
44 | FList.Add(Value);
|
---|
45 | end;
|
---|
46 |
|
---|
47 | function TGStack.Pop: TGStackItem;
|
---|
48 | begin
|
---|
49 | Result := FList.Extract(FList.Last);
|
---|
50 | end;
|
---|
51 |
|
---|
52 | constructor TGStack.Create;
|
---|
53 | begin
|
---|
54 | FList := TGList.Create;
|
---|
55 | end;
|
---|
56 |
|
---|
57 | destructor TGStack.Destroy;
|
---|
58 | begin
|
---|
59 | FList.Free;
|
---|
60 | inherited Destroy;
|
---|
61 | end;
|
---|
62 |
|
---|
63 | {$UNDEF IMPLEMENTATION}
|
---|
64 | {$ENDIF}
|
---|
Note:
See
TracBrowser
for help on using the repository browser.