Changeset 55 for branches/DelphiToC/UCompiler.pas
- Timestamp:
- Aug 10, 2010, 1:48:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/UCompiler.pas
r54 r55 15 15 Text: string; 16 16 Position: TPoint; 17 FileName: string; 17 18 end; 18 19 … … 22 23 private 23 24 FOnErrorMessage: TOnErrorMessage; 25 FFileName: string; 24 26 procedure ErrorMessage(Text: string; Position: TPoint); 25 27 public … … 30 32 constructor Create; 31 33 procedure Init; 32 procedure Compile( Source: TStringList; ProducedCode: TStringList);34 procedure Compile(ModuleName: string; Source: TStringList; ProducedCode: TStringList); 33 35 destructor Destroy; override; 34 property OnErrorMessage: TOnErrorMessage read FOnErrorMessage write FOnErrorMessage; 36 property OnErrorMessage: TOnErrorMessage read FOnErrorMessage 37 write FOnErrorMessage; 35 38 end; 36 39 … … 39 42 { TCompiler } 40 43 41 procedure TCompiler.Compile( Source: TStringList; ProducedCode: TStringList);44 procedure TCompiler.Compile(ModuleName: string; Source: TStringList; ProducedCode: TStringList); 42 45 var 43 46 NewModule: TModule; 44 47 begin 48 FFileName := ModuleName; 45 49 Parser.SourceCodeText := Source; 46 50 Parser.Init; 47 NewModule := TModule.Create; 48 ProgramCode.Modules.Add(NewModule); 49 Parser.ParseModule(NewModule); 51 ProgramCode.Modules.Add(Parser.ParseModule); 50 52 Producer.Produce(NewModule, ProducedCode); 51 53 end; … … 81 83 NewMessage.Text := Text; 82 84 NewMessage.Position := Position; 85 NewMessage.FileName := FFileName; 83 86 ErrorMessages.Add(NewMessage); 84 87 if Assigned(FOnErrorMessage) then FOnErrorMessage(Text, Position);
Note:
See TracChangeset
for help on using the changeset viewer.