Changeset 43
- Timestamp:
- Aug 5, 2010, 4:17:18 PM (14 years ago)
- Location:
- branches/DelphiToC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Analyze/UPascalParser.pas
r42 r43 10 10 11 11 type 12 EEndOfData = class(Exception); 13 12 14 TPascalParser = class; 13 15 … … 24 26 TParserExpression = class 25 27 class function Parse(Parser: TPascalParser; SourceCode: TExpression): TExpression; 28 end; 29 30 { TParserUsedModuleList } 31 32 TParserUsedModuleList = class 33 class procedure Parse(Parser: TPascalParser; SourceCode: TUsedModuleList); 26 34 end; 27 35 … … 108 116 SRedefineIdentifier = 'Identificator "%s" redefinition.'; 109 117 STypeNotDefined = 'Type "%s" not defined.'; 118 SEndOfDataReached = 'Parser reached to end of input data.'; 119 110 120 111 121 { TPascalParser } … … 122 132 if NextCode <> Code then begin 123 133 ErrorMessage(SExpectedButFound, [Code, NextCode]); 134 135 // Recovery: try to find nearest same code 136 while NextCode <> Code do 137 ReadCode; 124 138 end; 125 139 ReadCode; … … 210 224 with SourceCodeText do 211 225 while Result = '' do begin 212 while IsWhiteSpace(Text[I]) do Inc(I); 226 while IsWhiteSpace(Text[I]) and (I < Length(Text)) do Inc(I); 227 if I = Length(Text) then 228 raise EEndOfData.Create(SEndOfDataReached); 213 229 J := I; 214 if Copy(Text, J, 1) = '//' then begin 230 if Copy(Text, J, 2) = '//' then begin 231 // Line comment 215 232 while (Text[I] <> #13) and (Text[I] <> #10) do Inc(I); 216 233 Result := ''; 217 234 end else 218 235 if Copy(Text, J, 1) = '{' then begin 236 // Block comment 1 219 237 while (Text[I] <> '}') do Inc(I); 220 238 Result := ''; 221 239 end else 222 if Copy(Text, J, 1) = '(*' then begin 240 if Copy(Text, J, 2) = '(*' then begin 241 // Block comment 2 223 242 while not((Text[I] = '*') and (Text[I + 1] = ')')) do Inc(I); 224 243 Result := ''; 225 244 end else 226 245 if Text[J] = '''' then begin 246 // String constant 227 247 I := J + 1; 228 248 while not ((Text[I] = '''') and (Text[I + 1] <> '''')) do Inc(I); 229 249 Inc(I); 230 Result := Copy(Text, J, I - J 250 Result := Copy(Text, J, I - J); 231 251 end else 232 252 if (Text[J] in SpecChar) then begin 253 // Special char token 233 254 if (Text[J + 1] in SpecChar) then begin 234 255 for II := 0 to High(DoubleSpecChar) do … … 245 266 end; 246 267 end else begin 247 while IsAlphanumeric(Text[I]) do Inc(I); 248 Result := LowerCase(Copy(Text, J, I - J)); 268 if IsAlphabetic(Text[I]) then begin 269 // Identifier 270 while IsAlphanumeric(Text[I]) do Inc(I); 271 Result := Copy(Text, J, I - J); 272 end else begin 273 while not IsWhiteSpace(Text[I]) do Inc(I); 274 Result := Copy(Text, J, I - J); 275 end; 249 276 end; 250 277 J := I; … … 472 499 end; 473 500 end; 474 475 (* begin476 Expect('if');477 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin478 Instruction := inConditionalJump;479 ExpressionTree := ParseCommonBlockExpression(CommonBlock);480 Negative := True;481 end;482 First := Operations[Operations.Count - 1];483 Expect('then');484 ParseCommonBlockOperation(CommonBlock);485 if NextCode = 'else' then begin486 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin487 Instruction := inJump;488 end;489 Second := Operations[Operations.Count - 1];490 First.GotoAddress := Operations.Count;491 Expect('else');492 ParseCommonBlockOperation(CommonBlock);493 Second.GotoAddress := Operations.Count;494 end else First.GotoAddress := Operations.Count;495 end496 else if NextCode = 'repeat' then begin497 Expect('repeat');498 StartIndex := Operations.Count;499 ParseCommonBlockOperation(CommonBlock);500 Expect('until');501 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin502 Instruction := inConditionalJump;503 ExpressionTree := ParseCommonBlockExpression(CommonBlock);504 GotoAddress := StartIndex;505 end;506 end507 else if NextCode = 'while' then begin508 Expect('while');509 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin510 Instruction := inConditionalJump;511 ExpressionTree := ParseCommonBlockExpression(CommonBlock);512 end;513 First := Operations[Operations.Count - 1];514 StartIndex := Operations.Count - 1;515 Expect('do');516 ParseCommonBlockOperation(CommonBlock);517 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin518 Instruction := inJump;519 GotoAddress := StartIndex;520 end;521 First.GotoAddress := Operations.Count;522 end523 else if NextCode = 'for' then begin524 Expect('for');525 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin526 Instruction := inExpressionEvaluation;527 ExpressionTree := ParseCommonBlockExpression(CommonBlock);528 if (ExpressionTree.NodeType <> ntOperator) and529 (ExpressionTree.OperatorName <> ':=') then ErrorMessage('Expected assigment in for loop');530 if TExpression(TExpression(ExpressionTree).SubItems[0]).NodeType <> ntVariable then531 ErrorMessage('Index in FOR loop have to be variable');532 LoopVaraible := TExpression(TExpression(ExpressionTree).SubItems[0]).Variable;533 end;534 Expect('to');535 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin536 Instruction := inExpressionEvaluation;537 ExpressionTree := TExpression.Create;538 with ExpressionTree do begin539 NodeType := ntOperator;540 OperatorName := '=';541 SubItems[0] := TExpression.Create;542 with TExpression(SubItems[0]) do begin543 NodeType := ntVariable;544 Variable := LoopVaraible;545 end;546 SubItems[1] := ParseCommonBlockExpression(CommonBlock);547 end;548 Negative := True;549 end;550 First := Operations[Operations.Count - 1];551 StartIndex := Operations.Count - 1;552 Expect('do');553 ParseCommonBlockOperation(CommonBlock);554 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin555 Instruction := inExpressionEvaluation;556 ExpressionTree := TExpression.Create;557 with ExpressionTree do begin558 NodeType := ntOperator;559 OperatorName := ':=';560 SubItems[0] := TExpression.Create;561 with TExpression(SubItems[0]) do begin562 NodeType := ntVariable;563 Variable := LoopVaraible;564 end;565 SubItems[1] := TExpression.Create;566 with TExpression(SubItems[1]) do begin567 NodeType := ntOperator;568 OperatorName := '+';569 SubItems[0] := TExpression.Create;570 with TExpression(SubItems[0]) do begin571 NodeType := ntVariable;572 Variable := LoopVaraible;573 end;574 SubItems[1] := TExpression.Create;575 with TExpression(SubItems[1]) do begin576 NodeType := ntConstant;577 //SetLength(Value, 1);578 //Value[0] := 1;579 Value := 1;580 end;581 end;582 end;583 end;584 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin585 Instruction := inJump;586 GotoAddress := StartIndex;587 end;588 First.GotoAddress := Operations.Count;589 end590 else begin591 with TOperation(Operations[Operations.Add(TOperation.Create)]) do begin592 Instruction := inExpressionEvaluation;593 ExpressionTree := ParseCommonBlockExpression(CommonBlock);594 end;595 end;596 *)597 501 end; 598 502 … … 623 527 624 528 // Uses section 625 if NextCode = 'uses' then begin 626 Identifier := ReadCode; 627 while NextCode = ',' do begin 628 Identifier := ReadCode; 629 630 end; 631 end; 529 if NextCode = 'uses' then 530 TParserUsedModuleList.Parse(Parser, UsedModules); 531 632 532 TParserCommonBlock.Parse(Parser, SourceCode, '.'); 633 533 end; … … 912 812 end; 913 813 814 { TParserUsedModuleList } 815 816 class procedure TParserUsedModuleList.Parse(Parser: TPascalParser; 817 SourceCode: TUsedModuleList); 818 var 819 NewUsedModule: TUsedModule; 820 begin 821 with Parser do begin 822 Expect('uses'); 823 with TUsedModule(SourceCode.Items[SourceCode.Add(TUsedModule.Create)]) do begin 824 Name := ReadCode; 825 end; 826 while NextCode = ',' do begin 827 Expect(','); 828 with TUsedModule(SourceCode.Items[SourceCode.Add(TUsedModule.Create)]) do begin 829 Name := ReadCode; 830 end; 831 end; 832 Expect(';'); 833 end; 834 end; 835 914 836 end. -
branches/DelphiToC/DelphiToC.lpi
r42 r43 40 40 <Filename Value="DelphiToC.lpr"/> 41 41 <IsPartOfProject Value="True"/> 42 <IsVisibleTab Value="True"/> 42 43 <EditorIndex Value="11"/> 43 44 <WindowIndex Value="0"/> 44 <TopLine Value=" 3"/>45 <CursorPos X=" 39" Y="12"/>46 <UsageCount Value="6 4"/>45 <TopLine Value="4"/> 46 <CursorPos X="27" Y="16"/> 47 <UsageCount Value="66"/> 47 48 <Loaded Value="True"/> 48 49 </Unit0> … … 58 59 <TopLine Value="69"/> 59 60 <CursorPos X="1" Y="91"/> 60 <UsageCount Value="6 4"/>61 <UsageCount Value="66"/> 61 62 <Loaded Value="True"/> 62 63 <LoadedDesigner Value="True"/> … … 69 70 <TopLine Value="1"/> 70 71 <CursorPos X="1" Y="1"/> 71 <UsageCount Value="6 4"/>72 <UsageCount Value="66"/> 72 73 </Unit2> 73 74 <Unit3> … … 77 78 <EditorIndex Value="5"/> 78 79 <WindowIndex Value="0"/> 79 <TopLine Value=" 264"/>80 <CursorPos X=" 59" Y="277"/>81 <UsageCount Value="6 4"/>80 <TopLine Value="15"/> 81 <CursorPos X="19" Y="34"/> 82 <UsageCount Value="66"/> 82 83 <Loaded Value="True"/> 83 84 </Unit3> … … 88 89 <EditorIndex Value="10"/> 89 90 <WindowIndex Value="0"/> 90 <TopLine Value=" 38"/>91 <CursorPos X=" 38" Y="13"/>92 <UsageCount Value="6 4"/>91 <TopLine Value="25"/> 92 <CursorPos X="21" Y="38"/> 93 <UsageCount Value="66"/> 93 94 <Loaded Value="True"/> 94 95 </Unit4> … … 101 102 <TopLine Value="1"/> 102 103 <CursorPos X="9" Y="12"/> 103 <UsageCount Value="6 4"/>104 <UsageCount Value="66"/> 104 105 <Loaded Value="True"/> 105 106 </Unit5> … … 112 113 <TopLine Value="1"/> 113 114 <CursorPos X="1" Y="1"/> 114 <UsageCount Value="6 4"/>115 <UsageCount Value="66"/> 115 116 <Loaded Value="True"/> 116 117 </Unit6> … … 119 120 <IsPartOfProject Value="True"/> 120 121 <UnitName Value="UCSource"/> 121 <IsVisibleTab Value="True"/>122 122 <EditorIndex Value="9"/> 123 123 <WindowIndex Value="0"/> 124 <TopLine Value=" 156"/>125 <CursorPos X="6 7" Y="164"/>126 <UsageCount Value="6 4"/>124 <TopLine Value="75"/> 125 <CursorPos X="63" Y="89"/> 126 <UsageCount Value="66"/> 127 127 <Loaded Value="True"/> 128 128 </Unit7> … … 133 133 <EditorIndex Value="0"/> 134 134 <WindowIndex Value="0"/> 135 <TopLine Value="1 48"/>136 <CursorPos X=" 25" Y="153"/>137 <UsageCount Value="6 4"/>135 <TopLine Value="136"/> 136 <CursorPos X="1" Y="149"/> 137 <UsageCount Value="66"/> 138 138 <Loaded Value="True"/> 139 139 </Unit8> … … 153 153 <TopLine Value="68"/> 154 154 <CursorPos X="14" Y="90"/> 155 <UsageCount Value="3 2"/>155 <UsageCount Value="33"/> 156 156 <Loaded Value="True"/> 157 157 </Unit10> … … 170 170 <TopLine Value="61"/> 171 171 <CursorPos X="7" Y="68"/> 172 <UsageCount Value="1 5"/>172 <UsageCount Value="16"/> 173 173 <Loaded Value="True"/> 174 174 </Unit12> … … 179 179 <TopLine Value="139"/> 180 180 <CursorPos X="16" Y="146"/> 181 <UsageCount Value="1 5"/>181 <UsageCount Value="16"/> 182 182 <Loaded Value="True"/> 183 183 </Unit13> … … 194 194 <TopLine Value="834"/> 195 195 <CursorPos X="11" Y="847"/> 196 <UsageCount Value=" 10"/>196 <UsageCount Value="9"/> 197 197 </Unit15> 198 198 <Unit16> … … 211 211 <TopLine Value="112"/> 212 212 <CursorPos X="1" Y="128"/> 213 <UsageCount Value="2 6"/>213 <UsageCount Value="28"/> 214 214 <Loaded Value="True"/> 215 215 </Unit17> … … 225 225 <JumpHistory Count="30" HistoryIndex="29"> 226 226 <Position1> 227 <Filename Value=" Produce\UCSource.pas"/>228 <Caret Line="23 " Column="48" TopLine="9"/>227 <Filename Value="Analyze\UPascalParser.pas"/> 228 <Caret Line="234" Column="1" TopLine="213"/> 229 229 </Position1> 230 230 <Position2> 231 <Filename Value=" Produce\UCSource.pas"/>232 <Caret Line="2 6" Column="1" TopLine="10"/>231 <Filename Value="Analyze\UPascalParser.pas"/> 232 <Caret Line="238" Column="1" TopLine="217"/> 233 233 </Position2> 234 234 <Position3> 235 <Filename Value=" Produce\UCSource.pas"/>236 <Caret Line="2 7" Column="59" TopLine="11"/>235 <Filename Value="Analyze\UPascalParser.pas"/> 236 <Caret Line="242" Column="1" TopLine="221"/> 237 237 </Position3> 238 238 <Position4> 239 <Filename Value=" Produce\UCSource.pas"/>240 <Caret Line="2 8" Column="66" TopLine="11"/>239 <Filename Value="Analyze\UPascalParser.pas"/> 240 <Caret Line="248" Column="1" TopLine="235"/> 241 241 </Position4> 242 242 <Position5> 243 <Filename Value=" Produce\UCSource.pas"/>244 <Caret Line=" 136" Column="3" TopLine="127"/>243 <Filename Value="Analyze\UPascalParser.pas"/> 244 <Caret Line="264" Column="1" TopLine="251"/> 245 245 </Position5> 246 246 <Position6> 247 <Filename Value=" Produce\UCSource.pas"/>248 <Caret Line=" 85" Column="14" TopLine="76"/>247 <Filename Value="Analyze\UPascalParser.pas"/> 248 <Caret Line="266" Column="1" TopLine="251"/> 249 249 </Position6> 250 250 <Position7> 251 <Filename Value=" Produce\UCSource.pas"/>252 <Caret Line=" 91" Column="38" TopLine="78"/>251 <Filename Value="Analyze\UPascalParser.pas"/> 252 <Caret Line="225" Column="1" TopLine="212"/> 253 253 </Position7> 254 254 <Position8> 255 <Filename Value=" Produce\UCSource.pas"/>256 <Caret Line=" 92" Column="39" TopLine="79"/>255 <Filename Value="Analyze\UPascalParser.pas"/> 256 <Caret Line="227" Column="1" TopLine="212"/> 257 257 </Position8> 258 258 <Position9> 259 <Filename Value=" Produce\UCSource.pas"/>260 <Caret Line=" 83" Column="53" TopLine="78"/>259 <Filename Value="Analyze\UPascalParser.pas"/> 260 <Caret Line="229" Column="1" TopLine="212"/> 261 261 </Position9> 262 262 <Position10> 263 <Filename Value=" UPascalSource.pas"/>264 <Caret Line=" 61" Column="26" TopLine="48"/>263 <Filename Value="Analyze\UPascalParser.pas"/> 264 <Caret Line="230" Column="1" TopLine="212"/> 265 265 </Position10> 266 266 <Position11> 267 <Filename Value=" UPascalSource.pas"/>268 <Caret Line=" 64" Column="28" TopLine="52"/>267 <Filename Value="Analyze\UPascalParser.pas"/> 268 <Caret Line="234" Column="1" TopLine="213"/> 269 269 </Position11> 270 270 <Position12> 271 <Filename Value=" UPascalSource.pas"/>272 <Caret Line="23 " Column="11" TopLine="10"/>271 <Filename Value="Analyze\UPascalParser.pas"/> 272 <Caret Line="238" Column="1" TopLine="217"/> 273 273 </Position12> 274 274 <Position13> 275 <Filename Value=" UPascalSource.pas"/>276 <Caret Line=" 376" Column="17" TopLine="373"/>275 <Filename Value="Analyze\UPascalParser.pas"/> 276 <Caret Line="242" Column="1" TopLine="221"/> 277 277 </Position13> 278 278 <Position14> 279 <Filename Value=" Produce\UCSource.pas"/>280 <Caret Line=" 83" Column="53" TopLine="78"/>279 <Filename Value="Analyze\UPascalParser.pas"/> 280 <Caret Line="248" Column="1" TopLine="235"/> 281 281 </Position14> 282 282 <Position15> 283 <Filename Value=" Produce\UCSource.pas"/>284 <Caret Line=" 150" Column="1" TopLine="134"/>283 <Filename Value="Analyze\UPascalParser.pas"/> 284 <Caret Line="263" Column="18" TopLine="251"/> 285 285 </Position15> 286 286 <Position16> 287 <Filename Value=" Produce\UCSource.pas"/>288 <Caret Line="14 7" Column="36" TopLine="134"/>287 <Filename Value="Analyze\UPascalParser.pas"/> 288 <Caret Line="149" Column="3" TopLine="147"/> 289 289 </Position16> 290 290 <Position17> 291 <Filename Value=" Produce\UCSource.pas"/>292 <Caret Line=" 18" Column="38" TopLine="15"/>291 <Filename Value="Analyze\UPascalParser.pas"/> 292 <Caret Line="266" Column="1" TopLine="253"/> 293 293 </Position17> 294 294 <Position18> 295 295 <Filename Value="Analyze\UPascalParser.pas"/> 296 <Caret Line=" 7" Column="34" TopLine="1"/>296 <Caret Line="225" Column="1" TopLine="212"/> 297 297 </Position18> 298 298 <Position19> 299 299 <Filename Value="Analyze\UPascalParser.pas"/> 300 <Caret Line=" 53" Column="21" TopLine="40"/>300 <Caret Line="227" Column="1" TopLine="212"/> 301 301 </Position19> 302 302 <Position20> 303 303 <Filename Value="Analyze\UPascalParser.pas"/> 304 <Caret Line=" 54" Column="74" TopLine="40"/>304 <Caret Line="229" Column="1" TopLine="212"/> 305 305 </Position20> 306 306 <Position21> 307 307 <Filename Value="Analyze\UPascalParser.pas"/> 308 <Caret Line=" 61" Column="21" TopLine="40"/>308 <Caret Line="230" Column="1" TopLine="212"/> 309 309 </Position21> 310 310 <Position22> 311 311 <Filename Value="Analyze\UPascalParser.pas"/> 312 <Caret Line=" 62" Column="74" TopLine="40"/>312 <Caret Line="234" Column="1" TopLine="213"/> 313 313 </Position22> 314 314 <Position23> 315 315 <Filename Value="Analyze\UPascalParser.pas"/> 316 <Caret Line=" 69" Column="21" TopLine="56"/>316 <Caret Line="238" Column="1" TopLine="217"/> 317 317 </Position23> 318 318 <Position24> 319 319 <Filename Value="Analyze\UPascalParser.pas"/> 320 <Caret Line=" 70" Column="74" TopLine="56"/>320 <Caret Line="242" Column="1" TopLine="221"/> 321 321 </Position24> 322 322 <Position25> 323 323 <Filename Value="Analyze\UPascalParser.pas"/> 324 <Caret Line=" 73" Column="17" TopLine="56"/>324 <Caret Line="248" Column="1" TopLine="235"/> 325 325 </Position25> 326 326 <Position26> 327 327 <Filename Value="Analyze\UPascalParser.pas"/> 328 <Caret Line=" 74" Column="70" TopLine="56"/>328 <Caret Line="149" Column="1" TopLine="136"/> 329 329 </Position26> 330 330 <Position27> 331 331 <Filename Value="Analyze\UPascalParser.pas"/> 332 <Caret Line=" 88" Column="31" TopLine="75"/>332 <Caret Line="150" Column="1" TopLine="136"/> 333 333 </Position27> 334 334 <Position28> 335 335 <Filename Value="Analyze\UPascalParser.pas"/> 336 <Caret Line=" 89" Column="16" TopLine="75"/>336 <Caret Line="250" Column="36" TopLine="228"/> 337 337 </Position28> 338 338 <Position29> 339 <Filename Value=" Analyze\UPascalParser.pas"/>340 <Caret Line=" 307" Column="22" TopLine="294"/>339 <Filename Value="DelphiToC.lpr"/> 340 <Caret Line="12" Column="39" TopLine="3"/> 341 341 </Position29> 342 342 <Position30> 343 <Filename Value=" Analyze\UPascalParser.pas"/>344 <Caret Line="1 53" Column="25" TopLine="148"/>343 <Filename Value="DelphiToC.lpr"/> 344 <Caret Line="16" Column="38" TopLine="4"/> 345 345 </Position30> 346 346 </JumpHistory> … … 383 383 </CompilerOptions> 384 384 <Debugging> 385 <BreakPoints Count="1"> 386 <Item1> 387 <Source Value="Analyze\UPascalParser.pas"/> 388 <Line Value="456"/> 389 </Item1> 390 </BreakPoints> 385 391 <Exceptions Count="3"> 386 392 <Item1> -
branches/DelphiToC/Example.pas
r42 r43 1 1 program Test; 2 3 uses System, Crt; 2 4 3 5 procedure Pokus(A: Byte); … … 26 28 end; 27 29 while A < 1 do A := A + 1; 30 31 32 { 33 Block comment 2 34 } 35 WriteLn; 28 36 end. -
branches/DelphiToC/Produce/UCSource.pas
r42 r43 18 18 function TranslateOperator(Name: string): string; 19 19 procedure Emit(Text: string); 20 procedure GenerateUses(UsedModules: TUsedModuleList); 21 procedure GenerateModule(Module: TModule); 20 22 procedure GenerateCommonBlock(CommonBlock: TCommonBlock; 21 23 LabelPrefix: string); … … 80 82 end; 81 83 84 procedure TCProducer.GenerateUses(UsedModules: TUsedModuleList); 85 var 86 I: Integer; 87 begin 88 for I := 0 to UsedModules.Count - 1 do 89 Emit('#include "' + TUsedModule(UsedModules[I]).Name + '.h"'); 90 Emit(''); 91 end; 92 93 procedure TCProducer.GenerateModule(Module: TModule); 94 begin 95 GenerateUses(Module.UsedModules); 96 GenerateCommonBlock(Module, ''); 97 end; 98 82 99 procedure TCProducer.Produce; 83 100 begin … … 94 111 with ProgramBlock do 95 112 for I := 0 to Modules.Count - 1 do 96 Generate CommonBlock(TModule(Modules[I]), '');113 GenerateModule(TModule(Modules[I])); 97 114 end; 98 115 -
branches/DelphiToC/UPascalCompiler.pas
r40 r43 33 33 begin 34 34 Parser.CodePosition := 1; 35 TParserProgram.Parse(Parser, ProgramCode); 35 try 36 TParserProgram.Parse(Parser, ProgramCode); 37 except 38 on EEndOfData do ; 39 end; 36 40 Producer.Produce; 37 41 end; -
branches/DelphiToC/UPascalSource.pas
r42 r43 32 32 TVariable = class; 33 33 TConstant = class; 34 TModule = class; 34 35 35 36 TDevice = class … … 252 253 end; 253 254 255 TUsedModule = class 256 Name: string; 257 Module: TModule; 258 end; 259 260 TUsedModuleList = class(TObjectList) 261 end; 262 254 263 TModule = class(TCommonBlock) 255 264 public 256 265 ModuleType: TModuleType; 257 UsedModules: T ObjectList; // TObjectList<TModule>266 UsedModules: TUsedModuleList; 258 267 constructor Create; override; 259 268 procedure Clear; … … 349 358 begin 350 359 inherited; 351 UsedModules := T ObjectList.Create;360 UsedModules := TUsedModuleList.Create; 352 361 end; 353 362
Note:
See TracChangeset
for help on using the changeset viewer.