Changeset 77 for branches/Transpascal/Compiler/UCompiler.pas
- Timestamp:
- Oct 22, 2010, 9:22:55 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Transpascal/Compiler/UCompiler.pas
r76 r77 8 8 SysUtils, Variants, Classes, 9 9 Dialogs, USourceCode, UProducer, UPascalParser, UParser, 10 UProducerC, Contnrs; 10 UProducerDynamicC, Contnrs, UProducerTreeView, UProducerASM8051, 11 UProducerPascal, UProducerGCCC; 11 12 12 13 type 14 TProducerType = (ptGCCC, ptDynamicC, ptPascal, ptAssembler, ptXML); 13 15 14 16 TErrorMessage = class … … 33 35 private 34 36 FOnErrorMessage: TErrorMessageEvent; 37 FProducerType: TProducerType; 35 38 procedure ErrorMessage(Text: string; Position: TPoint; FileName: string); 39 procedure SetProducerType(const AValue: TProducerType); 36 40 public 37 41 ProgramCode: TProgram; … … 49 53 property OnErrorMessage: TErrorMessageEvent read FOnErrorMessage 50 54 write FOnErrorMessage; 55 property ProducerType: TProducerType read FProducerType 56 write SetProducerType; 51 57 end; 58 59 const 60 ProducerTypeName: array[TProducerType] of string = ( 61 'GCC C', 'Rabbit Dynamic C', 'Generic Pascal', 'Assembler', 'XML'); 62 52 63 53 64 implementation … … 93 104 94 105 ProgramCode := TProgram.Create; 95 Producer := TProducer C.Create;106 Producer := TProducerGCCC.Create; 96 107 Parser := TPascalParser.Create; 97 108 Parser.OnErrorMessage := ErrorMessage; … … 127 138 end; 128 139 140 procedure TCompiler.SetProducerType(const AValue: TProducerType); 141 begin 142 if FProducerType = AValue then Exit; 143 FProducerType := AValue; 144 Producer.Free; 145 case AValue of 146 ptGCCC: Producer := TProducerGCCC.Create; 147 ptDynamicC: Producer := TProducerDynamicC.Create; 148 ptPascal: Producer := TProducerPascal.Create; 149 ptAssembler: Producer := TProducerGCCC.Create; 150 ptXML: Producer := TProducerTreeView.Create; 151 end; 152 end; 153 129 154 { TCompilerTargetList } 130 155
Note:
See TracChangeset
for help on using the changeset viewer.