source: branches/Void/UOutputGenerator.pas

Last change on this file was 16, checked in by george, 15 years ago
  • Upraveno: Rozdělení jednotek pro generování výstupů do samostatných souborů.
  • Přidáno: Generátor kódu pro procesor Z80.
  • Přidáno: Parsování celých čísel.
File size: 815 bytes
Line 
1unit UOutputGenerator;
2
3{$mode Delphi}{$H+}
4
5interface
6
7uses
8 Classes, SysUtils, UModel, StrUtils;
9
10type
11 TOutputGenerator = class
12 private
13 public
14 Model: TModel;
15 IndentCount: Integer;
16 Output: TStringList;
17 function Indent: string;
18 procedure Generate(Model: TModel); virtual;
19 constructor Create;
20 destructor Destroy; override;
21 end;
22
23 implementation
24
25{ TOutputGenerator }
26
27function TOutputGenerator.Indent: string;
28begin
29 Result := DupeString(' ', IndentCount);
30end;
31
32procedure TOutputGenerator.Generate(Model: TModel);
33begin
34 Self.Model := Model;
35end;
36
37constructor TOutputGenerator.Create;
38begin
39 Output := TStringList.Create;
40end;
41
42destructor TOutputGenerator.Destroy;
43begin
44 Output.Destroy;
45 inherited Destroy;
46end;
47
48end.
49
50
Note: See TracBrowser for help on using the repository browser.