Changeset 38 for branches/DelphiToC
- Timestamp:
- Aug 5, 2010, 8:47:21 AM (14 years ago)
- Location:
- branches/DelphiToC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Analyze/UPascalParser.pas
r37 r38 14 14 TOnErrorMessage = procedure (Text: string) of object; 15 15 16 TParserCommand = class(TCommonBlock)17 function Parse(Parser: TPascalParser): TCommand;18 end;19 20 16 TParserWhileDo = class(TWhileDo) 21 17 procedure Parse(Parser: TPascalParser); … … 38 34 TParserCommonBlock = class(TCommonBlock) 39 35 procedure Parse(Parser: TPascalParser; EndSymbol: Char = ';'); 36 function ParseCommand(Parser: TPascalParser): TCommand; 40 37 end; 41 38 … … 76 73 ProgramCode: TProgram; 77 74 FOnErrorMessage: TOnErrorMessage; 78 procedure ErrorMessage( Text: string);75 procedure ErrorMessage(const Text: string; const Arguments: array of const); 79 76 public 80 77 CodePosition: Integer; … … 95 92 implementation 96 93 94 resourcestring 95 SUnknownIdentifier = 'Unknown identificator "%s".'; 96 SExpectedButFound = 'Expected "%s" but "%s" found.'; 97 SRedefineIdentifier = 'Identificator "%s" redefinition.'; 98 STypeNotDefined = 'Type "%s" not defined.'; 99 97 100 { TPascalParser } 98 101 99 procedure TPascalParser.ErrorMessage(Text: string); 100 begin 101 if Assigned(FOnErrorMessage) then FOnErrorMessage(Text); 102 procedure TPascalParser.ErrorMessage(const Text: string; const Arguments: array of const); 103 begin 104 if Assigned(FOnErrorMessage) then 105 FOnErrorMessage(Format(Text, Arguments)); 102 106 end; 103 107 … … 106 110 Log('Expected: ' + Code + ' Readed: ' + NextCode); 107 111 if NextCode <> Code then begin 108 ErrorMessage( 'Expected ' + Code + ' but ' + NextCode + ' found.');112 ErrorMessage(SExpectedButFound, [Code, NextCode]); 109 113 end; 110 114 ReadCode; … … 252 256 TParserExpression(Condition).Parse(Parser); 253 257 Expect('do'); 254 TParserCommand(Command).Parse(Parser);258 Command := TParserCommonBlock(CommonBlock).ParseCommand(Parser); 255 259 end; 256 260 end; … … 262 266 Identifier: string; 263 267 NewVariable: TVariable; 268 NewExpression: TExpression; 264 269 Method: TFunction; 265 270 Constant: TConstant; … … 269 274 II: Integer; 270 275 begin 271 (*Expressions := TExpressionList.Create;276 Expressions := TExpressionList.Create; 272 277 Expressions.Add(TExpression.Create); 273 278 with Parser do begin … … 276 281 Identifier := ReadCode; 277 282 if Identifier = '(' then begin 283 // Subexpression 278 284 with TExpression(Expressions[Expressions.Count - 1]) do begin 279 //SubItems[1] := TParserExpression(Self).Parse(Parser); 285 SubItems[1] := TExpression.Create; 286 TParserExpression(SubItems[1]).Parse(Parser); 280 287 end; 281 288 with TExpression(Expressions.Items[Expressions.Add(TExpression.Create)]) do begin … … 285 292 end else 286 293 if IsOperator(Identifier) then begin 294 // Operator 287 295 TExpression(Expressions[Expressions.Count - 1]).OperatorName := Identifier; 288 296 TExpression(Expressions[Expressions.Count - 1]).NodeType := ntOperator; 289 297 end else 290 298 if IsIdentificator(Identifier) then begin 291 NewVariable := Variables.Search(Identifier); 299 // Reference to identificator 300 NewVariable := CommonBlock.Variables.Search(Identifier); 292 301 if Assigned(NewVariable) then begin 302 // Referenced variable 293 303 with TExpression(Expressions[Expressions.Count - 1]) do begin 294 304 SubItems[1] := TExpression.Create; … … 300 310 end; 301 311 end else begin 302 Method := Methods.Search(Identifier);312 Method := CommonBlock.Methods.Search(Identifier); 303 313 if Assigned(Method) then begin 314 // Referenced method 304 315 with TExpression(Expressions[Expressions.Count - 1]) do begin 305 316 SubItems[1] := TExpression.Create; … … 307 318 with TExpression(SubItems[1]) do begin 308 319 Expect('('); 309 SubItems.Add(ParseCommonBlockExpression(CommonBlock)); 320 NewExpression := TExpression.Create; 321 NewExpression.CommonBlock := CommonBlock; 322 TParserExpression(NewExpression).Parse(Parser); 323 SubItems.Add(NewExpression); 310 324 while NextCode = ',' do begin 311 325 Expect(','); 312 SubItems.Add(ParseCommonBlockExpression(CommonBlock)); 326 NewExpression := TExpression.Create; 327 NewExpression.CommonBlock := CommonBlock; 328 TParserExpression(NewExpression).Parse(Parser); 329 SubItems.Add(NewExpression); 313 330 end; 314 331 Expect(')'); … … 321 338 end; 322 339 end else begin 323 Constant := Co nstants.Search(Identifier);340 Constant := CommonBlock.Constants.Search(Identifier); 324 341 if Assigned(Constant) then begin 342 // Referenced constant 325 343 with TExpression(Expressions[Expressions.Count - 1]) do begin 326 344 SubItems[1] := TExpression.Create; … … 332 350 end; 333 351 end else begin 334 ErrorMessage( 'Neznámý identifikátor: ' + Identifier);352 ErrorMessage(SUnknownIdentifier, [Identifier]); 335 353 end; 336 354 end; … … 338 356 end else 339 357 begin 358 // Constant value 340 359 with TExpression(Expressions[Expressions.Count - 1]) do begin 341 360 SubItems[1] := TExpression.Create; … … 372 391 end; 373 392 end; 374 Result := TExpression( Expressions[0]).SubItems[1];393 Result := TExpression(TExpression(Expressions[0]).SubItems[1]); 375 394 TExpression(Expressions[0]).SubItems[1] := nil; 376 395 TExpression(Expressions[1]).SubItems[0] := nil; 377 396 Expressions.Destroy; 378 *) 379 end; 380 381 { TParserCommand } 382 383 function TParserCommand.Parse(Parser: TPascalParser): TCommand; 397 end; 398 399 function TParserCommonBlock.ParseCommand(Parser: TPascalParser): TCommand; 384 400 var 385 401 Identifier: string; … … 395 411 if NextCode = 'begin' then begin 396 412 Result := TBeginEnd.Create; 413 Result.CommonBlock := Self; 397 414 TParserBeginEnd(Result).Parse(Parser); 398 415 end else 399 416 if NextCode = 'if' then begin 400 Result := TIfThenElse.Create; 417 Result := TIfThenElse.Create; 418 Result.CommonBlock := Self; 401 419 TParserIfThenElse(Result).Parse(Parser); 402 420 end else 403 421 if NextCode = 'while' then begin 404 422 Result := TWhileDo.Create; 423 Result.CommonBlock := Self; 405 424 TParserWhileDo(Result).Parse(Parser); 406 425 end else … … 408 427 if Assigned(Variables.Search(NextCode)) then begin 409 428 Result := TAssignment.Create; 429 Result.CommonBlock := Self; 410 430 IdentName := ReadCode; 411 431 TAssignment(Result).Target := Variables.Search(IdentName); 412 432 Expect(':='); 413 TAssignment(Result).Source := TParserExpression(Result).Parse(Parser); 433 TAssignment(Result).Source := TExpression.Create; 434 TAssignment(Result).Source.CommonBlock := Self; 435 TParserExpression(TAssignment(Result).Source).Parse(Parser); 414 436 end else 415 437 if Assigned(Methods.Search(NextCode)) then begin 416 438 Result := TMethodCall.Create; 439 Result.CommonBlock := Self; 417 440 // ParseMetVariable(TMethodCall(Result).Target); 418 441 end; … … 657 680 Expect('begin'); 658 681 while NextCode <> 'end' do begin 659 NewCommand := TParserComm and(Self).Parse(Parser);682 NewCommand := TParserCommonBlock(CommonBlock).ParseCommand(Parser); 660 683 if Assigned(NewCommand) then Commands.Add(NewCommand); 661 684 //ShowMessage(NextCode); … … 696 719 Identifiers.Add(ReadCode); 697 720 end; 698 end else ErrorMessage( 'Pøedefinování existující promìnné.');721 end else ErrorMessage(SRedefineIdentifier, [VariableName]); 699 722 Expect(':'); 700 723 TypeName := ReadCode; 701 724 NewValueType := Parent.Types.Search(TypeName); 702 if not Assigned(NewValueType) then ErrorMessage( 'Typ ' + TypeName + ' nebyl definován.')725 if not Assigned(NewValueType) then ErrorMessage(STypeNotDefined, [TypeName]) 703 726 else for I := 0 to Identifiers.Count - 1 do 704 727 with TParameter(Items[Add(TParameter.Create)]) do begin … … 753 776 Identifiers.Add(ReadCode); 754 777 end; 755 end else ErrorMessage( 'Pøedefinování existující promìnné.');778 end else ErrorMessage(SRedefineIdentifier, [VariableName]); 756 779 Expect(':'); 757 780 TypeName := ReadCode; 758 781 NewValueType := Parent.Types.Search(TypeName); 759 if NewValueType = nil then ErrorMessage( 'Typ ' + TypeName + ' nebyl definován.')782 if NewValueType = nil then ErrorMessage(STypeNotDefined, [TypeName]) 760 783 else for I := 0 to Identifiers.Count - 1 do 761 784 with TVariable(Items[Add(TVariable.Create)]) do begin … … 804 827 Identifiers.Add(ReadCode); 805 828 end; 806 end else ErrorMessage( 'Pøedefinování existující konstanty.');829 end else ErrorMessage(SRedefineIdentifier, [ConstantName]); 807 830 Expect(':'); 808 831 TypeName := ReadCode; … … 812 835 Expect(';'); 813 836 814 if NewValueType = nil then ErrorMessage( 'Typ ' + TypeName + ' nebyl definován.')837 if NewValueType = nil then ErrorMessage(STypeNotDefined, [TypeName]) 815 838 else for I := 0 to Identifiers.Count - 1 do 816 839 with TConstant(Items[Add(TConstant.Create)]) do begin -
branches/DelphiToC/DelphiToC.lpi
r37 r38 36 36 </Item1> 37 37 </RequiredPackages> 38 <Units Count="1 0">38 <Units Count="15"> 39 39 <Unit0> 40 40 <Filename Value="DelphiToC.lpr"/> 41 41 <IsPartOfProject Value="True"/> 42 <EditorIndex Value=" 4"/>43 <WindowIndex Value="0"/> 44 <TopLine Value=" 4"/>42 <EditorIndex Value="9"/> 43 <WindowIndex Value="0"/> 44 <TopLine Value="3"/> 45 45 <CursorPos X="39" Y="12"/> 46 <UsageCount Value=" 20"/>46 <UsageCount Value="54"/> 47 47 <Loaded Value="True"/> 48 48 </Unit0> … … 54 54 <ResourceBaseClass Value="Form"/> 55 55 <UnitName Value="UMainForm"/> 56 <EditorIndex Value=" 1"/>56 <EditorIndex Value="6"/> 57 57 <WindowIndex Value="0"/> 58 58 <TopLine Value="42"/> 59 59 <CursorPos X="17" Y="49"/> 60 <UsageCount Value=" 20"/>60 <UsageCount Value="54"/> 61 61 <Loaded Value="True"/> 62 62 <LoadedDesigner Value="True"/> … … 69 69 <TopLine Value="1"/> 70 70 <CursorPos X="1" Y="1"/> 71 <UsageCount Value=" 20"/>71 <UsageCount Value="54"/> 72 72 </Unit2> 73 73 <Unit3> … … 75 75 <IsPartOfProject Value="True"/> 76 76 <UnitName Value="UPascalSource"/> 77 <WindowIndex Value="0"/> 78 <TopLine Value="1"/> 79 <CursorPos X="1" Y="1"/> 80 <UsageCount Value="20"/> 77 <EditorIndex Value="4"/> 78 <WindowIndex Value="0"/> 79 <TopLine Value="189"/> 80 <CursorPos X="14" Y="205"/> 81 <UsageCount Value="54"/> 82 <Loaded Value="True"/> 81 83 </Unit3> 82 84 <Unit4> … … 84 86 <IsPartOfProject Value="True"/> 85 87 <UnitName Value="UPascalCompiler"/> 86 <EditorIndex Value=" 3"/>87 <WindowIndex Value="0"/> 88 <TopLine Value=" 32"/>89 <CursorPos X=" 34" Y="35"/>90 <UsageCount Value=" 20"/>88 <EditorIndex Value="8"/> 89 <WindowIndex Value="0"/> 90 <TopLine Value="1"/> 91 <CursorPos X="14" Y="9"/> 92 <UsageCount Value="54"/> 91 93 <Loaded Value="True"/> 92 94 </Unit4> … … 98 100 <TopLine Value="1"/> 99 101 <CursorPos X="1" Y="1"/> 100 <UsageCount Value=" 20"/>102 <UsageCount Value="54"/> 101 103 </Unit5> 102 104 <Unit6> … … 107 109 <TopLine Value="1"/> 108 110 <CursorPos X="1" Y="1"/> 109 <UsageCount Value=" 20"/>111 <UsageCount Value="54"/> 110 112 </Unit6> 111 113 <Unit7> … … 113 115 <IsPartOfProject Value="True"/> 114 116 <UnitName Value="UCSource"/> 115 <EditorIndex Value=" 2"/>117 <EditorIndex Value="7"/> 116 118 <WindowIndex Value="0"/> 117 119 <TopLine Value="3"/> 118 120 <CursorPos X="3" Y="8"/> 119 <UsageCount Value=" 20"/>121 <UsageCount Value="54"/> 120 122 <Loaded Value="True"/> 121 123 </Unit7> … … 127 129 <EditorIndex Value="0"/> 128 130 <WindowIndex Value="0"/> 129 <TopLine Value=" 204"/>130 <CursorPos X=" 27" Y="221"/>131 <UsageCount Value=" 20"/>131 <TopLine Value="75"/> 132 <CursorPos X="47" Y="96"/> 133 <UsageCount Value="54"/> 132 134 <Loaded Value="True"/> 133 135 </Unit8> … … 137 139 <TopLine Value="1"/> 138 140 <CursorPos X="1" Y="1"/> 139 <UsageCount Value=" 10"/>141 <UsageCount Value="7"/> 140 142 <DefaultSyntaxHighlighter Value="LFM"/> 141 143 </Unit9> 144 <Unit10> 145 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\packages\fcl-base\src\contnrs.pp"/> 146 <UnitName Value="contnrs"/> 147 <EditorIndex Value="5"/> 148 <WindowIndex Value="0"/> 149 <TopLine Value="67"/> 150 <CursorPos X="17" Y="80"/> 151 <UsageCount Value="27"/> 152 <Loaded Value="True"/> 153 </Unit10> 154 <Unit11> 155 <Filename Value="E:\Programy\Lazarus\lcl\stdctrls.pp"/> 156 <UnitName Value="StdCtrls"/> 157 <WindowIndex Value="0"/> 158 <TopLine Value="1555"/> 159 <CursorPos X="1" Y="1"/> 160 <UsageCount Value="10"/> 161 </Unit11> 162 <Unit12> 163 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysutilh.inc"/> 164 <EditorIndex Value="1"/> 165 <WindowIndex Value="0"/> 166 <TopLine Value="55"/> 167 <CursorPos X="7" Y="68"/> 168 <UsageCount Value="10"/> 169 <Loaded Value="True"/> 170 </Unit12> 171 <Unit13> 172 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysutils.inc"/> 173 <EditorIndex Value="2"/> 174 <WindowIndex Value="0"/> 175 <TopLine Value="139"/> 176 <CursorPos X="16" Y="146"/> 177 <UsageCount Value="10"/> 178 <Loaded Value="True"/> 179 </Unit13> 180 <Unit14> 181 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysstr.inc"/> 182 <EditorIndex Value="3"/> 183 <WindowIndex Value="0"/> 184 <TopLine Value="934"/> 185 <CursorPos X="10" Y="947"/> 186 <UsageCount Value="10"/> 187 <Loaded Value="True"/> 188 </Unit14> 142 189 </Units> 143 190 <JumpHistory Count="30" HistoryIndex="29"> 144 191 <Position1> 145 192 <Filename Value="Analyze\UPascalParser.pas"/> 146 <Caret Line=" 630" Column="1" TopLine="617"/>193 <Caret Line="274" Column="1" TopLine="255"/> 147 194 </Position1> 148 195 <Position2> 149 196 <Filename Value="Analyze\UPascalParser.pas"/> 150 <Caret Line=" 631" Column="1" TopLine="617"/>197 <Caret Line="275" Column="1" TopLine="258"/> 151 198 </Position2> 152 199 <Position3> 153 200 <Filename Value="Analyze\UPascalParser.pas"/> 154 <Caret Line=" 632" Column="1" TopLine="617"/>201 <Caret Line="284" Column="1" TopLine="271"/> 155 202 </Position3> 156 203 <Position4> 157 204 <Filename Value="Analyze\UPascalParser.pas"/> 158 <Caret Line=" 633" Column="1" TopLine="617"/>205 <Caret Line="288" Column="1" TopLine="271"/> 159 206 </Position4> 160 207 <Position5> 161 208 <Filename Value="Analyze\UPascalParser.pas"/> 162 <Caret Line=" 635" Column="1" TopLine="617"/>209 <Caret Line="344" Column="1" TopLine="331"/> 163 210 </Position5> 164 211 <Position6> 165 212 <Filename Value="Analyze\UPascalParser.pas"/> 166 <Caret Line=" 637" Column="1" TopLine="617"/>213 <Caret Line="345" Column="1" TopLine="331"/> 167 214 </Position6> 168 215 <Position7> 169 216 <Filename Value="Analyze\UPascalParser.pas"/> 170 <Caret Line=" 639" Column="1" TopLine="618"/>217 <Caret Line="270" Column="25" TopLine="251"/> 171 218 </Position7> 172 219 <Position8> 173 220 <Filename Value="Analyze\UPascalParser.pas"/> 174 <Caret Line=" 640" Column="1" TopLine="619"/>221 <Caret Line="384" Column="10" TopLine="365"/> 175 222 </Position8> 176 223 <Position9> 177 224 <Filename Value="Analyze\UPascalParser.pas"/> 178 <Caret Line="2 20" Column="1" TopLine="207"/>225 <Caret Line="269" Column="9" TopLine="255"/> 179 226 </Position9> 180 227 <Position10> 181 228 <Filename Value="Analyze\UPascalParser.pas"/> 182 <Caret Line=" 640" Column="1" TopLine="627"/>229 <Caret Line="287" Column="29" TopLine="273"/> 183 230 </Position10> 184 231 <Position11> 185 232 <Filename Value="Analyze\UPascalParser.pas"/> 186 <Caret Line=" 683" Column="38" TopLine="665"/>233 <Caret Line="95" Column="24" TopLine="86"/> 187 234 </Position11> 188 235 <Position12> 189 236 <Filename Value="Analyze\UPascalParser.pas"/> 190 <Caret Line=" 687" Column="1" TopLine="666"/>237 <Caret Line="348" Column="24" TopLine="335"/> 191 238 </Position12> 192 239 <Position13> 193 240 <Filename Value="Analyze\UPascalParser.pas"/> 194 <Caret Line=" 220" Column="33" TopLine="216"/>241 <Caret Line="102" Column="24" TopLine="99"/> 195 242 </Position13> 196 243 <Position14> 197 244 <Filename Value="Analyze\UPascalParser.pas"/> 198 <Caret Line=" 549" Column="1" TopLine="536"/>245 <Caret Line="99" Column="38" TopLine="99"/> 199 246 </Position14> 200 247 <Position15> 201 248 <Filename Value="Analyze\UPascalParser.pas"/> 202 <Caret Line=" 220" Column="1" TopLine="207"/>249 <Caret Line="75" Column="79" TopLine="74"/> 203 250 </Position15> 204 251 <Position16> 205 252 <Filename Value="Analyze\UPascalParser.pas"/> 206 <Caret Line=" 549" Column="1" TopLine="536"/>253 <Caret Line="102" Column="24" TopLine="88"/> 207 254 </Position16> 208 255 <Position17> 209 <Filename Value=" Analyze\UPascalParser.pas"/>210 <Caret Line=" 550" Column="1" TopLine="536"/>256 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysutils.inc"/> 257 <Caret Line="146" Column="16" TopLine="139"/> 211 258 </Position17> 212 259 <Position18> 213 260 <Filename Value="Analyze\UPascalParser.pas"/> 214 <Caret Line=" 551" Column="1" TopLine="536"/>261 <Caret Line="99" Column="47" TopLine="89"/> 215 262 </Position18> 216 263 <Position19> 217 264 <Filename Value="Analyze\UPascalParser.pas"/> 218 <Caret Line=" 552" Column="1" TopLine="536"/>265 <Caret Line="75" Column="37" TopLine="74"/> 219 266 </Position19> 220 267 <Position20> 221 268 <Filename Value="Analyze\UPascalParser.pas"/> 222 <Caret Line=" 562" Column="1" TopLine="549"/>269 <Caret Line="96" Column="54" TopLine="75"/> 223 270 </Position20> 224 271 <Position21> 225 272 <Filename Value="Analyze\UPascalParser.pas"/> 226 <Caret Line=" 563" Column="1" TopLine="549"/>273 <Caret Line="97" Column="52" TopLine="92"/> 227 274 </Position21> 228 275 <Position22> 229 276 <Filename Value="Analyze\UPascalParser.pas"/> 230 <Caret Line=" 564" Column="1" TopLine="549"/>277 <Caret Line="720" Column="47" TopLine="707"/> 231 278 </Position22> 232 279 <Position23> 233 280 <Filename Value="Analyze\UPascalParser.pas"/> 234 <Caret Line=" 565" Column="1" TopLine="549"/>281 <Caret Line="97" Column="3" TopLine="84"/> 235 282 </Position23> 236 283 <Position24> 237 284 <Filename Value="Analyze\UPascalParser.pas"/> 238 <Caret Line=" 566" Column="1" TopLine="561"/>285 <Caret Line="720" Column="58" TopLine="707"/> 239 286 </Position24> 240 287 <Position25> 241 288 <Filename Value="Analyze\UPascalParser.pas"/> 242 <Caret Line=" 567" Column="1" TopLine="561"/>289 <Caret Line="95" Column="52" TopLine="91"/> 243 290 </Position25> 244 291 <Position26> 245 292 <Filename Value="Analyze\UPascalParser.pas"/> 246 <Caret Line=" 568" Column="1" TopLine="561"/>293 <Caret Line="778" Column="33" TopLine="765"/> 247 294 </Position26> 248 295 <Position27> 249 296 <Filename Value="Analyze\UPascalParser.pas"/> 250 <Caret Line=" 572" Column="1" TopLine="561"/>297 <Caret Line="97" Column="3" TopLine="84"/> 251 298 </Position27> 252 299 <Position28> 253 300 <Filename Value="Analyze\UPascalParser.pas"/> 254 <Caret Line=" 579" Column="1" TopLine="561"/>301 <Caret Line="721" Column="69" TopLine="708"/> 255 302 </Position28> 256 303 <Position29> 257 304 <Filename Value="Analyze\UPascalParser.pas"/> 258 <Caret Line=" 219" Column="1" TopLine="206"/>305 <Caret Line="782" Column="62" TopLine="770"/> 259 306 </Position29> 260 307 <Position30> 261 308 <Filename Value="Analyze\UPascalParser.pas"/> 262 <Caret Line=" 220" Column="36" TopLine="206"/>309 <Caret Line="829" Column="64" TopLine="816"/> 263 310 </Position30> 264 311 </JumpHistory> … … 303 350 <Item1> 304 351 <Source Value="Analyze\UPascalParser.pas"/> 305 <Line Value=" 549"/>352 <Line Value="409"/> 306 353 </Item1> 307 354 <Item2> 308 355 <Source Value="Analyze\UPascalParser.pas"/> 309 <Line Value="2 19"/>356 <Line Value="275"/> 310 357 </Item2> 311 358 </BreakPoints> -
branches/DelphiToC/UPascalSource.pas
r36 r38 6 6 7 7 uses 8 Windows, Messages,SysUtils, Variants, Classes, Graphics, Controls, Forms,8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 9 Dialogs, StdCtrls, Contnrs; 10 10 … … 45 45 46 46 TCommand = class 47 Parent: TObject; 48 47 CommonBlock: TCommonBlock; 49 48 end; 50 49 … … 62 61 TBeginEnd = class(TCommand) 63 62 Commands: TCommandList; 63 CommonBlock: TCommonBlock; 64 64 procedure Clear; 65 65 constructor Create; … … 201 201 202 202 TExpression = class 203 CommonBlock: TCommonBlock; 203 204 NodeType: TNodeType; 204 205 Variable: TVariable; … … 377 378 Methods.Parent := Self; 378 379 Code := TBeginEnd.Create; 380 Code.CommonBlock := Self; 379 381 end; 380 382 … … 580 582 constructor TCaseOfEnd.Create; 581 583 begin 584 inherited; 582 585 Branches := TObjectList.Create 583 586 end;
Note:
See TracChangeset
for help on using the changeset viewer.