Changeset 51
- Timestamp:
- Aug 9, 2010, 3:50:42 PM (14 years ago)
- Location:
- branches/DelphiToC
- Files:
-
- 6 added
- 5 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/DelphiToC.lpi
r50 r51 40 40 </Item2> 41 41 </RequiredPackages> 42 <Units Count="2 1">42 <Units Count="20"> 43 43 <Unit0> 44 44 <Filename Value="DelphiToC.lpr"/> … … 48 48 <TopLine Value="4"/> 49 49 <CursorPos X="1" Y="29"/> 50 <UsageCount Value="11 2"/>50 <UsageCount Value="113"/> 51 51 <Loaded Value="True"/> 52 52 </Unit0> 53 53 <Unit1> 54 <Filename Value=" UMainForm.pas"/>54 <Filename Value="Forms\UMainForm.pas"/> 55 55 <IsPartOfProject Value="True"/> 56 56 <ComponentName Value="MainForm"/> … … 62 62 <TopLine Value="97"/> 63 63 <CursorPos X="60" Y="112"/> 64 <UsageCount Value="11 2"/>64 <UsageCount Value="113"/> 65 65 <Loaded Value="True"/> 66 66 <LoadedDesigner Value="True"/> … … 73 73 <TopLine Value="1"/> 74 74 <CursorPos X="1" Y="1"/> 75 <UsageCount Value="11 2"/>75 <UsageCount Value="113"/> 76 76 </Unit2> 77 77 <Unit3> 78 <Filename Value="U PascalSource.pas"/>79 <IsPartOfProject Value="True"/> 80 <UnitName Value="U PascalSource"/>78 <Filename Value="USourceCode.pas"/> 79 <IsPartOfProject Value="True"/> 80 <UnitName Value="USourceCode"/> 81 81 <EditorIndex Value="5"/> 82 82 <WindowIndex Value="0"/> 83 <TopLine Value=" 141"/>84 <CursorPos X=" 21" Y="155"/>85 <UsageCount Value="11 2"/>83 <TopLine Value="637"/> 84 <CursorPos X="13" Y="668"/> 85 <UsageCount Value="113"/> 86 86 <Loaded Value="True"/> 87 87 </Unit3> 88 88 <Unit4> 89 <Filename Value="U PascalCompiler.pas"/>90 <IsPartOfProject Value="True"/> 91 <UnitName Value="U PascalCompiler"/>89 <Filename Value="UCompiler.pas"/> 90 <IsPartOfProject Value="True"/> 91 <UnitName Value="UCompiler"/> 92 92 <EditorIndex Value="11"/> 93 93 <WindowIndex Value="0"/> 94 <TopLine Value="1 01"/>95 <CursorPos X=" 17" Y="102"/>96 <UsageCount Value="11 2"/>94 <TopLine Value="1"/> 95 <CursorPos X="40" Y="16"/> 96 <UsageCount Value="113"/> 97 97 <Loaded Value="True"/> 98 98 </Unit4> … … 105 105 <TopLine Value="112"/> 106 106 <CursorPos X="48" Y="128"/> 107 <UsageCount Value="11 2"/>107 <UsageCount Value="113"/> 108 108 <Loaded Value="True"/> 109 109 </Unit5> … … 116 116 <TopLine Value="1"/> 117 117 <CursorPos X="15" Y="13"/> 118 <UsageCount Value="11 2"/>118 <UsageCount Value="113"/> 119 119 <Loaded Value="True"/> 120 120 </Unit6> … … 127 127 <TopLine Value="128"/> 128 128 <CursorPos X="34" Y="141"/> 129 <UsageCount Value="11 2"/>129 <UsageCount Value="113"/> 130 130 <Loaded Value="True"/> 131 131 </Unit7> 132 132 <Unit8> 133 <Filename Value="Analyze\UPa scalParser.pas"/>134 <IsPartOfProject Value="True"/> 135 <UnitName Value="UPa scalParser"/>133 <Filename Value="Analyze\UParser.pas"/> 134 <IsPartOfProject Value="True"/> 135 <UnitName Value="UParser"/> 136 136 <EditorIndex Value="0"/> 137 137 <WindowIndex Value="0"/> 138 <TopLine Value=" 851"/>139 <CursorPos X=" 31" Y="862"/>140 <UsageCount Value="11 2"/>138 <TopLine Value="1021"/> 139 <CursorPos X="1" Y="1026"/> 140 <UsageCount Value="113"/> 141 141 <Loaded Value="True"/> 142 142 </Unit8> 143 143 <Unit9> 144 <Filename Value=" UMainForm.lfm"/>145 < WindowIndex Value="0"/>146 < TopLine Value="1"/>147 < CursorPos X="1" Y="1"/>148 < UsageCount Value="0"/>149 < DefaultSyntaxHighlighter Value="LFM"/>144 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\packages\fcl-base\src\contnrs.pp"/> 145 <UnitName Value="contnrs"/> 146 <WindowIndex Value="0"/> 147 <TopLine Value="78"/> 148 <CursorPos X="14" Y="91"/> 149 <UsageCount Value="55"/> 150 150 </Unit9> 151 151 <Unit10> 152 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\packages\fcl-base\src\contnrs.pp"/>153 <UnitName Value="contnrs"/>154 <WindowIndex Value="0"/>155 <TopLine Value="78"/>156 <CursorPos X="14" Y="91"/>157 <UsageCount Value="56"/>158 </Unit10>159 <Unit11>160 152 <Filename Value="E:\Programy\Lazarus\lcl\stdctrls.pp"/> 161 153 <UnitName Value="StdCtrls"/> … … 164 156 <CursorPos X="1" Y="1"/> 165 157 <UsageCount Value="4"/> 158 </Unit10> 159 <Unit11> 160 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysutilh.inc"/> 161 <EditorIndex Value="3"/> 162 <WindowIndex Value="0"/> 163 <TopLine Value="61"/> 164 <CursorPos X="7" Y="68"/> 165 <UsageCount Value="40"/> 166 <Loaded Value="True"/> 166 167 </Unit11> 167 168 <Unit12> 168 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysutil h.inc"/>169 <EditorIndex Value=" 3"/>170 <WindowIndex Value="0"/> 171 <TopLine Value=" 61"/>172 <CursorPos X=" 7" Y="68"/>173 <UsageCount Value=" 39"/>169 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysutils.inc"/> 170 <EditorIndex Value="4"/> 171 <WindowIndex Value="0"/> 172 <TopLine Value="139"/> 173 <CursorPos X="16" Y="146"/> 174 <UsageCount Value="40"/> 174 175 <Loaded Value="True"/> 175 176 </Unit12> 176 177 <Unit13> 177 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysutils.inc"/>178 <EditorIndex Value="4"/>179 <WindowIndex Value="0"/>180 <TopLine Value="139"/>181 <CursorPos X="16" Y="146"/>182 <UsageCount Value="39"/>183 <Loaded Value="True"/>184 </Unit13>185 <Unit14>186 178 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\sysutils\sysstr.inc"/> 187 179 <WindowIndex Value="0"/> … … 189 181 <CursorPos X="10" Y="947"/> 190 182 <UsageCount Value="8"/> 191 </Unit1 4>192 <Unit1 5>183 </Unit13> 184 <Unit14> 193 185 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\inc\systemh.inc"/> 194 186 <WindowIndex Value="0"/> … … 196 188 <CursorPos X="11" Y="847"/> 197 189 <UsageCount Value="4"/> 198 </Unit1 5>199 <Unit1 6>190 </Unit14> 191 <Unit15> 200 192 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\inc\objpash.inc"/> 201 193 <WindowIndex Value="0"/> … … 203 195 <CursorPos X="8" Y="166"/> 204 196 <UsageCount Value="13"/> 205 </Unit1 6>206 <Unit1 7>197 </Unit15> 198 <Unit16> 207 199 <Filename Value="Visual\USourceTree.pas"/> 208 200 <IsPartOfProject Value="True"/> … … 211 203 <EditorIndex Value="2"/> 212 204 <WindowIndex Value="0"/> 213 <TopLine Value="2 09"/>214 <CursorPos X=" 16" Y="218"/>215 <UsageCount Value="7 4"/>216 <Loaded Value="True"/> 217 </Unit1 7>218 <Unit1 8>205 <TopLine Value="254"/> 206 <CursorPos X="41" Y="268"/> 207 <UsageCount Value="75"/> 208 <Loaded Value="True"/> 209 </Unit16> 210 <Unit17> 219 211 <Filename Value="E:\Programy\Lazarus\lcl\comctrls.pp"/> 220 212 <UnitName Value="ComCtrls"/> … … 223 215 <CursorPos X="3" Y="2669"/> 224 216 <UsageCount Value="4"/> 225 </Unit1 8>226 <Unit1 9>217 </Unit17> 218 <Unit18> 227 219 <Filename Value="E:\Programy\Lazarus\fpc\2.4.0\source\rtl\objpas\classes\classesh.inc"/> 228 220 <WindowIndex Value="0"/> … … 230 222 <CursorPos X="57" Y="571"/> 231 223 <UsageCount Value="13"/> 232 </Unit1 9>233 <Unit 20>224 </Unit18> 225 <Unit19> 234 226 <Filename Value="Produce\UProducerPascal.pas"/> 235 227 <IsPartOfProject Value="True"/> … … 237 229 <EditorIndex Value="7"/> 238 230 <WindowIndex Value="0"/> 239 <TopLine Value="1 04"/>240 <CursorPos X="2 1" Y="112"/>241 <UsageCount Value=" 28"/>242 <Loaded Value="True"/> 243 </Unit 20>231 <TopLine Value="1"/> 232 <CursorPos X="23" Y="9"/> 233 <UsageCount Value="30"/> 234 <Loaded Value="True"/> 235 </Unit19> 244 236 </Units> 245 237 <JumpHistory Count="30" HistoryIndex="29"> 246 238 <Position1> 247 <Filename Value=" UMainForm.pas"/>248 <Caret Line=" 88" Column="1" TopLine="88"/>239 <Filename Value="Analyze\UParser.pas"/> 240 <Caret Line="1006" Column="1" TopLine="992"/> 249 241 </Position1> 250 242 <Position2> 251 <Filename Value=" UMainForm.pas"/>252 <Caret Line=" 33" Column="1" TopLine="20"/>243 <Filename Value="Analyze\UParser.pas"/> 244 <Caret Line="1004" Column="9" TopLine="991"/> 253 245 </Position2> 254 246 <Position3> 255 <Filename Value=" DelphiToC.lpr"/>256 <Caret Line=" 29" Column="1" TopLine="4"/>247 <Filename Value="Analyze\UParser.pas"/> 248 <Caret Line="1013" Column="16" TopLine="1002"/> 257 249 </Position3> 258 250 <Position4> 259 <Filename Value=" DelphiToC.lpr"/>260 <Caret Line=" 20" Column="36" TopLine="4"/>251 <Filename Value="Analyze\UParser.pas"/> 252 <Caret Line="1021" Column="14" TopLine="1008"/> 261 253 </Position4> 262 254 <Position5> 263 <Filename Value=" Produce\UProducerC.pas"/>264 <Caret Line=" 217" Column="71" TopLine="207"/>255 <Filename Value="Analyze\UParser.pas"/> 256 <Caret Line="1024" Column="35" TopLine="1010"/> 265 257 </Position5> 266 258 <Position6> 267 <Filename Value=" Produce\UProducerC.pas"/>268 <Caret Line=" 216" Column="80" TopLine="203"/>259 <Filename Value="Analyze\UParser.pas"/> 260 <Caret Line="1029" Column="21" TopLine="1016"/> 269 261 </Position6> 270 262 <Position7> 271 <Filename Value=" Produce\UProducerC.pas"/>272 <Caret Line="1 82" Column="44" TopLine="177"/>263 <Filename Value="Analyze\UParser.pas"/> 264 <Caret Line="1011" Column="33" TopLine="1010"/> 273 265 </Position7> 274 266 <Position8> 275 <Filename Value=" Produce\UProducerC.pas"/>276 <Caret Line=" 205" Column="3" TopLine="202"/>267 <Filename Value="Analyze\UParser.pas"/> 268 <Caret Line="67" Column="45" TopLine="54"/> 277 269 </Position8> 278 270 <Position9> 279 <Filename Value=" UPascalCompiler.pas"/>280 <Caret Line="1 28" Column="12" TopLine="111"/>271 <Filename Value="Analyze\UParser.pas"/> 272 <Caret Line="1001" Column="28" TopLine="988"/> 281 273 </Position9> 282 274 <Position10> 283 <Filename Value=" UPascalCompiler.pas"/>284 <Caret Line="1 27" Column="21" TopLine="111"/>275 <Filename Value="Analyze\UParser.pas"/> 276 <Caret Line="1024" Column="57" TopLine="1011"/> 285 277 </Position10> 286 278 <Position11> 287 <Filename Value=" DelphiToC.lpr"/>288 <Caret Line="1 6" Column="36" TopLine="4"/>279 <Filename Value="Analyze\UParser.pas"/> 280 <Caret Line="1022" Column="45" TopLine="1009"/> 289 281 </Position11> 290 282 <Position12> 291 <Filename Value=" UPascalSource.pas"/>292 <Caret Line=" 7" Column="59" TopLine="1"/>283 <Filename Value="Analyze\UParser.pas"/> 284 <Caret Line="1030" Column="39" TopLine="1017"/> 293 285 </Position12> 294 286 <Position13> 295 <Filename Value="Analyze\UPa scalParser.pas"/>296 <Caret Line=" 477" Column="13" TopLine="457"/>287 <Filename Value="Analyze\UParser.pas"/> 288 <Caret Line="1031" Column="41" TopLine="1018"/> 297 289 </Position13> 298 290 <Position14> 299 <Filename Value="Analyze\UPa scalParser.pas"/>300 <Caret Line=" 62" Column="50" TopLine="45"/>291 <Filename Value="Analyze\UParser.pas"/> 292 <Caret Line="1067" Column="63" TopLine="1051"/> 301 293 </Position14> 302 294 <Position15> 303 <Filename Value="Analyze\UPa scalParser.pas"/>304 <Caret Line="10 37" Column="1" TopLine="1012"/>295 <Filename Value="Analyze\UParser.pas"/> 296 <Caret Line="1058" Column="54" TopLine="1045"/> 305 297 </Position15> 306 298 <Position16> 307 <Filename Value=" Analyze\UPascalParser.pas"/>308 <Caret Line=" 865" Column="62" TopLine="391"/>299 <Filename Value="Visual\USourceTree.pas"/> 300 <Caret Line="207" Column="1" TopLine="193"/> 309 301 </Position16> 310 302 <Position17> 311 <Filename Value=" Analyze\UPascalParser.pas"/>312 <Caret Line=" 910" Column="55" TopLine="900"/>303 <Filename Value="Visual\USourceTree.pas"/> 304 <Caret Line="22" Column="30" TopLine="9"/> 313 305 </Position17> 314 306 <Position18> 315 <Filename Value=" Analyze\UPascalParser.pas"/>316 <Caret Line=" 862" Column="65" TopLine="850"/>307 <Filename Value="Visual\USourceTree.pas"/> 308 <Caret Line="208" Column="1" TopLine="193"/> 317 309 </Position18> 318 310 <Position19> 319 <Filename Value=" Analyze\UPascalParser.pas"/>320 <Caret Line=" 81" Column="3" TopLine="66"/>311 <Filename Value="Visual\USourceTree.pas"/> 312 <Caret Line="22" Column="70" TopLine="9"/> 321 313 </Position19> 322 314 <Position20> 323 <Filename Value=" Analyze\UPascalParser.pas"/>324 <Caret Line=" 862" Column="13" TopLine="850"/>315 <Filename Value="Visual\USourceTree.pas"/> 316 <Caret Line="207" Column="74" TopLine="195"/> 325 317 </Position20> 326 318 <Position21> 327 <Filename Value=" Analyze\UPascalParser.pas"/>328 <Caret Line=" 866" Column="24" TopLine="850"/>319 <Filename Value="Visual\USourceTree.pas"/> 320 <Caret Line="22" Column="15" TopLine="10"/> 329 321 </Position21> 330 322 <Position22> 331 <Filename Value=" UPascalSource.pas"/>332 <Caret Line=" 101" Column="34" TopLine="82"/>323 <Filename Value="Visual\USourceTree.pas"/> 324 <Caret Line="208" Column="16" TopLine="195"/> 333 325 </Position22> 334 326 <Position23> 335 <Filename Value=" Analyze\UPascalParser.pas"/>336 <Caret Line=" 866" Column="24" TopLine="850"/>327 <Filename Value="Visual\USourceTree.pas"/> 328 <Caret Line="22" Column="73" TopLine="9"/> 337 329 </Position23> 338 330 <Position24> 339 <Filename Value=" Analyze\UPascalParser.pas"/>340 <Caret Line=" 864" Column="7" TopLine="850"/>331 <Filename Value="Visual\USourceTree.pas"/> 332 <Caret Line="208" Column="46" TopLine="195"/> 341 333 </Position24> 342 334 <Position25> 343 335 <Filename Value="Visual\USourceTree.pas"/> 344 <Caret Line="2 9" Column="64" TopLine="14"/>336 <Caret Line="253" Column="77" TopLine="241"/> 345 337 </Position25> 346 338 <Position26> 347 339 <Filename Value="Visual\USourceTree.pas"/> 348 <Caret Line=" 112" Column="19" TopLine="105"/>340 <Caret Line="261" Column="17" TopLine="248"/> 349 341 </Position26> 350 342 <Position27> 351 343 <Filename Value="Visual\USourceTree.pas"/> 352 <Caret Line=" 78" Column="33" TopLine="62"/>344 <Caret Line="268" Column="32" TopLine="250"/> 353 345 </Position27> 354 346 <Position28> 355 347 <Filename Value="Visual\USourceTree.pas"/> 356 <Caret Line=" 300" Column="1" TopLine="275"/>348 <Caret Line="267" Column="13" TopLine="254"/> 357 349 </Position28> 358 350 <Position29> 359 351 <Filename Value="Visual\USourceTree.pas"/> 360 <Caret Line=" 84" Column="30" TopLine="65"/>352 <Caret Line="266" Column="74" TopLine="254"/> 361 353 </Position29> 362 354 <Position30> 363 <Filename Value=" UPascalCompiler.pas"/>364 <Caret Line=" 102" Column="17" TopLine="101"/>355 <Filename Value="Visual\USourceTree.pas"/> 356 <Caret Line="267" Column="48" TopLine="254"/> 365 357 </Position30> 366 358 </JumpHistory> … … 371 363 <SearchPaths> 372 364 <IncludeFiles Value="Analyze\;Produce\"/> 373 <OtherUnitFiles Value="Analyze\;Produce\;Visual\ "/>365 <OtherUnitFiles Value="Analyze\;Produce\;Visual\;Forms\"/> 374 366 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 375 367 </SearchPaths> -
branches/DelphiToC/DelphiToC.lpr
r46 r51 10 10 UMainForm in 'UMainForm.pas' {MainForm}, 11 11 UTextSource in 'UTextSource.pas', 12 U PascalSource in 'UPascalSource.pas',13 U PascalCompiler in 'UPascalCompiler.pas',12 USourceCode, 13 UCompiler, 14 14 UAssemblerSource in 'Produce\UAssemblerSource.pas', 15 15 UCodeProducer in 'Produce\UCodeProducer.pas', 16 16 UProducerC, UProducerPascal, 17 UPa scalParser in 'Analyze\UPascalParser.pas', USourceTree;17 UParser, USourceTree; 18 18 19 19 {$R *.res} -
branches/DelphiToC/Example.pas
r50 r51 2 2 3 3 uses System, Crt; 4 5 type 6 TPoint = record 7 X: Integer; 8 Y: Integer; 9 end; 4 10 5 11 function Max(A, B: Byte): Byte; … … 18 24 sS: Byte; 19 25 D: Byte; 26 20 27 begin 21 28 WriteLn(A); -
branches/DelphiToC/Produce/UAssemblerSource.pas
r40 r51 7 7 uses 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 Dialogs, U PascalSource, UCodeProducer;9 Dialogs, USourceCode, UCodeProducer; 10 10 11 11 type -
branches/DelphiToC/Produce/UCodeProducer.pas
r36 r51 6 6 7 7 uses 8 U PascalSource;8 USourceCode; 9 9 10 10 type -
branches/DelphiToC/Produce/UProducerC.pas
r50 r51 7 7 uses 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 Dialogs, StdCtrls, U PascalSource, UCodeProducer, StrUtils;9 Dialogs, StdCtrls, USourceCode, UCodeProducer, StrUtils; 10 10 11 11 type -
branches/DelphiToC/Produce/UProducerPascal.pas
r50 r51 7 7 uses 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 Dialogs, U PascalSource, UCodeProducer, StrUtils;9 Dialogs, USourceCode, UCodeProducer, StrUtils; 10 10 11 11 type -
branches/DelphiToC/Visual/USourceTree.pas
r50 r51 6 6 7 7 uses 8 Classes, SysUtils, U PascalSource, ComCtrls;8 Classes, SysUtils, USourceCode, ComCtrls; 9 9 10 10 type … … 20 20 procedure AddNodeMethodList(Node: TTreeNode; Methods: TFunctionList); 21 21 procedure AddNodeParameterList(Node: TTreeNode; Parameters: TParameterList); 22 procedure AddNodeTypeRecord(Node: TTreeNode; TypeRecord: TTypeRecord); 22 23 procedure AddNodeTypeList(Node: TTreeNode; Types: TTypeList); 23 24 procedure AddNodeVariableList(Node: TTreeNode; Variables: TVariableList); … … 195 196 NewNode: TTreeNode; 196 197 NewNode2: TTreeNode; 198 NewNode3: TTreeNode; 197 199 I: Integer; 198 200 begin … … 202 204 with TType(Types[I]) do 203 205 if not System then begin 204 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = '); 206 if TType(Types[I]) is TTypeRecord then begin 207 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = record'); 208 AddNodeTypeRecord(NewNode2, TTypeRecord(Types[I])); 209 end else if Assigned(UsedType) then 210 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = ' + UsedType.Name) 211 else NewNode2 := TreeView.Items.AddChild(NewNode, Name); 205 212 end; 206 213 end; … … 244 251 end; 245 252 253 procedure TSourceTree.AddNodeTypeRecord(Node: TTreeNode; TypeRecord: TTypeRecord 254 ); 255 var 256 NewNode: TTreeNode; 257 NewNode2: TTreeNode; 258 NewNode3: TTreeNode; 259 I: Integer; 260 begin 261 if TypeRecord.Items.Count > 0 then begin 262 for I := 0 to TypeRecord.Items.Count - 1 do 263 with TType(TypeRecord.Items[I]) do 264 if not System then begin 265 if TType(TypeRecord.Items[I]) is TTypeRecord then begin 266 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = record'); 267 AddNodeTypeRecord(NewNode2, TTypeRecord(TypeRecord.Items[I])) 268 end else if Assigned(UsedType) then 269 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = ' + UsedType.Name) 270 else NewNode2 := TreeView.Items.AddChild(NewNode, Name); 271 end; 272 end; 273 end; 274 246 275 procedure TSourceTree.AddNodeModule(Node: TTreeNode; Module: TModule); 247 276 var
Note:
See TracChangeset
for help on using the changeset viewer.