Changeset 41
- Timestamp:
- Aug 5, 2010, 1:17:35 PM (14 years ago)
- Location:
- branches/DelphiToC
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Analyze/UPascalParser.pas
r40 r41 458 458 Result.CommonBlock := SourceCode; 459 459 // ParseMetVariable(TMethodCall(Result).Target); 460 end else begin 461 Result := nil; 462 ErrorMessage(SUnknownIdentifier, [ReadCode]); 460 463 end; 461 464 end; -
branches/DelphiToC/DelphiToC.lpi
r40 r41 36 36 </Item1> 37 37 </RequiredPackages> 38 <Units Count="1 6">38 <Units Count="19"> 39 39 <Unit0> 40 40 <Filename Value="DelphiToC.lpr"/> 41 41 <IsPartOfProject Value="True"/> 42 <EditorIndex Value="1 0"/>42 <EditorIndex Value="12"/> 43 43 <WindowIndex Value="0"/> 44 44 <TopLine Value="3"/> 45 45 <CursorPos X="39" Y="12"/> 46 <UsageCount Value=" 57"/>46 <UsageCount Value="60"/> 47 47 <Loaded Value="True"/> 48 48 </Unit0> … … 54 54 <ResourceBaseClass Value="Form"/> 55 55 <UnitName Value="UMainForm"/> 56 <EditorIndex Value=" 6"/>57 <WindowIndex Value="0"/> 58 <TopLine Value=" 10"/>59 <CursorPos X=" 42" Y="24"/>60 <UsageCount Value=" 57"/>56 <EditorIndex Value="7"/> 57 <WindowIndex Value="0"/> 58 <TopLine Value="44"/> 59 <CursorPos X="19" Y="53"/> 60 <UsageCount Value="60"/> 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=" 57"/>71 <UsageCount Value="60"/> 72 72 </Unit2> 73 73 <Unit3> … … 75 75 <IsPartOfProject Value="True"/> 76 76 <UnitName Value="UPascalSource"/> 77 <EditorIndex Value=" 4"/>78 <WindowIndex Value="0"/> 79 <TopLine Value="1 "/>80 <CursorPos X=" 3" Y="12"/>81 <UsageCount Value=" 57"/>77 <EditorIndex Value="5"/> 78 <WindowIndex Value="0"/> 79 <TopLine Value="113"/> 80 <CursorPos X="27" Y="132"/> 81 <UsageCount Value="60"/> 82 82 <Loaded Value="True"/> 83 83 </Unit3> … … 86 86 <IsPartOfProject Value="True"/> 87 87 <UnitName Value="UPascalCompiler"/> 88 <EditorIndex Value=" 9"/>89 <WindowIndex Value="0"/> 90 <TopLine Value=" 1"/>91 <CursorPos X=" 55" Y="9"/>92 <UsageCount Value=" 57"/>88 <EditorIndex Value="10"/> 89 <WindowIndex Value="0"/> 90 <TopLine Value="22"/> 91 <CursorPos X="1" Y="35"/> 92 <UsageCount Value="60"/> 93 93 <Loaded Value="True"/> 94 94 </Unit4> … … 97 97 <IsPartOfProject Value="True"/> 98 98 <UnitName Value="UAssemblerSource"/> 99 <EditorIndex Value=" 7"/>99 <EditorIndex Value="8"/> 100 100 <WindowIndex Value="0"/> 101 101 <TopLine Value="1"/> 102 102 <CursorPos X="9" Y="12"/> 103 <UsageCount Value=" 57"/>103 <UsageCount Value="60"/> 104 104 <Loaded Value="True"/> 105 105 </Unit5> … … 111 111 <TopLine Value="1"/> 112 112 <CursorPos X="1" Y="1"/> 113 <UsageCount Value=" 57"/>113 <UsageCount Value="60"/> 114 114 </Unit6> 115 115 <Unit7> … … 117 117 <IsPartOfProject Value="True"/> 118 118 <UnitName Value="UCSource"/> 119 <EditorIndex Value=" 8"/>119 <EditorIndex Value="9"/> 120 120 <WindowIndex Value="0"/> 121 121 <TopLine Value="3"/> 122 122 <CursorPos X="3" Y="8"/> 123 <UsageCount Value=" 57"/>123 <UsageCount Value="60"/> 124 124 <Loaded Value="True"/> 125 125 </Unit7> … … 131 131 <EditorIndex Value="0"/> 132 132 <WindowIndex Value="0"/> 133 <TopLine Value=" 868"/>134 <CursorPos X=" 26" Y="886"/>135 <UsageCount Value=" 57"/>133 <TopLine Value="444"/> 134 <CursorPos X="1" Y="461"/> 135 <UsageCount Value="60"/> 136 136 <Loaded Value="True"/> 137 137 </Unit8> … … 147 147 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\packages\fcl-base\src\contnrs.pp"/> 148 148 <UnitName Value="contnrs"/> 149 <EditorIndex Value=" 5"/>149 <EditorIndex Value="6"/> 150 150 <WindowIndex Value="0"/> 151 151 <TopLine Value="68"/> 152 152 <CursorPos X="14" Y="90"/> 153 <UsageCount Value=" 28"/>153 <UsageCount Value="30"/> 154 154 <Loaded Value="True"/> 155 155 </Unit10> … … 164 164 <Unit12> 165 165 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysutilh.inc"/> 166 <EditorIndex Value=" 1"/>166 <EditorIndex Value="2"/> 167 167 <WindowIndex Value="0"/> 168 168 <TopLine Value="61"/> 169 169 <CursorPos X="7" Y="68"/> 170 <UsageCount Value="1 1"/>170 <UsageCount Value="13"/> 171 171 <Loaded Value="True"/> 172 172 </Unit12> 173 173 <Unit13> 174 174 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysutils.inc"/> 175 <EditorIndex Value=" 2"/>175 <EditorIndex Value="3"/> 176 176 <WindowIndex Value="0"/> 177 177 <TopLine Value="139"/> 178 178 <CursorPos X="16" Y="146"/> 179 <UsageCount Value="1 1"/>179 <UsageCount Value="13"/> 180 180 <Loaded Value="True"/> 181 181 </Unit13> 182 182 <Unit14> 183 183 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysstr.inc"/> 184 <EditorIndex Value=" 3"/>184 <EditorIndex Value="4"/> 185 185 <WindowIndex Value="0"/> 186 186 <TopLine Value="934"/> 187 187 <CursorPos X="10" Y="947"/> 188 <UsageCount Value="1 1"/>188 <UsageCount Value="13"/> 189 189 <Loaded Value="True"/> 190 190 </Unit14> … … 196 196 <UsageCount Value="10"/> 197 197 </Unit15> 198 <Unit16> 199 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\inc\objpash.inc"/> 200 <EditorIndex Value="11"/> 201 <WindowIndex Value="0"/> 202 <TopLine Value="171"/> 203 <CursorPos X="21" Y="184"/> 204 <UsageCount Value="12"/> 205 <Loaded Value="True"/> 206 </Unit16> 207 <Unit17> 208 <Filename Value="Visual\USourceTree.pas"/> 209 <IsPartOfProject Value="True"/> 210 <UnitName Value="USourceTree"/> 211 <EditorIndex Value="1"/> 212 <WindowIndex Value="0"/> 213 <TopLine Value="52"/> 214 <CursorPos X="39" Y="65"/> 215 <UsageCount Value="22"/> 216 <Loaded Value="True"/> 217 </Unit17> 218 <Unit18> 219 <Filename Value="E:\Programy\Lazarus\lcl\comctrls.pp"/> 220 <UnitName Value="ComCtrls"/> 221 <WindowIndex Value="0"/> 222 <TopLine Value="2656"/> 223 <CursorPos X="3" Y="2669"/> 224 <UsageCount Value="10"/> 225 </Unit18> 198 226 </Units> 199 <JumpHistory Count="30" HistoryIndex="2 8">227 <JumpHistory Count="30" HistoryIndex="29"> 200 228 <Position1> 201 229 <Filename Value="Analyze\UPascalParser.pas"/> 202 <Caret Line=" 826" Column="43" TopLine="813"/>230 <Caret Line="589" Column="1" TopLine="576"/> 203 231 </Position1> 204 232 <Position2> 205 233 <Filename Value="Analyze\UPascalParser.pas"/> 206 <Caret Line="70 " Column="21" TopLine="70"/>234 <Caret Line="705" Column="1" TopLine="692"/> 207 235 </Position2> 208 236 <Position3> 209 237 <Filename Value="Analyze\UPascalParser.pas"/> 210 <Caret Line=" 826" Column="93" TopLine="826"/>238 <Caret Line="707" Column="1" TopLine="692"/> 211 239 </Position3> 212 240 <Position4> 213 241 <Filename Value="Analyze\UPascalParser.pas"/> 214 <Caret Line="70 " Column="48" TopLine="70"/>242 <Caret Line="703" Column="1" TopLine="692"/> 215 243 </Position4> 216 244 <Position5> 217 245 <Filename Value="Analyze\UPascalParser.pas"/> 218 <Caret Line=" 826" Column="91" TopLine="826"/>246 <Caret Line="704" Column="46" TopLine="692"/> 219 247 </Position5> 220 248 <Position6> 221 249 <Filename Value="Analyze\UPascalParser.pas"/> 222 <Caret Line=" 837" Column="26" TopLine="824"/>250 <Caret Line="462" Column="23" TopLine="469"/> 223 251 </Position6> 224 252 <Position7> 225 253 <Filename Value="Analyze\UPascalParser.pas"/> 226 <Caret Line=" 872" Column="26" TopLine="862"/>254 <Caret Line="445" Column="1" TopLine="432"/> 227 255 </Position7> 228 256 <Position8> 229 257 <Filename Value="Analyze\UPascalParser.pas"/> 230 <Caret Line=" 876" Column="29" TopLine="863"/>258 <Caret Line="446" Column="1" TopLine="432"/> 231 259 </Position8> 232 260 <Position9> 233 261 <Filename Value="Analyze\UPascalParser.pas"/> 234 <Caret Line=" 877" Column="26" TopLine="864"/>262 <Caret Line="449" Column="1" TopLine="432"/> 235 263 </Position9> 236 264 <Position10> 237 265 <Filename Value="Analyze\UPascalParser.pas"/> 238 <Caret Line=" 78" Column="11" TopLine="65"/>266 <Caret Line="448" Column="1" TopLine="432"/> 239 267 </Position10> 240 268 <Position11> 241 269 <Filename Value="Analyze\UPascalParser.pas"/> 242 <Caret Line=" 884" Column="75" TopLine="868"/>270 <Caret Line="447" Column="1" TopLine="432"/> 243 271 </Position11> 244 272 <Position12> 245 273 <Filename Value="Analyze\UPascalParser.pas"/> 246 <Caret Line=" 877" Column="46" TopLine="864"/>274 <Caret Line="450" Column="1" TopLine="432"/> 247 275 </Position12> 248 276 <Position13> 249 277 <Filename Value="Analyze\UPascalParser.pas"/> 250 <Caret Line=" 884" Column="58" TopLine="868"/>278 <Caret Line="445" Column="1" TopLine="432"/> 251 279 </Position13> 252 280 <Position14> 253 281 <Filename Value="Analyze\UPascalParser.pas"/> 254 <Caret Line=" 78" Column="48" TopLine="78"/>282 <Caret Line="446" Column="1" TopLine="432"/> 255 283 </Position14> 256 284 <Position15> 257 285 <Filename Value="Analyze\UPascalParser.pas"/> 258 <Caret Line=" 884" Column="75" TopLine="868"/>286 <Caret Line="456" Column="1" TopLine="435"/> 259 287 </Position15> 260 288 <Position16> 261 <Filename Value=" UPascalCompiler.pas"/>262 <Caret Line=" 9" Column="73" TopLine="10"/>289 <Filename Value="Analyze\UPascalParser.pas"/> 290 <Caret Line="461" Column="1" TopLine="448"/> 263 291 </Position16> 264 292 <Position17> 265 <Filename Value=" UPascalCompiler.pas"/>266 <Caret Line=" 35" Column="43" TopLine="22"/>293 <Filename Value="Analyze\UPascalParser.pas"/> 294 <Caret Line="462" Column="1" TopLine="448"/> 267 295 </Position17> 268 296 <Position18> 269 <Filename Value=" UPascalCompiler.pas"/>270 <Caret Line="4 5" Column="17" TopLine="33"/>297 <Filename Value="Analyze\UPascalParser.pas"/> 298 <Caret Line="463" Column="1" TopLine="448"/> 271 299 </Position18> 272 300 <Position19> 273 301 <Filename Value="Analyze\UPascalParser.pas"/> 274 <Caret Line=" 872" Column="27" TopLine="861"/>302 <Caret Line="429" Column="1" TopLine="416"/> 275 303 </Position19> 276 304 <Position20> 277 <Filename Value=" UPascalCompiler.pas"/>278 <Caret Line=" 46" Column="24" TopLine="33"/>305 <Filename Value="Analyze\UPascalParser.pas"/> 306 <Caret Line="590" Column="1" TopLine="577"/> 279 307 </Position20> 280 308 <Position21> 281 <Filename Value=" UMainForm.pas"/>282 <Caret Line=" 88" Column="41" TopLine="76"/>309 <Filename Value="Analyze\UPascalParser.pas"/> 310 <Caret Line="429" Column="1" TopLine="416"/> 283 311 </Position21> 284 312 <Position22> 285 <Filename Value=" Produce\UAssemblerSource.pas"/>286 <Caret Line=" 1" Column="1" TopLine="1"/>313 <Filename Value="Analyze\UPascalParser.pas"/> 314 <Caret Line="590" Column="1" TopLine="577"/> 287 315 </Position22> 288 316 <Position23> 289 <Filename Value=" Produce\UAssemblerSource.pas"/>290 <Caret Line=" 9" Column="12" TopLine="1"/>317 <Filename Value="Analyze\UPascalParser.pas"/> 318 <Caret Line="706" Column="1" TopLine="693"/> 291 319 </Position23> 292 320 <Position24> 293 <Filename Value=" Produce\UAssemblerSource.pas"/>294 <Caret Line=" 8" Column="3" TopLine="1"/>321 <Filename Value="Analyze\UPascalParser.pas"/> 322 <Caret Line="708" Column="1" TopLine="693"/> 295 323 </Position24> 296 324 <Position25> 297 <Filename Value=" Produce\UAssemblerSource.pas"/>298 <Caret Line=" 34" Column="31" TopLine="21"/>325 <Filename Value="Analyze\UPascalParser.pas"/> 326 <Caret Line="704" Column="1" TopLine="693"/> 299 327 </Position25> 300 328 <Position26> 301 <Filename Value=" Produce\UAssemblerSource.pas"/>302 <Caret Line=" 193" Column="1" TopLine="171"/>329 <Filename Value="Analyze\UPascalParser.pas"/> 330 <Caret Line="705" Column="1" TopLine="693"/> 303 331 </Position26> 304 332 <Position27> 305 <Filename Value=" Produce\UAssemblerSource.pas"/>306 <Caret Line=" 12" Column="17" TopLine="1"/>333 <Filename Value="Analyze\UPascalParser.pas"/> 334 <Caret Line="706" Column="1" TopLine="693"/> 307 335 </Position27> 308 336 <Position28> 309 <Filename Value=" Produce\UAssemblerSource.pas"/>310 <Caret Line=" 14" Column="9" TopLine="1"/>337 <Filename Value="Analyze\UPascalParser.pas"/> 338 <Caret Line="708" Column="1" TopLine="693"/> 311 339 </Position28> 312 340 <Position29> 313 <Filename Value=" Produce\UAssemblerSource.pas"/>314 <Caret Line=" 12" Column="9" TopLine="1"/>341 <Filename Value="Analyze\UPascalParser.pas"/> 342 <Caret Line="704" Column="1" TopLine="693"/> 315 343 </Position29> 316 344 <Position30> 317 <Filename Value=" UPascalSource.pas"/>318 <Caret Line=" 12" Column="3" TopLine="1"/>345 <Filename Value="Analyze\UPascalParser.pas"/> 346 <Caret Line="705" Column="1" TopLine="693"/> 319 347 </Position30> 320 348 </JumpHistory> … … 325 353 <SearchPaths> 326 354 <IncludeFiles Value="Analyze\;Produce\"/> 327 <OtherUnitFiles Value="Analyze\;Produce\ "/>355 <OtherUnitFiles Value="Analyze\;Produce\;Visual\"/> 328 356 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 329 357 </SearchPaths> … … 357 385 </CompilerOptions> 358 386 <Debugging> 387 <BreakPoints Count="1"> 388 <Item1> 389 <Source Value="Analyze\UPascalParser.pas"/> 390 <Line Value="445"/> 391 </Item1> 392 </BreakPoints> 359 393 <Exceptions Count="3"> 360 394 <Item1> -
branches/DelphiToC/DelphiToC.lpr
r37 r41 15 15 UCodeProducer in 'Produce\UCodeProducer.pas', 16 16 UCSource in 'Produce\UCSource.pas', 17 UPascalParser in 'Analyze\UPascalParser.pas' ;17 UPascalParser in 'Analyze\UPascalParser.pas', USourceTree; 18 18 19 19 {$R *.res} -
branches/DelphiToC/Example.pas
r20 r41 12 12 sS: Byte; 13 13 begin 14 WriteLn; 15 begin 16 begin 17 end; 18 end; 14 19 A := 1; 15 20 While A < 1 do A := A + 1; -
branches/DelphiToC/UMainForm.pas
r40 r41 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 9 Dialogs, StdCtrls, UPascalSource, UPascalCompiler, UAssemblerSource, 10 UCSource, ComCtrls ;10 UCSource, ComCtrls, USourceTree; 11 11 12 12 const … … 30 30 public 31 31 Compiler: TCompiler; 32 SourceTree: TSourceTree; 32 33 end; 33 34 … … 48 49 Compiler.SourceCode.Assign(Memo1.Lines); 49 50 Compiler.Compile; 50 FillTreeView; 51 SourceTree.TreeView := TreeView1; 52 SourceTree.Code := Compiler.ProgramCode; 53 SourceTree.Fill; 54 //FillTreeView; 51 55 Memo2.Clear; 52 56 if Compiler.Producer is TAssemblerProducer then begin … … 138 142 Compiler := TCompiler.Create; 139 143 Compiler.OnErrorMessage := ErrorMessage; 144 SourceTree := TSourceTree.Create; 140 145 end; 141 146 142 147 procedure TMainForm.FormDestroy(Sender: TObject); 143 148 begin 144 Compiler.Destroy; 149 Compiler.Free; 150 SourceTree.Free; 145 151 end; 146 152 -
branches/DelphiToC/UPascalSource.pas
r39 r41 439 439 440 440 destructor TFunctionList.Destroy; 441 var 442 I: Integer; 443 begin 444 for I := 0 to Count - 1 do 445 TFunction(Items[I]).Free; 441 begin 446 442 inherited; 447 443 end;
Note:
See TracChangeset
for help on using the changeset viewer.